@zeniai/web-app-ui 5.0.1-dev → 5.0.2-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-D4ZwWdW3.js +1 -0
- package/dist/assets/AddressScreen-DG2igJ3e.js +9 -0
- package/dist/assets/AiCfoScreen-zU1Nx73v.js +11 -0
- package/dist/assets/BillPayApprovalRoutes-5SmQw6w5.js +1 -0
- package/dist/assets/{BillPayRoutes-DvR3hqif.js → BillPayRoutes-be_i6u1i.js} +7 -7
- package/dist/assets/{BusinessVerificationPageScreen-Db_j23ph.js → BusinessVerificationPageScreen-D-2VpDbP.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-B2KJAodB.js → ChargeCardRoutes-B9FmCIkx.js} +9 -9
- package/dist/assets/CompanyPassportScreen-BIqiLLcA.js +1 -0
- package/dist/assets/ConnectionAuthScreen-Dah9BIfx.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BCDiCbBG.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CnVH8vUK.js → CustomerOnboardingRoutes-hpECeIAZ.js} +3 -3
- package/dist/assets/{DashboardRoutes-6WcO8n0u.js → DashboardRoutes-9GSNK76c.js} +3 -3
- package/dist/assets/{DefaultTenantHome-CrXP_cR1.js → DefaultTenantHome-D1vXY83X.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-C51IXDOd.js → DomesticWireDetailScreen-CBvkPR3e.js} +3 -3
- package/dist/assets/DrawerScreen-B_llN9HS.js +1 -0
- package/dist/assets/EntityDetailRoutes-BQvHfHXF.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-BCVBp8qi.js → ExpenseAutomationRoutes-DkcdbkvF.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-BZdfwZgd.js +1 -0
- package/dist/assets/MagicLinkRoutes-B3KZdLtz.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-BKi_zF71.js +12 -0
- package/dist/assets/MobileAppDrawer-Q6-14poV.js +1 -0
- package/dist/assets/NotFoundScreen-Cz9quvZz.js +1 -0
- package/dist/assets/{NotificationRoutes-C37yYJm9.js → NotificationRoutes-eISVis3N.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-CJ17X8Du.js +1 -0
- package/dist/assets/{PeopleRoutes-nhSxQuOd.js → PeopleRoutes-D7cCmX3b.js} +5 -5
- package/dist/assets/PerformanceRoutes-BfV7NXh6.js +1 -0
- package/dist/assets/{Preview--bb5p9Hr.js → Preview-hp5oXBDl.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-ChkHB_5w.js → QBOConnectionScreen-DQ1AuSJF.js} +34 -34
- package/dist/assets/ReferralListScreen-eM-LRvxR.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-CFORcsiU.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Doqr5IfY.js → ReimbursementApprovalRuleDetailScreen-DAGX2Bpj.js} +1 -1
- package/dist/assets/ReimbursementRoutes-B_ZwbgUK.js +68 -0
- package/dist/assets/ReportsRoutes-Cjg471Jx.js +1 -0
- package/dist/assets/RewardsRoutes-akBEyetT.js +1 -0
- package/dist/assets/ScreenRoutes-DNdR3Wy8.js +2 -0
- package/dist/assets/SettingsRoutes-BZEUVpEo.js +57 -0
- package/dist/assets/{SetupPagesScreen-DeB97TrS.js → SetupPagesScreen-hvGS92ve.js} +5 -5
- package/dist/assets/{SignInScreen-CEzGCpsn.js → SignInScreen-BJuZCyu8.js} +1 -1
- package/dist/assets/SignOutScreen-CGW09UIk.js +9 -0
- package/dist/assets/TaskListScreen-tJJhpcmp.js +9 -0
- package/dist/assets/TaskRoutes-DCNhNgxM.js +9 -0
- package/dist/assets/TransactionDetailRoutes-RIZOkAYz.js +1 -0
- package/dist/assets/TransactionDetailScreen-BeTw-X5z.js +5 -0
- package/dist/assets/TransactionListRoutes-ZRAuVXeU.js +1 -0
- package/dist/assets/{TreasuryRoutes-u5hb_BqK.js → TreasuryRoutes-BaR7b6eY.js} +6 -6
- package/dist/assets/{VendorsRoutes-DG-CUygJ.js → VendorsRoutes-B4vpI764.js} +20 -20
- package/dist/assets/{WiseConfirmationScreen-uk0X1R83.js → WiseConfirmationScreen-v0Wu2mUB.js} +1 -1
- package/dist/assets/ZeniAccountRoutes-CjxtzBYh.js +66 -0
- package/dist/assets/ZeniAccountStatementScreen-C-RdVVLR.js +9 -0
- package/dist/assets/{accountMappingHelper-CEUIWp7O.js → accountMappingHelper-B_vdVXJd.js} +1 -1
- package/dist/assets/{analytics-BkhHPaQ4.js → analytics-B_kykzhy.js} +1 -1
- package/dist/assets/{analyticsHelper-DZ0CUT0b.js → analyticsHelper-RuE4CbDL.js} +1 -1
- package/dist/assets/{core-C_NeXleM.js → core-C7cnuUop.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-Drd7YS9D.js → decodeURIComponentSafe-rDkCEJpn.js} +1 -1
- package/dist/assets/{dnd-C0SdDgY2.js → dnd-TzLeX35A.js} +1 -1
- package/dist/assets/{empty-5JhUjXJf.js → empty-7vbmHAL6.js} +1 -1
- package/dist/assets/{empty-CDZc49VR.js → empty-B375B_HA.js} +1 -1
- package/dist/assets/{emptyVideoElement-SE9UwlDX.js → emptyVideoElement-BGxjtXTu.js} +1 -1
- package/dist/assets/epic-DefpUSD4.js +2 -0
- package/dist/assets/getLocaleForTenant-BRT6_AeC.js +1 -0
- package/dist/assets/{index-3wKQcxVk.js → index-BAxpczYf.js} +2 -2
- package/dist/assets/{index-DEiuB93P.js → index-CcLDrNJO.js} +1 -1
- package/dist/assets/{index-TZBFPhBM.js → index-DGKR7P5A.js} +13079 -12937
- package/dist/assets/{index-Y_8J-EV-.js → index-DrxEgkQ-.js} +1 -1
- package/dist/assets/{index-COcEChnY.js → index-Qmma5Ck1.js} +1 -1
- package/dist/assets/{index-DYUyEm6J.js → index-_vh22_qX.js} +1 -1
- package/dist/assets/{index-Dmixh63m.js → index-m-Adf2ll.js} +1 -1
- package/dist/assets/{lexical-B1vtLf4F.js → lexical-Dp9Fvoo6.js} +1 -1
- package/dist/assets/{liveblocks-BCZSgQbG.js → liveblocks-jLbycGCP.js} +1 -1
- package/dist/assets/{lottie-BdeQlKTG.js → lottie-SbVYeXJk.js} +1 -1
- package/dist/assets/{mui-CgjVMn8C.js → mui-BkznVaFh.js} +1 -1
- package/dist/assets/{pathToGoBack-BDpRzqvH.js → pathToGoBack-DXgc_G9d.js} +1 -1
- package/dist/assets/{pdf-CQPNphc4.js → pdf-DQg4OfsP.js} +4 -4
- package/dist/assets/{pdf-lib-DznUmqID.js → pdf-lib-CDsnDRGG.js} +1 -1
- package/dist/assets/{plaid-B3UNGbGB.js → plaid-DfnoQTVm.js} +1 -1
- package/dist/assets/{pusher-SrZYiYid.js → pusher-CQHA__kt.js} +1 -1
- package/dist/assets/{react-B1LuGLWv.js → react-BfsHsZ2B.js} +1 -1
- package/dist/assets/{react-CkJUroZo.js → react-CCO8orgk.js} +1 -1
- package/dist/assets/{react-CUvZ-QKI.js → react-CJwzWgLi.js} +1 -1
- package/dist/assets/{react-BLym8SqS.js → react-DPNnFJXW.js} +1 -1
- package/dist/assets/{react-BR-uiB3M.js → react-pHyk9OpQ.js} +1 -1
- package/dist/assets/{react-BUr4gNxK.js → react-tE35hRos.js} +1 -1
- package/dist/assets/{recharts-NCr2Pwd1.js → recharts-Dt8COHEP.js} +1 -1
- package/dist/assets/{routePaths-fq-ods6n.js → routePaths-BjxXYb1e.js} +1 -1
- package/dist/assets/{sentry-CGkVgbup.js → sentry-CflaePyQ.js} +1 -1
- package/dist/assets/{url-D7JZ1pkZ.js → url-CMgR7Whs.js} +1 -1
- package/dist/assets/{url-ax2xfQkc.js → url-DZF6CZ5y.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BhmP_lnc.js +1 -0
- package/dist/assets/{useDeviceId-DxDe1m2N.js → useDeviceId-aTbWtPu7.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-Ex4_WTph.js +1 -0
- package/dist/assets/{useInitialThreadRequest-DYY0nYQq.js → useInitialThreadRequest-DoYKoe1O.js} +1 -1
- package/dist/assets/{utils-CTLGOmjC.js → utils-t3ltqqZ0.js} +1 -1
- package/dist/assets/withTransactionSidePanel-BBmA3NZ6.js +8 -0
- package/dist/assets/zeni-epic-state-DPGmsT0c.js +14 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-BQP-CfGZ.js +0 -1
- package/dist/assets/AddressScreen-wF2P11Cc.js +0 -9
- package/dist/assets/AiCfoScreen-CILB5bBS.js +0 -11
- package/dist/assets/BillPayApprovalRoutes-Bm6O9E1C.js +0 -1
- package/dist/assets/CompanyPassportScreen-C20zLwxY.js +0 -1
- package/dist/assets/ConnectionAuthScreen-DJ5wyIja.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BSF1us15.js +0 -1
- package/dist/assets/DrawerScreen-CV5-68Vp.js +0 -1
- package/dist/assets/EntityDetailRoutes-CWP-yEzD.js +0 -1
- package/dist/assets/FeaturePreviewScreen-C9zUUTCh.js +0 -1
- package/dist/assets/MagicLinkRoutes-q1juhq3J.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-D3tHYM0l.js +0 -12
- package/dist/assets/MobileAppDrawer-Czhowgsf.js +0 -1
- package/dist/assets/NotFoundScreen-D0cCxE_g.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-LRtjQJx_.js +0 -1
- package/dist/assets/PerformanceRoutes-BU2_koAY.js +0 -1
- package/dist/assets/ReferralListScreen-DRhEWofN.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-BaUI0RrG.js +0 -1
- package/dist/assets/ReimbursementRoutes-B52nhenO.js +0 -68
- package/dist/assets/ReportsRoutes-CNqyQ8jz.js +0 -1
- package/dist/assets/RewardsRoutes-CqIupqR0.js +0 -1
- package/dist/assets/ScreenRoutes-CDdkS4QP.js +0 -2
- package/dist/assets/SettingsRoutes-CbTsbTLb.js +0 -57
- package/dist/assets/SignOutScreen-CETwZ0Jp.js +0 -9
- package/dist/assets/TaskListScreen-b7SlqOLh.js +0 -9
- package/dist/assets/TaskRoutes-BMFJJPYD.js +0 -9
- package/dist/assets/TransactionDetailRoutes-CdhRrWAk.js +0 -1
- package/dist/assets/TransactionDetailScreen-Bh4hnUTb.js +0 -5
- package/dist/assets/TransactionListRoutes-DLq7cUVK.js +0 -1
- package/dist/assets/ZeniAccountRoutes-CN91LxEE.js +0 -66
- package/dist/assets/ZeniAccountStatementScreen-Da1Wlwqe.js +0 -9
- package/dist/assets/epic-CBKcA32L.js +0 -2
- package/dist/assets/getLocaleForTenant-C75hRciY.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BmhiW9nY.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-CJ1dU4ni.js +0 -1
- package/dist/assets/withTransactionSidePanel-CsJoitfl.js +0 -8
- package/dist/assets/zeni-epic-state-Dp14ovRw.js +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-jLbycGCP.js";import{A as i}from"./AddressScreen-DG2igJ3e.js";import s from"./NotFoundScreen-Cz9quvZz.js";import"./sentry-CflaePyQ.js";import{n as d,o as r}from"./core-C7cnuUop.js";import"./zeni-epic-state-DPGmsT0c.js";import"./recharts-Dt8COHEP.js";import"./index-DGKR7P5A.js";import"./mui-BkznVaFh.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="339d6624-b51b-426b-a0cc-e8e8bd837ae0",t._sentryDebugIdIdentifier="sentry-dbid-339d6624-b51b-426b-a0cc-e8e8bd837ae0")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-jLbycGCP.js";import{a as S}from"./sentry-CflaePyQ.js";import{j as P,h as _,u as j,l as E,g as M,k as B}from"./core-C7cnuUop.js";import{Z as $,m as L,z as D,j as K,B as R,R as N,d as I,g as m,q as z,i as h,s as F}from"./index-DGKR7P5A.js";import{IL as C,gI as U,eM as q,IM as G,b$ as O,IN as V,jQ as H}from"./zeni-epic-state-DPGmsT0c.js";import{n as Q}from"./mui-BkznVaFh.js";import Z from"./NotFoundScreen-Cz9quvZz.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]="8c7241be-6fab-4b1b-9797-cc404bfad46a",e._sentryDebugIdIdentifier="sentry-dbid-8c7241be-6fab-4b1b-9797-cc404bfad46a")}catch{}})();const J=Q.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,W=B(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=q(e),a=t.roleMap!=null&&G(t.roleMap),r=i||c==="user_address"||O(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=V(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=C(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,n=F(r?.pathnameStackToGoBack);let s=n.poppedPathname??k();const u=r?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const r=X(a);e(H({addressType:c,addressToCreate:r})),I?.trackSaveAddressClicked(m.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(z);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=P(),r=_(),n=j(),{addressId:s,addressType:u}=E(),g=$(),w=L(),v=D.getSignedInUser(),[f,x]=S.useState(s==null),p=M(b=>s!=null?C(b,s).fetchState:"Not-Started"),A=K();if(v==null)throw Error("Can't access address page without signing in...");const T=b=>b.trackPageLoaded(s!=null?m.Event.editAddress:m.Event.addAddress),y=l??u;return S.useEffect(()=>{f||s==null||(x(!0),r(U(s,!1)))},[f,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?d.jsx(R,{fetchState:p,style:{backgroundColor:w.colors.grey5}}):s!=null&&p==="Error"?(a(`${k(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(N,{analytics:I,onLoad:T}),d.jsx(J,{windowSize:g,children:d.jsx(W,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):d.jsx(Z,{})}const k=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},X=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{de as A,X as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{j as S}from"./liveblocks-jLbycGCP.js";import{a as i}from"./sentry-CflaePyQ.js";import{h as ee,j as te,u as se,g as U,l as ae,k as ne}from"./core-C7cnuUop.js";import{K as oe,cB as ie,z as re,Z as le,cC as ue,cD as ce,cE as $,R as de,d as _,O as B,cF as me,cG as fe,g as pe,a1 as he,cH as Se,Q as ge,w as Ce,s as be,cI as we,cJ as Ie}from"./index-DGKR7P5A.js";import{fE as ke,f3 as N,eM as Ee,h8 as ye,Ph as Pe,eL as Te,hi as _e,he as xe,fu as ve,fo as Qe,fh as Ae,fl as j,fp as Oe,fq as Fe,fr as De,fs as Le,ft as Me}from"./zeni-epic-state-DPGmsT0c.js";import{D as Re,n as x,P as Ue,S as Be}from"./mui-BkznVaFh.js";import{p as je}from"./pathToGoBack-DXgc_G9d.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="fd1f3c8b-bd24-49e1-b0a4-032069b494fe",a._sentryDebugIdIdentifier="sentry-dbid-fd1f3c8b-bd24-49e1-b0a4-032069b494fe")}catch{}})();const q="chat-response-generated",$e=ne(function(a,r){const n=N(a),d=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&n.uiState.currentChatSessionId==null,aiCfoView:n,isSubmitting:d,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ge}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled}},function(a,r){const{location:n,currentTenant:d,userId:u,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===q&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=Fe(t.type),c=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,c);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,c,Ie(h,s),t.metadata.message_id??null):_.trackAICFOChatAnswerGenerated(t.text,C?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,De(t.visualization?.type??"")??null,c,t.summarized_title,t.metadata.message_id??null),a(Le({chatSessionId:t.metadata.chat_session_id,responseType:m,fetchState:{fetchState:"Completed",error:void 0}})),a(Me({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:u}))}},onSubmit:(e,o,t,m)=>{e&&we(a,e,o,p,g,u,m,t)},updateCurrentInput:e=>{a(j(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(Oe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=be(n.state?.pathnameStackToGoBack),o=e.poppedPathname??je(1);f(o,{state:{...n.state,pathnameStackToGoBack:e.newStack}}),a(j(""))},togglePageView:()=>{f(`/${d.tenantEmailDomain}/dashboard`,{state:{...n.state,message:"open_ai_cfo_drawer"}})},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{f(-1)},onNewChatClick:()=>{p!=null&&a(Ae());const e=Ce(n.state?.pathnameStackToGoBack,n.pathname);f(`/${d.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{a(Qe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(he(Se)),rt=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:r}=oe(),n=ee(),d=te(),u=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(ke())},[n]);const{customPageTitle:g}=ie(),e=U(l=>N(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),c=U(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ue({currentTenant:c,currentChatSessionId:s,aiCfoView:e}),h=u.state,b=h?.aiCfoInitialQuestion,v=!!h?.aiCfoShouldSubmit,[G,k]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||b==null||b===""||(k(b),E(v),Q.current=!0)},[b,v]);const H=i.useCallback(()=>{k(null),E(!1)},[]),A=i.useMemo(()=>new URLSearchParams(u.search),[u.search]),O=A.get("ref")??h?.aiCfoRef,y=A.get("emailRefId")??h?.aiCfoEmailRefId,F=i.useRef(!1);i.useEffect(()=>{F.current||O!=="month-end-email"||y==null||s!=null||o==null||(n(ye("controller",o.userId,y,"MONTH_END_EMAIL")),F.current=!0)},[O,y,s,n,o]);const w=e.uiState.lastContextMessage;i.useEffect(()=>{w!=null&&w!==""&&s!=null&&(k(w),E(!0),n(Pe()))},[w,s,n]);const W=c.masterTOSInfo,I=W?.isMasterTOSAccepted??!1,{visitedSessions:D}=ce(s),P=e.fetchState,T=e.uiState.chatSessionsNextPageToken.hasMore||!e.uiState.chatSessionsFirstPageFetched,L=s!=null?e.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",M=s==null||(e.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),R=e.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:z}=$(R,s),J=z.length===0;i.useEffect(()=>{I||d("../dashboard",{state:{...u.state,message:"open_ai_cfo_drawer"}})},[I]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...u.state}})},[s,t]),i.useEffect(()=>{t!=null&&s==null&&t!=="new_chat"&&t!=="explore"&&n(Te({sessionId:t,agentId:"controller"}))},[]);const K=i.useMemo(()=>({events:D.map(l=>`private-chat-${l}.${q}`),eventCallback:(l,Y,Z)=>Z.onEventReceived(l,Y)}),[D]);if(i.useEffect(()=>{P!=="In-Progress"&&T&&n(_e())},[P,T,n]),i.useEffect(()=>{s!=null&&L!=="In-Progress"&&M&&o!=null&&P==="Completed"&&!T&&n(xe(s,o.userId))},[L,M,s,o,n]),o==null||t==null)throw Error("Can't access AI Controller page without signing in...");const X=s!=null&&e.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return S.jsxs(qe,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),B(m)&&C.drawerElement,S.jsx($e,{...K,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:R,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:u,isSubmitting:X,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:c,emailLinkQuestion:G??void 0,autoSubmitEmailLinkQuestion:V,onEmailLinkQuestionProcessed:H,onMenuClick:B(m)?C.open:void 0,isFileUploadEnabled:a}),S.jsx(Re,{anchor:"right",open:f,transitionDuration:250,PaperProps:{component:Ge,style:{width:`${me}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>p(!1),children:S.jsx(Ne,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:I,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{I||c.userRoleId==null||n(ve(c.userRoleId)),p(!1)}})})})]})},Ne=x(Be)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,qe=x.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,Ge=x(Ue)`
|
|
9
|
+
box-shadow: ${({theme:a})=>a.colors.elevation2};
|
|
10
|
+
color: ${({theme:a})=>a.colors.grey4};
|
|
11
|
+
`;export{rt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-jLbycGCP.js";import{a as f}from"./sentry-CflaePyQ.js";import{j as U,u as B,h as T,g as v,N,k as j,l as $,n as L,o as h}from"./core-C7cnuUop.js";import{eM as O,M2 as A,LK as b,wT as w,wN as F,wR as I,wG as M,LM as W,wJ as q,wV as z,wU as C}from"./zeni-epic-state-DPGmsT0c.js";import{m as P,z as k,B as V,a1 as G,bu as J,aa as _,bv as K}from"./index-DGKR7P5A.js";import"./mui-BkznVaFh.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-DAGX2Bpj.js";import Q from"./NotFoundScreen-Cz9quvZz.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="92c86552-2b18-4ae4-97bb-c2f2cfdc1d67",e._sentryDebugIdIdentifier="sentry-dbid-92c86552-2b18-4ae4-97bb-c2f2cfdc1d67")}catch{}})();const R="bill-approval-rule-update",X=j(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(R)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(G(J)),Y=()=>{const e=U(),o=B(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>O(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-${c.companyId}.${R}`]:[],eventCallback:(i,x,m)=>{i.endsWith(R)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...y})},Z=j(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),x=y.actors.selectedNonUsers.map(S=>{const E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(x);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{t("../")}}})(K);function D(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(q(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(L,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Q,{})})]})}export{se as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-BCZSgQbG.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as y}from"./core-C_NeXleM.js";import{eL as Z,L9 as Oe,bu as At,Gf as ra,bn as xt,bC as pe,La as Bt,w4 as Et,xe as Ue,wD as ca,bm as je,Lb as da,Lc as ua,b$ as pa,Ld as ma,j6 as Dt,Le as jt,Lf as Tt,xP as Me,wj as Be,Lg as ba,vU as it,Lh as ha,A$ as ga,vY as Sa,w2 as Pt,Li as Ie,Lj as Ne,xf as ze,Lk as ya,Ll as fa,xi as Ze,Lm as Ia,xv as va,Ln as Ft,w$ as ot,x4 as ka,Lo as wa,Lp as ue,Lq as Lt,Lr as Rt,Ls as Vt,fF as Ca,wo as _e,ct as $t,Lt as Aa,gw as xa,Lu as Ba,Lv as Ea,eS as Ut,eQ as _t,Lw as He,Lx as Da,Ly as ja,IU as We,Lz as Ta,IV as ie,IW as qe,LA as Pa,LB as Fa,LC as La,x6 as lt,x3 as Ra,LD as Va,LE as $a,LF as Ua,wR as _a,LG as Ga,LH as Oa,LI as Ma,cN as Gt,cJ as Ot,jh as Na,bI as za,bp as Mt,bJ as Nt,va as Za,LJ as Ha,AO as Wa,AU as qa,rO as Ja,xg as Ka,xW as Qa,ju as fe,LK as Ya,LL as zt,jY as Xa,jo as Zt,jJ as Ht,jI as st,bB as be,bH as en,LM as tn,LN as ve,h$ as an,LO as rt,LP as nn,i3 as on,iq as ln,y8 as sn,LQ as rn,jR as cn,x_ as dn,LR as ct,y2 as un,y7 as pn,y4 as mn,xY as bn,LS as Wt,wd as hn,LT as gn,LU as Sn,fz as yn,fy as fn,fx as In,jx as vn,jP as dt,j_ as kn,pl as wn,jG as Cn,y0 as An,i9 as xn,k3 as Bn,LV as En,i1 as Dn,pc as jn,LW as Tn,wX as Pn,bD as Fn,br as Ln,HX as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-Dp14ovRw.js";import{m as me,z as R,S as ke,D as Je,Z as oe,i as S,aI as Ee,B as ce,o as E,q as Te,c as j,b1 as Gn,p as z,M as Ke,k as D,K as we,b2 as ut,b3 as pt,b4 as On,af as Mn,y as Nn,aC as zn,w as qt,O as Qe,A as Ye,b5 as Zn,ao as Jt,b6 as Hn,E as Wn,e as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,n as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-TZBFPhBM.js";import{n as V,S as di}from"./mui-CgjVMn8C.js";import{A as mt}from"./AddressScreen-wF2P11Cc.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-C51IXDOd.js";import{a as f}from"./sentry-CGkVgbup.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-BmhiW9nY.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-CJ1dU4ni.js";import{u as Yt}from"./useInitialThreadRequest-DYY0nYQq.js";import De from"./NotFoundScreen-D0cCxE_g.js";import{D as bi}from"./DrawerScreen-CV5-68Vp.js";import{M as Xt}from"./MobileAppDrawer-Czhowgsf.js";import{F as ea}from"./FeaturePreviewScreen-C9zUUTCh.js";import{S as Le}from"./SetupPagesScreen-DeB97TrS.js";import{B as hi}from"./BillPayApprovalRoutes-Bm6O9E1C.js";import{FallBackRoute as gi}from"./ScreenRoutes-CDdkS4QP.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.js";import"./analyticsHelper-DZ0CUT0b.js";import"./routePaths-fq-ods6n.js";import"./BusinessVerificationPageScreen-Db_j23ph.js";import"./ReimbursementApprovalRuleDetailScreen-Doqr5IfY.js";import"./getLocaleForTenant-C75hRciY.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]="4aac759c-7e40-46c8-ad2d-a99939a9e8d9",e._sentryDebugIdIdentifier="sentry-dbid-4aac759c-7e40-46c8-ad2d-a99939a9e8d9")}catch{}})();const Si=Y(function(e,t){const l=Oe(e,t.billId),n=R.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},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(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(Sa(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(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(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Me(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Gn);function yi(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),u=ke(),o=v(w=>Z(w)),s=v(w=>Oe(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[_,G]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(S.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(S.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),O=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,O,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,O,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,t]),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(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(Si,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:O,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const Se=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=R.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=R.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(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[_,G]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let M=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Oe(w,n??""));u===!1&&(M=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const O=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{M==="Not-Started"&&(u&&_?G(!1):!u&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||u||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),u&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(O??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(O??"",w,i?.userEmail??"","no"),t(ya({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(M==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(M!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:O}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{})})]})}):a.jsxs(Re,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(On,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(Mn,{titleComponent:a.jsx(xi,{children:Se.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(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(wi,{children:[a.jsx(Ci,{children:`${Se.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-jLbycGCP.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as S}from"./core-C7cnuUop.js";import{eM as Z,Lk as Me,bu as At,Gm as ra,bn as xt,bC as ue,Ll as Bt,wb as Et,xl as Ue,wK as ca,bm as je,Lm as da,Ln as pa,b$ as ua,Lo as ma,j8 as Dt,Lp as jt,Lq as Tt,xW as Oe,wq as Be,Lr as ba,v$ as it,Ls as ha,B6 as ga,w3 as ya,w9 as Pt,Lt as Ie,Lu as Ne,xm as ze,Lv as Sa,Lw as fa,xp as Ze,Lx as Ia,xC as va,Ly as Ft,x6 as ot,xb as ka,Lz as wa,LA as pe,LB as Lt,LC as Rt,LD as Vt,fG as Ca,wv as _e,ct as $t,LE as Aa,gy as xa,LF as Ba,LG as Ea,eT as Ut,eR as _t,LH as He,LI as Da,LJ as ja,J3 as We,LK as Ta,J4 as ie,J5 as qe,LL as Pa,LM as Fa,LN as La,xd as lt,xa as Ra,LO as Va,LP as $a,LQ as Ua,wY as _a,LR as Ga,LS as Ma,LT as Oa,cN as Gt,cJ as Mt,jj as Na,bI as za,bp as Ot,bJ as Nt,vh as Za,LU as Ha,AV as Wa,A$ as qa,rQ as Ja,xn as Ka,y1 as Qa,jw as fe,LV as Ya,LW as zt,j_ as Xa,jq as Zt,jL as Ht,jK as st,bB as be,bH as en,LX as tn,LY as ve,i1 as an,LZ as rt,L_ as nn,i5 as on,is as ln,yf as sn,L$ as rn,jT as cn,y5 as dn,M0 as ct,y9 as pn,ye as un,yb as mn,y3 as bn,M1 as Wt,wk as hn,M2 as gn,M3 as yn,fA as Sn,fz as fn,fy as In,jz as vn,jR as dt,k0 as kn,pn as wn,jI as Cn,y7 as An,ib as xn,k5 as Bn,M4 as En,i3 as Dn,pe as jn,M5 as Tn,x2 as Pn,bD as Fn,br as Ln,I2 as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-DPGmsT0c.js";import{m as me,z as R,j as ke,K as Je,a as oe,r as y,aI as Ee,B as ce,o as E,R as Te,d as j,b1 as Gn,s as z,Q as Ke,w as D,Z as we,b2 as pt,b3 as ut,b4 as Mn,af as On,G as Nn,aC as zn,C as qt,D as Qe,H as Ye,b5 as Zn,ao as Jt,b6 as Hn,M as Wn,g as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,y as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-DGKR7P5A.js";import{n as V,S as di}from"./mui-BkznVaFh.js";import{A as mt}from"./AddressScreen-DG2igJ3e.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-CBvkPR3e.js";import{a as f}from"./sentry-CflaePyQ.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-BhmP_lnc.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-Ex4_WTph.js";import{u as Yt}from"./useInitialThreadRequest-DoYKoe1O.js";import De from"./NotFoundScreen-Cz9quvZz.js";import{D as bi}from"./DrawerScreen-B_llN9HS.js";import{M as Xt}from"./MobileAppDrawer-Q6-14poV.js";import{F as ea}from"./FeaturePreviewScreen-BZdfwZgd.js";import{S as Le}from"./SetupPagesScreen-hvGS92ve.js";import{B as hi}from"./BillPayApprovalRoutes-5SmQw6w5.js";import{FallBackRoute as gi}from"./ScreenRoutes-DNdR3Wy8.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";import"./analyticsHelper-RuE4CbDL.js";import"./routePaths-BjxXYb1e.js";import"./BusinessVerificationPageScreen-D-2VpDbP.js";import"./ReimbursementApprovalRuleDetailScreen-DAGX2Bpj.js";import"./getLocaleForTenant-BRT6_AeC.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]="bc5daeb2-6396-43ac-9f76-4d33e27d8eb2",e._sentryDebugIdIdentifier="sentry-dbid-bc5daeb2-6396-43ac-9f76-4d33e27d8eb2")}catch{}})();const yi=Y(function(e,t){const l=Me(e,t.billId),n=R.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),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(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Gn);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),p=ke(),o=v(w=>Z(w)),s=v(w=>Me(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[_,G]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),M=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,M,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,M,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,t]),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(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:M,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=R.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=R.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(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[_,G]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Me(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const M=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&_?G(!1):!p&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||p||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),p&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(M??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(M??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:M}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]})}):a.jsxs(Re,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Mn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(p,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(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(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function ki(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 ht=V.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -77,7 +77,7 @@ import{j as a}from"./liveblocks-BCZSgQbG.js";import{j as K,h as re,u as Q,l as t
|
|
|
77
77
|
margin-bottom: 30px;
|
|
78
78
|
margin-top: ${E.sp4};
|
|
79
79
|
white-space: pre-line;
|
|
80
|
-
`,Ei=Y(function(e,t){return{billsReviewView:Ft(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(
|
|
80
|
+
`,Ei=Y(function(e,t){return{billsReviewView:Ft(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(pe())},onCloseReviewItem:l=>{e(wa(l))},onProceedForBulkActionClick:(l,n)=>{switch(l){case"send_for_approval":e(ka());break;case"approve":case"review":e(ot("approved",n??""));break;case"reject":e(ot("rejected",n??""))}}}})(Hn);function Di(){const e=K(),t=v(n=>n.billsBulkActionViewState.bulkSubmissionFetchState.fetchState),{billsForReview:l}=v(n=>Ft(n));return f.useEffect(()=>{t!=="Completed"&&l.length!==0||e("./")},[t,l.length]),a.jsx(Ei,{navigate:e,analytics:j})}const ae=ja(),aa="bulk-operation-update",Ge="bill-approval-rule-update",{spendManagement:ji,common:yt}=Qe.getLocalizedStrings(),St=ji.billPay.bulkActions,Ti=V.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
min-height: 100%;
|
|
83
83
|
width: 100%;
|
|
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-BCZSgQbG.js";import{j as K,h as re,u as Q,l as t
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,Pi=Y(function(e,t){const l=R.getSignedInUser(),n=je(l),c=Vt(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
|
|
88
|
+
`,Pi=Y(function(e,t){const l=R.getSignedInUser(),n=je(l),c=Vt(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 p=e.entityAutoCompleteState.autoCompleteText.common,o=We(e,"common"),s=e.tenantState.currentTenantId,i=Z(e),d=i?.companyName??"",u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},h=e.billListState.downloadUIState.downloadState,g=c.fetchState,m=Ta(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:g,analytics:j,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:p,entityAutoCompleteView:o},downloadParams:{authParams:u,companyName:d,timePeriod:ae,spendManagementEndPoint:`${Ke}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:h,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:m.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:p}=n;return{updateTabToState:o=>{e(pe()),e(Lt(o))},onSubtabChange:o=>{e(pe()),e(Rt(o))},onTransactionClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Li(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;j?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=D(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(Ga(o))},onReloadTransactions:()=>{e(_e(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e(_a(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Ua({filters:o})),o.categories.every(s=>s.field!=null&&s.values?.length!==0)&&j.trackSpendManagmentFilterChange("bill_pay",o.categories.map(s=>`${s.field}-${JSON.stringify(s.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&j.trackSpendManagementDownloadClick("bill_pay"),e($a({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Va(o))},removeAllTransactionsFromBulkActionList:()=>{e(pe())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Ra(o,s??""));break;case"send_for_approval":e(lt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(lt("approve")),t.navigate("./bulk-review");break;case"review":e(La()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Ge)&&e(Fa(!1))},onEventReceived:o=>{o===aa&&e(Pa())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(qe({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}}}})(qn(Jn));function Fi(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=Je(),l=K(),n=re(),c=Q(),r=we(),p=c.state,o=ke(),[s,i]=f.useState(!1),[d,u]=f.useState(null),h=la("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(p?.tab!=null&&p?.subTab!=null&&(n(Lt(p?.tab)),n(Rt(p?.subTab))),()=>{n(pe())}),[]);const g=R.getSignedInUser(),m=v(P=>Z(P)),{areTenantIdsInSync:b}=Wn(),[A,T]=f.useState(!1),{useFeatureGate:I}=oe(),{isFeatureEnabled:k}=I(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:H}=I(y.isBillPayCommentingEnabled),{isFeatureEnabled:_}=I(y.isReimbursementCommentingEnabled),{isFeatureEnabled:G}=I(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:F}=I(y.isBillPayBulkActionEnabled),{isFeatureEnabled:x}=I(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:$}=I(y.isBillPayDetectInsufficientFundsEnabled),U=v(P=>Vt(P,ae,F,g?.userId)),{isFeatureEnabled:B}=I(y.isDebitCardFeatureEnabled),O=U.fetchState,{isAiCfoAccessEnabled:W,onAskAiCfoClick:q}=tt({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Bills List"});at({isDataReady:O==="Completed"});const J=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,M=!!m.companyBillPayInfo?.info?.isBillPayEnabled,le=v(P=>Ca(P.companyState,m.companyId)),X=le?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!A&&M&&b&&(T(!0),n(_e(ae,!0,k,x)))},[A,ae,b,n]),g==null)throw Error("Can't access address page without signing in...");const w=(P,de)=>{n(Da({uiState:{sortKey:P,sortOrder:de},period:ae}))},se=$t(o?.loggedInUserRoleMap),Fe=ue(o?.loggedInUserRoleMap),Ce=P=>{i(P)},{billsProcessed:N,billsProcessing:Ae}=v(P=>Aa(P));f.useEffect(()=>{N===Ae&&d!=null&&(n(xa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:N>1?St.bills:St.bill},{variableName:"_has_",variableValue:N>1?yt.texts.have:yt.texts.has},{variableName:"_action_",variableValue:Ba(d)}]})),n(Ea()),setTimeout(()=>{n(_e(ae,!0,k,!0,x))},3e3),u(null))},[N,Ae]);const na={events:m.companyId!=null?[`private-${m.companyId}.${aa}`,`private-${m.companyId}.${Ge}`]:[],eventCallback:(P,de,nt)=>{P.endsWith(Ge)?nt.onBillPayApprovalRulesEventReceived?.(P):de?.entity_type==="bill"&&(u(de.operation_type),nt.onEventReceived(P))}},ia=Ut(B,m),oa=_t(m);return c.pathname.endsWith("/bills/")||c.pathname.endsWith("/bills")||c.pathname.endsWith("/bills/bulk-review")?ia===!0||oa===!0?a.jsx(ea,{}):M?a.jsxs(a.Fragment,{children:[O==="Completed"?a.jsx(Te,{analytics:j,onLoad:P=>(de=>de.trackPageLoaded(Kt.Event.billPayHome))(P)}):null,a.jsxs(Ti,{windowSize:r,children:[a.jsx(Xt,{isAppContentDrawerOpen:s,handleDrawerToggle:Ce}),a.jsx(bi,{isOpen:h,drawerLeftMargin:new qt(0,0,300,600),onClose:()=>{l("./"),n(pe())},children:a.jsx(Ri,{onClick:P=>P.stopPropagation(),children:a.jsx(Di,{})})}),a.jsx(Pi,{location:c,navigate:l,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:H,isReimbursementCommentingEnabled:_,period:ae,isAdmin:!1,uiState:U.uiState,onColumnSortConfigChanged:w,isUserHasOnlyBillpayAccess:se,isShowDeletedBillsEnabled:k,isShowDeletedReimbursementEnabled:G,isBulkActionEnabled:F,roleMap:o?.loggedInUserRoleMap,onClickMenuIcon:()=>{Ce(!0)},isDownloadEnabled:U.isDownloadEnabled,connectedAccountProvider:X,bulkSubmissionLimit:U.billBulkSubmissionLimit,bulkSubmissionFetchState:U.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:U.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:x,isDetectInsufficientFundsEnabled:$,isAiCfoAccessEnabled:W,onAskAiCfoClick:q,...na})]})]}):J===!0&&Fe===!0?a.jsx(ee,{to:"../setup"}):o!=null&&He(m,o.loggedInUserRoleMap)?a.jsx(ee,{to:"../promo"}):a.jsx(ce,{fetchState:O}):a.jsx(De,{})}const Li=e=>`/${e}/bills/setup`,Ri=V(di)`
|
|
89
89
|
display: flex;
|
|
90
90
|
min-height: 100%;
|
|
91
91
|
flex-direction: column;
|
|
92
|
-
`,{common:{currency:ye},spendManagement:{billPay:{billDetails:Vi}},appName:$i}=Qe.getLocalizedStrings(),Ui=Y(function(e,t){const l=R.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=We(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=je(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??$i} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,h=za(t.billDetailsView.paymentDetailsSection?.paymentType?.method),g=t.currentTenant.createTime,m=Mt(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,A=g.add(b,"month").isAfter(m),T=!!(t.billDetailsView.billStage==="draft"&&h&&p!=null&&p>0)&&!Nt(p,t.billDetailsView.approvalRules.allApprovalRules,l),I=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Dt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,analytics:j,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:I.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:T,isZeniUser:d,isNewUser:A,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(st(i));const d=It(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(Zt(d,!1)),e(Ht({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(st());const p=It(s,void 0,l),h=D(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:h}})},onInvoiceUpload:i=>{i!=null&&e(Ze(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(ze(i))},onSaveChangesToLocalStore:(i,d,p,h,g)=>{const m=Mi(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:g}},p,d,t.isInternationalPaymentShaVsOurEnabled,h,t.vendor);e(Xa({billDetailLocalData:m,billId:l}))},saveBillDetails:()=>{e(Me("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(zt("draft"))},reviewBillDetails:()=>{const i=_i(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Ie({billId:i}))},clearBillPayReviewLocalState:()=>e(Ya()),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(fe(!1,i));const d=Gi(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(fe(!1,i));const d=Oi(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(fe(!1,i));const d=Qt(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(Ie({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Pt(l))},onAttachmentClick:(i,d)=>{const p=Pe(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Xn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Ka(!0,i,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ja("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(qa(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Wa(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Za("bill_pay","bill_pay_detail")),e(Ha({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Kn);function ft(){const e=K(),t=Q(),l=re(),{billId:n,tenantEmailDomain:c}=te(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(S.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(S.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(S.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:h}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=r(S.isRecurringBillsFeatureEnabled),{isFeatureEnabled:m}=r(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(S.isShaDisabled),{isFeatureEnabled:A}=r(S.isOurDisabled),{isFeatureEnabled:T}=r(S.isBillPayDetectInsufficientFundsEnabled),{configValue:I}=u(Ee.zeniAccountsConfig),k=Oa(I),{configValue:H}=u(Ee.sameDayAchDisablementConfig),_=Ma(H),G=R.getSignedInUser(),F=v(N=>Z(N)),x=v(N=>Ne(N,h,m,n)),$=Yt(F?.companyId,{clearParams:x.fetchState==="Completed"}),{isAiCfoOpen:U,setIsAiCfoOpen:B}=Je(),{isAiCfoAccessEnabled:M,onAskAiCfoClick:W}=tt({isAiCfoOpen:U,setIsAiCfoOpen:B,mobileExploreReferrer:"Bill Details"});at({isDataReady:x.fetchState==="Completed"});const q=F.companyId??R.getSignedInUserTenant(c)?.companyId,J=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,O=ke(),le=Gt(O?.loggedInUserRoleMap),X=Ot(O?.loggedInUserRoleMap),w=pe(O?.loggedInUserRoleMap),se=xt(F.userRole);if(f.useEffect(()=>{n!=null&&l(Bt(n))},[n]),G==null)throw Error("Can't access address page without signing in...");const Fe=v(N=>Na(N.accountState,N.accountListState,"billPayAccountList")),Ce={pathname:"../",search:t.search};return x.isDeleted===!0||x.billStage=="paid"||x.fetchState=="Not-Started"?a.jsx(ee,{to:Ce}):x.deleteStatus.fetchState==="In-Progress"||s?a.jsx(ce,{fetchState:x.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:N=>(Ae=>{n!=null&&x.deleteStatus.fetchState!=="Completed"&&Ae.trackBillPayEditBill(n,x.isRecurring)})(N)}),a.jsx(Ui,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:F,billId:n,companyId:q,billDetailsView:x,isMagicLinkEnabled:o,isVendorRecommendationEnabled:h,isLocalCurrencyEnabled:p,uncategorizedAccounts:Fe,isInternationalPaymentShaVsOurEnabled:i,vendor:x.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:A,isRecurringBillsFeatureEnabled:g,isAccountsEnabled:J,hasZeniAccountsAdminAccess:le,isZeniAccountsUser:X,isBillPayAdmin:w,isSuperAdmin:se,accountsPromoConfig:k,isDetectInsufficientFundsEnabled:T,sameDayAchDisablementConfig:_,isAiCfoAccessEnabled:M,onAskAiCfoClick:W})]})}const It=(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},_i=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},Gi=(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},Oi=(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},L="paymentDetails",Mi=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Mt(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[L]?.paymentDate?be(t[L].paymentDate.toString()):void 0,paymentType:t[L]?.paymentType!=null?t[L]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[L]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[L]?.paymentType?.method!=null&&t[L].paymentType.method.includes(en)&&u?.vendorCurrencyCode===ye.currencyCode&&c?t[L]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=t[L]?.recurringPaymentType?.selectedOption===Vi.recurringBill.paymentTypeOptions[1],h={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[L]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:tn(t[L]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[L]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[L]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[L]?.recurringPaymentDetails?.startDate?be(t[L]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[L]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[L]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[L]?.recurringPaymentDetails?.updateRecurringBills},g=Ni(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),m=Object.keys(g).length>0?Qn(g):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:m,recipientTotalAmount:m,file:e.file,updatesByLineId:g,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:h}},Ni=(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=Yn(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??ye.currencyCode,currencySymbol:o.currency?.currencySymbol??ye.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??ye.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??ye.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},zi=V.div`
|
|
92
|
+
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Vi}},appName:$i}=Qe.getLocalizedStrings(),Ui=Y(function(e,t){const l=R.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=z(t.location.state?.pathnameStackToGoBack);let p=!0;r.poppedPathname?.includes("bills")===!0&&(p=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=We(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=je(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??$i} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const u=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,h=za(t.billDetailsView.paymentDetailsSection?.paymentType?.method),g=t.currentTenant.createTime,m=Ot(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,A=g.add(b,"month").isAfter(m),T=!!(t.billDetailsView.billStage==="draft"&&h&&u!=null&&u>0)&&!Nt(u,t.billDetailsView.approvalRules.allApprovalRules,l),I=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Dt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,analytics:j,showBackButton:p,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:I.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:T,isZeniUser:d,isNewUser:A,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:p,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(st(i));const d=It(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Zt(d,!1)),e(Ht({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(st());const u=It(s,void 0,l),h=D(r.state?.pathnameStackToGoBack,r.pathname);p(u,{state:{pathnameStackToGoBack:h}})},onInvoiceUpload:i=>{i!=null&&e(Ze(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(ze(i))},onSaveChangesToLocalStore:(i,d,u,h,g)=>{const m=Oi(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:g}},u,d,t.isInternationalPaymentShaVsOurEnabled,h,t.vendor);e(Xa({billDetailLocalData:m,billId:l}))},saveBillDetails:()=>{e(Oe("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(zt("draft"))},reviewBillDetails:()=>{const i=_i(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Ie({billId:i}))},clearBillPayReviewLocalState:()=>e(Ya()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})}},redirectToACHScreen:i=>{e(fe(!1,i));const d=Gi(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToWireScreen:i=>{e(fe(!1,i));const d=Mi(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToInternationalScreen:i=>{e(fe(!1,i));const d=Qt(s,l,i),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(Ie({})),p(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Pt(l))},onAttachmentClick:(i,d)=>{const u=Pe(s,i,d);window.open(`${u}`,"_blank")},onBackClick:()=>{const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);p(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Xn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Ka(!0,i,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ja("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(qa(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,u)=>{e(Wa(i,d,"bill_pay","bill_pay_detail",u))},onEstablishConnectionSuccess:()=>{e(Za("bill_pay","bill_pay_detail")),e(Ha({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Kn);function ft(){const e=K(),t=Q(),l=re(),{billId:n,tenantEmailDomain:c}=te(),{useFeatureGate:r,useDynamicConfig:p}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:u}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:h}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:m}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:A}=r(y.isOurDisabled),{isFeatureEnabled:T}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:I}=p(Ee.zeniAccountsConfig),k=Ma(I),{configValue:H}=p(Ee.sameDayAchDisablementConfig),_=Oa(H),G=R.getSignedInUser(),F=v(N=>Z(N)),x=v(N=>Ne(N,h,m,n)),$=Yt(F?.companyId,{clearParams:x.fetchState==="Completed"}),{isAiCfoOpen:U,setIsAiCfoOpen:B}=Je(),{isAiCfoAccessEnabled:O,onAskAiCfoClick:W}=tt({isAiCfoOpen:U,setIsAiCfoOpen:B,mobileExploreReferrer:"Bill Details"});at({isDataReady:x.fetchState==="Completed"});const q=F.companyId??R.getSignedInUserTenant(c)?.companyId,J=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,M=ke(),le=Gt(M?.loggedInUserRoleMap),X=Mt(M?.loggedInUserRoleMap),w=ue(M?.loggedInUserRoleMap),se=xt(F.userRole);if(f.useEffect(()=>{n!=null&&l(Bt(n))},[n]),G==null)throw Error("Can't access address page without signing in...");const Fe=v(N=>Na(N.accountState,N.accountListState,"billPayAccountList")),Ce={pathname:"../",search:t.search};return x.isDeleted===!0||x.billStage=="paid"||x.fetchState=="Not-Started"?a.jsx(ee,{to:Ce}):x.deleteStatus.fetchState==="In-Progress"||s?a.jsx(ce,{fetchState:x.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:N=>(Ae=>{n!=null&&x.deleteStatus.fetchState!=="Completed"&&Ae.trackBillPayEditBill(n,x.isRecurring)})(N)}),a.jsx(Ui,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:F,billId:n,companyId:q,billDetailsView:x,isMagicLinkEnabled:o,isVendorRecommendationEnabled:h,isLocalCurrencyEnabled:u,uncategorizedAccounts:Fe,isInternationalPaymentShaVsOurEnabled:i,vendor:x.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:A,isRecurringBillsFeatureEnabled:g,isAccountsEnabled:J,hasZeniAccountsAdminAccess:le,isZeniAccountsUser:X,isBillPayAdmin:w,isSuperAdmin:se,accountsPromoConfig:k,isDetectInsufficientFundsEnabled:T,sameDayAchDisablementConfig:_,isAiCfoAccessEnabled:O,onAskAiCfoClick:W})]})}const It=(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},_i=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},Gi=(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},Mi=(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},L="paymentDetails",Oi=(e,t,l,n,c,r,p)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Ot(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[L]?.paymentDate?be(t[L].paymentDate.toString()):void 0,paymentType:t[L]?.paymentType!=null?t[L]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[L]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[L]?.paymentType?.method!=null&&t[L].paymentType.method.includes(en)&&p?.vendorCurrencyCode===Se.currencyCode&&c?t[L]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,u=t[L]?.recurringPaymentType?.selectedOption===Vi.recurringBill.paymentTypeOptions[1],h={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[L]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:tn(t[L]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[L]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[L]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[L]?.recurringPaymentDetails?.startDate?be(t[L]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[L]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[L]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[L]?.recurringPaymentDetails?.updateRecurringBills},g=Ni(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),m=Object.keys(g).length>0?Qn(g):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:p,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:m,recipientTotalAmount:m,file:e.file,updatesByLineId:g,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:u,recurringConfig:h}},Ni=(e,t,l,n,c,r)=>{const p={};return n.forEach(o=>{let s,i;o.account.selectedOption!=null&&(s=e.find(u=>u.qboId===o.account.selectedOption||u.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(i=t.find(u=>u.classId===o.class.selectedOption));const d=Yn(l[o.lineId],o,c,r);p[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??Se.currencyCode,currencySymbol:o.currency?.currencySymbol??Se.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??Se.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??Se.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}}),p},zi=V.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
height: 100vh;
|
|
95
95
|
width: 100%;
|
|
@@ -98,7 +98,7 @@ import{j as a}from"./liveblocks-BCZSgQbG.js";import{j as K,h as re,u as Q,l as t
|
|
|
98
98
|
align-items: center;
|
|
99
99
|
background-color: ${e=>e.theme.colors.grey4};
|
|
100
100
|
box-shadow: ${e=>`0px 2px ${E.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
-
`,Zi=Y(function(e,t){const{vendorId:l,billId:n}=t,c=ve(e,l),r=Ne(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:
|
|
101
|
+
`,Zi=Y(function(e,t){const{vendorId:l,billId:n}=t,c=ve(e,l),r=Ne(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:p}=t,{tenantEmailDomain:o}=p;return{onFetchBankNameBySwift:s=>{e(ln(s))},onSaveHandler:()=>{e(on(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(nn({data:i}))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??vt();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(rt())},onAddressClick:s=>{const i=et(o,s,l),d=D(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(an({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??vt(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(rt())}}})(ei);function Hi(){const e=K(),t=Q(),l=we(),{vendorId:n,billId:c}=te(),{useFeatureGate:r}=oe(),p=me(),o=R.getSignedInUser(),s=v(m=>Z(m)),i=z(t.state?.pathnameStackToGoBack),d=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",u=v(m=>ve(m,n)),{isFeatureEnabled:h}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&u.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:u.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:p.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${p.colors.dropShadowNormal}`}}):a.jsxs(zi,{windowSize:l,children:[a.jsx(Xe,{vendorId:n,billId:c}),a.jsx(Zi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:h,isZeniAccountsFeatureEnabled:g})]})}const vt=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},Wi=V.div`
|
|
102
102
|
display: flex;
|
|
103
103
|
height: 100vh;
|
|
104
104
|
width: 100%;
|
|
@@ -107,7 +107,7 @@ import{j as a}from"./liveblocks-BCZSgQbG.js";import{j as K,h as re,u as Q,l as t
|
|
|
107
107
|
align-items: center;
|
|
108
108
|
background-color: ${e=>e.theme.colors.grey4};
|
|
109
109
|
box-shadow: ${e=>`0px 2px ${E.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
-
`,qi=Y(function(e,t){const{vendorId:l}=t,n=ve(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=rn(e,c||"international_business",t.billId),
|
|
110
|
+
`,qi=Y(function(e,t){const{vendorId:l}=t,n=ve(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=rn(e,c||"international_business",t.billId),p=n.editVendorState??n.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[cn(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:p?.vendorNewAddressStatus?.addressToCreate,mailingAddress:p?.vendorAddress,billAmount:o??0}},function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:p}=t,{tenantEmailDomain:o}=p;return{onSaveHandler:()=>{e(bn(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,i,d,u)=>{e(un(s)),u&&e(mn(i,d))},onCurrencyUpdated:(s,i,d)=>{e(pn(s,i,d,!1))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??kt();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ct())},onAddressClick:s=>{const i=et(o,s,l),d=D(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(dn({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??kt(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(ct())}}})(ti);function Ji(){const e=K(),t=Q(),l=we(),{vendorId:n,billId:c}=te(),r=re(),p=me(),o=R.getSignedInUser(),s=v(k=>Z(k)),i=z(t.state?.pathnameStackToGoBack),[d,u]=f.useState(!1),h=v(k=>k.vendorViewState.newVendorState.fetchStatus.fetchState),g=v(k=>n!=null?k.vendorViewState.editVendorStateById[n]?.fetchStatus.fetchState??"Not-Started":"Not-Started"),m=n!==void 0?g:h;f.useEffect(()=>{d===!1&&m==="Not-Started"&&n!=null&&(r(fe(!1,n)),u(!0))},[d,m,n]);const[b,A]=f.useState(!1);f.useEffect(()=>{b||m==="In-Progress"||(A(!0),r(sn(c,n)))},[b,m,r]);const T=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",I=v(k=>ve(k,n));if(o==null)throw Error("Can't access international wire page without signing in...");return T==="billDetail"&&I.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:I.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:p.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${p.colors.dropShadowNormal}`}}):a.jsxs(Wi,{windowSize:l,children:[a.jsx(Xe,{vendorId:n,billId:c}),a.jsx(qi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:T})]})}const kt=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},wt=V.div`
|
|
111
111
|
display: flex;
|
|
112
112
|
height: 100vh;
|
|
113
113
|
width: 100%;
|
|
@@ -116,4 +116,4 @@ import{j as a}from"./liveblocks-BCZSgQbG.js";import{j as K,h as re,u as Q,l as t
|
|
|
116
116
|
align-items: center;
|
|
117
117
|
background-color: ${e=>e.theme.colors.grey4};
|
|
118
118
|
box-shadow: ${e=>`0px 2px ${E.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
-
`,Ki=Y(function(e,t){const l=R.getSignedInUser(),n=Wt(e,t.billId),c=gn(e),r=je(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Nt(u,c.allApprovalRules,l);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:j,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(Ie({}))},saveBillDetails:(o,s)=>{o&&e(Tt({billId:n,data:s})),e(Me(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(jt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(zt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Be(t.billId,"retry"))}}})(ni);function Ct(){const e=K(),t=re(),l=Q(),{billId:n}=te(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(S.isBillPayDetectInsufficientFundsEnabled),o=we(),s=R.getSignedInUser(),{isFeatureEnabled:i}=c(S.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(S.isBillPayCommentingEnabled),h=z(l.state?.pathnameStackToGoBack),{poppedPathname:g}=h,{isFeatureEnabled:m}=c(S.isRecurringBillsFeatureEnabled),b=v(I=>Z(I)),A=v(I=>Wt(I,n)),T=A.fetchState??"Not-Started";if(f.useEffect(()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null}),[e]),f.useEffect(()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)},[]),f.useEffect(()=>{const I=A.vendor?.name,k=A.vendor?.id,H=A.totalAmount.amount,_=A.recipientTotalAmount.amount,G=A.invoiceNumber;I&&k&&t(hn(I,k,H,_,G,n))},[]),g==null)return a.jsx(ee,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return T==="In-Progress"?a.jsx(wt,{windowSize:o,children:a.jsx(ai,{})}):a.jsx(wt,{windowSize:o,children:a.jsx(Ki,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:m,isDetectInsufficientFundsEnabled:u})})}const Qi=Y(function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=We(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=R.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Jt.fileMicroServiceBaseUrl}`,authParams:i,analytics:j,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(Dn(u??void 0,t.billId)),i!=null&&e(jn(i))},saveVendorDetailLocalData:i=>{e(Ht({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(En({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(dt(u))},updateSelectedVendorForCreate:i=>{e(Bn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?Qt(s,t.billId,u):mi(s,t.billId,u):p=pi(s,t.billId,u);const h=D(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:h}})},onRemoveBankAccount:(i,d)=>{e(d===!0?An(i,"vendor",u):xn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=et(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(Cn({files:i}))},onEditFileName:(i,d)=>{e(wn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(dt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(kn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(vn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ui(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(In(i,"BillPayVendor"))},onResendOtp:i=>{e(fn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(yn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(Sn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Zt(i,!1))}}})(si),xe=()=>{const e=K(),t=re(),l=ii(),n=Q(),{billId:c,vendorId:r}=te(),u=v(b=>Z(b)),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(S.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),p=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),h=v(b=>ve(b,r)),g=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),m=r!==void 0?g:p;return f.useEffect(()=>{i===!1&&m==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[i,m,r]),h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?a.jsx(oi,{}):m==="Error"?a.jsx(li,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Xe,{vendorId:r,billId:c}),a.jsx(Qi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:h,isLocalCurrencyEnabled:s})]})},Yi=Y(function(e,t){const{companyId:l}=t;return{billPaySetupView:Tn(e,l),analytics:j,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",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(Pn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}})(ri),Xi=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=te(),[n,c]=f.useState(!1),r=me(),u=v(g=>Z(g)),o=u.companyId??R.getSignedInUserTenant(l)?.companyId,s=R.getSignedInUser(),i=ke(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(i?.loggedInUserRoleMap),h=g=>{c(g)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(ee,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(ee,{to:"../../bills/setup"}):d===!1||i!=null&&He(u,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:g=>(m=>m.trackPageLoaded(Kt.Event.billPayPromoPage))(g)}),a.jsx(Xt,{isAppContentDrawerOpen:n,handleDrawerToggle:h}),a.jsx(Yi,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{h(!0)}})]}):a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Fo(){const e=v(U=>Z(U)),t=ke(),l=pe(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(S.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Ji:Hi,{isFeatureEnabled:o}=c(S.isDebitCardFeatureEnabled),s=Ut(o,e),i=_t(e),d=Q(),p=e?.userRole!=null&&At(e?.userRole),h=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),g=$t(t?.loggedInUserRoleMap),m=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Fn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(S.isDepositAccountsFeatureEnabled),A=b&&!p&&Gt(t?.loggedInUserRoleMap),{isFeatureEnabled:T}=c(S.isChargeCardFeatureEnabled),I=ci(e,T,o)&&!p&&Ln(t?.loggedInUserRoleMap),k=Rn(t?.loggedInUserRoleMap),H=Ot(t?.loggedInUserRoleMap),_=Vn(t?.loggedInUserRoleMap),G=$n(t?.loggedInUserRoleMap),F=Un(t?.loggedInUserRoleMap),x=_n(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=te();return a.jsxs(sa,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"setup",element:a.jsx(Le,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"setup"})}),a.jsx(y,{path:"verification",element:a.jsx(Le,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"verification"})}),a.jsx(y,{path:"promo",element:a.jsx(Xi,{})}),a.jsx(y,{path:"approval-rules/*",element:h?a.jsx(hi,{}):a.jsx(gi,{isUserHasZeniAccountsAccess:H,isUserHasChargeCardAccess:G,isUserHasBillPayAccess:F,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:_,isTenantBankingOnly:s,tenantEmailDomain:$??""})}),a.jsx(y,{path:"international-wire",element:a.jsx(Le,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(y,{path:"*",element:a.jsx(Fi,{})}),(s===!0||i===!0)&&a.jsx(y,{path:"/*",element:a.jsx(ea,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(y,{path:"*",element:a.jsx(ee,{to:"../setup"})}),t!=null&&He(e,t.loggedInUserRoleMap)&&a.jsx(y,{path:"*",element:a.jsx(ee,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"new",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:":billId",element:a.jsx(C,{appContent:a.jsx(yi,{})})}),a.jsx(y,{path:":billId/edit",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:"new/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(y,{path:":billId/edit/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(y,{path:"/:billId/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(y,{path:"/new/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(y,{path:"new/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"new/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:"new/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:"new/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"*",element:a.jsx(De,{})})]}):a.jsx(y,{path:"*",element:a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(y,{path:"*",element:a.jsx(De,{})})]})}export{Fo as default};
|
|
119
|
+
`,Ki=Y(function(e,t){const l=R.getSignedInUser(),n=Wt(e,t.billId),c=gn(e),r=je(l),p=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Nt(p,c.allApprovalRules,l);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:j,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:p}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},saveBillDetails:(o,s)=>{o&&e(Tt({billId:n,data:s})),e(Oe(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(jt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(zt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Be(t.billId,"retry"))}}})(ni);function Ct(){const e=K(),t=re(),l=Q(),{billId:n}=te(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=R.getSignedInUser(),{isFeatureEnabled:i}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayCommentingEnabled),h=z(l.state?.pathnameStackToGoBack),{poppedPathname:g}=h,{isFeatureEnabled:m}=c(y.isRecurringBillsFeatureEnabled),b=v(I=>Z(I)),A=v(I=>Wt(I,n)),T=A.fetchState??"Not-Started";if(f.useEffect(()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null}),[e]),f.useEffect(()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)},[]),f.useEffect(()=>{const I=A.vendor?.name,k=A.vendor?.id,H=A.totalAmount.amount,_=A.recipientTotalAmount.amount,G=A.invoiceNumber;I&&k&&t(hn(I,k,H,_,G,n))},[]),g==null)return a.jsx(ee,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return T==="In-Progress"?a.jsx(wt,{windowSize:o,children:a.jsx(ai,{})}):a.jsx(wt,{windowSize:o,children:a.jsx(Ki,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:u,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:m,isDetectInsufficientFundsEnabled:p})})}const Qi=Y(function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=We(e,"common"),r=l!=null?"edit":"create",p=Z(e),o=R.getSignedInUser(),s=p.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Jt.fileMicroServiceBaseUrl}`,authParams:i,analytics:j,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:p,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(Dn(p??void 0,t.billId)),i!=null&&e(jn(i))},saveVendorDetailLocalData:i=>{e(Ht({vendorId:p,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(En({vendorId:p,contacts:i}))},resetVendorDetailLocalData:()=>{e(dt(p))},updateSelectedVendorForCreate:i=>{e(Bn(i))},navigateToBankDetailPage:(i,d)=>{let u;i==="wire"?u=d==="international"?Qt(s,t.billId,p):mi(s,t.billId,p):u=ui(s,t.billId,p);const h=D(r.state?.pathnameStackToGoBack,r.pathname);c(u,{state:{pathnameStackToGoBack:h}})},onRemoveBankAccount:(i,d)=>{e(d===!0?An(i,"vendor",p):xn(i,"vendor",p))},navigateToMailingAddressPage:i=>{const d=et(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:u}})},updateFilesEntity:i=>{e(Cn({files:i}))},onEditFileName:(i,d)=>{e(wn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{p==null&&e(dt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(kn("Not-Started",p))},onVendorSelected:i=>{i!=null&&e(vn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??pi(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(In(i,"BillPayVendor"))},onResendOtp:i=>{e(fn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(Sn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,u)=>{e(yn(i,d,u))},onFetchAndUpdateVendorRecommendations:i=>{e(Zt(i,!1))}}})(si),xe=()=>{const e=K(),t=re(),l=ii(),n=Q(),{billId:c,vendorId:r}=te(),p=v(b=>Z(b)),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),u=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),h=v(b=>ve(b,r)),g=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),m=r!==void 0?g:u;return f.useEffect(()=>{i===!1&&m==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[i,m,r]),h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?a.jsx(oi,{}):m==="Error"?a.jsx(li,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Xe,{vendorId:r,billId:c}),a.jsx(Qi,{navigate:e,location:n,themeState:l,currentTenant:p,vendorId:r,billId:c,vendorViewDetails:h,isLocalCurrencyEnabled:s})]})},Yi=Y(function(e,t){const{companyId:l}=t;return{billPaySetupView:Tn(e,l),analytics:j,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",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(Pn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}})(ri),Xi=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=te(),[n,c]=f.useState(!1),r=me(),p=v(g=>Z(g)),o=p.companyId??R.getSignedInUserTenant(l)?.companyId,s=R.getSignedInUser(),i=ke(),d=!!p.companyBillPayInfo?.info?.isBillPayTOSAccepted,u=ue(i?.loggedInUserRoleMap),h=g=>{c(g)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return p.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(ee,{to:"../../../bills"}):d===!0&&u===!0?a.jsx(ee,{to:"../../bills/setup"}):d===!1||i!=null&&He(p,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:g=>(m=>m.trackPageLoaded(Kt.Event.billPayPromoPage))(g)}),a.jsx(Xt,{isAppContentDrawerOpen:n,handleDrawerToggle:h}),a.jsx(Yi,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{h(!0)}})]}):a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Fo(){const e=v(U=>Z(U)),t=ke(),l=ue(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),p=r===!0?Ji:Hi,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Ut(o,e),i=_t(e),d=Q(),u=e?.userRole!=null&&At(e?.userRole),h=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!u)&&ue(t?.loggedInUserRoleMap),g=$t(t?.loggedInUserRoleMap),m=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!u)&&Fn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),A=b&&!u&&Gt(t?.loggedInUserRoleMap),{isFeatureEnabled:T}=c(y.isChargeCardFeatureEnabled),I=ci(e,T,o)&&!u&&Ln(t?.loggedInUserRoleMap),k=Rn(t?.loggedInUserRoleMap),H=Mt(t?.loggedInUserRoleMap),_=Vn(t?.loggedInUserRoleMap),G=$n(t?.loggedInUserRoleMap),F=Un(t?.loggedInUserRoleMap),x=_n(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=te();return a.jsxs(sa,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Le,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Le,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Xi,{})}),a.jsx(S,{path:"approval-rules/*",element:h?a.jsx(hi,{}):a.jsx(gi,{isUserHasZeniAccountsAccess:H,isUserHasChargeCardAccess:G,isUserHasBillPayAccess:F,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:_,isTenantBankingOnly:s,tenantEmailDomain:$??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Le,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(Fi,{})}),(s===!0||i===!0)&&a.jsx(S,{path:"/*",element:a.jsx(ea,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../setup"})}),t!=null&&He(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:":billId",element:a.jsx(C,{appContent:a.jsx(Si,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]}):a.jsx(S,{path:"*",element:a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]})}export{Fo as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-jLbycGCP.js";import{a as V}from"./sentry-CflaePyQ.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-C7cnuUop.js";import{j as ce,a as ue,aI as de,z as M,R as pe,d as B,aa as x,g as z,bq as le,ao as me,w as E,ap as R}from"./index-DGKR7P5A.js";import{LS as fe,eM as G,rf as ye,Gq as Se,wY as ge,zF as Ie,Cc as he,CR as be,DK as De,Md as Oe,Me as Te,Mf as ke,Mg as Ce,Mh as Ve,IM as we,Lf as Ae,IY as Ne,jQ as _e,fA as Fe,fz as ve,fy as xe,pn as ze,pe as Me,pb as Be,jI as Ee,ro as Re,rm as L,bB as P,rA as j,cr as Le}from"./zeni-epic-state-DPGmsT0c.js";import{n as Pe}from"./mui-BkznVaFh.js";import{c as U}from"./routePaths-BjxXYb1e.js";import{M as je}from"./MobileAppDrawer-Q6-14poV.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="526b1212-7750-41dd-90db-e2937a103e68",e._sentryDebugIdIdentifier="sentry-dbid-526b1212-7750-41dd-90db-e2937a103e68")}catch{}})();const Ue=Pe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-BCZSgQbG.js";import{a as V}from"./sentry-CGkVgbu
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=
|
|
9
|
+
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=M.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ae(e.companyConfigState),s=Ne(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:Y,transactionVolume:Z,transactionVolumeDescription:$,purposeOfAccount:K,purposeOfAccountDescription:Q,regulatedStatus:W,regulatedStatusDescription:H,usNexus:J,usNexusTypes:X}=t,F=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Le(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?P(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:Y,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:W??"",regulatedStatusDescription:H,usNexus:J,usNexusTypes:X?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(j({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_}=p;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:O,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(I.selectedOption):void 0,phone:u,birthday:n!=null?P(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(L(i,t,r))},onSendForVerificationClick:t=>{e(L(i,t,r,!0))},onAddressClick:t=>{const s=U(b,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(b,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Ee({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(Me(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(Fe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Je=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,b]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:O}=p(de.zeniAccountsConfig),T=fe(O),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??M.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(De(n,!0));break;case"zeni_treasury":r(be(n,!0));break;case"reimbursement":r(he(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),M.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{b(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=Oe(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(Ue,{children:[k.jsx(pe,{analytics:B,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Je as B};
|