@zeniai/web-app-ui 5.0.56-qa → 5.0.57-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-C1bL1yEL.js +1 -0
- package/dist/assets/AddressScreen-C6IvqCLW.js +9 -0
- package/dist/assets/{AiCfoScreen-O3ZQKZZv.js → AiCfoScreen-CzXeITwY.js} +3 -3
- package/dist/assets/{BillPayApprovalRoutes-BR7zuPpx.js → BillPayApprovalRoutes-CiWD3mPm.js} +1 -1
- package/dist/assets/{BillPayRoutes-BEElHUA2.js → BillPayRoutes-DYqCDQKr.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-rFNtUgWM.js → BusinessVerificationPageScreen-CPbmBL7J.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-DmaCLBqf.js → ChargeCardRoutes-CAQ18GHz.js} +7 -7
- package/dist/assets/CompanyPassportScreen-7bEBCgDZ.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-HA-Pe0hW.js → ConnectionAuthScreen-Drw16O1C.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DbhhpyIu.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-WWiZNAQF.js → CustomerOnboardingRoutes-CsQUOi23.js} +1 -1
- package/dist/assets/{DashboardRoutes-CYUHs4DQ.js → DashboardRoutes-FjJ49qIi.js} +3 -3
- package/dist/assets/{DefaultTenantHome-DLHNOHLk.js → DefaultTenantHome-BxEBIEMW.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-_XVPNAtR.js → DomesticWireDetailScreen-YdN2GJI3.js} +3 -3
- package/dist/assets/DrawerScreen-D376zeqM.js +1 -0
- package/dist/assets/{EntityDetailRoutes-ekN9KSvw.js → EntityDetailRoutes-BhxpLYjU.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-BWA0VeqR.js → ExpenseAutomationRoutes-DMIgQeGn.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-BBBv1uMR.js +1 -0
- package/dist/assets/MagicLinkRoutes-DYFaWJEB.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-BYKmWE-B.js +12 -0
- package/dist/assets/MobileAppDrawer-BqatZNBg.js +1 -0
- package/dist/assets/NotFoundScreen-BrmwEoGP.js +1 -0
- package/dist/assets/{NotificationRoutes-Y7mMfA0c.js → NotificationRoutes-BhWmeNUp.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-D2gaV3KQ.js +1 -0
- package/dist/assets/{PeopleRoutes-BvoQnuNu.js → PeopleRoutes-C49twcDs.js} +9 -9
- package/dist/assets/PerformanceRoutes-8TzRyboc.js +1 -0
- package/dist/assets/{Preview-CktKjgWY.js → Preview-v6ufh9Up.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DJquJzTz.js → QBOConnectionScreen-Cnhg87ad.js} +1 -1
- package/dist/assets/ReferralListScreen-Czxg_tCU.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-qRkSf3Jp.js → ReimbursementApprovalRoutes-CSGZqgWn.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-cDRgJHyb.js → ReimbursementApprovalRuleDetailScreen-DQiQsDBw.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CilgOLR3.js → ReimbursementRoutes-pEKPc1LV.js} +4 -4
- package/dist/assets/{ReportsRoutes-BYbURSgw.js → ReportsRoutes-IJfcYi5_.js} +1 -1
- package/dist/assets/RewardsRoutes-DAxVBnQa.js +1 -0
- package/dist/assets/{ScreenRoutes-DabvobX8.js → ScreenRoutes-CyuhXplX.js} +2 -2
- package/dist/assets/{SettingsRoutes-OqTPOlbr.js → SettingsRoutes-BG6iE30t.js} +6 -6
- package/dist/assets/{SetupPagesScreen-DbbCxfjw.js → SetupPagesScreen-8DP-INVh.js} +5 -5
- package/dist/assets/{SignInScreen-jrrIh9b0.js → SignInScreen-CJfDbzv1.js} +1 -1
- package/dist/assets/{SignOutScreen-DJFswWiT.js → SignOutScreen-B8SOTK5f.js} +1 -1
- package/dist/assets/{TaskListScreen-Bzrucczg.js → TaskListScreen-DYKkvt2-.js} +2 -2
- package/dist/assets/TaskRoutes-D26BUK4U.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BZNOCcmc.js +1 -0
- package/dist/assets/{TransactionDetailScreen-BzK7FXm-.js → TransactionDetailScreen-B3KLkUFa.js} +2 -2
- package/dist/assets/{TransactionListRoutes-4Rg7SF_b.js → TransactionListRoutes-DG9rPkBC.js} +1 -1
- package/dist/assets/{TreasuryRoutes-C1PdE97m.js → TreasuryRoutes-ZGFkV4TM.js} +6 -6
- package/dist/assets/{VendorsRoutes-5lt5Cpm-.js → VendorsRoutes-B8LMPpiX.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-btVOEfVh.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-DG2kQIui.js → ZeniAccountRoutes-CPNfHI8n.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-B4A5SVx8.js +9 -0
- package/dist/assets/{accountMappingHelper-BOSY12FJ.js → accountMappingHelper-C1yTeNF1.js} +1 -1
- package/dist/assets/{analytics-CcGmsyc8.js → analytics-xb_2pDDq.js} +1 -1
- package/dist/assets/{analyticsHelper-wMrdFRpH.js → analyticsHelper-CNwzWBf_.js} +1 -1
- package/dist/assets/{core-DkPdadc6.js → core-DGD8k-EU.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-h3wJzOm1.js → decodeURIComponentSafe-DKUmHyeo.js} +1 -1
- package/dist/assets/{dnd-D-YvLFfj.js → dnd-s5MAPZ_4.js} +1 -1
- package/dist/assets/{empty-C7PzWdR6.js → empty-C-OX54ey.js} +1 -1
- package/dist/assets/{empty-ohi5JxHm.js → empty-Dt0wGXhX.js} +1 -1
- package/dist/assets/{emptyVideoElement-B09QwhYv.js → emptyVideoElement-19CW_zr_.js} +1 -1
- package/dist/assets/{epic-DC-PDk7m.js → epic-BWgHIe0E.js} +1 -1
- package/dist/assets/getLocaleForTenant-BrCCfdIO.js +1 -0
- package/dist/assets/{index-DHz0Faq_.js → index-BD5JP2X1.js} +1 -1
- package/dist/assets/{index-CxVN3Ojx.js → index-BE1Y8qVe.js} +1 -1
- package/dist/assets/{index-BIUa1dNl.js → index-BIyxkQfN.js} +2 -2
- package/dist/assets/{index-B5LlGXSS.js → index-CNT4WvUT.js} +14405 -14465
- package/dist/assets/{index-ufE2I9Jb.js → index-CTLIpLfK.js} +1 -1
- package/dist/assets/{index-8VSOxL6k.js → index-DFm7CUCx.js} +1 -1
- package/dist/assets/{index-BVoPsTXN.js → index-vWYcYgGc.js} +1 -1
- package/dist/assets/{lexical-Sc7rk4Y7.js → lexical-D9fe9vQ7.js} +1 -1
- package/dist/assets/{liveblocks-tcXs1fes.js → liveblocks-Cxvop2w5.js} +1 -1
- package/dist/assets/{lottie-CwApzZxI.js → lottie-rysS_6yg.js} +1 -1
- package/dist/assets/{mui-DbdGpDJj.js → mui-Cdh_ZgIg.js} +1 -1
- package/dist/assets/{pathToGoBack-D9y2NyzP.js → pathToGoBack-79-68hCi.js} +1 -1
- package/dist/assets/{pdf-DG2fyOfp.js → pdf-B7Btpc50.js} +4 -4
- package/dist/assets/{pdf-lib-fmjHY_Su.js → pdf-lib-o7tH0fyZ.js} +1 -1
- package/dist/assets/{plaid-UeHpA8su.js → plaid-BVGCfCA1.js} +1 -1
- package/dist/assets/{pusher-CH-5kFcN.js → pusher-yXRrAcLQ.js} +1 -1
- package/dist/assets/{react-CjW2GUTT.js → react-Bu0vc7Mq.js} +1 -1
- package/dist/assets/{react-P8ikJhK3.js → react-C5Y1Z7Ny.js} +1 -1
- package/dist/assets/{react-CFEMacjg.js → react-CniPiXF0.js} +1 -1
- package/dist/assets/{react-CAp_bFar.js → react-DXDp-y6T.js} +1 -1
- package/dist/assets/{react-D3qpynvt.js → react-D_nAXUQt.js} +1 -1
- package/dist/assets/{react-BTMxDr8F.js → react-DbAaKnkZ.js} +1 -1
- package/dist/assets/{recharts-D0a4NFa9.js → recharts-oolJNF1J.js} +1 -1
- package/dist/assets/{routePaths-DLaKTtZ1.js → routePaths-CKa13qEa.js} +1 -1
- package/dist/assets/{sentry-DNuKG-9f.js → sentry-Bel9R1P0.js} +1 -1
- package/dist/assets/{url-EFuL_PC5.js → url-CKAhPnIv.js} +1 -1
- package/dist/assets/{url-Bxb4Dr7g.js → url-CXvkkYyM.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CwXdaO7x.js +1 -0
- package/dist/assets/{useDeviceId-DoEHbao8.js → useDeviceId-C-LBnIzp.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-7gmq8HnL.js +1 -0
- package/dist/assets/useInitialThreadRequest-KZIIx-jA.js +1 -0
- package/dist/assets/{utils-BmJyX3cx.js → utils-y7cfvjBg.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-D6IjOlY9.js → withTransactionSidePanel-Bmv6ar-S.js} +2 -2
- package/dist/assets/{zeni-epic-state-CSoWjbAn.js → zeni-epic-state-CjARY91O.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-Ct22cch9.js +0 -1
- package/dist/assets/AddressScreen-BZLn4WXp.js +0 -9
- package/dist/assets/CompanyPassportScreen-CPhtVigG.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DccrP6Ii.js +0 -1
- package/dist/assets/DrawerScreen-Lpd7yHHT.js +0 -1
- package/dist/assets/FeaturePreviewScreen-CXPzFCOG.js +0 -1
- package/dist/assets/MagicLinkRoutes-BM5EBV4g.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-CUpAMwgA.js +0 -12
- package/dist/assets/MobileAppDrawer-4e3Dnoyk.js +0 -1
- package/dist/assets/NotFoundScreen-D9IauLgD.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-Oi34FulL.js +0 -1
- package/dist/assets/PerformanceRoutes-BF5xhlzy.js +0 -1
- package/dist/assets/ReferralListScreen-CdcLyZxu.js +0 -5
- package/dist/assets/RewardsRoutes-B01_JIOc.js +0 -1
- package/dist/assets/TaskRoutes-BQtLZoYh.js +0 -9
- package/dist/assets/TransactionDetailRoutes-oxE-1NtY.js +0 -1
- package/dist/assets/WiseConfirmationScreen-BnyC9-LE.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-3oBNuFw5.js +0 -9
- package/dist/assets/getLocaleForTenant-U9nBzLWh.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CPSMuZiJ.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-Btx9ztNW.js +0 -1
- package/dist/assets/useInitialThreadRequest-BgK6IHKx.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-Cxvop2w5.js";import{A as d}from"./AddressScreen-C6IvqCLW.js";import i from"./NotFoundScreen-BrmwEoGP.js";import"./sentry-Bel9R1P0.js";import{n as s,o as r}from"./core-DGD8k-EU.js";import"./zeni-epic-state-CjARY91O.js";import"./recharts-oolJNF1J.js";import"./index-CNT4WvUT.js";import"./mui-Cdh_ZgIg.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.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]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-Cxvop2w5.js";import{a as m}from"./sentry-Bel9R1P0.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-DGD8k-EU.js";import{q as $,h as D,z as L,j as K,B as N,A as R,d as C,f as S,r as z,k as h,v as F}from"./index-CNT4WvUT.js";import{I$ as k,gM as U,eN as q,J0 as G,c0 as J,J1 as O,k6 as V}from"./zeni-epic-state-CjARY91O.js";import{n as H}from"./mui-Cdh_ZgIg.js";import Q from"./NotFoundScreen-BrmwEoGP.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]="da1e90b1-1775-4b2b-9cae-1bc6783b2713",e._sentryDebugIdIdentifier="sentry-dbid-da1e90b1-1775-4b2b-9cae-1bc6783b2713")}catch{}})();const W=H.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
|
+
`,X=M(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"||J(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=O(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(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??I();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=Y(a);e(V({addressType:c,addressToCreate:r})),C?.trackSaveAddressClicked(S.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=T(),r=_(),n=j(),{addressId:s,addressType:u}=E(),g=$(),v=D(),w=L.getSignedInUser(),[f,A]=m.useState(s==null),p=B(b=>s!=null?k(b,s).fetchState:"Not-Started"),x=K();if(w==null)throw Error("Can't access address page without signing in...");const P=b=>b.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return m.useEffect(()=>{f||s==null||(A(!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(N,{fetchState:p,style:{backgroundColor:v.colors.grey5}}):s!=null&&p==="Error"?(a(`${I(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(R,{analytics:C,onLoad:P}),d.jsx(W,{windowSize:g,children:d.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):d.jsx(Q,{})}const I=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Y=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,Y as t};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-
|
|
1
|
+
import{j as h}from"./liveblocks-Cxvop2w5.js";import{a as r}from"./sentry-Bel9R1P0.js";import{h as oe,j as ne,u as ie,g as j,l as re,k as le}from"./core-DGD8k-EU.js";import{J as ce,cG as ue,z as de,q as me,cH as pe,cI as fe,cJ as he,cK as $,A as Se,d as v,N as q,cL as ge,cM as Ce,f as ke,a1 as we,cN as be,O as Ie,x as Pe,v as G,aY as Ee,cO as Te}from"./index-CNT4WvUT.js";import{fD as ye,f2 as H,eN as _e,hq as xe,Px as ve,eM as Ue,hA as Ae,hw as Oe,ft as Qe,fn as De,fg as Fe,fk as V,fo as Me,fp as Le,fq as Be,fr as Ne,fs as Re}from"./zeni-epic-state-CjARY91O.js";import{D as je,n as U,P as qe,S as Ge}from"./mui-Cdh_ZgIg.js";import{p as Ve}from"./pathToGoBack-79-68hCi.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="e4705dd8-cf52-4628-9fcf-6a61f4d46400",s._sentryDebugIdIdentifier="sentry-dbid-e4705dd8-cf52-4628-9fcf-6a61f4d46400")}catch{}})();const W="chat-response-generated",$e=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:P}=$(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(P,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Ne({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Re({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Ee(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(V(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Me(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ve(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(V(""))},togglePageView:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Pe(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(we(be)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=j(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=j(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:P}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,k=C?.aiCfoInitialQuestion,O=!!C?.aiCfoShouldSubmit,[z,E]=r.useState(null),[J,T]=r.useState(!1),Q=r.useRef(!1);r.useEffect(()=>{Q.current||k==null||k===""||(E(k),T(O),Q.current=!0)},[k,O]);const Y=r.useCallback(()=>{E(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,M=r.useRef(!1);r.useEffect(()=>{M.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),M.current=!0)},[F,y,t,a,e]);const w=l.uiState.lastContextMessage;r.useEffect(()=>{w!=null&&w!==""&&t!=null&&(E(w),T(!0),a(ve()))},[w,t,a]);const K=c.masterTOSInfo,b=K?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",N=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),R=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=$(R,t),X=Z.length===0;r.useEffect(()=>{b||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[b]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&N&&e!=null&&_==="Completed"&&!x&&a(Oe(t,e.userId))},[B,N,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(ke.Event.aiCFOPage)}),q(n)&&A.drawerElement,h.jsx($e,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:R,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:X,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:J,onEmailLinkQuestionProcessed:Y,onMenuClick:q(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:P,onUploadPromoClose:g}),h.jsx(je,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:b,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{b||c.userRoleId==null||a(Qe(c.userRoleId)),f(!1)}})})})]})},He=U(Ge)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,We=
|
|
5
|
+
`,We=U.div`
|
|
6
6
|
height: 100vh;
|
|
7
7
|
width: 100%;
|
|
8
|
-
`,ze=
|
|
8
|
+
`,ze=U(qe)`
|
|
9
9
|
box-shadow: ${({theme:s})=>s.colors.elevation2};
|
|
10
10
|
color: ${({theme:s})=>s.colors.grey4};
|
|
11
11
|
`;export{dt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-Cxvop2w5.js";import{a as y}from"./sentry-Bel9R1P0.js";import{j as B,u as U,h as j,g as f,N as $,k as T,l as N,n as O,o as b}from"./core-DGD8k-EU.js";import{eN as L,Mi as A,L_ as h,x8 as w,x2 as F,x6 as x,wX as z,M0 as M,w_ as W,xa as q,x9 as C}from"./zeni-epic-state-CjARY91O.js";import{h as P,z as k,B as _,a1 as X,by as G,ab as V,bz as H}from"./index-CNT4WvUT.js";import"./mui-Cdh_ZgIg.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-DQiQsDBw.js";import K from"./NotFoundScreen-BrmwEoGP.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]="1652140b-cd3b-4b71-94a3-d1be6dd93611",e._sentryDebugIdIdentifier="sentry-dbid-1652140b-cd3b-4b71-94a3-d1be6dd93611")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(M(!1))},onBackClick:()=>{V(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(X(G)),Y=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>L(i)),r=f(i=>A(i)),g=f(i=>h(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.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...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const v={events:c.companyId!=null?[`private-${c.companyId}.${I}`]:[],eventCallback:(i,R,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(_,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...v})},Z=T(function(e,o){const t=h(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=V(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(v=>{const i=v.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=v.actors.selectedNonUsers.map(S=>{const E=!!J(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(R);g.push({action:v.stepType.selectedOption,actors:m,operator:m.length>1?v.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(q())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=N(),a=k.getSignedInUser(),u=P(),s=f(r=>h(r)),d=f(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.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(_,{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(O,{children:[l.jsx(b,{path:"/",element:l.jsx(Y,{})}),l.jsx(b,{path:"/new",element:l.jsx(D,{})}),l.jsx(b,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(b,{path:"*",element:l.jsx(K,{})})]})}export{se as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-tcXs1fes.js";import{j as K,h as re,u as Q,l as te,g as I,N as ee,k as X,i as la,n as sa,o as S}from"./core-DkPdadc6.js";import{eN as Z,LA as Ge,bv as At,GD as ra,bo as xt,bD as pe,LB as Bt,ws as Et,xC as Ue,w$ as ca,bn as je,LC as da,LD as ua,c0 as pa,LE as ma,jq as Dt,LF as jt,LG as Tt,yb as Oe,wH as Be,LH as ba,wg as it,LI as ha,Bn as ga,wk as ya,wq as Pt,LJ as ke,LK as Ne,xD as ze,LL as Sa,LM as fa,xG as Ze,LN as ka,xT as Ia,LO as Ft,xn as ot,xs as va,LP as wa,LQ as ue,LR as Rt,LS as Lt,LT as Vt,fH as Ca,wM as Me,cv as $t,LU as Aa,gC as xa,LV as Ba,LW as Ea,eT as Ut,eR as Mt,LX as He,LY as Da,LZ as ja,Jj as We,L_ as Ta,Jk as ie,Jl as qe,L$ as Pa,M0 as Fa,M1 as Ra,xu as lt,xr as La,M2 as Va,M3 as $a,M4 as Ua,xd as Ma,M5 as _a,M6 as Ga,M7 as Oa,cj as _t,cL as Gt,jB as Na,bJ as za,bq as Ot,bK as Nt,vy as Za,M8 as Ha,Ba as Wa,Bg as qa,s5 as Ja,xE as Ka,yi as Qa,jO as fe,M9 as Xa,Ma as zt,kg as Ya,jI as Zt,k1 as Ht,k0 as st,bC as be,bI as en,Mb as tn,Mc as Ie,ik as an,Md as rt,Me as nn,ip as on,iK as ln,yw as sn,Mf as rn,k9 as cn,ym as dn,Mg as ct,yq as un,yv as pn,ys as mn,yk as bn,Mh as Wt,wB as hn,Mi as gn,Mj as yn,fz as Sn,fy as fn,fx as kn,jR as In,k7 as dt,ki as vn,pE as wn,j_ as Cn,yo as An,iv as xn,kn as Bn,Mk as En,im as Dn,pv as jn,Ml as Tn,xj as Pn,bE as Fn,bs as Rn,Ik as Ln,cN as Vn,cM as $n,cu as Un,cA as Mn}from"./zeni-epic-state-CSoWjbAn.js";import{h as me,z as L,j as ve,M as Je,a as oe,p as y,aJ as Ee,B as ce,o as E,x as Te,d as j,b5 as _n,m as z,U as Ke,r as D,q as we,b6 as ut,b7 as pt,b8 as Gn,ag as On,G as Nn,aD as zn,E as qt,D as Qe,J as Xe,b9 as Zn,ap as Jt,ba as Hn,Q as Wn,f as Kt,a2 as qn,bb as Jn,bc as Kn,bd as Qn,be as Xn,bf as Yn,bg as ei,bh as ti,bi as ai,bj as ni,$ as ii,bk as oi,b1 as li,bl as si,bm as ri,a5 as ci}from"./index-B5LlGXSS.js";import{n as V,S as di}from"./mui-DbdGpDJj.js";import{A as mt}from"./AddressScreen-BZLn4WXp.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-_XVPNAtR.js";import{a as f}from"./sentry-DNuKG-9f.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-CPSMuZiJ.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-Btx9ztNW.js";import{u as Xt}from"./useInitialThreadRequest-BgK6IHKx.js";import De from"./NotFoundScreen-D9IauLgD.js";import{D as bi}from"./DrawerScreen-Lpd7yHHT.js";import{M as Yt}from"./MobileAppDrawer-4e3Dnoyk.js";import{F as ea}from"./FeaturePreviewScreen-CXPzFCOG.js";import{S as Re}from"./SetupPagesScreen-DbbCxfjw.js";import{B as hi}from"./BillPayApprovalRoutes-BR7zuPpx.js";import{FallBackRoute as gi}from"./ScreenRoutes-DabvobX8.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";import"./analyticsHelper-wMrdFRpH.js";import"./routePaths-DLaKTtZ1.js";import"./BusinessVerificationPageScreen-rFNtUgWM.js";import"./ReimbursementApprovalRuleDetailScreen-cDRgJHyb.js";import"./getLocaleForTenant-U9nBzLWh.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]="abc33ebc-32b0-44f9-be75-501c07890bb7",e._sentryDebugIdIdentifier="sentry-dbid-abc33ebc-32b0-44f9-be75-501c07890bb7")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.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(ke({}))},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(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(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=I(w=>Z(w)),s=I(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(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,k]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=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&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(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"||(k(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,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:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.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=L.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(Ia({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(ka({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=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),k=I(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=I(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=I(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=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"&&(u&&M?_(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),u&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",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(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(k.tenantEmailDomain);t(ke({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,k.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(ut,{fallback:Y,children:a.jsxs(Le,{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:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{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(ki,{})}),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:Ii(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function ki(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function Ii(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}
|
|
1
|
+
import{j as a}from"./liveblocks-Cxvop2w5.js";import{j as K,h as re,u as Q,l as te,g as I,N as ee,k as X,i as la,n as sa,o as S}from"./core-DGD8k-EU.js";import{eN as Z,LA as Ge,bv as At,GD as ra,bo as xt,bD as pe,LB as Bt,ws as Et,xC as Ue,w$ as ca,bn as je,LC as da,LD as ua,c0 as pa,LE as ma,jq as Dt,LF as jt,LG as Tt,yb as Oe,wH as Be,LH as ba,wg as it,LI as ha,Bn as ga,wk as ya,wq as Pt,LJ as ke,LK as Ne,xD as ze,LL as Sa,LM as fa,xG as Ze,LN as ka,xT as Ia,LO as Ft,xn as ot,xs as va,LP as wa,LQ as ue,LR as Rt,LS as Lt,LT as Vt,fH as Ca,wM as Me,cv as $t,LU as Aa,gC as xa,LV as Ba,LW as Ea,eT as Ut,eR as Mt,LX as He,LY as Da,LZ as ja,Jj as We,L_ as Ta,Jk as ie,Jl as qe,L$ as Pa,M0 as Fa,M1 as Ra,xu as lt,xr as La,M2 as Va,M3 as $a,M4 as Ua,xd as Ma,M5 as _a,M6 as Ga,M7 as Oa,cj as _t,cL as Gt,jB as Na,bJ as za,bq as Ot,bK as Nt,vy as Za,M8 as Ha,Ba as Wa,Bg as qa,s5 as Ja,xE as Ka,yi as Qa,jO as fe,M9 as Xa,Ma as zt,kg as Ya,jI as Zt,k1 as Ht,k0 as st,bC as be,bI as en,Mb as tn,Mc as Ie,ik as an,Md as rt,Me as nn,ip as on,iK as ln,yw as sn,Mf as rn,k9 as cn,ym as dn,Mg as ct,yq as un,yv as pn,ys as mn,yk as bn,Mh as Wt,wB as hn,Mi as gn,Mj as yn,fz as Sn,fy as fn,fx as kn,jR as In,k7 as dt,ki as vn,pE as wn,j_ as Cn,yo as An,iv as xn,kn as Bn,Mk as En,im as Dn,pv as jn,Ml as Tn,xj as Pn,bE as Fn,bs as Rn,Ik as Ln,cN as Vn,cM as $n,cu as Un,cA as Mn}from"./zeni-epic-state-CjARY91O.js";import{h as me,z as L,j as ve,J as Je,a as oe,p as y,aJ as Ee,B as ce,o as E,A as Te,d as j,b5 as _n,v as z,O as Ke,x as D,q as we,b6 as ut,b7 as pt,b8 as Gn,ag as On,E as Nn,aD as zn,C as qt,D as Qe,F as Xe,b9 as Zn,ap as Jt,ba as Hn,K as Wn,f as Kt,a1 as qn,bb as Jn,bc as Kn,bd as Qn,be as Xn,bf as Yn,bg as ei,bh as ti,bi as ai,bj as ni,$ as ii,bk as oi,b1 as li,bl as si,bm as ri,a5 as ci}from"./index-CNT4WvUT.js";import{n as V,S as di}from"./mui-Cdh_ZgIg.js";import{A as mt}from"./AddressScreen-C6IvqCLW.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-YdN2GJI3.js";import{a as f}from"./sentry-Bel9R1P0.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-CwXdaO7x.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-7gmq8HnL.js";import{u as Xt}from"./useInitialThreadRequest-KZIIx-jA.js";import De from"./NotFoundScreen-BrmwEoGP.js";import{D as bi}from"./DrawerScreen-D376zeqM.js";import{M as Yt}from"./MobileAppDrawer-BqatZNBg.js";import{F as ea}from"./FeaturePreviewScreen-BBBv1uMR.js";import{S as Re}from"./SetupPagesScreen-8DP-INVh.js";import{B as hi}from"./BillPayApprovalRoutes-CiWD3mPm.js";import{FallBackRoute as gi}from"./ScreenRoutes-CyuhXplX.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.js";import"./analyticsHelper-CNwzWBf_.js";import"./routePaths-CKa13qEa.js";import"./BusinessVerificationPageScreen-CPbmBL7J.js";import"./ReimbursementApprovalRuleDetailScreen-DQiQsDBw.js";import"./getLocaleForTenant-BrCCfdIO.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]="6262281e-a3e4-458c-9886-8f07c62f4ef7",e._sentryDebugIdIdentifier="sentry-dbid-6262281e-a3e4-458c-9886-8f07c62f4ef7")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.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(ke({}))},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(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(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=I(w=>Z(w)),s=I(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(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,k]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=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&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(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"||(k(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,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:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.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=L.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(Ia({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(ka({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=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),k=I(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=I(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=I(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=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"&&(u&&M?_(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),u&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",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(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(k.tenantEmailDomain);t(ke({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,k.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(ut,{fallback:Y,children:a.jsxs(Le,{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:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{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(ki,{})}),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:Ii(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function ki(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function Ii(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 vi(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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-Cxvop2w5.js";import{a as V}from"./sentry-Bel9R1P0.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-DGD8k-EU.js";import{j as ce,a as ue,aJ as de,z as E,A as pe,d as M,ab as F,f as z,bu as le,ap as me,x as B,aq as R}from"./index-CNT4WvUT.js";import{M6 as fe,eN as G,rw as ye,GH as Se,xd as ge,zW as Ie,Ct as be,D6 as he,D$ as De,Mt as Oe,Mu as Te,Mv as ke,Mw as Ce,Mx as Ve,J0 as we,Lv as Ae,Jc as Ne,k6 as _e,fz as ve,fy as xe,fx as Fe,pE as ze,pv as Ee,ps as Me,j_ as Be,rF as Re,rD as P,bC as L,rR as j,ct as Pe}from"./zeni-epic-state-CjARY91O.js";import{n as Le}from"./mui-Cdh_ZgIg.js";import{c as U}from"./routePaths-CKa13qEa.js";import{M as je}from"./MobileAppDrawer-BqatZNBg.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]="4b06b6d1-655d-4608-85ff-aec8bc9083b9",e._sentryDebugIdIdentifier="sentry-dbid-4b06b6d1-655d-4608-85ff-aec8bc9083b9")}catch{}})();const Ue=Le.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-tcXs1fes.js";import{a as V}from"./sentry-DNuKG-9
|
|
|
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=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},
|
|
9
|
+
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},h=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:h,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:h}=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:b,companySourceOfFunds:q,companySourceOfFundsDescription:J,transactionVolume:$,transactionVolumeDescription:W,purposeOfAccount:Z,purposeOfAccountDescription:H,regulatedStatus:K,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y}=t,v=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Pe(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(x=>x.length===2?x:R(x))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:J,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:W,purposeOfAccount:Z?.selectedOption??"",purposeOfAccountDescription:H,regulatedStatus:K??"",regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y?.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 b;return f.selectDocumentType==="driverLicense"?b="driving_license":f.selectDocumentType==="passport"?b="passport":f.selectDocumentType==="stateId"?b="id_document":f.selectDocumentType==="ssnCard"&&(b="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?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:b,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(P(i,t,r))},onSendForVerificationClick:t=>{e(P(i,t,r,!0))},onAddressClick:t=>{const s=U(h,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(h,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Be({files:t}))},onDeleteFile:t=>{e(Me(t))},onDeleteFileList:t=>{e(Ee(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(Fe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(xe(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(ve(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Xe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,h]=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??E.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(he(n,!0));break;case"reimbursement":r(be(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),E.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=>{h(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:M,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,F(i)?"Settings":void 0)}})(a)}),F(i)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:M,currentTenant:c,productType:e,isSettings:F(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Xe as B};
|