@zeniai/web-app-ui 5.0.69-qa → 5.0.70-next
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-DeiyTicu.js +1 -0
- package/dist/assets/AddressScreen-CqN2m8jr.js +9 -0
- package/dist/assets/AiCfoScreen-CAYEJ5O5.js +11 -0
- package/dist/assets/BillPayApprovalRoutes-4zgtGZR2.js +1 -0
- package/dist/assets/{BillPayRoutes-xwiyRCEj.js → BillPayRoutes-jThpswSi.js} +17 -17
- package/dist/assets/{BusinessVerificationPageScreen-B-O4fGng.js → BusinessVerificationPageScreen-CDrDTvtJ.js} +2 -2
- package/dist/assets/ChargeCardRoutes-cvyBbKCd.js +71 -0
- package/dist/assets/CompanyPassportScreen-DBj4wqbX.js +1 -0
- package/dist/assets/ConnectionAuthScreen-B9LY9Ett.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-qAuUHkDS.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DBczs8W1.js → CustomerOnboardingRoutes-BIHdUdzB.js} +4 -4
- package/dist/assets/{DashboardRoutes-6tX_FJnK.js → DashboardRoutes-CvW0eCrD.js} +3 -3
- package/dist/assets/DefaultTenantHome-CG7ZnfV5.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-DZ1aEjMk.js +18 -0
- package/dist/assets/DrawerScreen-CR4GTmpO.js +1 -0
- package/dist/assets/EntityDetailRoutes-HWftLZJg.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-DaQKUIoC.js +25 -0
- package/dist/assets/FeaturePreviewScreen-C-DrdhwC.js +1 -0
- package/dist/assets/MagicLinkRoutes-CJ7qsGNd.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-BYXwKVNf.js +12 -0
- package/dist/assets/MobileAppDrawer-CanZHImd.js +1 -0
- package/dist/assets/NotFoundScreen-qOlBSqQS.js +1 -0
- package/dist/assets/{NotificationRoutes-DE_b-rRI.js → NotificationRoutes-DaH9wBSH.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-oaiw53DB.js +1 -0
- package/dist/assets/PeopleRoutes-Bp6G-oiV.js +22 -0
- package/dist/assets/PerformanceRoutes-BVKrav5z.js +1 -0
- package/dist/assets/{Preview-BzKmpY8q.js → Preview-D2McFqjx.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-H8Qvt38d.js → QBOConnectionScreen-r4C0IwOV.js} +1 -1
- package/dist/assets/ReferralListScreen-B--T5kCL.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-DcmO3rtg.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-DHB0Y6Ez.js +1 -0
- package/dist/assets/{ReimbursementRoutes-V4aVhNjv.js → ReimbursementRoutes-dJTZ5Llk.js} +8 -8
- package/dist/assets/ReportsRoutes-WKOAJGf5.js +1 -0
- package/dist/assets/RewardsRoutes-BmS21jMf.js +1 -0
- package/dist/assets/ScreenRoutes-D7TgV1r1.js +2 -0
- package/dist/assets/{SettingsRoutes-0j-n-7mu.js → SettingsRoutes-DckMCFWG.js} +8 -8
- package/dist/assets/{SetupPagesScreen-C4GjXjRP.js → SetupPagesScreen-D3DtxfXm.js} +5 -5
- package/dist/assets/{SignInScreen-B6ywBnJ6.js → SignInScreen-qBhC3YaP.js} +1 -1
- package/dist/assets/SignOutScreen-W9tMxqrB.js +9 -0
- package/dist/assets/TaskListScreen-B22aeT45.js +9 -0
- package/dist/assets/TaskRoutes-DN9mbXAb.js +9 -0
- package/dist/assets/TransactionDetailRoutes-Bh5HP7Aa.js +1 -0
- package/dist/assets/TransactionDetailScreen-BhZmCHGq.js +5 -0
- package/dist/assets/TransactionListRoutes-MecJicQI.js +1 -0
- package/dist/assets/{TreasuryRoutes-D4_fryuU.js → TreasuryRoutes-BUB7tWC4.js} +6 -6
- package/dist/assets/{VendorsRoutes-DKMnK28g.js → VendorsRoutes-C2i_Q0tE.js} +15 -15
- package/dist/assets/WiseConfirmationScreen-CS6XnsvF.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-ByRr-Rvb.js → ZeniAccountRoutes-DN-sTVza.js} +12 -12
- package/dist/assets/ZeniAccountStatementScreen-C3GA_297.js +9 -0
- package/dist/assets/{accountMappingHelper-CbeIjSvu.js → accountMappingHelper-DFjUKa9J.js} +1 -1
- package/dist/assets/{analytics-CX30pJB4.js → analytics-D8oYfpTm.js} +1 -1
- package/dist/assets/{analyticsHelper-SG8tB9jY.js → analyticsHelper-DBHckA8w.js} +1 -1
- package/dist/assets/{core-Chn6k0lm.js → core-nI7qhWxF.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-B4WuQ5yM.js → decodeURIComponentSafe-BO4lHXB6.js} +1 -1
- package/dist/assets/{dnd-CKKgQZIG.js → dnd-C_C-95qu.js} +1 -1
- package/dist/assets/empty-CFdjgM_6.js +1 -0
- package/dist/assets/{empty-CM7hXaA6.js → empty-Cw25tTjp.js} +1 -1
- package/dist/assets/{emptyVideoElement-BB3xSIc2.js → emptyVideoElement-8mGBsq8M.js} +1 -1
- package/dist/assets/epic-CsmRNRNv.js +2 -0
- package/dist/assets/getLocaleForTenant-BT8jU8Uf.js +1 -0
- package/dist/assets/{index-BOIvqKof.js → index-BTUmM8Z2.js} +1 -1
- package/dist/assets/index-Bi6n-I0p.js +1 -0
- package/dist/assets/{index-BreaiJNl.js → index-DOZAHQPK.js} +15833 -17309
- package/dist/assets/{index-Dswa3EzJ.js → index-Ds3fQe8k.js} +1 -1
- package/dist/assets/{index-Cyof-eFv.js → index-LWlg87mc.js} +1 -1
- package/dist/assets/{index-D-iEs16m.js → index-QA5EYQmg.js} +2 -2
- package/dist/assets/index-i1zScItT.js +1 -0
- package/dist/assets/{lexical-CMmB3hg4.js → lexical-Dn1INXtc.js} +1 -1
- package/dist/assets/{liveblocks-DuKOLlGn.js → liveblocks-9BgV5FgM.js} +1 -1
- package/dist/assets/{lottie-BzC_z70r.js → lottie-XIGGYNiw.js} +1 -1
- package/dist/assets/{mui-BKTsYfTF.js → mui-fAmxa5Xh.js} +1 -1
- package/dist/assets/{pathToGoBack-DuG_pESe.js → pathToGoBack-DYMk9yrd.js} +1 -1
- package/dist/assets/{pdf-DKctSUPl.js → pdf-DKSy7px9.js} +3 -3
- package/dist/assets/{pdf-lib-CFnSeXgz.js → pdf-lib-QGtQfDJE.js} +1 -1
- package/dist/assets/{plaid-BDw9fPCd.js → plaid-DVpb3qqP.js} +1 -1
- package/dist/assets/{pusher-C3OEsBE6.js → pusher-XpoFJ9aT.js} +1 -1
- package/dist/assets/{react-7DVU8bop.js → react-BapJ6S9j.js} +1 -1
- package/dist/assets/{react-D6FwTuSW.js → react-BsGlkpw5.js} +1 -1
- package/dist/assets/{react-w6DB2NS-.js → react-DhbVKugu.js} +1 -1
- package/dist/assets/{react-DX8ScWZU.js → react-DmZJuUHn.js} +1 -1
- package/dist/assets/{react-CJKpxSUM.js → react-M8FR3LMy.js} +1 -1
- package/dist/assets/{react-CyKriL-x.js → react-lgFVK-Yq.js} +1 -1
- package/dist/assets/{recharts-DDgm0ZY-.js → recharts-BW5HAPx6.js} +1 -1
- package/dist/assets/{routePaths-D5pZG1HW.js → routePaths-CrSok7sW.js} +1 -1
- package/dist/assets/{sentry-8NyHUHYi.js → sentry-p6MzREFX.js} +1 -1
- package/dist/assets/{url-KL9dl4eL.js → url-BNGZMs7z.js} +1 -1
- package/dist/assets/{url-Ch2k8kvj.js → url-VIlXu71o.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Cw-C7Jga.js +1 -0
- package/dist/assets/{useDeviceId-EvuyeVv7.js → useDeviceId-BMD5TpXb.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-B-aMJgNE.js +1 -0
- package/dist/assets/useInitialThreadRequest-BV5Gn6Hv.js +1 -0
- package/dist/assets/{utils-BgDKBMSG.js → utils-D1SR7NNe.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BxWHMEM-.js → withTransactionSidePanel-CaYRSAqs.js} +2 -2
- package/dist/assets/zeni-epic-state-Crbh9Aj_.js +14 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-1NXz8t4Q.js +0 -1
- package/dist/assets/AddressScreen-DcX4lc_F.js +0 -9
- package/dist/assets/AiCfoScreen-B-SD-BvW.js +0 -11
- package/dist/assets/BillPayApprovalRoutes-Basd0KQv.js +0 -1
- package/dist/assets/ChargeCardRoutes-CZHJ2f3S.js +0 -71
- package/dist/assets/CompanyPassportScreen-DMNbV7xV.js +0 -1
- package/dist/assets/ConnectionAuthScreen-DQHN7Yil.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-DWZf1W12.js +0 -1
- package/dist/assets/DefaultTenantHome-gdhC8rFn.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-CwGd9Q26.js +0 -18
- package/dist/assets/DrawerScreen-DApdgXsr.js +0 -1
- package/dist/assets/EntityDetailRoutes-CGMIAqZF.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-RczgWR48.js +0 -25
- package/dist/assets/FeaturePreviewScreen-DukdbkDU.js +0 -1
- package/dist/assets/MagicLinkRoutes-CJq_o8r6.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-Cq-_I3N7.js +0 -12
- package/dist/assets/MobileAppDrawer-B0SDRa0y.js +0 -1
- package/dist/assets/NotFoundScreen-DnYi4Alo.js +0 -1
- package/dist/assets/OAuthConsentScreen-C4y7IeaO.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BegSQYJd.js +0 -1
- package/dist/assets/PeopleRoutes-CaRj4nPy.js +0 -22
- package/dist/assets/PerformanceRoutes-BmdUlT3Y.js +0 -1
- package/dist/assets/ReferralListScreen-Ih6wu8ZB.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-B07Q_12k.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-Cs1Oz67I.js +0 -1
- package/dist/assets/ReportsRoutes-IDUQFhiX.js +0 -1
- package/dist/assets/RewardsRoutes-DsoF8WDm.js +0 -1
- package/dist/assets/ScreenRoutes-q84xLWb1.js +0 -2
- package/dist/assets/SignOutScreen-syLC8-ZX.js +0 -9
- package/dist/assets/TaskListScreen-Ute_eU7l.js +0 -9
- package/dist/assets/TaskRoutes-BqaUB3X4.js +0 -9
- package/dist/assets/TransactionDetailRoutes-RdDsGxG0.js +0 -1
- package/dist/assets/TransactionDetailScreen-B71792qc.js +0 -5
- package/dist/assets/TransactionListRoutes-Blo9KvRe.js +0 -1
- package/dist/assets/WiseConfirmationScreen-iZmAunYq.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-DLzmrfoy.js +0 -9
- package/dist/assets/empty-BOUM9tFw.js +0 -1
- package/dist/assets/epic-CWSv6htf.js +0 -2
- package/dist/assets/getLocaleForTenant-j9oTpFdD.js +0 -1
- package/dist/assets/index-CAPfyPqh.js +0 -2
- package/dist/assets/index-qc05mnSq.js +0 -1
- package/dist/assets/index-vkGyITuL.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Yc6V_8SE.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-Dl_AzQW_.js +0 -1
- package/dist/assets/useInitialThreadRequest-DWCinY7g.js +0 -1
- package/dist/assets/zeni-epic-state-CrPv4S-z.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-9BgV5FgM.js";import{A as d}from"./AddressScreen-CqN2m8jr.js";import i from"./NotFoundScreen-qOlBSqQS.js";import"./sentry-p6MzREFX.js";import{n as s,o as r}from"./core-nI7qhWxF.js";import"./zeni-epic-state-Crbh9Aj_.js";import"./recharts-BW5HAPx6.js";import"./index-DOZAHQPK.js";import"./mui-fAmxa5Xh.js";import"./analytics-D8oYfpTm.js";import"./plaid-DVpb3qqP.js";import"./dnd-C_C-95qu.js";import"./stripe-DMRn4zHo.js";import"./lottie-XIGGYNiw.js";import"./lexical-Dn1INXtc.js";import"./pdf-DKSy7px9.js";import"./utils-D1SR7NNe.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 r}from"./liveblocks-9BgV5FgM.js";import{a as h}from"./sentry-p6MzREFX.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-nI7qhWxF.js";import{r as $,h as D,z as L,j as K,B as N,C as R,c as C,e as m,v as z,i as b,w as F}from"./index-DOZAHQPK.js";import{I$ as k,gM as U,eN as G,J0 as J,c0 as O,J1 as V,k6 as q}from"./zeni-epic-state-Crbh9Aj_.js";import{n as H}from"./mui-fAmxa5Xh.js";import Q from"./NotFoundScreen-qOlBSqQS.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]="4d953604-22ad-4c73-b593-fc9d2fe80b03",e._sentryDebugIdIdentifier="sentry-dbid-4d953604-22ad-4c73-b593-fc9d2fe80b03")}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=G(e),a=t.roleMap!=null&&J(t.roleMap),d=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:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=F(d?.pathnameStackToGoBack);let s=n.poppedPathname??w();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=Y(a);e(q({addressType:c,addressToCreate:d})),C?.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 re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=_(),n=j(),{addressId:s,addressType:u}=E(),g=$(),I=D(),v=L.getSignedInUser(),[f,x]=h.useState(s==null),p=B(S=>s!=null?k(S,s).fetchState:"Not-Started"),A=K();if(v==null)throw Error("Can't access address page without signing in...");const P=S=>S.trackPageLoaded(s!=null?m.Event.editAddress:m.Event.addAddress),y=l??u;return h.useEffect(()=>{f||s==null||(x(!0),d(U(s,!1)))},[f,s,d]),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"?r.jsx(N,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(R,{analytics:C,onLoad:P}),r.jsx(W,{windowSize:g,children:r.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):r.jsx(Q,{})}const w=(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{re as A,Y as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{j as h}from"./liveblocks-9BgV5FgM.js";import{a as r}from"./sentry-p6MzREFX.js";import{h as oe,j as ne,u as ie,g as j,l as re,k as le}from"./core-nI7qhWxF.js";import{M as ce,cG as ue,z as de,r as me,cH as pe,cI as fe,cJ as he,cK as q,C as Se,c as U,R as G,cL as ge,cM as Ce,e as be,a1 as ke,cN as we,U as Ie,y as Pe,w as V,aY as Ee,cO as Te}from"./index-DOZAHQPK.js";import{fD as ye,f2 as H,eN as _e,hq as xe,Px as Ue,eM as ve,hA as Ae,hw as Oe,ft as Qe,fn as De,fg as Fe,fk as $,fo as Le,fp as Me,fq as Be,fr as Re,fs as Ne}from"./zeni-epic-state-Crbh9Aj_.js";import{D as je,n as v,P as Ge,S as Ve}from"./mui-fAmxa5Xh.js";import{p as $e}from"./pathToGoBack-DYMk9yrd.js";import"./recharts-BW5HAPx6.js";import"./analytics-D8oYfpTm.js";import"./plaid-DVpb3qqP.js";import"./dnd-C_C-95qu.js";import"./stripe-DMRn4zHo.js";import"./lottie-XIGGYNiw.js";import"./lexical-Dn1INXtc.js";import"./pdf-DKSy7px9.js";import"./utils-D1SR7NNe.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]="ba438b7c-a92b-4c49-999c-5f04afc3a898",s._sentryDebugIdIdentifier="sentry-dbid-ba438b7c-a92b-4c49-999c-5f04afc3a898")}catch{}})();const W="chat-response-generated",qe=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=Me(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:P}=q(S,t);c!=="answer"?U.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(P,I),n.metadata.message_id??null):U.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(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Ne({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($(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Le(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??$e(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s($(""))},togglePageView:()=>{const e=V(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}})(ke(we)),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,b=C?.aiCfoInitialQuestion,O=!!C?.aiCfoShouldSubmit,[z,E]=r.useState(null),[Y,T]=r.useState(!1),Q=r.useRef(!1);r.useEffect(()=>{Q.current||b==null||b===""||(E(b),T(O),Q.current=!0)},[b,O]);const J=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,L=r.useRef(!1);r.useEffect(()=>{L.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),L.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(E(k),T(!0),a(Ue()))},[k,t,a]);const K=c.masterTOSInfo,w=K?.isMasterTOSAccepted??!1,{visitedSessions:M}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),N=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=q(N,t),X=Z.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),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(ve({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:M.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[M]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Oe(t,e.userId))},[B,R,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:U,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),G(n)&&A.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:N,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:Y,onEmailLinkQuestionProcessed:J,onMenuClick:G(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:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Qe(c.userRoleId)),f(!1)}})})})]})},He=v(Ve)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,We=v.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,ze=v(Ge)`
|
|
9
|
+
box-shadow: ${({theme:s})=>s.colors.elevation2};
|
|
10
|
+
color: ${({theme:s})=>s.colors.grey4};
|
|
11
|
+
`;export{dt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-9BgV5FgM.js";import{a as y}from"./sentry-p6MzREFX.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-nI7qhWxF.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-Crbh9Aj_.js";import{h as P,z as k,B as _,a1 as X,by as G,ab as V,bz as H}from"./index-DOZAHQPK.js";import"./mui-fAmxa5Xh.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-DHB0Y6Ez.js";import K from"./NotFoundScreen-qOlBSqQS.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,23 +1,23 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-DuKOLlGn.js";import{j as K,h as se,u as X,l as ae,g as v,N as te,k as Y,i as na,n as ia,o as S}from"./core-Chn6k0lm.js";import{eO as Z,LX as Ue,bv as It,GS as oa,bo as wt,bE as pe,LY as xt,wt as Bt,xD as Ve,x0 as la,bn as De,LZ as sa,L_ as ra,c1 as ca,L$ as da,jr as Ct,M0 as At,M1 as Et,yc as _e,wI as Ce,M2 as ua,wh as tt,M3 as pa,Bo as ma,wl as ba,wr as Dt,M4 as ke,M5 as Ge,xE as Oe,M6 as ha,M7 as ga,xH as Ne,M8 as ya,xU as Sa,M9 as jt,xo as at,xt as fa,Ma as ka,Mb as ue,Mc as Tt,Md as Pt,Me as Ft,fI as va,wN as $e,cw as Rt,Mf as Ia,gD as wa,Mg as xa,Mh as Ba,eU as Mt,eS as Vt,Mi as ze,Mj as Ca,Mk as Aa,JG as Ze,Ml as Ea,JH as oe,JI as He,Mm as Da,Mn as ja,Mo as Ta,xv as nt,xs as Pa,Mp as Fa,Mq as Ra,Mr as Ma,xe as Va,Ms as $a,Mt as La,Mu as Ua,ck as $t,cM as Lt,jC as _a,bK as Ga,bq as Ut,bL as _t,vz as Oa,Mv as Na,Bb as za,Bh as Za,s6 as Ha,xF as Wa,yj as qa,jP as fe,Mw as Ja,Mx as Gt,kh as Ka,jJ as Ot,k2 as Nt,k1 as it,bD as be,bJ as Xa,My as Ya,Mz as ve,il as Qa,MA as ot,MB as en,iq as tn,iL as an,yx as nn,MC as on,ka as ln,yn as sn,MD as lt,yr as rn,yw as cn,yt as dn,yl as un,ME as zt,wC as pn,MF as mn,MG as bn,fA as hn,fz as gn,fy as yn,jS as Sn,k8 as st,kj as fn,pF as kn,j$ as vn,yp as In,iw as wn,ko as xn,MH as Bn,io as Cn,pw as An,MI as En,xk as Dn,bF as jn,bs as Tn,IC as Pn,cO as Fn,cN as Rn,cv as Mn,cB as Vn}from"./zeni-epic-state-CrPv4S-z.js";import{m as me,z as M,I as Ie,C as le,$ as y,aK as Ae,B as re,d as A,x as je,c as D,b6 as $n,p as z,X as We,s as E,Z as we,b7 as rt,b8 as ct,b9 as Ln,ah as Un,F as _n,aE as Gn,A as Zt,D as qe,J as Je,ba as On,aq as Ht,bb as Nn,U as zn,f as Wt,a3 as Zn,bc as Hn,bd as Wn,be as qn,bf as Jn,bg as Kn,bh as Xn,bi as Yn,bj as Qn,bk as ei,H as ti,bl as ai,b2 as ni,bm as ii,bn as oi,a6 as li}from"./index-BreaiJNl.js";import{n as L,S as si}from"./mui-BKTsYfTF.js";import{A as dt}from"./AddressScreen-DcX4lc_F.js";import{g as ie,a as Te,i as qt,V as Ke,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-CwGd9Q26.js";import{a as f}from"./sentry-8NyHUHYi.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-Yc6V_8SE.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-Dl_AzQW_.js";import{u as Jt}from"./useInitialThreadRequest-DWCinY7g.js";import Ee from"./NotFoundScreen-DnYi4Alo.js";import{D as ui}from"./DrawerScreen-DApdgXsr.js";import{M as Kt}from"./MobileAppDrawer-B0SDRa0y.js";import{F as Xt}from"./FeaturePreviewScreen-DukdbkDU.js";import{S as Pe}from"./SetupPagesScreen-C4GjXjRP.js";import{B as pi}from"./BillPayApprovalRoutes-Basd0KQv.js";import{FallBackRoute as mi}from"./ScreenRoutes-q84xLWb1.js";import"./recharts-DDgm0ZY-.js";import"./analytics-CX30pJB4.js";import"./plaid-BDw9fPCd.js";import"./dnd-CKKgQZIG.js";import"./stripe-DMRn4zHo.js";import"./lottie-BzC_z70r.js";import"./lexical-CMmB3hg4.js";import"./pdf-DKctSUPl.js";import"./utils-BgDKBMSG.js";import"./analyticsHelper-SG8tB9jY.js";import"./routePaths-D5pZG1HW.js";import"./BusinessVerificationPageScreen-B-O4fGng.js";import"./ReimbursementApprovalRuleDetailScreen-Cs1Oz67I.js";import"./getLocaleForTenant-j9oTpFdD.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]="90ac5f16-65c7-4555-bcd0-c7e6a06af480",e._sentryDebugIdIdentifier="sentry-dbid-90ac5f16-65c7-4555-bcd0-c7e6a06af480")}catch{}})();const bi=Y(function(e,t){const l=Ue(e,t.billId),i=M.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.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 n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})($n);function hi(){const e=K(),t=se(),l=X(),{billId:i}=ae(),c=me(),r=M.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});Qe({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:U}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=U(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:J}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,Q,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,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(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=M.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=M.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Ne(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=M.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,U]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const J=v(F=>Ue(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Q=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Oe(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(U(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(U(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Ne(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Q}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Ln,{}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Me,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
2
|
-
${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=
|
|
1
|
+
import{j as a}from"./liveblocks-9BgV5FgM.js";import{j as K,h as se,u as Q,l as ae,g as v,N as te,k as X,i as na,n as ia,o as S}from"./core-nI7qhWxF.js";import{eN as Z,LA as Me,bv as It,GD as oa,bo as wt,bD as pe,LB as xt,ws as Bt,xC as Ve,w$ as la,bn as De,LC as sa,LD as ra,c0 as ca,LE as da,jq as Ct,LF as At,LG as Et,yb as _e,wH as Ce,LH as ua,wg as tt,LI as pa,Bn as ma,wk as ba,wq as Dt,LJ as ke,LK as Ge,xD as Ne,LL as ha,LM as ga,xG as Oe,LN as ya,xT as Sa,LO as jt,xn as at,xs as fa,LP as ka,LQ as ue,LR as Tt,LS as Pt,LT as Ft,fH as va,wM as $e,cv as Rt,LU as Ia,gC as wa,LV as xa,LW as Ba,eT as Lt,eR as Vt,LX as ze,LY as Ca,LZ as Aa,Jj as Ze,L_ as Ea,Jk as oe,Jl as He,L$ as Da,M0 as ja,M1 as Ta,xu as nt,xr as Pa,M2 as Fa,M3 as Ra,M4 as La,xd as Va,M5 as $a,M6 as Ua,M7 as Ma,cj as $t,cL as Ut,jB as _a,bJ as Ga,bq as Mt,bK as _t,vy as Na,M8 as Oa,Ba as za,Bg as Za,s5 as Ha,xE as Wa,yi as qa,jO as fe,M9 as Ja,Ma as Gt,kg as Ka,jI as Nt,k1 as Ot,k0 as it,bC as be,bI as Qa,Mb as Xa,Mc as ve,ik as Ya,Md as ot,Me as en,ip as tn,iK as an,yw as nn,Mf as on,k9 as ln,ym as sn,Mg as lt,yq as rn,yv as cn,ys as dn,yk as un,Mh as zt,wB as pn,Mi as mn,Mj as bn,fz as hn,fy as gn,fx as yn,jR as Sn,k7 as st,ki as fn,pE as kn,j_ as vn,yo as In,iv as wn,kn as xn,Mk as Bn,im as Cn,pv as An,Ml as En,xj as Dn,bE as jn,bs as Tn,Ik as Pn,cN as Fn,cM as Rn,cu as Ln,cA as Vn}from"./zeni-epic-state-Crbh9Aj_.js";import{h as me,z as L,j as Ie,p as le,m as y,aJ as Ae,B as re,o as A,C as je,c as D,b5 as $n,w as z,U as We,y as E,r as we,b6 as rt,b7 as ct,b8 as Un,ag as Mn,H as _n,aD as Gn,F as Zt,D as qe,J as Je,b9 as Nn,ap as Ht,ba as On,N as zn,e as Wt,a1 as Zn,bb as Hn,bc as Wn,bd as qn,be as Jn,bf as Kn,bg as Qn,bh as Xn,bi as Yn,bj as ei,A as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a5 as li}from"./index-DOZAHQPK.js";import{n as U,S as si}from"./mui-fAmxa5Xh.js";import{A as dt}from"./AddressScreen-CqN2m8jr.js";import{g as ie,a as Te,i as qt,V as Ke,b as Qe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-DZ1aEjMk.js";import{a as f}from"./sentry-p6MzREFX.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-Cw-C7Jga.js";import{c as Ye}from"./useFetchSuggestedQuestionsWhenReady-B-aMJgNE.js";import{u as Jt}from"./useInitialThreadRequest-BV5Gn6Hv.js";import Ee from"./NotFoundScreen-qOlBSqQS.js";import{D as ui}from"./DrawerScreen-CR4GTmpO.js";import{M as Kt}from"./MobileAppDrawer-CanZHImd.js";import{F as Qt}from"./FeaturePreviewScreen-C-DrdhwC.js";import{S as Pe}from"./SetupPagesScreen-D3DtxfXm.js";import{B as pi}from"./BillPayApprovalRoutes-4zgtGZR2.js";import{FallBackRoute as mi}from"./ScreenRoutes-D7TgV1r1.js";import"./recharts-BW5HAPx6.js";import"./analytics-D8oYfpTm.js";import"./plaid-DVpb3qqP.js";import"./dnd-C_C-95qu.js";import"./stripe-DMRn4zHo.js";import"./lottie-XIGGYNiw.js";import"./lexical-Dn1INXtc.js";import"./pdf-DKSy7px9.js";import"./utils-D1SR7NNe.js";import"./analyticsHelper-DBHckA8w.js";import"./routePaths-CrSok7sW.js";import"./BusinessVerificationPageScreen-CDrDTvtJ.js";import"./ReimbursementApprovalRuleDetailScreen-DHB0Y6Ez.js";import"./getLocaleForTenant-BT8jU8Uf.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]="106d6a2f-5dca-4348-9e74-e779d9698f7c",e._sentryDebugIdIdentifier="sentry-dbid-106d6a2f-5dca-4348-9e74-e779d9698f7c")}catch{}})();const bi=X(function(e,t){const l=Me(e,t.billId),i=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.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 n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})($n);function hi(){const e=K(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=L.getSignedInUser(),u=Ie(),o=v(N=>Z(N)),s=v(N=>Me(N,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});Ye({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:M}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=M(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:J}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(N=>N.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,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(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:N=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(N)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=L.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ne(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,M]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const J=v(F=>Me(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Ne(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?M(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(M(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(M(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const N={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Le,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Le,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Mn,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:N,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Le,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Nn();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
2
|
+
${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=U.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
5
5
|
margin-left: ${A.sp5};
|
|
6
6
|
position: absolute;
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
9
|
-
`,ki=
|
|
9
|
+
`,ki=U.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
justify-content: center;
|
|
12
12
|
align-items: center;
|
|
13
13
|
padding-top: 9px;
|
|
14
14
|
gap: ${A.sp2};
|
|
15
15
|
margin-bottom: -${A.sp2};
|
|
16
|
-
`,vi=
|
|
16
|
+
`,vi=U(Je.StandardMedium)``,Ii=U(e=>f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M3.35001 15L3.35001 10.125C3.35001 6.81129 6.0363 4.125 9.35001 4.125H16.475M16.475 4.125L13.85 1.5M16.475 4.125L13.85 6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M20.6 9V13.875C20.6 17.1887 17.9137 19.875 14.6 19.875H7.47501M7.47501 19.875L10.1 22.5M7.47501 19.875L10.1 17.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))`
|
|
17
17
|
color: ${e=>e.theme.colors.hero};
|
|
18
18
|
height: ${A.sp3};
|
|
19
19
|
width: ${A.sp3};
|
|
20
|
-
`,
|
|
20
|
+
`,Xt=U(e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})))`
|
|
21
21
|
width: ${A.sp3};
|
|
22
22
|
height: ${A.sp3};
|
|
23
23
|
cursor: pointer;
|
|
@@ -25,7 +25,7 @@ import{j as a}from"./liveblocks-DuKOLlGn.js";import{j as K,h as se,u as X,l as a
|
|
|
25
25
|
&:hover {
|
|
26
26
|
color: ${e=>e.theme.colors.primary};
|
|
27
27
|
}
|
|
28
|
-
`,Fe=
|
|
28
|
+
`,Fe=U.div`
|
|
29
29
|
display: flex;
|
|
30
30
|
height: 100vh;
|
|
31
31
|
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
@@ -43,7 +43,7 @@ import{j as a}from"./liveblocks-DuKOLlGn.js";import{j as K,h as se,u as X,l as a
|
|
|
43
43
|
z-index: 3;
|
|
44
44
|
display: ${e=>e.windowSize==="small"?"none":"block"};
|
|
45
45
|
}
|
|
46
|
-
`,Re=
|
|
46
|
+
`,Re=U.div`
|
|
47
47
|
position: absolute;
|
|
48
48
|
top: 56px;
|
|
49
49
|
left: 0;
|
|
@@ -51,7 +51,7 @@ import{j as a}from"./liveblocks-DuKOLlGn.js";import{j as K,h as se,u as X,l as a
|
|
|
51
51
|
height: 1px;
|
|
52
52
|
background-color: ${e=>e.theme.colors.grey2};
|
|
53
53
|
z-index: 3;
|
|
54
|
-
`,mt=
|
|
54
|
+
`,mt=U.div`
|
|
55
55
|
position: fixed;
|
|
56
56
|
top: 0;
|
|
57
57
|
left: 0;
|
|
@@ -59,25 +59,25 @@ import{j as a}from"./liveblocks-DuKOLlGn.js";import{j as K,h as se,u as X,l as a
|
|
|
59
59
|
bottom: 0;
|
|
60
60
|
background-color: ${_n.overlayBackgroundBlack};
|
|
61
61
|
z-index: 5;
|
|
62
|
-
`,
|
|
62
|
+
`,Le=U.div`
|
|
63
63
|
display: flex;
|
|
64
64
|
flex-direction: column;
|
|
65
65
|
width: ${e=>`${gi.containerWidth.value(e.windowSize)}%`};
|
|
66
66
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
67
|
-
`,wi=
|
|
67
|
+
`,wi=U(Je.H6Regular)`
|
|
68
68
|
margin-top: ${A.sp7};
|
|
69
69
|
padding-left: ${A.sp8};
|
|
70
70
|
padding-right: ${A.sp8};
|
|
71
71
|
color: ${e=>e.theme.colors.primary};
|
|
72
72
|
word-break: break-word;
|
|
73
|
-
`,xi=
|
|
73
|
+
`,xi=U(Je.LargeRegularSp)`
|
|
74
74
|
color: ${e=>e.theme.colors.hero};
|
|
75
75
|
padding-left: ${A.sp8};
|
|
76
76
|
padding-right: ${A.sp8};
|
|
77
77
|
margin-bottom: 30px;
|
|
78
78
|
margin-top: ${A.sp4};
|
|
79
79
|
white-space: pre-line;
|
|
80
|
-
`,Bi=
|
|
80
|
+
`,Bi=X(function(e,t){return{billsReviewView:jt(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(ue())},onCloseReviewItem:l=>{e(ka(l))},onProceedForBulkActionClick:(l,i)=>{switch(l){case"send_for_approval":e(fa());break;case"approve":case"review":e(at("approved",i??""));break;case"reject":e(at("rejected",i??""))}}}})(On);function Ci(){const e=K(),t=v(i=>i.billsBulkActionViewState.bulkSubmissionFetchState.fetchState),{billsForReview:l}=v(i=>jt(i));return f.useEffect(()=>{t!=="Completed"&&l.length!==0||e("./")},[t,l.length]),a.jsx(Bi,{navigate:e,analytics:D})}const ne=Aa(),Yt="bulk-operation-update",Ue="bill-approval-rule-update",{spendManagement:Ai,common:bt}=qe.getLocalizedStrings(),ht=Ai.billPay.bulkActions,Ei=U.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
min-height: 100%;
|
|
83
83
|
width: 100%;
|
|
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-DuKOLlGn.js";import{j as K,h as se,u as X,l as a
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,Di=
|
|
88
|
+
`,Di=X(function(e,t){const l=L.getSignedInUser(),i=De(l),c=Ft(e,ne,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter(b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted"):t.roleMap.bill_pay_approver&&(r=r.filter(b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted"))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter(b=>b!=="deleted"));const u=e.entityAutoCompleteState.autoCompleteText.common,o=Ze(e,"common"),s=e.tenantState.currentTenantId,n=Z(e),d=n?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,h=c.fetchState,g=Ea(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:h,analytics:D,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ne,spendManagementEndPoint:`${We}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:i,billPayApprovalRulesAffectedEntityIds:g.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:i,location:c,period:r}=t,{tenantEmailDomain:u}=i;return{updateTabToState:o=>{e(ue()),e(Tt(o))},onSubtabChange:o=>{e(ue()),e(Pt(o))},onTransactionClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);l(n,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ti(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;D?.trackBillPayNewBill();const s=`/${o}/bill/new`,n=E(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:n}})},onSearchTextChanged:o=>{e($a(o))},onReloadTransactions:()=>{e($e(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e(Va(i.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(La({filters:o})),o.categories.every(s=>s.field!=null&&s.values?.length!==0)&&D.trackSpendManagmentFilterChange("bill_pay",o.categories.map(s=>`${s.field}-${JSON.stringify(s.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&D.trackSpendManagementDownloadClick("bill_pay"),e(Ra({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Fa(o))},removeAllTransactionsFromBulkActionList:()=>{e(ue())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Pa(o,s??""));break;case"send_for_approval":e(nt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(nt("approve")),t.navigate("./bulk-review");break;case"review":e(Ta()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Ue)&&e(ja(!1))},onEventReceived:o=>{o===Yt&&e(Da())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(He({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}}}})(Zn(Hn));function ji(){const e=K(),t=se(),l=Q(),i=we(),c=l.state,r=Ie(),[u,o]=f.useState(!1),[s,n]=f.useState(null),d=na("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(c?.tab!=null&&c?.subTab!=null&&(t(Tt(c?.tab)),t(Pt(c?.subTab))),()=>{t(ue())}),[]);const p=L.getSignedInUser(),m=v(P=>Z(P)),{areTenantIdsInSync:h}=zn(),[g,b]=f.useState(!1),{useFeatureGate:k}=le(),{isFeatureEnabled:j}=k(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:x}=k(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=k(y.isReimbursementCommentingEnabled),{isFeatureEnabled:_}=k(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:T}=k(y.isBillPayBulkActionEnabled),{isFeatureEnabled:M}=k(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:V}=k(y.isBillPayDetectInsufficientFundsEnabled),I=v(P=>Ft(P,ne,T,p?.userId)),{isFeatureEnabled:H}=k(y.isDebitCardFeatureEnabled),G=I.fetchState,{isAiCfoAccessEnabled:C,onAskAiCfoClick:q}=Xe({mobileExploreReferrer:"Bills List"});Ye({isDataReady:G==="Completed"});const W=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,$=!!m.companyBillPayInfo?.info?.isBillPayEnabled,J=v(P=>va(P.companyState,m.companyId)),Y=J?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!g&&$&&h&&(b(!0),t($e(ne,!0,j,M)))},[g,ne,h,t]),p==null)throw Error("Can't access address page without signing in...");const N=(P,de)=>{t(Ca({uiState:{sortKey:P,sortOrder:de},period:ne}))},ee=Rt(r?.loggedInUserRoleMap),F=pe(r?.loggedInUserRoleMap),ce=P=>{o(P)},{billsProcessed:O,billsProcessing:xe}=v(P=>Ia(P));f.useEffect(()=>{O===xe&&s!=null&&(t(wa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:O>1?ht.bills:ht.bill},{variableName:"_has_",variableValue:O>1?bt.texts.have:bt.texts.has},{variableName:"_action_",variableValue:xa(s)}]})),t(Ba()),setTimeout(()=>{t($e(ne,!0,j,!0,M))},3e3),n(null))},[O,xe]);const ea={events:m.companyId!=null?[`private-${m.companyId}.${Yt}`,`private-${m.companyId}.${Ue}`]:[],eventCallback:(P,de,et)=>{P.endsWith(Ue)?et.onBillPayApprovalRulesEventReceived?.(P):de?.entity_type==="bill"&&(n(de.operation_type),et.onEventReceived(P))}},ta=Lt(H,m),aa=Vt(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?ta===!0||aa===!0?a.jsx(Qt,{}):$?a.jsxs(a.Fragment,{children:[G==="Completed"?a.jsx(je,{analytics:D,onLoad:P=>(de=>de.trackPageLoaded(Wt.Event.billPayHome))(P)}):null,a.jsxs(Ei,{windowSize:i,children:[a.jsx(Kt,{isAppContentDrawerOpen:u,handleDrawerToggle:ce}),a.jsx(ui,{isOpen:d,drawerLeftMargin:new Zt(0,0,300,600),onClose:()=>{e("./"),t(ue())},children:a.jsx(Pi,{onClick:P=>P.stopPropagation(),children:a.jsx(Ci,{})})}),a.jsx(Di,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:x,isReimbursementCommentingEnabled:B,period:ne,isAdmin:!1,uiState:I.uiState,onColumnSortConfigChanged:N,isUserHasOnlyBillpayAccess:ee,isShowDeletedBillsEnabled:j,isShowDeletedReimbursementEnabled:_,isBulkActionEnabled:T,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ce(!0)},isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:Y,bulkSubmissionLimit:I.billBulkSubmissionLimit,bulkSubmissionFetchState:I.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:I.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:M,isDetectInsufficientFundsEnabled:V,isAiCfoAccessEnabled:C,onAskAiCfoClick:q,...ea})]})]}):W===!0&&F===!0?a.jsx(te,{to:"../setup"}):r!=null&&ze(m,r.loggedInUserRoleMap)?a.jsx(te,{to:"../promo"}):a.jsx(re,{fetchState:G}):a.jsx(Ee,{})}const Ti=e=>`/${e}/bills/setup`,Pi=U(si)`
|
|
89
89
|
display: flex;
|
|
90
90
|
min-height: 100%;
|
|
91
91
|
flex-direction: column;
|
|
92
|
-
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=qe.getLocalizedStrings(),Mi=Y(function(e,t){const l=M.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let n=`${l?.firstName} ${l?.lastName}`;const d=De(l);t.billId!=null&&t.billDetailsView!=null&&(n=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(n="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ga(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=Ut(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,k=h.add(b,"month").isAfter(g),j=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!_t(p,t.billDetailsView.approvalRules.allApprovalRules,l),x=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Ct(e),billId:t.billId,createdBy:n,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${We}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:x.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:j,isZeniUser:d,isNewUser:k,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:i,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:n=>{e(it(n));const d=yt(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:n=>{const d=n??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Ot(d,!1)),e(Nt({localData:{vendorName:n??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(it());const p=yt(s,void 0,l),m=E(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:n=>{n!=null&&e(Ne(n,t.isVendorRecommendationEnabled))},updateShowAutofill:n=>{e(Oe(n))},onSaveChangesToLocalStore:(n,d,p,m,h)=>{const g=Ui(t.billDetailsView,{...n,paymentDetails:{...n?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ka({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(_e("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Gt("draft"))},reviewBillDetails:()=>{const n=Vi(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:n})=>{e(ke({billId:n}))},clearBillPayReviewLocalState:()=>e(Ja()),onClickDismiss:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:n=>{if(n==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:n=>{e(fe(!1,n));const d=$i(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:n=>{e(fe(!1,n));const d=Li(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:n=>{e(fe(!1,n));const d=qt(s,l,n),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(n,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(n,d)=>{const p=Te(s,n,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:n.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(n,d){e(qa(n,d,l))},onWiseVerifyClick:()=>{let n="";n=Kn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${n}/login`;window.open(d,"_blank")},onVendorSelected:n=>{e(Wa(!0,n,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:(n,d)=>{e(Ha("bill_pay_detail",n,d))},onEstablishConnectionClick:n=>{e(Za(n,i,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(n,d,p)=>{e(za(n,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Oa("bill_pay","bill_pay_detail")),e(Na({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Wn);function gt(){const e=K(),t=X(),l=se(),{billId:i,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:n}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:k}=r(y.isOurDisabled),{isFeatureEnabled:j}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:x}=u(Ae.zeniAccountsConfig),B=La(x),{configValue:_}=u(Ae.sameDayAchDisablementConfig),T=Ua(_),U=M.getSignedInUser(),V=v(N=>Z(N)),I=v(N=>Ge(N,m,g,i)),H=Jt(V?.companyId,{clearParams:I.fetchState==="Completed"}),{isAiCfoAccessEnabled:G,onAskAiCfoClick:C}=Ye({mobileExploreReferrer:"Bill Details"});Qe({isDataReady:I.fetchState==="Completed"});const q=V.companyId??M.getSignedInUserTenant(c)?.companyId,W=!!V.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=Ie(),J=$t($?.loggedInUserRoleMap),Q=Lt($?.loggedInUserRoleMap),O=pe($?.loggedInUserRoleMap),ee=wt(V.userRole);if(f.useEffect(()=>{i!=null&&l(xt(i))},[i]),U==null)throw Error("Can't access address page without signing in...");const F=v(N=>_a(N.accountState,N.accountListState,"billPayAccountList")),ce={pathname:"../",search:t.search};return I.isDeleted===!0||I.billStage=="paid"||I.fetchState=="Not-Started"?a.jsx(te,{to:ce}):I.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:I.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:N=>(xe=>{i!=null&&I.deleteStatus.fetchState!=="Completed"&&xe.trackBillPayEditBill(i,I.isRecurring)})(N)}),a.jsx(Mi,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:V,billId:i,companyId:q,billDetailsView:I,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:F,isInternationalPaymentShaVsOurEnabled:n,vendor:I.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:k,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:W,hasZeniAccountsAdminAccess:J,isZeniAccountsUser:Q,isBillPayAdmin:O,isSuperAdmin:ee,accountsPromoConfig:B,isDetectInsufficientFundsEnabled:j,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:G,onAskAiCfoClick:C})]})}const yt=(e,t,l)=>{let i=`/${e}/bill/`;return l==null?i=t!=null?i.concat(`new/vendor/${encodeURIComponent(t)}/edit`):i.concat("new/vendor/create"):(i=i.concat(`${encodeURIComponent(l)}/edit/vendor/`),i=t!=null?i.concat(`${encodeURIComponent(t)}/edit`):i.concat("create")),i},Vi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},$i=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),i},Li=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),i},R="paymentDetails",Ui=(e,t,l,i,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Ut(),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[R]?.paymentDate?be(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[R]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(Xa)&&u?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},n=r?.type==="Contact"?r?.email:void 0,d=!!n,p=t[R]?.recurringPaymentType?.selectedOption===Fi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Ya(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},h=_i(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,i,l),g=Object.keys(h).length>0?qn(h):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:g,recipientTotalAmount:g,file:e.file,updatesByLineId:h,toAccountVendorEmail:n,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},_i=(e,t,l,i,c,r)=>{const u={};return i.forEach(o=>{let s,n;o.account.selectedOption!=null&&(s=e.find(p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(n=t.find(p=>p.classId===o.class.selectedOption));const d=Jn(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??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:n,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},Gi=L.div`
|
|
92
|
+
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=qe.getLocalizedStrings(),Li=X(function(e,t){const l=L.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let n=`${l?.firstName} ${l?.lastName}`;const d=De(l);t.billId!=null&&t.billDetailsView!=null&&(n=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(n="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ga(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=Mt(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,k=h.add(b,"month").isAfter(g),j=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!_t(p,t.billDetailsView.approvalRules.allApprovalRules,l),x=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Ct(e),billId:t.billId,createdBy:n,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${We}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:x.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:j,isZeniUser:d,isNewUser:k,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:i,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:n=>{e(it(n));const d=yt(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:n=>{const d=n??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Nt(d,!1)),e(Ot({localData:{vendorName:n??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(it());const p=yt(s,void 0,l),m=E(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:n=>{n!=null&&e(Oe(n,t.isVendorRecommendationEnabled))},updateShowAutofill:n=>{e(Ne(n))},onSaveChangesToLocalStore:(n,d,p,m,h)=>{const g=Mi(t.billDetailsView,{...n,paymentDetails:{...n?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ka({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(_e("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Gt("draft"))},reviewBillDetails:()=>{const n=Vi(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:n})=>{e(ke({billId:n}))},clearBillPayReviewLocalState:()=>e(Ja()),onClickDismiss:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:n=>{if(n==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:n=>{e(fe(!1,n));const d=$i(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:n=>{e(fe(!1,n));const d=Ui(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:n=>{e(fe(!1,n));const d=qt(s,l,n),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(n,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(n,d)=>{const p=Te(s,n,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:n.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(n,d){e(qa(n,d,l))},onWiseVerifyClick:()=>{let n="";n=Kn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${n}/login`;window.open(d,"_blank")},onVendorSelected:n=>{e(Wa(!0,n,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:(n,d)=>{e(Ha("bill_pay_detail",n,d))},onEstablishConnectionClick:n=>{e(Za(n,i,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(n,d,p)=>{e(za(n,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Na("bill_pay","bill_pay_detail")),e(Oa({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Wn);function gt(){const e=K(),t=Q(),l=se(),{billId:i,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:n}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:k}=r(y.isOurDisabled),{isFeatureEnabled:j}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:x}=u(Ae.zeniAccountsConfig),B=Ua(x),{configValue:_}=u(Ae.sameDayAchDisablementConfig),T=Ma(_),M=L.getSignedInUser(),V=v(O=>Z(O)),I=v(O=>Ge(O,m,g,i)),H=Jt(V?.companyId,{clearParams:I.fetchState==="Completed"}),{isAiCfoAccessEnabled:G,onAskAiCfoClick:C}=Xe({mobileExploreReferrer:"Bill Details"});Ye({isDataReady:I.fetchState==="Completed"});const q=V.companyId??L.getSignedInUserTenant(c)?.companyId,W=!!V.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=Ie(),J=$t($?.loggedInUserRoleMap),Y=Ut($?.loggedInUserRoleMap),N=pe($?.loggedInUserRoleMap),ee=wt(V.userRole);if(f.useEffect(()=>{i!=null&&l(xt(i))},[i]),M==null)throw Error("Can't access address page without signing in...");const F=v(O=>_a(O.accountState,O.accountListState,"billPayAccountList")),ce={pathname:"../",search:t.search};return I.isDeleted===!0||I.billStage=="paid"||I.fetchState=="Not-Started"?a.jsx(te,{to:ce}):I.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:I.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(xe=>{i!=null&&I.deleteStatus.fetchState!=="Completed"&&xe.trackBillPayEditBill(i,I.isRecurring)})(O)}),a.jsx(Li,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:V,billId:i,companyId:q,billDetailsView:I,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:F,isInternationalPaymentShaVsOurEnabled:n,vendor:I.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:k,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:W,hasZeniAccountsAdminAccess:J,isZeniAccountsUser:Y,isBillPayAdmin:N,isSuperAdmin:ee,accountsPromoConfig:B,isDetectInsufficientFundsEnabled:j,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:G,onAskAiCfoClick:C})]})}const yt=(e,t,l)=>{let i=`/${e}/bill/`;return l==null?i=t!=null?i.concat(`new/vendor/${encodeURIComponent(t)}/edit`):i.concat("new/vendor/create"):(i=i.concat(`${encodeURIComponent(l)}/edit/vendor/`),i=t!=null?i.concat(`${encodeURIComponent(t)}/edit`):i.concat("create")),i},Vi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},$i=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),i},Ui=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),i},R="paymentDetails",Mi=(e,t,l,i,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[R]?.paymentDate?be(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[R]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(Qa)&&u?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},n=r?.type==="Contact"?r?.email:void 0,d=!!n,p=t[R]?.recurringPaymentType?.selectedOption===Fi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Xa(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},h=_i(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,i,l),g=Object.keys(h).length>0?qn(h):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:g,recipientTotalAmount:g,file:e.file,updatesByLineId:h,toAccountVendorEmail:n,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},_i=(e,t,l,i,c,r)=>{const u={};return i.forEach(o=>{let s,n;o.account.selectedOption!=null&&(s=e.find(p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(n=t.find(p=>p.classId===o.class.selectedOption));const d=Jn(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??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:n,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},Gi=U.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
height: 100vh;
|
|
95
95
|
width: 100%;
|
|
@@ -98,7 +98,7 @@ import{j as a}from"./liveblocks-DuKOLlGn.js";import{j as K,h as se,u as X,l as a
|
|
|
98
98
|
align-items: center;
|
|
99
99
|
background-color: ${e=>e.theme.colors.grey4};
|
|
100
100
|
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
-
`,
|
|
101
|
+
`,Ni=X(function(e,t){const{vendorId:l,billId:i}=t,c=ve(e,l),r=Ge(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,i);return{billId:i,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:l,navigate:i,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(an(s))},onSaveHandler:()=>{e(tn(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:n}=s;e(en({data:n}))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),n=s.poppedPathname??St();i(n,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ot())},onAddressClick:s=>{const n=Qe(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);i(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Ya({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),n=s.poppedPathname??St(0);t.navigate(n,{state:{pathnameStackToGoBack:s.newStack}}),e(ot())}}})(Qn);function Oi(){const e=K(),t=Q(),l=we(),{vendorId:i,billId:c}=ae(),{useFeatureGate:r}=le(),u=me(),o=L.getSignedInUser(),s=v(g=>Z(g)),n=z(t.state?.pathnameStackToGoBack),d=n.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=v(g=>ve(g,i)),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Gi,{windowSize:l,children:[a.jsx(Ke,{vendorId:i,billId:c}),a.jsx(Ni,{location:t,navigate:e,billId:c,vendorId:i,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:h})]})}const St=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},zi=U.div`
|
|
102
102
|
display: flex;
|
|
103
103
|
height: 100vh;
|
|
104
104
|
width: 100%;
|
|
@@ -107,7 +107,7 @@ import{j as a}from"./liveblocks-DuKOLlGn.js";import{j as K,h as se,u as X,l as a
|
|
|
107
107
|
align-items: center;
|
|
108
108
|
background-color: ${e=>e.theme.colors.grey4};
|
|
109
109
|
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
-
`,Zi=
|
|
110
|
+
`,Zi=X(function(e,t){const{vendorId:l}=t,i=ve(e,l),c=l!=null?i.editVendorState?.vendorDetailLocalData?.vendorType:i.newVendorState?.vendorDetailLocalData?.vendorType,r=on(e,c||"international_business",t.billId),u=i.editVendorState??i.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[ln(t.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:i,bankAccountContext:t.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}},function(e,t){const{billId:l,navigate:i,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(un(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,n,d,p)=>{e(cn(s)),p&&e(dn(n,d))},onCurrencyUpdated:(s,n,d)=>{e(rn(s,n,d,!1))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),n=s.poppedPathname??ft();i(n,{state:{pathnameStackToGoBack:s.newStack}})})(),e(lt())},onAddressClick:s=>{const n=Qe(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);i(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(sn({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),n=s.poppedPathname??ft(0);t.navigate(n,{state:{pathnameStackToGoBack:s.newStack}}),e(lt())}}})(Xn);function Hi(){const e=K(),t=Q(),l=we(),{vendorId:i,billId:c}=ae(),r=se(),u=me(),o=L.getSignedInUser(),s=v(B=>Z(B)),n=z(t.state?.pathnameStackToGoBack),[d,p]=f.useState(!1),m=v(B=>B.vendorViewState.newVendorState.fetchStatus.fetchState),h=v(B=>i!=null?B.vendorViewState.editVendorStateById[i]?.fetchStatus.fetchState??"Not-Started":"Not-Started"),g=i!==void 0?h:m;f.useEffect(()=>{d===!1&&g==="Not-Started"&&i!=null&&(r(fe(!1,i)),p(!0))},[d,g,i]);const[b,k]=f.useState(!1);f.useEffect(()=>{b||g==="In-Progress"||(k(!0),r(nn(c,i)))},[b,g,r]);const j=n.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",x=v(B=>ve(B,i));if(o==null)throw Error("Can't access international wire page without signing in...");return j==="billDetail"&&x.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:x.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(zi,{windowSize:l,children:[a.jsx(Ke,{vendorId:i,billId:c}),a.jsx(Zi,{location:t,navigate:e,billId:c,vendorId:i,currentTenant:s,bankAccountContext:j})]})}const ft=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},kt=U.div`
|
|
111
111
|
display: flex;
|
|
112
112
|
height: 100vh;
|
|
113
113
|
width: 100%;
|
|
@@ -116,4 +116,4 @@ import{j as a}from"./liveblocks-DuKOLlGn.js";import{j as K,h as se,u as X,l as a
|
|
|
116
116
|
align-items: center;
|
|
117
117
|
background-color: ${e=>e.theme.colors.grey4};
|
|
118
118
|
box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
-
`,Wi=Y(function(e,t){const l=M.getSignedInUser(),i=zt(e,t.billId),c=mn(e),r=De(l),u=i.totalAmount.amount,o=i.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!_t(u,c.allApprovalRules,l);return{billDetails:i,billId:t.billId,billpayApprovalView:c,analytics:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:i,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ie(c.tenantEmailDomain),s=E(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:i,data:s})),e(_e(o?"paid":"pending_approval",o,!1,i))},discardOutsideZeniPaymentData:()=>{e(At({billId:i}))},updateBillDetailSaveBillCode:()=>{e(Gt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const n=Te(u,o,s);window.open(`${n}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Ce(t.billId,"retry"))}}})(ei);function vt(){const e=K(),t=se(),l=X(),{billId:i}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=M.getSignedInUser(),{isFeatureEnabled:n}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),m=z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(y.isRecurringBillsFeatureEnabled),b=v(x=>Z(x)),k=v(x=>zt(x,i)),j=k.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(`../${i}`)},[]),f.useEffect(()=>{const x=k.vendor?.name,B=k.vendor?.id,_=k.totalAmount.amount,T=k.recipientTotalAmount.amount,U=k.invoiceNumber;x&&B&&t(pn(x,B,_,T,U,i))},[]),h==null)return a.jsx(te,{to:`../${i}`});if(s==null)throw Error("Can't access address page without signing in...");return j==="In-Progress"?a.jsx(kt,{windowSize:o,children:a.jsx(Qn,{})}):a.jsx(kt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:i,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:n,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=Y(function(e,t){const{vendorId:l}=t,i=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=M.getSignedInUser(),s=u.tenantId,n={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:n,analytics:D,vendorSearchAutoCompleteData:{autoCompleteText:i,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:i,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=i;return{onSaveVendor:n=>{e(Cn(u??void 0,t.billId)),n!=null&&e(An(n))},saveVendorDetailLocalData:n=>{e(Nt({vendorId:u,localData:n}))},saveContactsInVendorDetailLocalData:n=>{e(Bn({vendorId:u,contacts:n}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:n=>{e(xn(n))},navigateToBankDetailPage:(n,d)=>{let p;n==="wire"?p=d==="international"?qt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(n,d)=>{e(d===!0?In(n,"vendor",u):wn(n,"vendor",u))},navigateToMailingAddressPage:n=>{const d=Xe(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:n=>{e(vn({files:n}))},onEditFileName:(n,d)=>{e(kn(n,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:n=>{n!=null&&e(Sn(n,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ri(i.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:n.newStack}})},onGetOtp:n=>{e(yn(n,"BillPayVendor"))},onResendOtp:n=>{e(gn(n,"BillPayVendor"))},onVerifyOtp:(n,d)=>{e(hn(n,d,"BillPayVendor"))},onVerifyOtpSuccess:(n,d,p)=>{e(bn(n,d,p))},onFetchAndUpdateVendorRecommendations:n=>{e(Ot(n,!1))}}})(ii),Be=()=>{const e=K(),t=se(),l=ti(),i=X(),{billId:c,vendorId:r}=ae(),u=v(b=>Z(b)),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[n,d]=f.useState(!1),p=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),m=v(b=>ve(b,r)),h=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),g=r!==void 0?h:p;return f.useEffect(()=>{n===!1&&g==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[n,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ai,{}):g==="Error"?a.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ke,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:i,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ji=Y(function(e,t){const{companyId:l}=t;return{billPaySetupView:En(e,l),analytics:D,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:i}=t;return{onButtonClick:()=>{e(Dn(l))},onBackClick:()=>{i("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{i("../bills/setup",{relative:"path"})}}})(oi),Ki=()=>{const e=K(),t=X(),{tenantEmailDomain:l}=ae(),[i,c]=f.useState(!1),r=me(),u=v(h=>Z(h)),o=u.companyId??M.getSignedInUserTenant(l)?.companyId,s=M.getSignedInUser(),n=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(n?.loggedInUserRoleMap),m=h=>{c(h)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(te,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(te,{to:"../../bills/setup"}):d===!1||n!=null&&ze(u,n.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Kt,{isAppContentDrawerOpen:i,handleDrawerToggle:m}),a.jsx(Ji,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{m(!0)}})]}):a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function jo(){const e=v(G=>Z(G)),t=Ie(),l=pe(t?.loggedInUserRoleMap),i=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Ni,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Mt(o,e),n=Vt(e),d=X(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Rt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&jn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),k=b&&!p&&$t(t?.loggedInUserRoleMap),{isFeatureEnabled:j}=c(y.isChargeCardFeatureEnabled),x=li(e,j,o)&&!p&&Tn(t?.loggedInUserRoleMap),B=Pn(t?.loggedInUserRoleMap),_=Lt(t?.loggedInUserRoleMap),T=Fn(t?.loggedInUserRoleMap),U=Rn(t?.loggedInUserRoleMap),V=Mn(t?.loggedInUserRoleMap),I=Vn(t?.loggedInUserRoleMap),{tenantEmailDomain:H}=ae();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Ki,{})}),a.jsx(S,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{isUserHasZeniAccountsAccess:_,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:T,isTenantBankingOnly:s,tenantEmailDomain:H??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(ji,{})}),(s===!0||n===!0)&&a.jsx(S,{path:"/*",element:a.jsx(Xt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:":billId",element:a.jsx(w,{appContent:a.jsx(hi,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]}):a.jsx(S,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${i.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]})}export{jo as default};
|
|
119
|
+
`,Wi=X(function(e,t){const l=L.getSignedInUser(),i=zt(e,t.billId),c=mn(e),r=De(l),u=i.totalAmount.amount,o=i.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!_t(u,c.allApprovalRules,l);return{billDetails:i,billId:t.billId,billpayApprovalView:c,analytics:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:i,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ie(c.tenantEmailDomain),s=E(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:i,data:s})),e(_e(o?"paid":"pending_approval",o,!1,i))},discardOutsideZeniPaymentData:()=>{e(At({billId:i}))},updateBillDetailSaveBillCode:()=>{e(Gt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const n=Te(u,o,s);window.open(`${n}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Ce(t.billId,"retry"))}}})(ei);function vt(){const e=K(),t=se(),l=Q(),{billId:i}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=L.getSignedInUser(),{isFeatureEnabled:n}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),m=z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(y.isRecurringBillsFeatureEnabled),b=v(x=>Z(x)),k=v(x=>zt(x,i)),j=k.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(`../${i}`)},[]),f.useEffect(()=>{const x=k.vendor?.name,B=k.vendor?.id,_=k.totalAmount.amount,T=k.recipientTotalAmount.amount,M=k.invoiceNumber;x&&B&&t(pn(x,B,_,T,M,i))},[]),h==null)return a.jsx(te,{to:`../${i}`});if(s==null)throw Error("Can't access address page without signing in...");return j==="In-Progress"?a.jsx(kt,{windowSize:o,children:a.jsx(Yn,{})}):a.jsx(kt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:i,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:n,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=X(function(e,t){const{vendorId:l}=t,i=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=L.getSignedInUser(),s=u.tenantId,n={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:n,analytics:D,vendorSearchAutoCompleteData:{autoCompleteText:i,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:i,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=i;return{onSaveVendor:n=>{e(Cn(u??void 0,t.billId)),n!=null&&e(An(n))},saveVendorDetailLocalData:n=>{e(Ot({vendorId:u,localData:n}))},saveContactsInVendorDetailLocalData:n=>{e(Bn({vendorId:u,contacts:n}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:n=>{e(xn(n))},navigateToBankDetailPage:(n,d)=>{let p;n==="wire"?p=d==="international"?qt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(n,d)=>{e(d===!0?In(n,"vendor",u):wn(n,"vendor",u))},navigateToMailingAddressPage:n=>{const d=Qe(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:n=>{e(vn({files:n}))},onEditFileName:(n,d)=>{e(kn(n,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:n=>{n!=null&&e(Sn(n,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ri(i.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:n.newStack}})},onGetOtp:n=>{e(yn(n,"BillPayVendor"))},onResendOtp:n=>{e(gn(n,"BillPayVendor"))},onVerifyOtp:(n,d)=>{e(hn(n,d,"BillPayVendor"))},onVerifyOtpSuccess:(n,d,p)=>{e(bn(n,d,p))},onFetchAndUpdateVendorRecommendations:n=>{e(Nt(n,!1))}}})(ii),Be=()=>{const e=K(),t=se(),l=ti(),i=Q(),{billId:c,vendorId:r}=ae(),u=v(b=>Z(b)),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[n,d]=f.useState(!1),p=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),m=v(b=>ve(b,r)),h=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),g=r!==void 0?h:p;return f.useEffect(()=>{n===!1&&g==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[n,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ai,{}):g==="Error"?a.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ke,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:i,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ji=X(function(e,t){const{companyId:l}=t;return{billPaySetupView:En(e,l),analytics:D,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:i}=t;return{onButtonClick:()=>{e(Dn(l))},onBackClick:()=>{i("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{i("../bills/setup",{relative:"path"})}}})(oi),Ki=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=ae(),[i,c]=f.useState(!1),r=me(),u=v(h=>Z(h)),o=u.companyId??L.getSignedInUserTenant(l)?.companyId,s=L.getSignedInUser(),n=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(n?.loggedInUserRoleMap),m=h=>{c(h)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(te,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(te,{to:"../../bills/setup"}):d===!1||n!=null&&ze(u,n.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Kt,{isAppContentDrawerOpen:i,handleDrawerToggle:m}),a.jsx(Ji,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{m(!0)}})]}):a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function jo(){const e=v(G=>Z(G)),t=Ie(),l=pe(t?.loggedInUserRoleMap),i=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Oi,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Lt(o,e),n=Vt(e),d=Q(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Rt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&jn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),k=b&&!p&&$t(t?.loggedInUserRoleMap),{isFeatureEnabled:j}=c(y.isChargeCardFeatureEnabled),x=li(e,j,o)&&!p&&Tn(t?.loggedInUserRoleMap),B=Pn(t?.loggedInUserRoleMap),_=Ut(t?.loggedInUserRoleMap),T=Fn(t?.loggedInUserRoleMap),M=Rn(t?.loggedInUserRoleMap),V=Ln(t?.loggedInUserRoleMap),I=Vn(t?.loggedInUserRoleMap),{tenantEmailDomain:H}=ae();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Ki,{})}),a.jsx(S,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{isUserHasZeniAccountsAccess:_,isUserHasChargeCardAccess:M,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:T,isTenantBankingOnly:s,tenantEmailDomain:H??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(ji,{})}),(s===!0||n===!0)&&a.jsx(S,{path:"/*",element:a.jsx(Qt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:":billId",element:a.jsx(w,{appContent:a.jsx(hi,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]}):a.jsx(S,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${i.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]})}export{jo as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-9BgV5FgM.js";import{a as V}from"./sentry-p6MzREFX.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-nI7qhWxF.js";import{j as ce,p as ue,aJ as de,z as E,C as pe,c as M,ab as x,e as z,bu as le,ap as me,y as B,aq as R}from"./index-DOZAHQPK.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 Ne,Jc as Ae,k6 as _e,fz as ve,fy as Fe,fx as xe,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-Crbh9Aj_.js";import{n as Le}from"./mui-fAmxa5Xh.js";import{c as U}from"./routePaths-CrSok7sW.js";import{M as je}from"./MobileAppDrawer-CanZHImd.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]="0ab430a6-516f-443d-a450-b876c5d0c805",e._sentryDebugIdIdentifier="sentry-dbid-0ab430a6-516f-443d-a450-b876c5d0c805")}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-DuKOLlGn.js";import{a as V}from"./sentry-8NyHUHY
|
|
|
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??""},h=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=
|
|
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=Ne(e.companyConfigState),s=Ae(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:N,sourceOfFunds:A,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:N?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(F=>F.length===2?F:R(F))??[],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:N,treasuryUserVerificationStatus:A,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:N,treasuryUserVerificationStatus:A,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(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(Fe(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,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:M,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Xe as B};
|