@zeniai/web-app-ui 5.3.86-dev → 5.3.87-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-BXvURRvs.js → AccountMappingScreen-9MHulU9s.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-CkPu1Iyz.js → ActualMatchingMatchDetailScreen-Db6bbB6u.js} +1 -1
- package/dist/assets/AddressRoutes-DHraPu2z.js +1 -0
- package/dist/assets/AddressScreen-BOTH_mRu.js +9 -0
- package/dist/assets/{AiCfoScreen-Akbbu7OO.js → AiCfoScreen-bjaeBeb9.js} +1 -1
- package/dist/assets/{AppDrawer-B4rZP8Bn.js → AppDrawer-UbqqLXJe.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-BG_fZlTC.js → BillPayApprovalRoutes-CYDv31qk.js} +1 -1
- package/dist/assets/{BillPayRoutes-pg5PH9Oh.js → BillPayRoutes-C4GXOC5A.js} +6 -6
- package/dist/assets/BusinessVerificationPageScreen-CqSHzLo6.js +9 -0
- package/dist/assets/{CardsAiCfoScreen-hMGqj2aq.js → CardsAiCfoScreen-DZorjbaf.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-STh2Wp7w.js → ChargeCardRoutes-C7tzEoGV.js} +6 -6
- package/dist/assets/CompanyPassportScreen-DViAGsze.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-BKVwXbSh.js → ConnectionAuthScreen-yW3T26AI.js} +3 -3
- package/dist/assets/CustomerOnboardingAuthScreen-CEs020qJ.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CNIJctLU.js → CustomerOnboardingRoutes-B2flxgjR.js} +5 -5
- package/dist/assets/{DashboardRoutes-Cq-Lxh3h.js → DashboardRoutes-D6igUQ_c.js} +3 -3
- package/dist/assets/{DefaultTenantHome-CshmDcap.js → DefaultTenantHome-CMpQllfi.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-D-XdJZt2.js +18 -0
- package/dist/assets/{DrawerScreen-CBAh6dJa.js → DrawerScreen-DquM7PdJ.js} +1 -1
- package/dist/assets/EntityDetailRoutes-B7vzEsHl.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-FZqTLeVo.js → ExpenseAutomationRoutes-o1rALTgt.js} +6 -6
- package/dist/assets/{FeaturePreviewScreen-CZR8YW-L.js → FeaturePreviewScreen-B0SxkBd3.js} +1 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-CYGRU6le.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-T1CjerOs.js → InboxNotificationsProvider-DPgK9Ai7.js} +1 -1
- package/dist/assets/{InvoicingRoutes-Ys89tvz2.js → InvoicingRoutes-BroIFZYm.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-DR9AEDCZ.js → MagicLinkRoutes-BYZevXyH.js} +5 -5
- package/dist/assets/MagicLinkSignInScreen-DqgSvyNq.js +12 -0
- package/dist/assets/{MobileAppDrawer-CtIgBgQ-.js → MobileAppDrawer-C6gfQS8M.js} +1 -1
- package/dist/assets/NotFoundScreen-0hF8kIyY.js +1 -0
- package/dist/assets/NotificationRoutes-BRYauJLR.js +1 -0
- package/dist/assets/OAuthConsentScreen-B_ncopNh.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-BU_XWD0n.js +1 -0
- package/dist/assets/{PaymentLinkScreen-EXZ3ZrN9.js → PaymentLinkScreen-6qwvkVJe.js} +1 -1
- package/dist/assets/{PeopleRoutes-CCoQcfmM.js → PeopleRoutes-BT10_5ZZ.js} +5 -5
- package/dist/assets/{PerformanceRoutes-Bx8pszb9.js → PerformanceRoutes-DEM0F09k.js} +1 -1
- package/dist/assets/{Preview-C3KwiSeU.js → Preview-xYIpXmh0.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-B_IVukb7.js → QBOConnectionScreen-CPdRdNFp.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-Dm2Et1-C.js → ReimbursementApprovalRoutes-kSFV0KaQ.js} +1 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CD8m8c7W.js +1 -0
- package/dist/assets/{ReimbursementRoutes-D1jTtRL_.js → ReimbursementRoutes-B7HRPmdv.js} +4 -4
- package/dist/assets/{ReportsRoutes-DwdL-iuL.js → ReportsRoutes-CkYyyTje.js} +1 -1
- package/dist/assets/{RewardsRoutes-CKpKVKBM.js → RewardsRoutes-kEA_DefW.js} +1 -1
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-BTUJ8zwC.js → ScheduleDetailsPrepaidExpensesScreen-DH-G2ABB.js} +4 -4
- package/dist/assets/{ScreenRoutes-_NAgJfqV.js → ScreenRoutes-C72NzSAe.js} +2 -2
- package/dist/assets/{SettingsRoutes-BK2pVuXm.js → SettingsRoutes-gBgMK1MW.js} +5 -5
- package/dist/assets/{SetupPagesScreen-CUiMxOyt.js → SetupPagesScreen-CIrP22mo.js} +4 -4
- package/dist/assets/{SignInScreen-B16ytfH2.js → SignInScreen-DAl9_AVs.js} +1 -1
- package/dist/assets/SignOutScreen-CvQRUG30.js +9 -0
- package/dist/assets/TaskListScreen-DI37lN7R.js +9 -0
- package/dist/assets/TaskRoutes-Sr-eq5Xy.js +9 -0
- package/dist/assets/TransactionDetailRoutes-DHOAhb5X.js +1 -0
- package/dist/assets/{TransactionDetailScreen-DFFAXF6x.js → TransactionDetailScreen-BfwmFu4d.js} +2 -2
- package/dist/assets/{TransactionListRoutes-bvLvzle-.js → TransactionListRoutes-CcqGcmw0.js} +1 -1
- package/dist/assets/{TreasuryRoutes-DYIO-YgE.js → TreasuryRoutes-S1BfnYGO.js} +5 -5
- package/dist/assets/{VendorsRoutes-DxWng3tY.js → VendorsRoutes-D9wt7kTI.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-CBCiP645.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-bTRWcMAn.js → ZeniAccountRoutes-CgUN5fCf.js} +9 -9
- package/dist/assets/ZeniAccountStatementScreen-jmmjZcA9.js +9 -0
- package/dist/assets/{accountMappingHelper-Cl-vw8fd.js → accountMappingHelper-BYw-4sqP.js} +1 -1
- package/dist/assets/{analytics-bcpq8FmH.js → analytics-UPQyZr49.js} +1 -1
- package/dist/assets/{analyticsHelper-DTKAaOR4.js → analyticsHelper-nRPDDcpi.js} +1 -1
- package/dist/assets/{core-CLbwxogo.js → core-D4EC26kf.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CTII6a9j.js → decodeURIComponentSafe-CDB32jt8.js} +1 -1
- package/dist/assets/{dnd-D7kr6gj3.js → dnd-CQ9igkkh.js} +1 -1
- package/dist/assets/{empty-BdckjUGv.js → empty-CI6RvMsS.js} +1 -1
- package/dist/assets/{empty-BIuVl5i4.js → empty-D2f6MViE.js} +1 -1
- package/dist/assets/{emptyVideoElement-CsPLODSh.js → emptyVideoElement-DMQKfl7Z.js} +1 -1
- package/dist/assets/epic-pH_zo6MR.js +2 -0
- package/dist/assets/expenseAutomationHelper-DLTA8kBq.js +1 -0
- package/dist/assets/{getLocaleForTenant-BdgPeU-B.js → getLocaleForTenant-B07LkoV2.js} +1 -1
- package/dist/assets/{index-COZnX9q1.js → index-B_bOZ9_a.js} +1 -1
- package/dist/assets/{index-C31Y0QTF.js → index-CEVAJ-IM.js} +1 -1
- package/dist/assets/{index-DPWxOeVp.js → index-CWHRX-bO.js} +1 -1
- package/dist/assets/{index-BWTXRZ02.js → index-Ch-ATQTq.js} +12598 -12590
- package/dist/assets/{index-CFqdtjWk.js → index-Cjagh0U7.js} +2 -2
- package/dist/assets/{index-CtHN3MJR.js → index-CllzBMQZ.js} +1 -1
- package/dist/assets/{index-CGtk3Boq.js → index-D7USIDVj.js} +1 -1
- package/dist/assets/{index-BGZGT2EB.js → index-DIih7oGD.js} +1 -1
- package/dist/assets/{lexical-DBQnrckW.js → lexical-DvwBeJWJ.js} +1 -1
- package/dist/assets/{liveblocks-B8NMVuJ_.js → liveblocks-DcDE-V-o.js} +1 -1
- package/dist/assets/{lottie-DZboDKA6.js → lottie-DBrmrNFb.js} +1 -1
- package/dist/assets/{mui-DB2eP-4H.js → mui-BCH_ILdb.js} +1 -1
- package/dist/assets/{pathToGoBack-kLAH7lQZ.js → pathToGoBack-rzbozB31.js} +1 -1
- package/dist/assets/{pdf-lib-B2sKhaXv.js → pdf-lib-CbTEittW.js} +1 -1
- package/dist/assets/{pdf-ByO6Vz9p.js → pdf-zGCHYG6q.js} +4 -4
- package/dist/assets/{plaid-BjkLQcpb.js → plaid-a-pmhWdo.js} +1 -1
- package/dist/assets/{pusher-DLAXsv5D.js → pusher-DTPJtuD1.js} +1 -1
- package/dist/assets/{react-Bnoavnug.js → react-BxMK-s19.js} +1 -1
- package/dist/assets/{react-CSeNOqFc.js → react-C83CKqL4.js} +1 -1
- package/dist/assets/{react-DnFO_FFm.js → react-CW0JS27q.js} +1 -1
- package/dist/assets/{react-6e8jc3Wj.js → react-Cc6y9hJ0.js} +1 -1
- package/dist/assets/{react-Bdnz9ur-.js → react-DEi14qD-.js} +1 -1
- package/dist/assets/{react-3YBksWOJ.js → react-Dom5mok4.js} +1 -1
- package/dist/assets/{recharts-DLaK4yUy.js → recharts-BRIJ8RH5.js} +1 -1
- package/dist/assets/{routePaths-D7Q4znoA.js → routePaths-D0-Tropc.js} +1 -1
- package/dist/assets/{sentry-Di8VmQH9.js → sentry-DB4rU-NW.js} +1 -1
- package/dist/assets/{stripSplatSuffix-vknm6I0a.js → stripSplatSuffix-DDkMarxH.js} +1 -1
- package/dist/assets/{url-DQtqpgyq.js → url-B6fk1MD4.js} +1 -1
- package/dist/assets/{url-D-LhAzLP.js → url-C0P0ff3A.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-BNN20aCx.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CoIOeMrO.js → useAiCfoDashboardSuggestedQuestionsChips-DOmg3jmM.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-2NTBRuLk.js → useAskAiCfoHostNavButtonProps-CBSVhkeG.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-CyCKOPqT.js → useChargeCardPusherEvents-WOovjOqT.js} +1 -1
- package/dist/assets/{useDeviceId-D9wKXTe6.js → useDeviceId-Dy35NfBh.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-27P04Izm.js +1 -0
- package/dist/assets/{useInitialThreadRequest-_cR9E-my.js → useInitialThreadRequest-Da3K5Ksw.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-DYYDLTVZ.js → useTaskManagerAccess-CX5toJpg.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-DaFacbHX.js → useTaskManagerPusherEvents-BiZinOaM.js} +1 -1
- package/dist/assets/{utils-cD9C-nwV.js → utils-CU_Pr3K6.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BOBG-nk3.js → withTransactionSidePanel-CCvid0cv.js} +1 -1
- package/dist/assets/{zeni-epic-state-DuYWeJse.js → zeni-epic-state-Bl3gAQPi.js} +5 -5
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-CRV9O3fJ.js +0 -1
- package/dist/assets/AddressScreen-CbqqBPeg.js +0 -9
- package/dist/assets/BusinessVerificationPageScreen-B81g6W18.js +0 -9
- package/dist/assets/CompanyPassportScreen-LxcAg-6u.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-yvp5XDgC.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-BSEUD6C3.js +0 -18
- package/dist/assets/EntityDetailRoutes-CKxj6mH-.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-CUlI7cbh.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-2HP7A3da.js +0 -12
- package/dist/assets/NotFoundScreen-oJupr3pq.js +0 -1
- package/dist/assets/NotificationRoutes-DPQX5f6K.js +0 -1
- package/dist/assets/OAuthConsentScreen-BFDI6eC9.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DyZHHb1Z.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CKOH-HzU.js +0 -1
- package/dist/assets/SignOutScreen-CYY1dAbn.js +0 -9
- package/dist/assets/TaskListScreen-DHzPd6H5.js +0 -9
- package/dist/assets/TaskRoutes-hldsrW8n.js +0 -9
- package/dist/assets/TransactionDetailRoutes-Cii1a7bV.js +0 -1
- package/dist/assets/WiseConfirmationScreen-3GfsXfj0.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-ulCu2kq_.js +0 -9
- package/dist/assets/epic-AKFDmlZB.js +0 -2
- package/dist/assets/expenseAutomationHelper-C40iB_7D.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-BtihcKgk.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-CLDF1mnr.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-B8NMVuJ_.js";import{h as J,u as le,g as X,i as ee,j as v,N as Q,l as K,q as aa,n as na,o as y}from"./core-CLbwxogo.js";import{fI as Y,YJ as Ge,bq as It,SJ as ia,bo as vt,bK as de,YK as kt,Hj as wt,II as Re,HW as oa,bn as Ce,YL as la,YM as sa,c9 as ra,YN as ca,m3 as xt,YO as Bt,YP as Ct,Ja as Ue,HC as xe,YQ as da,H7 as et,YR as ua,N2 as pa,Hb as ma,Hh as At,YS as Se,YT as _e,IJ as Me,Hz as Dt,YU as ba,YV as ha,IM as Ne,YW as ga,IS as Sa,YX as Et,Il as tt,Iq as ya,YY as fa,YZ as ce,Y_ as jt,Y$ as Tt,Z0 as Pt,gZ as Ia,HH as Ve,cH as Ft,Z1 as va,gk as ka,Z2 as wa,Z3 as xa,e0 as Rt,d$ as Vt,Z4 as Oe,Z5 as Ba,Z6 as Ca,Xh as Ze,Z7 as Aa,Xi as ie,Xj as ze,Z8 as Da,Z9 as Ea,Za as ja,Is as at,Ip as Ta,Zb as Pa,Zc as Fa,Zd as Ra,Ib as Va,Ze as $a,Zf as La,cv as $t,db as Lt,me as Ga,bP as Ua,br as Gt,bQ as Ut,Gn as _a,Zg as Ma,MR as Na,MX as Oa,Cx as Za,IK as za,Jh as Ha,mr as ge,Zh as Wa,Zi as _t,mV as Ya,ml as Mt,mG as Nt,mF as nt,bF as pe,bO as qa,Zj as Ja,Zk as ye,kR as Xa,Zl as it,Zm as Ka,kV as Qa,le as en,Jv as tn,Zn as an,mO as nn,Jl as on,Zo as ot,Jp as ln,Ju as sn,Js as rn,Jj as cn,Zp as Ot,Hs as dn,Zq as un,Zr as pn,gJ as mn,gI as bn,gH as hn,mu as gn,mM as lt,mX as Sn,v2 as yn,mD as fn,Jn as In,k$ as vn,n0 as kn,Zs as wn,kT as xn,uV as Bn,Zt as Cn,Ih as An,bL as Dn,bu as En,UI as jn,de as Tn,dd as Pn,cG as Fn,cN as Rn}from"./zeni-epic-state-DuYWeJse.js";import{z as V,V as fe,aq as He,W as oe,A as f,bg as We,a5 as se,E as A,a6 as Ae,h as E,bt as Vn,a2 as W,at as Ye,p as D,$ as Ie,bu as st,bv as rt,bw as $n,ax as Ln,ad as Gn,aQ as Un,a9 as Zt,G as De,ae as qe,bx as _n,ac as zt,by as Mn,ao as Nn,N as Ht,w as On,bz as Zn,bA as zn,bB as Hn,bC as Wn,bD as Yn,bE as qn,bF as Jn,bG as Xn,bH as Kn,o as Qn,bI as ei,bq as ti,bJ as ai,ag as ni,bK as ii,f as oi}from"./index-BWTXRZ02.js";import{u as ue,n as G,S as li}from"./mui-DB2eP-4H.js";import{A as ct}from"./AddressScreen-CbqqBPeg.js";import{g as ne,a as Ee,i as Wt,V as Je,b as Xe,c as si,v as ri,d as ci,A as me,D as be}from"./DomesticWireDetailScreen-BSEUD6C3.js";import{a as g}from"./sentry-Di8VmQH9.js";import{u as Ke}from"./useAskAiCfoHostNavButtonProps-2NTBRuLk.js";import{u as Yt}from"./useInitialThreadRequest-_cR9E-my.js";import{u as di}from"./BusinessVerificationPageScreen-B81g6W18.js";import Be from"./NotFoundScreen-oJupr3pq.js";import{D as ui}from"./DrawerScreen-CBAh6dJa.js";import{M as qt}from"./MobileAppDrawer-CtIgBgQ-.js";import{F as Jt}from"./FeaturePreviewScreen-CZR8YW-L.js";import{S as je}from"./SetupPagesScreen-CUiMxOyt.js";import{B as pi}from"./BillPayApprovalRoutes-BG_fZlTC.js";import{F as mi}from"./ScreenRoutes-_NAgJfqV.js";import"./recharts-DLaK4yUy.js";import"./analytics-bcpq8FmH.js";import"./plaid-BjkLQcpb.js";import"./dnd-D7kr6gj3.js";import"./stripe-cKAAJElX.js";import"./lottie-DZboDKA6.js";import"./lexical-DBQnrckW.js";import"./pdf-ByO6Vz9p.js";import"./utils-cD9C-nwV.js";import"./routePaths-D7Q4znoA.js";import"./InboxNotificationsProvider-T1CjerOs.js";import"./useTaskManagerAccess-DYYDLTVZ.js";import"./analyticsHelper-DTKAaOR4.js";import"./ReimbursementApprovalRuleDetailScreen-CKOH-HzU.js";import"./getLocaleForTenant-BdgPeU-B.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]="51f36ddd-239e-4c24-826e-b840d71bc8f0",e._sentryDebugIdIdentifier="sentry-dbid-51f36ddd-239e-4c24-826e-b840d71bc8f0")}catch{}})();const bi=K((function(e,t){const l=Ge(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=W(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;Ce(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:S,isMarkAsPaidBtnVisible:h}=la(l.billActivities,sa(t.currentTenant),n);i=S,d=h}const p=ra(t.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&ca(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ye}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:E,showMarkAsPaidButtonToCreator:m}}),(function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{E.trackBillPayDeleteBill(l,o),e(At(l))},cancelAndDeleteBill:(o,s)=>{s===!0?E.trackBillPayCancelAndDeleteBill(l,o):E.trackBillPayCancelBill(l),e(ma(l,s))},onSaveRealTimeApprovals:o=>{e(pa(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ua({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(et(l,o.type,"")):e(et(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(xe(l,"retry")):e(xe(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=W(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(da({billId:t.billId}))},onRefundPaymentClick:()=>{e(xe(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Ct({data:i,billId:l})),e(Ue(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}}))(Vn);function hi(){const e=J(),t=le(),l=X(),{billId:n}=ee(),c=ue(),r=V.getSignedInUser(),u=fe(),o=v((U=>Y(U))),s=v((U=>Ge(U,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ke({mobileExploreReferrer:"Bill Details"});He({isDataReady:s.fetchState==="Completed"});const S=o?.userRole!=null&&It(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!S,[b,C]=g.useState(!1),[I,T]=g.useState(!1),[B,j]=g.useState(!1),{useFeatureGate:k,useDynamicConfig:$}=oe(),{isFeatureEnabled:O}=k(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:_}=k(f.isBillPayDetectInsufficientFundsEnabled),{configValue:Z}=$(We.zeniAssistConfig),z=ia(o),w=vt(o.userRole),M=h&&de(u?.loggedInUserRoleMap),L=Z.user_ids!=null&&r?.userId!=null&&Z.user_ids.includes(r?.userId),{isFeatureEnabled:H}=k(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:q}=k(f.billPaySetupShowInternationalPaymentByWise);if(g.useEffect((()=>{O&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&z===!1?j(!1):j(s.billActivities[0]?.isRealTimeApprovalEnabled&&(w||M||s.allApprovers.find((U=>U.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,w,M,o.isZeni,z,r]),g.useEffect((()=>{n!=null&&t(kt(n))}),[n]),g.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(C(!0),t(wt(n??"",O,L,!1)))}),[b,s,n,t]),g.useEffect((()=>{I||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(T(!0),t(Re(!1,O,L,q,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(oa()))}),[I,s,n,t,O,L,q]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(Q,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Ae,{analytics:E,onLoad:U=>(N=>{n!=null&&N.trackBillPayBillDetails(n,s.isRecurring)})(U)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:O,location:l,navigate:e,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:H,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:_,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const $e=De.getLocalizedStrings().spendManagement.billPay.billDetails,dt=De.getLocalizedStrings().common,gi={containerWidth:new Zt(100,58)},ut=K((function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${zt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:E,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}}),(function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{E?.trackBillPaySkipAutofill(),e(Me(n))},onDeleteClick:()=>{e(ga({billId:t.billId})),E?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(Un);function x({appContent:e}){const t=le(),l=J(),{billId:n}=ee(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=d(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(f.billPaySetupShowInternationalPaymentByWise),{configValue:C}=p(We.zeniAssistConfig),I=C.user_ids!=null&&i?.userId!=null&&C.user_ids.includes(i?.userId),T=v((P=>Y(P)));di();const[B,j]=g.useState(!1),[k,$]=g.useState(!1),[O,_]=g.useState(!1),[Z,z]=g.useState(),w=v((P=>_e(P,m,h,n)));let M=w.fetchState,L=w.file,H=w.showAutofill;const q=v((P=>Ge(P,n??"")));u===!1&&(M=q.fetchState,L=q.transactionDetails?.attachments?.[0],H=!1);const U=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;g.useEffect((()=>{n==null&&t(Me(!0))}),[n,t]),g.useEffect((()=>{M==="Not-Started"&&(u&&k?$(!1):!u&&B&&j(!1))}),[n]),g.useEffect((()=>{B||n==null||u||(j(!0),t(wt(n,S,I,!1)),t(Dt(n)),k||($(!0),t(Re(!1,S,I,b,n)))),u&&!k&&($(!0),t(Re(!1,S,I,b,n)))}),[B,k,u,n,t,S,I,b]);const N={onOkClick:()=>{if(_(!1),!Z)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","yes"),t(ha({replaceBillData:!0,billId:n})),t(Ne(Z,m,n))},onCancelClick:()=>{if(_(!1),!Z)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","no"),t(ba({file:Z,billId:n}))}},te=g.useCallback((()=>{const P=W(c.state?.pathnameStackToGoBack),ve=P.poppedPathname??ne(T.tenantEmailDomain);t(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:P.newStack}})}),[c.state,T.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(M==="Error"||q.fetchState==="Error")return a.jsx(Be,{});if(M!="Completed")return n==null&&o!=="small"?a.jsx(st,{fallback:te,children:a.jsxs(Te,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Pe,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:_,setPayload:z,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:U}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:!0})})]})}):a.jsxs(Te,{windowSize:o,children:[o==="small"||H?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:te,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx($n,{}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:n==null})})]});{const P=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(st,{fallback:te,children:a.jsxs(Te,{windowSize:o,children:[H&&o!=="small"?a.jsx(mt,{}):null,O?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:$e.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:$e.overwriteDescription}),primaryButtonText:dt.yes,secondaryButtonText:dt.no,action:N,isEditPopup:!0}):null,o==="small"||H?null:a.jsx(pt,{children:a.jsx(Si,{})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:H,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:yi(u,q,w),setShowConfirmationPopup:_,setPayload:z,showActionButtons:fi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:P}),a.jsx(Fe,{windowSize:o,children:e})]})})}}function Si(){const{triggerBack:e}=_n();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function yi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(Ii,{children:[a.jsx(vi,{children:`${$e.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-DcDE-V-o.js";import{h as J,u as le,g as X,i as ee,j as v,N as Q,l as K,q as aa,n as na,o as y}from"./core-D4EC26kf.js";import{fI as Y,YK as Ge,bq as It,SJ as ia,bo as vt,bK as de,YL as kt,Hj as wt,II as Re,HW as oa,bn as Ce,YM as la,YN as sa,c9 as ra,YO as ca,m3 as xt,YP as Bt,YQ as Ct,Ja as Ue,HC as xe,YR as da,H7 as et,YS as ua,N2 as pa,Hb as ma,Hh as At,YT as Se,YU as _e,IJ as Me,Hz as Dt,YV as ba,YW as ha,IM as Ze,YX as ga,IS as Sa,YY as Et,Il as tt,Iq as ya,YZ as fa,Y_ as ce,Y$ as jt,Z0 as Tt,Z1 as Pt,gZ as Ia,HH as Ve,cH as Ft,Z2 as va,gk as ka,Z3 as wa,Z4 as xa,e0 as Rt,d$ as Vt,Z5 as Ne,Z6 as Ba,Z7 as Ca,Xi as Oe,Z8 as Aa,Xj as ie,Xk as ze,Z9 as Da,Za as Ea,Zb as ja,Is as at,Ip as Ta,Zc as Pa,Zd as Fa,Ze as Ra,Ib as Va,Zf as $a,Zg as La,cv as $t,db as Lt,me as Ga,bP as Ua,br as Gt,bQ as Ut,Gn as _a,Zh as Ma,MR as Za,MX as Na,Cx as Oa,IK as za,Jh as Ha,mr as ge,Zi as Wa,Zj as _t,mV as Ya,ml as Mt,mG as Zt,mF as nt,bF as pe,bO as qa,Zk as Ja,Zl as ye,kR as Xa,Zm as it,Zn as Ka,kV as Qa,le as en,Jv as tn,Zo as an,mO as nn,Jl as on,Zp as ot,Jp as ln,Ju as sn,Js as rn,Jj as cn,Zq as Nt,Hs as dn,Zr as un,Zs as pn,gJ as mn,gI as bn,gH as hn,mu as gn,mM as lt,mX as Sn,v2 as yn,mD as fn,Jn as In,k$ as vn,n0 as kn,Zt as wn,kT as xn,uV as Bn,Zu as Cn,Ih as An,bL as Dn,bu as En,UJ as jn,de as Tn,dd as Pn,cG as Fn,cN as Rn}from"./zeni-epic-state-Bl3gAQPi.js";import{z as V,V as fe,aq as He,W as oe,A as f,bg as We,a5 as se,E as A,a6 as Ae,j as E,bt as Vn,a2 as W,at as Ye,p as D,$ as Ie,bu as st,bv as rt,bw as $n,ax as Ln,ad as Gn,aQ as Un,a9 as Ot,G as De,ae as qe,bx as _n,ac as zt,by as Mn,ao as Zn,N as Ht,w as Nn,bz as On,bA as zn,bB as Hn,bC as Wn,bD as Yn,bE as qn,bF as Jn,bG as Xn,bH as Kn,e as Qn,bI as ei,bq as ti,bJ as ai,ag as ni,bK as ii,g as oi}from"./index-Ch-ATQTq.js";import{u as ue,n as G,S as li}from"./mui-BCH_ILdb.js";import{A as ct}from"./AddressScreen-BOTH_mRu.js";import{g as ne,a as Ee,i as Wt,V as Je,b as Xe,c as si,v as ri,d as ci,A as me,D as be}from"./DomesticWireDetailScreen-D-XdJZt2.js";import{a as g}from"./sentry-DB4rU-NW.js";import{u as Ke}from"./useAskAiCfoHostNavButtonProps-CBSVhkeG.js";import{u as Yt}from"./useInitialThreadRequest-Da3K5Ksw.js";import{u as di}from"./BusinessVerificationPageScreen-CqSHzLo6.js";import Be from"./NotFoundScreen-0hF8kIyY.js";import{D as ui}from"./DrawerScreen-DquM7PdJ.js";import{M as qt}from"./MobileAppDrawer-C6gfQS8M.js";import{F as Jt}from"./FeaturePreviewScreen-B0SxkBd3.js";import{S as je}from"./SetupPagesScreen-CIrP22mo.js";import{B as pi}from"./BillPayApprovalRoutes-CYDv31qk.js";import{F as mi}from"./ScreenRoutes-C72NzSAe.js";import"./recharts-BRIJ8RH5.js";import"./analytics-UPQyZr49.js";import"./plaid-a-pmhWdo.js";import"./dnd-CQ9igkkh.js";import"./stripe-cKAAJElX.js";import"./lottie-DBrmrNFb.js";import"./lexical-DvwBeJWJ.js";import"./pdf-zGCHYG6q.js";import"./utils-CU_Pr3K6.js";import"./routePaths-D0-Tropc.js";import"./InboxNotificationsProvider-DPgK9Ai7.js";import"./useTaskManagerAccess-CX5toJpg.js";import"./analyticsHelper-nRPDDcpi.js";import"./ReimbursementApprovalRuleDetailScreen-CD8m8c7W.js";import"./getLocaleForTenant-B07LkoV2.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]="c5ddd54b-c1aa-44fd-b8d5-c6d43b34e7b7",e._sentryDebugIdIdentifier="sentry-dbid-c5ddd54b-c1aa-44fd-b8d5-c6d43b34e7b7")}catch{}})();const bi=K((function(e,t){const l=Ge(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=W(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;Ce(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:S,isMarkAsPaidBtnVisible:h}=la(l.billActivities,sa(t.currentTenant),n);i=S,d=h}const p=ra(t.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&ca(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ye}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:E,showMarkAsPaidButtonToCreator:m}}),(function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{E.trackBillPayDeleteBill(l,o),e(At(l))},cancelAndDeleteBill:(o,s)=>{s===!0?E.trackBillPayCancelAndDeleteBill(l,o):E.trackBillPayCancelBill(l),e(ma(l,s))},onSaveRealTimeApprovals:o=>{e(pa(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ua({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(et(l,o.type,"")):e(et(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(xe(l,"retry")):e(xe(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=W(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(da({billId:t.billId}))},onRefundPaymentClick:()=>{e(xe(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Ct({data:i,billId:l})),e(Ue(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}}))(Vn);function hi(){const e=J(),t=le(),l=X(),{billId:n}=ee(),c=ue(),r=V.getSignedInUser(),u=fe(),o=v((U=>Y(U))),s=v((U=>Ge(U,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ke({mobileExploreReferrer:"Bill Details"});He({isDataReady:s.fetchState==="Completed"});const S=o?.userRole!=null&&It(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!S,[b,C]=g.useState(!1),[I,T]=g.useState(!1),[B,j]=g.useState(!1),{useFeatureGate:k,useDynamicConfig:$}=oe(),{isFeatureEnabled:N}=k(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:_}=k(f.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=$(We.zeniAssistConfig),z=ia(o),w=vt(o.userRole),M=h&&de(u?.loggedInUserRoleMap),L=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:H}=k(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:q}=k(f.billPaySetupShowInternationalPaymentByWise);if(g.useEffect((()=>{N&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&z===!1?j(!1):j(s.billActivities[0]?.isRealTimeApprovalEnabled&&(w||M||s.allApprovers.find((U=>U.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,w,M,o.isZeni,z,r]),g.useEffect((()=>{n!=null&&t(kt(n))}),[n]),g.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(C(!0),t(wt(n??"",N,L,!1)))}),[b,s,n,t]),g.useEffect((()=>{I||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(T(!0),t(Re(!1,N,L,q,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(oa()))}),[I,s,n,t,N,L,q]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(Q,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Ae,{analytics:E,onLoad:U=>(Z=>{n!=null&&Z.trackBillPayBillDetails(n,s.isRecurring)})(U)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:N,location:l,navigate:e,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:H,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:_,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const $e=De.getLocalizedStrings().spendManagement.billPay.billDetails,dt=De.getLocalizedStrings().common,gi={containerWidth:new Ot(100,58)},ut=K((function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${zt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:E,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}}),(function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{E?.trackBillPaySkipAutofill(),e(Me(n))},onDeleteClick:()=>{e(ga({billId:t.billId})),E?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(Un);function x({appContent:e}){const t=le(),l=J(),{billId:n}=ee(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=d(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(f.billPaySetupShowInternationalPaymentByWise),{configValue:C}=p(We.zeniAssistConfig),I=C.user_ids!=null&&i?.userId!=null&&C.user_ids.includes(i?.userId),T=v((P=>Y(P)));di();const[B,j]=g.useState(!1),[k,$]=g.useState(!1),[N,_]=g.useState(!1),[O,z]=g.useState(),w=v((P=>_e(P,m,h,n)));let M=w.fetchState,L=w.file,H=w.showAutofill;const q=v((P=>Ge(P,n??"")));u===!1&&(M=q.fetchState,L=q.transactionDetails?.attachments?.[0],H=!1);const U=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;g.useEffect((()=>{n==null&&t(Me(!0))}),[n,t]),g.useEffect((()=>{M==="Not-Started"&&(u&&k?$(!1):!u&&B&&j(!1))}),[n]),g.useEffect((()=>{B||n==null||u||(j(!0),t(wt(n,S,I,!1)),t(Dt(n)),k||($(!0),t(Re(!1,S,I,b,n)))),u&&!k&&($(!0),t(Re(!1,S,I,b,n)))}),[B,k,u,n,t,S,I,b]);const Z={onOkClick:()=>{if(_(!1),!O)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","yes"),t(ha({replaceBillData:!0,billId:n})),t(Ze(O,m,n))},onCancelClick:()=>{if(_(!1),!O)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","no"),t(ba({file:O,billId:n}))}},te=g.useCallback((()=>{const P=W(c.state?.pathnameStackToGoBack),ve=P.poppedPathname??ne(T.tenantEmailDomain);t(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:P.newStack}})}),[c.state,T.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(M==="Error"||q.fetchState==="Error")return a.jsx(Be,{});if(M!="Completed")return n==null&&o!=="small"?a.jsx(st,{fallback:te,children:a.jsxs(Te,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Pe,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:_,setPayload:z,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:U}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:!0})})]})}):a.jsxs(Te,{windowSize:o,children:[o==="small"||H?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:te,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx($n,{}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:n==null})})]});{const P=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(st,{fallback:te,children:a.jsxs(Te,{windowSize:o,children:[H&&o!=="small"?a.jsx(mt,{}):null,N?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:$e.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:$e.overwriteDescription}),primaryButtonText:dt.yes,secondaryButtonText:dt.no,action:Z,isEditPopup:!0}):null,o==="small"||H?null:a.jsx(pt,{children:a.jsx(Si,{})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:H,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:yi(u,q,w),setShowConfirmationPopup:_,setPayload:z,showActionButtons:fi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:P}),a.jsx(Fe,{windowSize:o,children:e})]})})}}function Si(){const{triggerBack:e}=_n();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function yi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(Ii,{children:[a.jsx(vi,{children:`${$e.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(ki,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const pt=G.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-B8NMVuJ_.js";import{h as J,u as le,g as X,i as e
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,Di=K((function(e,t){const l=V.getSignedInUser(),n=Ce(l),c=Pt(e,ae,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter((b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted")):t.roleMap.bill_pay_approver&&(r=r.filter((b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted")))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter((b=>b!=="deleted")));const u=e.entityAutoCompleteState.autoCompleteText.common,o=
|
|
88
|
+
`,Di=K((function(e,t){const l=V.getSignedInUser(),n=Ce(l),c=Pt(e,ae,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter((b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted")):t.roleMap.bill_pay_approver&&(r=r.filter((b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted")))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter((b=>b!=="deleted")));const u=e.entityAutoCompleteState.autoCompleteText.common,o=Oe(e,"common"),s=e.tenantState.currentTenantId,i=Y(e),d=i?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,S=c.fetchState,h=Aa(e);return{transactionList:t.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter((b=>b.isDeleted===!1)),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:S,analytics:E,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ae,spendManagementEndPoint:`${Ye}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:h.affectedEntityIds}}),(function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:u}=n;return{updateTabToState:o=>{e(ce()),e(jt(o))},onSubtabChange:o=>{e(ce()),e(Tt(o))},onTransactionClick:(o,s)=>{const i=Ee(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=ji(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;E?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=D(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e($a(o))},onReloadTransactions:()=>{e(Ve(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e(Va(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Ra({filters:o})),o.categories.every((s=>s.field!=null&&s.values?.length!==0))&&E.trackSpendManagmentFilterChange("bill_pay",o.categories.map((s=>`${s.field}-${JSON.stringify(s.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&E.trackSpendManagementDownloadClick("bill_pay"),e(Fa({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Pa(o))},removeAllTransactionsFromBulkActionList:()=>{e(ce())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Ta(o,s??""));break;case"send_for_approval":e(at("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(at("approve")),t.navigate("./bulk-review");break;case"review":e(ja()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Le)&&e(Ea(!1))},onEventReceived:o=>{o===Kt&&e(Da())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ze({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}}}}))(Nn(On));function Ei(){const e=J(),t=le(),l=X(),n=Ie(),c=l.state,r=fe(),[u,o]=g.useState(!1),[s,i]=g.useState(null),d=aa("/:tenantEmailDomain/bills/bulk-review")!=null;g.useEffect((()=>(c?.tab!=null&&c?.subTab!=null&&(t(jt(c?.tab)),t(Tt(c?.subTab))),()=>{t(ce())})),[]);const p=V.getSignedInUser(),m=v((F=>Y(F))),{areTenantIdsInSync:S}=Zn(),[h,b]=g.useState(!1),{useFeatureGate:C}=oe(),{isFeatureEnabled:I}=C(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:T}=C(f.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:B}=C(f.isBillPayBulkActionEnabled),{isFeatureEnabled:j}=C(f.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:k}=C(f.isBillPayDetectInsufficientFundsEnabled),$=v((F=>Pt(F,ae,B,p?.userId))),{isFeatureEnabled:N}=C(f.isDebitCardFeatureEnabled),_=$.fetchState,{isAiCfoAccessEnabled:O,onAskAiCfoClick:z}=Ke({mobileExploreReferrer:"Bills List"});He({isDataReady:_==="Completed"});const w=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,M=!!m.companyBillPayInfo?.info?.isBillPayEnabled,L=v((F=>Ia(F.companyState,m.companyId))),H=L?.company.featuresActivationInfo.connectedAccountProvider;if(g.useEffect((()=>{!h&&M&&S&&(b(!0),t(Ve(ae,!0,I,j)))}),[h,ae,S,t]),p==null)throw Error("Can't access address page without signing in...");const q=(F,re)=>{t(Ba({uiState:{sortKey:F,sortOrder:re},period:ae}))},U=Ft(r?.loggedInUserRoleMap),Z=de(r?.loggedInUserRoleMap),te=F=>{o(F)},{billsProcessed:P,billsProcessing:ve}=v((F=>va(F)));g.useEffect((()=>{P===ve&&s!=null&&(t(ka({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:P>1?ke.headers.bills:ke.texts.bill2},{variableName:"_has_",variableValue:P>1?ke.texts.have:ke.texts.has},{variableName:"_action_",variableValue:wa(s)}]})),t(xa()),setTimeout((()=>{t(Ve(ae,!0,I,!0,j))}),3e3),i(null))}),[P,ve]);const Qt={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${Kt}`,`private-encrypted-${m.companyId}.${Le}`]:[],eventCallback:(F,re,Qe)=>{F.endsWith(Le)?Qe.onBillPayApprovalRulesEventReceived?.(F):re?.entity_type==="bill"&&(i(re.operation_type),Qe.onEventReceived(F))}},ea=Rt(N,m),ta=Vt(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?ea===!0||ta===!0?a.jsx(Jt,{}):M?a.jsxs(a.Fragment,{children:[_==="Completed"?a.jsx(Ae,{analytics:E,onLoad:F=>(re=>re.trackPageLoaded(Ht.Event.billPayHome))(F)}):null,a.jsxs(Ai,{windowSize:n,children:[a.jsx(qt,{isAppContentDrawerOpen:u,handleDrawerToggle:te}),a.jsx(ui,{isOpen:d,drawerLeftMargin:new Ot(0,0,300,600),onClose:()=>{e(`/${m.tenantEmailDomain}/bills`),t(ce())},children:a.jsx(Ti,{onClick:F=>F.stopPropagation(),children:a.jsx(Ci,{tenantEmailDomain:m.tenantEmailDomain})})}),a.jsx(Di,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",period:ae,isAdmin:!1,uiState:$.uiState,onColumnSortConfigChanged:q,isUserHasOnlyBillpayAccess:U,isShowDeletedBillsEnabled:I,isShowDeletedReimbursementEnabled:T,isBulkActionEnabled:B,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{te(!0)},isDownloadEnabled:$.isDownloadEnabled,connectedAccountProvider:H,bulkSubmissionLimit:$.billBulkSubmissionLimit,bulkSubmissionFetchState:$.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:$.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:j,isDetectInsufficientFundsEnabled:k,isAiCfoAccessEnabled:O,onAskAiCfoClick:z,...Qt})]})]}):w===!0&&Z===!0?a.jsx(Q,{to:"../setup"}):r!=null&&Ne(m,r.loggedInUserRoleMap)?a.jsx(Q,{to:"../promo"}):a.jsx(se,{fetchState:_}):a.jsx(Be,{})}const ji=e=>`/${e}/bills/setup`,Ti=G(li)`
|
|
89
89
|
display: flex;
|
|
90
90
|
min-height: 100%;
|
|
91
91
|
flex-direction: column;
|
|
92
|
-
`,{common:{currency:he},spendManagement:{billPay:{billDetails:Pi}},appName:Fi}=De.getLocalizedStrings(),Ri=K((function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=W(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=Ce(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??Fi} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ua(t.billDetailsView.paymentDetailsSection?.paymentType?.method),S=t.currentTenant.createTime,h=Gt(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,C=S.add(b,"month").isAfter(h),I=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Ut(p,t.billDetailsView.approvalRules.allApprovalRules,l,t.billDetailsView.vendor?.id,t.billDetailsView.classId),T=Y(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:xt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${Ye}/transaction_attachment`,analytics:E,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:T.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:I,isZeniUser:d,isNewUser:C,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}}),(function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(nt(i));const d=ht(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Mt(d,!1)),e(Nt({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(nt());const p=ht(s,void 0,l),m=D(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(Ne(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Me(i))},onSaveChangesToLocalStore:(i,d,p,m,S)=>{const h=Gi(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:S}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ya({billDetailLocalData:h,billId:l}))},saveBillDetails:()=>{e(Ue("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(_t("draft"))},reviewBillDetails:()=>{const i=Vi(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Se({billId:i}))},clearBillPayReviewLocalState:()=>e(Wa()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(ge(!1,i));const d=$i(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(ge(!1,i));const d=Li(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(ge(!1,i));const d=Wt(s,l,i),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(Se({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(At(l))},onAttachmentClick:(i,d)=>{const p=Ee(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=W(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(ze({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Ha(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Yn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(za(!0,i,l))},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Za("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(Oa(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Na(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(_a("bill_pay","bill_pay_detail")),e(Ma({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}}))(zn);function bt(){const e=J(),t=X(),l=le(),{billId:n,tenantEmailDomain:c}=ee(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(f.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(f.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:p}=r(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:m}=r(f.isRecurringBillsFeatureEnabled),{isFeatureEnabled:S}=r(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=r(f.isShaDisabled),{isFeatureEnabled:b}=r(f.isOurDisabled),{isFeatureEnabled:C}=r(f.isBillPayDetectInsufficientFundsEnabled),{configValue:I}=u(We.sameDayAchDisablementConfig),T=La(I),B=V.getSignedInUser(),j=v((N=>Y(N))),k=v((N=>_e(N,p,S,n))),$=Yt(j?.companyId,{clearParams:k.fetchState==="Completed"}),{isAiCfoAccessEnabled:O,onAskAiCfoClick:_}=Ke({mobileExploreReferrer:"Bill Details"});He({isDataReady:k.fetchState==="Completed"});const Z=j.companyId??V.getSignedInUserTenant(c)?.companyId,z=fe(),w=$t(z?.loggedInUserRoleMap),M=Lt(z?.loggedInUserRoleMap),L=de(z?.loggedInUserRoleMap),H=vt(j.userRole);if(g.useEffect((()=>{n!=null&&l(kt(n))}),[n]),g.useEffect((()=>{n!=null&&l(Dt(n))}),[n,l]),B==null)throw Error("Can't access address page without signing in...");const q=v((N=>Ga(N.accountState,N.accountListState,"billPayAccountList"))),U={pathname:"../",search:t.search};return k.isDeleted===!0||k.billStage=="paid"||k.fetchState=="Not-Started"?a.jsx(Q,{to:U}):k.deleteStatus.fetchState==="In-Progress"||s?a.jsx(se,{fetchState:k.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Ae,{analytics:E,onLoad:N=>(te=>{n!=null&&k.deleteStatus.fetchState!=="Completed"&&te.trackBillPayEditBill(n,k.isRecurring)})(N)}),a.jsx(Ri,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:j,billId:n,companyId:Z,billDetailsView:k,isMagicLinkEnabled:o,isVendorRecommendationEnabled:p,isLocalCurrencyEnabled:d,uncategorizedAccounts:q,isInternationalPaymentShaVsOurEnabled:i,vendor:k.vendor,isShaDisabled:h,isOurDisabled:b,isRecurringBillsFeatureEnabled:m,hasZeniAccountsAdminAccess:w,isZeniAccountsUser:M,isBillPayAdmin:L,isSuperAdmin:H,isDetectInsufficientFundsEnabled:C,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:O,onAskAiCfoClick:_})]})}const ht=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},Vi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},$i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Li=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},R="paymentDetails",Gi=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?pe(t.whatFor.invoiceDate.toString()):Gt(),billDueDate:t.whatFor.billDueDate?pe(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?pe(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find((b=>b.id===t[R]?.withdrawFrom?.selectedOption)),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(qa)&&u?.vendorCurrencyCode===he.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=t[R]?.recurringPaymentType?.selectedOption===Pi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Ja(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?pe(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?pe(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},S=Ui(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),h=Object.keys(S).length>0?Hn(S):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:h,recipientTotalAmount:h,file:e.file,updatesByLineId:S,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Ui=(e,t,l,n,c,r)=>{const u={};return n.forEach((o=>{let s,i;o.account.selectedOption!=null&&(s=e.find((p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption))),o.class?.selectedOption!=null&&(i=t.find((p=>p.classId===o.class.selectedOption)));const d=Wn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??he.currencyCode,currencySymbol:o.currency?.currencySymbol??he.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??he.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??he.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}})),u},_i=G.div`
|
|
92
|
+
`,{common:{currency:he},spendManagement:{billPay:{billDetails:Pi}},appName:Fi}=De.getLocalizedStrings(),Ri=K((function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=W(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Oe(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=Ce(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??Fi} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ua(t.billDetailsView.paymentDetailsSection?.paymentType?.method),S=t.currentTenant.createTime,h=Gt(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,C=S.add(b,"month").isAfter(h),I=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Ut(p,t.billDetailsView.approvalRules.allApprovalRules,l,t.billDetailsView.vendor?.id,t.billDetailsView.classId),T=Y(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:xt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${Ye}/transaction_attachment`,analytics:E,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:T.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:I,isZeniUser:d,isNewUser:C,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}}),(function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(nt(i));const d=ht(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Mt(d,!1)),e(Zt({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(nt());const p=ht(s,void 0,l),m=D(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(Ze(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Me(i))},onSaveChangesToLocalStore:(i,d,p,m,S)=>{const h=Gi(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:S}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ya({billDetailLocalData:h,billId:l}))},saveBillDetails:()=>{e(Ue("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(_t("draft"))},reviewBillDetails:()=>{const i=Vi(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Se({billId:i}))},clearBillPayReviewLocalState:()=>e(Wa()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(ge(!1,i));const d=$i(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(ge(!1,i));const d=Li(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(ge(!1,i));const d=Wt(s,l,i),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(Se({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(At(l))},onAttachmentClick:(i,d)=>{const p=Ee(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=W(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(ze({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Ha(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Yn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(za(!0,i,l))},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Oa("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(Na(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Za(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(_a("bill_pay","bill_pay_detail")),e(Ma({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}}))(zn);function bt(){const e=J(),t=X(),l=le(),{billId:n,tenantEmailDomain:c}=ee(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(f.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(f.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:p}=r(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:m}=r(f.isRecurringBillsFeatureEnabled),{isFeatureEnabled:S}=r(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=r(f.isShaDisabled),{isFeatureEnabled:b}=r(f.isOurDisabled),{isFeatureEnabled:C}=r(f.isBillPayDetectInsufficientFundsEnabled),{configValue:I}=u(We.sameDayAchDisablementConfig),T=La(I),B=V.getSignedInUser(),j=v((Z=>Y(Z))),k=v((Z=>_e(Z,p,S,n))),$=Yt(j?.companyId,{clearParams:k.fetchState==="Completed"}),{isAiCfoAccessEnabled:N,onAskAiCfoClick:_}=Ke({mobileExploreReferrer:"Bill Details"});He({isDataReady:k.fetchState==="Completed"});const O=j.companyId??V.getSignedInUserTenant(c)?.companyId,z=fe(),w=$t(z?.loggedInUserRoleMap),M=Lt(z?.loggedInUserRoleMap),L=de(z?.loggedInUserRoleMap),H=vt(j.userRole);if(g.useEffect((()=>{n!=null&&l(kt(n))}),[n]),g.useEffect((()=>{n!=null&&l(Dt(n))}),[n,l]),B==null)throw Error("Can't access address page without signing in...");const q=v((Z=>Ga(Z.accountState,Z.accountListState,"billPayAccountList"))),U={pathname:"../",search:t.search};return k.isDeleted===!0||k.billStage=="paid"||k.fetchState=="Not-Started"?a.jsx(Q,{to:U}):k.deleteStatus.fetchState==="In-Progress"||s?a.jsx(se,{fetchState:k.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Ae,{analytics:E,onLoad:Z=>(te=>{n!=null&&k.deleteStatus.fetchState!=="Completed"&&te.trackBillPayEditBill(n,k.isRecurring)})(Z)}),a.jsx(Ri,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:j,billId:n,companyId:O,billDetailsView:k,isMagicLinkEnabled:o,isVendorRecommendationEnabled:p,isLocalCurrencyEnabled:d,uncategorizedAccounts:q,isInternationalPaymentShaVsOurEnabled:i,vendor:k.vendor,isShaDisabled:h,isOurDisabled:b,isRecurringBillsFeatureEnabled:m,hasZeniAccountsAdminAccess:w,isZeniAccountsUser:M,isBillPayAdmin:L,isSuperAdmin:H,isDetectInsufficientFundsEnabled:C,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:N,onAskAiCfoClick:_})]})}const ht=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},Vi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},$i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Li=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},R="paymentDetails",Gi=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?pe(t.whatFor.invoiceDate.toString()):Gt(),billDueDate:t.whatFor.billDueDate?pe(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?pe(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find((b=>b.id===t[R]?.withdrawFrom?.selectedOption)),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(qa)&&u?.vendorCurrencyCode===he.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=t[R]?.recurringPaymentType?.selectedOption===Pi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Ja(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?pe(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?pe(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},S=Ui(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),h=Object.keys(S).length>0?Hn(S):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:h,recipientTotalAmount:h,file:e.file,updatesByLineId:S,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Ui=(e,t,l,n,c,r)=>{const u={};return n.forEach((o=>{let s,i;o.account.selectedOption!=null&&(s=e.find((p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption))),o.class?.selectedOption!=null&&(i=t.find((p=>p.classId===o.class.selectedOption)));const d=Wn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??he.currencyCode,currencySymbol:o.currency?.currencySymbol??he.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??he.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??he.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}})),u},_i=G.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
height: 100vh;
|
|
95
95
|
width: 100%;
|
|
@@ -98,7 +98,7 @@ import{j as a}from"./liveblocks-B8NMVuJ_.js";import{h as J,u as le,g as X,i as e
|
|
|
98
98
|
align-items: center;
|
|
99
99
|
background-color: ${e=>e.theme.colors.grey4};
|
|
100
100
|
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
-
`,Mi=K((function(e,t){const{vendorId:l,billId:n}=t,c=ye(e,l),r=_e(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(en(s))},onSaveHandler:()=>{e(Qa(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(Ka({data:i}))},onCancel:()=>{(()=>{const s=W(c.state?.pathnameStackToGoBack),i=s.poppedPathname??gt();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(it())},onAddressClick:s=>{const i=Xe(o,s,l),d=D(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Xa({fetchState:"Not-Started"}));const s=W(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??gt(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(it())}}}))(qn);function
|
|
101
|
+
`,Mi=K((function(e,t){const{vendorId:l,billId:n}=t,c=ye(e,l),r=_e(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(en(s))},onSaveHandler:()=>{e(Qa(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(Ka({data:i}))},onCancel:()=>{(()=>{const s=W(c.state?.pathnameStackToGoBack),i=s.poppedPathname??gt();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(it())},onAddressClick:s=>{const i=Xe(o,s,l),d=D(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Xa({fetchState:"Not-Started"}));const s=W(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??gt(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(it())}}}))(qn);function Zi(){const e=J(),t=X(),l=Ie(),{vendorId:n,billId:c}=ee(),{useFeatureGate:r}=oe(),u=ue(),o=V.getSignedInUser(),s=v((h=>Y(h))),i=W(t.state?.pathnameStackToGoBack),d=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=v((h=>ye(h,n))),{isFeatureEnabled:m}=r(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=r(f.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(_i,{windowSize:l,children:[a.jsx(Je,{vendorId:n,billId:c}),a.jsx(Mi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:S})]})}const gt=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},Ni=G.div`
|
|
102
102
|
display: flex;
|
|
103
103
|
height: 100vh;
|
|
104
104
|
width: 100%;
|
|
@@ -107,7 +107,7 @@ import{j as a}from"./liveblocks-B8NMVuJ_.js";import{h as J,u as le,g as X,i as e
|
|
|
107
107
|
align-items: center;
|
|
108
108
|
background-color: ${e=>e.theme.colors.grey4};
|
|
109
109
|
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
-
`,
|
|
110
|
+
`,Oi=K((function(e,t){const{vendorId:l}=t,n=ye(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=an(e,c||"international_business",t.billId),u=n.editVendorState??n.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[nn(t.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:n,bankAccountContext:t.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}}),(function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(cn(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,i,d,p)=>{e(sn(s)),p&&e(rn(i,d))},onCurrencyUpdated:(s,i,d)=>{e(ln(s,i,d,!1))},onCancel:()=>{(()=>{const s=W(c.state?.pathnameStackToGoBack),i=s.poppedPathname??St();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ot())},onAddressClick:s=>{const i=Xe(o,s,l),d=D(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(on({fetchState:"Not-Started"}));const s=W(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??St(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(ot())}}}))(Jn);function zi(){const e=J(),t=X(),l=Ie(),{vendorId:n,billId:c}=ee(),r=le(),u=ue(),o=V.getSignedInUser(),s=v((B=>Y(B))),i=W(t.state?.pathnameStackToGoBack),[d,p]=g.useState(!1),m=v((B=>B.vendorViewState.newVendorState.fetchStatus.fetchState)),S=v((B=>n!=null?B.vendorViewState.editVendorStateById[n]?.fetchStatus.fetchState??"Not-Started":"Not-Started")),h=n!==void 0?S:m;g.useEffect((()=>{d===!1&&h==="Not-Started"&&n!=null&&(r(ge(!1,n)),p(!0))}),[d,h,n]);const[b,C]=g.useState(!1);g.useEffect((()=>{b||h==="In-Progress"||(C(!0),r(tn(c,n)))}),[b,h,r]);const I=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",T=v((B=>ye(B,n)));if(o==null)throw Error("Can't access international wire page without signing in...");return I==="billDetail"&&T.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:T.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Ni,{windowSize:l,children:[a.jsx(Je,{vendorId:n,billId:c}),a.jsx(Oi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:I})]})}const St=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},yt=G.div`
|
|
111
111
|
display: flex;
|
|
112
112
|
height: 100vh;
|
|
113
113
|
width: 100%;
|
|
@@ -116,4 +116,4 @@ import{j as a}from"./liveblocks-B8NMVuJ_.js";import{h as J,u as le,g as X,i as e
|
|
|
116
116
|
align-items: center;
|
|
117
117
|
background-color: ${e=>e.theme.colors.grey4};
|
|
118
118
|
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
-
`,Hi=K((function(e,t){const l=V.getSignedInUser(),n=Ot(e,t.billId),c=un(e),r=Ce(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Ut(u,c.allApprovalRules,l,n.vendor?.id,n.classId);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:E,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}}),(function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},saveBillDetails:(o,s)=>{o&&e(Ct({billId:n,data:s})),e(Ue(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(_t("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(xe(t.billId,"retry"))}}}))(Kn);function ft(){const e=J(),t=le(),l=X(),{billId:n}=ee(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(f.isBillPayDetectInsufficientFundsEnabled),o=Ie(),s=V.getSignedInUser(),{isFeatureEnabled:i}=c(f.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(f.isVendorRecommendationFeatureEnabled),p=W(l.state?.pathnameStackToGoBack),{poppedPathname:m}=p,{isFeatureEnabled:S}=c(f.isRecurringBillsFeatureEnabled),h=v((I=>Y(I))),b=v((I=>Ot(I,n))),C=b.fetchState??"Not-Started";if(g.useEffect((()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null})),[e]),g.useEffect((()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)}),[]),g.useEffect((()=>{const I=b.vendor?.name,T=b.vendor?.id,B=b.totalAmount.amount,j=b.recipientTotalAmount.amount,k=b.invoiceNumber;I&&T&&t(dn(I,T,B,j,k,n))}),[]),m==null)return a.jsx(Q,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return C==="In-Progress"?a.jsx(yt,{windowSize:o,children:a.jsx(Xn,{})}):a.jsx(yt,{windowSize:o,children:a.jsx(Hi,{location:l,navigate:e,currentTenant:h,billId:n,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:S,isDetectInsufficientFundsEnabled:u})})}const Wi=K((function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Y(e),o=V.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${zt.fileMicroServiceBaseUrl}`,authParams:i,analytics:E,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}}),(function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(xn(u??void 0,t.billId)),i!=null&&e(Bn(i))},saveVendorDetailLocalData:i=>{e(Nt({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(wn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(lt(u))},updateSelectedVendorForCreate:i=>{e(kn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?Wt(s,t.billId,u):ci(s,t.billId,u):p=ri(s,t.billId,u);const m=D(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?In(i,"vendor",u):vn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Xe(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(fn({files:i}))},onEditFileName:(i,d)=>{e(yn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(lt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(Sn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(gn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(ze({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=W(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??si(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(hn(i,"BillPayVendor"))},onResendOtp:i=>{e(bn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(mn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(pn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Mt(i,!1))}}}))(ai),we=()=>{const e=J(),t=le(),l=Qn(),n=X(),{billId:c,vendorId:r}=ee(),u=v((b=>Y(b))),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(f.isBillPayLocalCurrencyFeatureEnabled),[i,d]=g.useState(!1),p=v((b=>b.vendorViewState.newVendorState.fetchStatus.fetchState)),m=v((b=>ye(b,r))),S=v((b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started")),h=r!==void 0?S:p;return g.useEffect((()=>{i===!1&&h==="Not-Started"&&r!=null&&(t(ge(!1,r)),d(!0))}),[i,h,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ei,{}):h==="Error"?a.jsx(ti,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Je,{vendorId:r,billId:c}),a.jsx(Wi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Yi=K((function(e,t){const{companyId:l}=t;return{billPaySetupView:Cn(e,l),analytics:E,videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}}),(function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(An(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}}))(ii),qi=()=>{const e=ni(),t=J(),l=X(),{tenantEmailDomain:n}=ee(),[c,r]=g.useState(!1),u=ue(),o=v((h=>Y(h))),s=o.companyId??V.getSignedInUserTenant(n)?.companyId,i=V.getSignedInUser(),d=fe(),p=!!o.companyBillPayInfo?.info?.isBillPayTOSAccepted,m=de(d?.loggedInUserRoleMap),S=h=>{r(h)};if(i==null)throw Error("Can't access bill pay promo page without signing in...");return o.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(Q,{to:"../../../bills"}):p===!0&&m===!0?a.jsx(Q,{to:"../../bills/setup"}):p===!1||d!=null&&Oe(o,d.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Ae,{analytics:E,onLoad:h=>(b=>b.trackPageLoaded(Ht.Event.billPayPromoPage))(h)}),a.jsx(qt,{isAppContentDrawerOpen:c,handleDrawerToggle:S}),a.jsx(Yi,{companyId:s,navigate:t,location:l,meetingUrl:e("bill_pay_promo"),onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:u.colors.grey5}})};function jo(){const e=v((H=>Y(H))),t=fe(),l=de(t?.loggedInUserRoleMap),n=ue(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(f.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?zi:Ni,{isFeatureEnabled:o}=c(f.isDebitCardFeatureEnabled),s=Rt(o,e),i=Vt(e),d=X(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&de(t?.loggedInUserRoleMap),S=Ft(t?.loggedInUserRoleMap),h=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Dn(t?.loggedInUserRoleMap),b=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,C=b&&$t(t?.loggedInUserRoleMap),{isFeatureEnabled:I}=c(f.isChargeCardFeatureEnabled),T=oi(e,I,o)&&!p,B=T&&En(t?.loggedInUserRoleMap),j=jn(t?.loggedInUserRoleMap),k=Lt(t?.loggedInUserRoleMap),$=Tn(t?.loggedInUserRoleMap),O=b&&k,_=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&$,Z=Pn(t?.loggedInUserRoleMap),z=Fn(t?.loggedInUserRoleMap),w=Rn(t?.loggedInUserRoleMap),M=T&&Z,{tenantEmailDomain:L}=ee();return a.jsxs(na,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"setup",element:a.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:j,productType:"bill_pay",type:"setup"})}),a.jsx(y,{path:"verification",element:a.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:j,productType:"bill_pay",type:"verification"})}),a.jsx(y,{path:"promo",element:a.jsx(qi,{})}),a.jsx(y,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{showZeniAccountRoute:O,isUserHasBillPayAccess:z,isUserHasReimbursementAccess:w,showTreasuryRoute:_,isTenantBankingOnly:s,showChargeCardRoute:M,tenantEmailDomain:L??""})}),a.jsx(y,{path:"international-wire",element:a.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:j,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(y,{path:"*",element:a.jsx(Ei,{})}),(s===!0||i===!0)&&a.jsx(y,{path:"/*",element:a.jsx(Jt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(y,{path:"*",element:a.jsx(Q,{to:"../setup"})}),t!=null&&Oe(e,t.loggedInUserRoleMap)&&a.jsx(y,{path:"*",element:a.jsx(Q,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"new",element:a.jsx(x,{appContent:a.jsx(bt,{})})}),a.jsx(y,{path:":billId",element:a.jsx(x,{appContent:a.jsx(hi,{})})}),a.jsx(y,{path:":billId/edit",element:a.jsx(x,{appContent:a.jsx(bt,{})})}),a.jsx(y,{path:"new/review",element:a.jsx(x,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:":billId/edit/review",element:a.jsx(x,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:"/:billId/:addressType",element:a.jsx(x,{appContent:a.jsx(ct,{isSubPage:!0})})}),a.jsx(y,{path:"/new/:addressType",element:a.jsx(x,{appContent:a.jsx(ct,{isSubPage:!0})})}),a.jsx(y,{path:"new/vendor/create",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"new/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:"new/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:"new/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"*",element:a.jsx(Be,{})})]}):a.jsx(y,{path:"*",element:a.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(y,{path:"*",element:a.jsx(Be,{})})]})}export{jo as default};
|
|
119
|
+
`,Hi=K((function(e,t){const l=V.getSignedInUser(),n=Nt(e,t.billId),c=un(e),r=Ce(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Ut(u,c.allApprovalRules,l,n.vendor?.id,n.classId);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:E,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}}),(function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},saveBillDetails:(o,s)=>{o&&e(Ct({billId:n,data:s})),e(Ue(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(_t("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(xe(t.billId,"retry"))}}}))(Kn);function ft(){const e=J(),t=le(),l=X(),{billId:n}=ee(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(f.isBillPayDetectInsufficientFundsEnabled),o=Ie(),s=V.getSignedInUser(),{isFeatureEnabled:i}=c(f.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(f.isVendorRecommendationFeatureEnabled),p=W(l.state?.pathnameStackToGoBack),{poppedPathname:m}=p,{isFeatureEnabled:S}=c(f.isRecurringBillsFeatureEnabled),h=v((I=>Y(I))),b=v((I=>Nt(I,n))),C=b.fetchState??"Not-Started";if(g.useEffect((()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null})),[e]),g.useEffect((()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)}),[]),g.useEffect((()=>{const I=b.vendor?.name,T=b.vendor?.id,B=b.totalAmount.amount,j=b.recipientTotalAmount.amount,k=b.invoiceNumber;I&&T&&t(dn(I,T,B,j,k,n))}),[]),m==null)return a.jsx(Q,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return C==="In-Progress"?a.jsx(yt,{windowSize:o,children:a.jsx(Xn,{})}):a.jsx(yt,{windowSize:o,children:a.jsx(Hi,{location:l,navigate:e,currentTenant:h,billId:n,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:S,isDetectInsufficientFundsEnabled:u})})}const Wi=K((function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=Oe(e,"common"),r=l!=null?"edit":"create",u=Y(e),o=V.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${zt.fileMicroServiceBaseUrl}`,authParams:i,analytics:E,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}}),(function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(xn(u??void 0,t.billId)),i!=null&&e(Bn(i))},saveVendorDetailLocalData:i=>{e(Zt({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(wn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(lt(u))},updateSelectedVendorForCreate:i=>{e(kn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?Wt(s,t.billId,u):ci(s,t.billId,u):p=ri(s,t.billId,u);const m=D(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?In(i,"vendor",u):vn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Xe(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(fn({files:i}))},onEditFileName:(i,d)=>{e(yn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(lt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(Sn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(gn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(ze({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=W(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??si(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(hn(i,"BillPayVendor"))},onResendOtp:i=>{e(bn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(mn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(pn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Mt(i,!1))}}}))(ai),we=()=>{const e=J(),t=le(),l=Qn(),n=X(),{billId:c,vendorId:r}=ee(),u=v((b=>Y(b))),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(f.isBillPayLocalCurrencyFeatureEnabled),[i,d]=g.useState(!1),p=v((b=>b.vendorViewState.newVendorState.fetchStatus.fetchState)),m=v((b=>ye(b,r))),S=v((b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started")),h=r!==void 0?S:p;return g.useEffect((()=>{i===!1&&h==="Not-Started"&&r!=null&&(t(ge(!1,r)),d(!0))}),[i,h,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ei,{}):h==="Error"?a.jsx(ti,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Je,{vendorId:r,billId:c}),a.jsx(Wi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Yi=K((function(e,t){const{companyId:l}=t;return{billPaySetupView:Cn(e,l),analytics:E,videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}}),(function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(An(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}}))(ii),qi=()=>{const e=ni(),t=J(),l=X(),{tenantEmailDomain:n}=ee(),[c,r]=g.useState(!1),u=ue(),o=v((h=>Y(h))),s=o.companyId??V.getSignedInUserTenant(n)?.companyId,i=V.getSignedInUser(),d=fe(),p=!!o.companyBillPayInfo?.info?.isBillPayTOSAccepted,m=de(d?.loggedInUserRoleMap),S=h=>{r(h)};if(i==null)throw Error("Can't access bill pay promo page without signing in...");return o.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(Q,{to:"../../../bills"}):p===!0&&m===!0?a.jsx(Q,{to:"../../bills/setup"}):p===!1||d!=null&&Ne(o,d.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Ae,{analytics:E,onLoad:h=>(b=>b.trackPageLoaded(Ht.Event.billPayPromoPage))(h)}),a.jsx(qt,{isAppContentDrawerOpen:c,handleDrawerToggle:S}),a.jsx(Yi,{companyId:s,navigate:t,location:l,meetingUrl:e("bill_pay_promo"),onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:u.colors.grey5}})};function jo(){const e=v((H=>Y(H))),t=fe(),l=de(t?.loggedInUserRoleMap),n=ue(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(f.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?zi:Zi,{isFeatureEnabled:o}=c(f.isDebitCardFeatureEnabled),s=Rt(o,e),i=Vt(e),d=X(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&de(t?.loggedInUserRoleMap),S=Ft(t?.loggedInUserRoleMap),h=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Dn(t?.loggedInUserRoleMap),b=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,C=b&&$t(t?.loggedInUserRoleMap),{isFeatureEnabled:I}=c(f.isChargeCardFeatureEnabled),T=oi(e,I,o)&&!p,B=T&&En(t?.loggedInUserRoleMap),j=jn(t?.loggedInUserRoleMap),k=Lt(t?.loggedInUserRoleMap),$=Tn(t?.loggedInUserRoleMap),N=b&&k,_=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&$,O=Pn(t?.loggedInUserRoleMap),z=Fn(t?.loggedInUserRoleMap),w=Rn(t?.loggedInUserRoleMap),M=T&&O,{tenantEmailDomain:L}=ee();return a.jsxs(na,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"setup",element:a.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:j,productType:"bill_pay",type:"setup"})}),a.jsx(y,{path:"verification",element:a.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:j,productType:"bill_pay",type:"verification"})}),a.jsx(y,{path:"promo",element:a.jsx(qi,{})}),a.jsx(y,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{showZeniAccountRoute:N,isUserHasBillPayAccess:z,isUserHasReimbursementAccess:w,showTreasuryRoute:_,isTenantBankingOnly:s,showChargeCardRoute:M,tenantEmailDomain:L??""})}),a.jsx(y,{path:"international-wire",element:a.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:j,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(y,{path:"*",element:a.jsx(Ei,{})}),(s===!0||i===!0)&&a.jsx(y,{path:"/*",element:a.jsx(Jt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(y,{path:"*",element:a.jsx(Q,{to:"../setup"})}),t!=null&&Ne(e,t.loggedInUserRoleMap)&&a.jsx(y,{path:"*",element:a.jsx(Q,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"new",element:a.jsx(x,{appContent:a.jsx(bt,{})})}),a.jsx(y,{path:":billId",element:a.jsx(x,{appContent:a.jsx(hi,{})})}),a.jsx(y,{path:":billId/edit",element:a.jsx(x,{appContent:a.jsx(bt,{})})}),a.jsx(y,{path:"new/review",element:a.jsx(x,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:":billId/edit/review",element:a.jsx(x,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:"/:billId/:addressType",element:a.jsx(x,{appContent:a.jsx(ct,{isSubPage:!0})})}),a.jsx(y,{path:"/new/:addressType",element:a.jsx(x,{appContent:a.jsx(ct,{isSubPage:!0})})}),a.jsx(y,{path:"new/vendor/create",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"new/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:"new/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:"new/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(x,{appContent:a.jsx(we,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(x,{appContent:a.jsx(me,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(x,{appContent:a.jsx(be,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(x,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"*",element:a.jsx(Be,{})})]}):a.jsx(y,{path:"*",element:a.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(y,{path:"*",element:a.jsx(Be,{})})]})}export{jo as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as O}from"./sentry-DB4rU-NW.js";import{u as W,j as b,h as se,g as oe,i as ie,N as re,l as ce}from"./core-D4EC26kf.js";import{fI as z,HZ as ue,Ib as de,Ln as le,Od as pe,OT as fe,PI as me,ZC as ye,BY as Se,SN as Ie,ZD as ge,ZE as be,ZF as he,ZG as Te,ZH as De,ZI as Ce,VR as Oe,YI as ke,W4 as Ve,Mz as Ae,Mr as we,W5 as Ne,Mv as Fe,mL as ve,gJ as _e,gI as Ee,gH as xe,v2 as Re,uV as ze,uS as Be,mD as Pe,C5 as Le,C3 as B,bF as P,Ch as L,cF as Me}from"./zeni-epic-state-Bl3gAQPi.js";import{bR as Ue,V as Ze,W as je,bg as Ge,z as R,a6 as We,j as M,n as E,N as x,bT as He,ac as Ke,p as U,aE as Z}from"./index-Ch-ATQTq.js";import{n as qe}from"./mui-BCH_ILdb.js";import{j as A}from"./liveblocks-DcDE-V-o.js";import{d as j}from"./routePaths-D0-Tropc.js";import{M as Ye}from"./MobileAppDrawer-C6gfQS8M.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="8b378f9f-1935-4c43-bd35-527fe1427c5f",e._sentryDebugIdIdentifier="sentry-dbid-8b378f9f-1935-4c43-bd35-527fe1427c5f")}catch{}})();function it(){const e=W(),r=b((u=>z(u))),a=r?.tenantId,{isApprovalRulesV3Enabled:s,isLoading:l}=Ue(a),p=b((u=>u.billPaySetupApproverViewState.fetchState));O.useEffect((()=>{a==null||l||p==="Not-Started"&&e(ue(!0,!0,s))}),[a,l,s,p,e])}function G(e,r,a,s=!1){switch(r){case"zeni_accounts":e(me(a,!0,s));break;case"zeni_treasury":e(fe(a,!0,s));break;case"reimbursement":e(pe(a,!0,s));break;case"charge_cards":e(le(a,!0,s));break;default:e(de(a,!0,s))}}const $e=qe.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
|
+
`,Je=ce((function(e,r){const{businessVerificationDetails:a}=r,s=z(e),l=R.getSignedInUser(),p=s.tenantId,u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:p??""},h=Oe(r.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=ke(e.companyConfigState),o=Ve(e.userRoleConfigState);return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${Ke.fileMicroServiceBaseUrl}`,authParams:u,isDisabled:h,allIndustries:t.companyIndustries??[],companyTitles:o.companyTitles}}),(function(e,r){const{companyId:a,productType:s,currentTenant:l,navigate:p,location:u}=r,{tenantEmailDomain:h}=l;return{onCompanyDetailsChanged:t=>{const{companyDescription:o,companyIndustry:f,companyIndustryType:k,companyLegalName:V,companyTaxId:y,companyWebsite:m,companyPhone:S,primaryContactEmail:d,primaryContactName:i,primaryContactUserId:T,primaryContactSyncToken:D,syncToken:c,fileIds:C,incDate:n,typeOfIncorporation:I,stateOfIncorporation:w,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:g,companySourceOfFunds:H,companySourceOfFundsDescription:K,transactionVolume:q,transactionVolumeDescription:Y,purposeOfAccount:$,purposeOfAccountDescription:J,regulatedStatus:Q,regulatedStatusDescription:X,usNexus:ee,usNexusTypes:te}=t,v=k?.selectedOption,ae={companyId:a,companyDescription:o,companyIndustry:f.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:V,taxIdOrEIN:y,website:m!=""&&m!=null?Me(m):void 0,phone:S,syncToken:c,fileIds:C,incDate:n!=null?P(n?.toString()):n,typeOfIncorporation:I?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:g?.selectedOptions.map((_=>_.length===2?_:Z(_)))??[],companySourceOfFunds:H?.selectedOption??"",companySourceOfFundsDescription:K,transactionVolume:q?.selectedOption??"",transactionVolumeDescription:Y,purposeOfAccount:$?.selectedOption??"",purposeOfAccountDescription:J,regulatedStatus:Q??"",regulatedStatusDescription:X,usNexus:ee,usNexusTypes:te?.selectedOptions??[]},ne={userId:T,firstName:i.firstName,lastName:i.lastName,email:d,syncToken:D};e(L({companyDetails:ae,primaryContactDetails:ne}))},onCompanyOfficerUpdated:t=>{const o=t.map((f=>{const{officerType:k,userId:V,name:y,email:m,nationalityCountryCode:S,ssn:d,dob:i,phone:T,syncToken:D,selectDocument:c,role:C,ownership:n,isSelectedForVerification:I,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F}=f;let g;return c.selectDocumentType==="driverLicense"?g="driving_license":c.selectDocumentType==="passport"?g="passport":c.selectDocumentType==="stateId"?g="id_document":c.selectDocumentType==="ssnCard"&&(g="social_security_card"),{officerType:k,userId:V,firstName:y.firstName,lastName:y.lastName,email:m,ssn:d,nationalityCountryCode:S?.selectedOption!=null?Z(S.selectedOption):void 0,phone:T,birthday:i!=null?P(i?.toString()):i,syncToken:D,titleAtCompany:C.selectedOption,ownershipInCompany:n,documentTypeSelectedForVerification:g,isSelectedForVerification:I,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(L({officers:o}))},onSaveDetailsClick:t=>{e(B(a,t,s))},onSendForVerificationClick:t=>{e(B(a,t,s,!0))},onAddressClick:t=>{const o=j(h,t),f=U(u.state?.pathnameStackToGoBack,u.pathname);p(o,{state:{pathnameStackToGoBack:f}})},onRegisteredAddressClick:t=>{const o=j(h,t),f=U(u.state?.pathnameStackToGoBack,u.pathname);p(o,{state:{pathnameStackToGoBack:f}})},onBackClick:()=>{e(Le({companyId:a})),p("../setup")},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,o)=>{e(Re(t,o.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(Ee(t,"SpendManagementSetup"))},onVerifyOtp:(t,o)=>{e(_e(t,o,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,o)=>{e(ve({addressType:t,addressToCreate:o}))},onIdentityDocumentUploadedForAutofill:t=>{if(a==null)return;const o=Ne(t.documentType);o!=null&&e(Fe({target:"setup",companyId:a,officerType:t.officerType,fileId:t.fileId,documentType:o}))},onCompanyDocumentUploadedForAutofill:t=>{a!=null&&e(we({target:"setup",companyId:a,fileId:t.fileId,documentType:t.documentType}))},onResetKycKybClick:()=>{e(Ae())}}}))(He),rt=({productType:e})=>{const r=se(),a=oe(),s=W(),[l,p]=O.useState(!1),[u,h]=O.useState(!1),{tenantEmailDomain:t}=ie(),o=Ze(),{useDynamicConfig:f}=je(),{configValue:k}=f(Ge.zeniAccountsConfig),V=ye(k),y=b((n=>{switch(e){case"zeni_accounts":return n.zeniAccountSetupViewState.fetchState;case"reimbursement":return n.remiSetupViewState.fetchState;case"charge_cards":return n.chargeCardSetupViewState.fetchState;case"zeni_treasury":return n.treasurySetupViewState.fetchState;default:return n.billPaySetupViewState.fetchState}})),m=b((n=>n.companyConfigState.fetchState)),S=b((n=>n.userRoleConfigState.fetchState)),d=b((n=>z(n))),i=d.companyId??R.getSignedInUserTenant(t)?.companyId;O.useEffect((()=>{m==="Not-Started"&&s(Se()),S==="Not-Started"&&s(Ie(!0))}),[m,S,s]),O.useEffect((()=>{l||y!=="Not-Started"||i==null||(p(!0),G(s,e,i))}),[l,y,i,s]);const T=b((n=>{switch(e){case"zeni_accounts":return De(n,i);case"zeni_treasury":return Te(n,i);case"charge_cards":return he(n,i);case"reimbursement":return be(n,i);default:return ge(n,i)}})),D=T.kycKybResetStatus.fetchState;if(O.useEffect((()=>{D==="Completed"&&i!=null&&(G(s,e,i,!0),s(Ce()))}),[D,i,e,s]),R.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let c;switch(e){case"zeni_accounts":c=d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":c=d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":c=d.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||d.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":c=d.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:c=d.companyBillPayInfo?.info?.isBillPayTOSAccepted}const C=n=>{h(n)};return c===!1?A.jsx(re,{to:"../promo"}):A.jsxs($e,{children:[A.jsx(We,{analytics:M,onLoad:n=>(I=>{switch(e){case"zeni_accounts":return I.trackPageLoaded(x.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return I.trackPageLoaded(x.Event.reimbursementBusinessVerification);default:return I.trackPageLoaded(x.Event.billPayBusinessVerification,E(a)?"Settings":void 0)}})(n)}),E(a)?A.jsx(Ye,{isAppContentDrawerOpen:u,handleDrawerToggle:C}):null,A.jsx(Je,{businessVerificationDetails:T,navigate:r,location:a,companyId:i,analytics:M,currentTenant:d,productType:e,isSettings:E(a),roleMap:o?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{C(!0)},maxInsuredAmount:V.maxInsuredAmount})]})};export{rt as B,G as d,it as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as g}from"./liveblocks-
|
|
1
|
+
import{j as g}from"./liveblocks-DcDE-V-o.js";import{a as r}from"./sentry-DB4rU-NW.js";import{u as he,h as Ce,g as fe,j as H,i as Se,l as ge}from"./core-D4EC26kf.js";import{e4 as be,a as Pe,e5 as ye,z as Ie,e7 as we,e9 as W,ea as Ee,bm as G,a6 as ke,j as F,eb as M,el as xe,G as Ae,N as Te,w as Ue,ee as Oe,ef as _e,at as ve,ei as Qe,ej as je,bi as De,ek as Fe}from"./index-Ch-ATQTq.js";import{gN as $e,fH as J,fI as Le,gb as Ve,jp as Re,jl as qe,fJ as N,gx as Be,gr as He,gt as z,gz as Me,gA as Ne,gB as ze,gC as We,gD as Ge}from"./zeni-epic-state-Bl3gAQPi.js";import{D as Je,n as L,v as Ye,S as Ke}from"./mui-BCH_ILdb.js";import"./recharts-BRIJ8RH5.js";import"./analytics-UPQyZr49.js";import"./plaid-a-pmhWdo.js";import"./dnd-CQ9igkkh.js";import"./stripe-cKAAJElX.js";import"./lottie-DBrmrNFb.js";import"./lexical-DvwBeJWJ.js";import"./pdf-zGCHYG6q.js";import"./utils-CU_Pr3K6.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="b22b4774-0f3a-4e91-98f3-277e759dc032",t._sentryDebugIdIdentifier="sentry-dbid-b22b4774-0f3a-4e91-98f3-277e759dc032")}catch{}})();const Y="chat-response-generated",K="cards/ask",X="card_policy_hero";function $(t){return`/${t}/cards`}function Z(t){return`/${t}/cards/policy`}const Xe=ge((function(t,s){const d=J(t),l=s.isSubmitting,u=_e(t,{allUsers:s.allUsers,onCardPolicyVendorSearchTextChange:s.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:s.sessionFromUrl==="new_chat"&&d.uiState.currentChatSessionId==null,aiCfoView:d,isSubmitting:l,isNewChatSession:s.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${ve}/tableDownload`,exportDownloadEndPoint:Qe(),emailLinkQuestion:s.emailLinkQuestion,autoSubmitEmailLinkQuestion:s.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:s.onEmailLinkQuestionProcessed,isFileUploadEnabled:s.isFileUploadEnabled,isUploadPromoVisible:s.isUploadPromoVisible,onUploadPromoClose:s.onUploadPromoClose,...u}}),(function(t,s){const{location:d,currentTenant:l,userId:u,navigate:o,currentChatSessionId:P,allSessionsWithOrderedQuestionAnswers:C,isAiCardCreationEnabled:x,isCardPolicyEnabled:A,cardPolicyPageContext:T}=s,f=l.tenantEmailDomain,c=d.state?.referrer,h=c===X?Z(f):$(f);return{onEventReceived:(a,n)=>{if(a===Y&&typeof n.text=="string"&&typeof n.metadata=="object"){const e=n,m=Ne(e.type),y=e.metadata.chat_session_id??null,{currentChatSession:U,currentQuestionAnswer:b,currentQuestionAnswerSummary:p}=G(C,y);m!=="answer"?F.trackAICFOChatResponseGenerated(m,b?.question.questionText??"",e.text,y,Fe(p,U),e.metadata.message_id??null):F.trackAICFOChatAnswerGenerated(e.text,b?.question.questionText??"",(e.follow_up_questions?.length??0)>0,!!e.assumptions,!!e.insights,e.visualization!=null,ze(e.visualization?.type??"")??null,y,e.summarized_title,e.metadata.message_id??null),t(We({chatSessionId:e.metadata.chat_session_id,responseType:m,fetchState:{fetchState:"Completed",error:void 0}})),t(Ge({chatSessionId:e.metadata.chat_session_id,answerPayload:e,userId:u}))}},onSubmit:(a,n,e,m)=>{a&&De(t,a,n,P,C,u,m,e,T)},updateCurrentInput:a=>{t(z(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{t(Me(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{o(-1)},onCloseClick:()=>{o(h,{state:{...d.state}}),t(z(""))},togglePageView:()=>{o(h,{state:W(d.state)}),s.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{o(-1)},onNewChatClick:()=>{P!=null&&t(He()),o((function(a){return`/${a}/${K}`})(f),{state:{...d.state}})},onToggleCotCollapsed:(a,n)=>{t(Be({questionAnswerId:a,isCollapsed:n}))},...je(t,{isAiCardCreationEnabled:x,isCardPolicyEnabled:A,currentChatSessionId:P,onAfterCardsCreationSubmit:()=>{s.setIsAiCfoOpen(!0),o($(f),{state:{...d.state}})},onAfterCardPolicySubmit:()=>{s.setIsAiCfoOpen(!0),o(`/${f}/cards/policy`,{state:{...d.state}})}})}}))(Ue(Oe)),{spendManagement:{chargeCard:{cardsAiCfoHero:ee,cardPolicyAiCfoHero:te}}}=Ae.getLocalizedStrings(),k=ee.pageTitle,Ze=te.pageTitle,et=ee.chatHeaderSubtitle,tt=te.chatHeaderSubtitle,Pt=({isFileUploadEnabled:t})=>{const s=be(),{setIsAiCfoOpen:d}=Pe(),l=he(),u=Ce(),o=fe(),[P,C]=r.useState(!1),{allUsers:x,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,onCardPolicyVendorSearchTextChange:f}=ye();r.useEffect((()=>{l($e())}),[l]);const c=H((i=>J(i))),h=Ie.getSignedInUser(),{session_id:a}=Se(),n=H((i=>Le(i))),e=c.uiState.currentChatSessionId,m=n.tenantEmailDomain,{handleUploadPromoClose:y,isUploadPromoVisible:U}=we({isFileUploadEnabled:t,tenantEmailDomain:m}),b=o.state,p=b?.aiCfoInitialQuestion??null,O=!!b?.aiCfoShouldSubmit,I=b?.referrer===X,se=I?"card_policy":void 0,ae=r.useMemo((()=>({title:I?Ze:k,subtitle:I?tt:et})),[I]),[oe,_]=r.useState(null),[ne,v]=r.useState(!1),Q=r.useRef(!1);r.useEffect((()=>{Q.current||p==null||p===""||(_(p),v(O),Q.current=!0)}),[p,O]);const ie=r.useCallback((()=>{_(null),v(!1),u(o.pathname,{replace:!0,state:W(o.state)})}),[o.pathname,o.state,u]),re=n.masterTOSInfo,S=re?.isMasterTOSAccepted??!1,E=r.useRef(null);r.useEffect((()=>{if(S&&E.current!=null){const{question:i,shouldSubmit:w}=E.current;E.current=null,_(i),v(w),Q.current=!1}}),[S]);const{visitedSessions:V}=Ee(e),j=c.fetchState,D=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,R=e!=null?c.fetchChatSessionHistoryByChatSessionId?.[e]?.fetchState??"Not-Started":"Not-Started",q=e==null||(c.uiState.chatHistoryNextPageToken[e]?.hasMore??!0),B=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:le}=G(B,e),de=le.length===0;r.useEffect((()=>{e!=null&&a!==e&&u((function(i,w){return`/${i}/${K}/${w}`})(m,e),{state:{...o.state},replace:!0})}),[e,a,m,u,o.state]),r.useEffect((()=>{a!=null&&e==null&&a!=="new_chat"&&l(Ve({sessionId:a,agentId:"controller"}))}),[]);const ce=r.useMemo((()=>({events:V.map((i=>`private-encrypted-chat-${i}.${Y}`)),eventCallback:(i,w,pe)=>pe.onEventReceived(i,w)})),[V]);if(r.useEffect((()=>{j!=="In-Progress"&&D&&l(Re())}),[j,D,l]),r.useEffect((()=>{e!=null&&R!=="In-Progress"&&q&&h!=null&&j==="Completed"&&!D&&l(qe(e,h.userId))}),[R,q,e,h,l]),h==null)throw Error("Can't access Cards AI CFO page without signing in...");const ue=a??"new_chat",me=e!=null&&c.responseStateByChatSessionId?.[e]?.answer?.fetchState==="In-Progress";return g.jsxs(at,{children:[g.jsx(ke,{analytics:F,onLoad:i=>i.trackPageLoaded(Te.Event.aiCFOPage)}),S?g.jsx(Xe,{answerExportEndPoint:s,...ce,currentChatSessionId:e,allSessionsWithOrderedQuestionAnswers:B,allUsers:x,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,openOnboardingPage:()=>C(!0),userId:h.userId,setIsAiCfoOpen:d,navigate:u,sessionFromUrl:ue,location:o,isSubmitting:me,isEmptyChatWithSession:de,customPageTitle:k,chatHeader:ae,currentTenant:n,emailLinkQuestion:oe??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:ie,isFileUploadEnabled:t,isUploadPromoVisible:U,onUploadPromoClose:y,onCardPolicyVendorSearchTextChange:f,cardPolicyPageContext:se}):g.jsx(M,{isTOSAccepted:S,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:k,onCloseClick:()=>{u(I?Z(m):$(m),{state:{...o.state}})},onCompleteClick:()=>{S||n.userRoleId==null||(p!=null&&p!==""&&(E.current={question:p,shouldSubmit:O}),l(N(n.userRoleId)))}}),g.jsx(Je,{anchor:"right",open:P,transitionDuration:250,PaperProps:{component:ot,style:{width:`${xe}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>C(!1),children:g.jsx(st,{onClick:i=>i.stopPropagation(),children:g.jsx(M,{isTOSAccepted:S,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:k,onCloseClick:()=>C(!1),onCompleteClick:()=>{S||n.userRoleId==null||l(N(n.userRoleId)),C(!1)}})})})]})},st=L(Ke)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|