@zeniai/web-app-ui 5.0.93-qa → 5.0.94-qa
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-C4ikWgPo.js +1 -0
- package/dist/assets/AddressScreen-BNN0XhH8.js +9 -0
- package/dist/assets/AiCfoScreen-Bg9ijLCA.js +22 -0
- package/dist/assets/{BillPayApprovalRoutes-Btsu3H48.js → BillPayApprovalRoutes-BpV8hV9h.js} +1 -1
- package/dist/assets/{BillPayRoutes-CZNt9nN-.js → BillPayRoutes-BnNnXg6p.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-Bpubo3oO.js → BusinessVerificationPageScreen-fGxnzjnu.js} +2 -2
- package/dist/assets/ChargeCardRoutes-Cxl-Dfno.js +71 -0
- package/dist/assets/{CompanyPassportScreen-BN0_lZh1.js → CompanyPassportScreen-6oghFs5-.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-CpX3K7rD.js → ConnectionAuthScreen-rIEFWD8p.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-BYdpJPsr.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DE5g8gop.js → CustomerOnboardingRoutes-52j6GlB4.js} +4 -4
- package/dist/assets/{DashboardRoutes-LjpSDL97.js → DashboardRoutes-BdO71Zfj.js} +3 -3
- package/dist/assets/{DefaultTenantHome-B3GQtREy.js → DefaultTenantHome-ChuSwEZz.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-xS5yR7KI.js → DomesticWireDetailScreen-DT1-4XE1.js} +3 -3
- package/dist/assets/DrawerScreen-ueiFgeV8.js +1 -0
- package/dist/assets/EntityDetailRoutes-BDYJNo-V.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-0uEo0sF6.js → ExpenseAutomationRoutes-BGsp6tOc.js} +1 -1
- package/dist/assets/FeaturePreviewScreen-C2KS_KpA.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-V8qKg5-6.js → HubSpotOAuthCallbackScreen-BtWyS7u5.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-Cew60Z39.js → MagicLinkRoutes-CiL3RYaJ.js} +9 -9
- package/dist/assets/MagicLinkSignInScreen-GKE3oNCV.js +12 -0
- package/dist/assets/{MobileAppDrawer-CPI95lgy.js → MobileAppDrawer-DFwRXpE0.js} +1 -1
- package/dist/assets/NotFoundScreen-C4a6Q5Lb.js +1 -0
- package/dist/assets/{NotificationRoutes-CQtvYBtP.js → NotificationRoutes-TuKcUgWz.js} +1 -1
- package/dist/assets/OAuthConsentScreen-ChC9fP6N.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-CU7PJY2i.js +1 -0
- package/dist/assets/PeopleRoutes-CeW1yv_N.js +22 -0
- package/dist/assets/PerformanceRoutes-COmcQAYA.js +1 -0
- package/dist/assets/{Preview-D3Uiphuo.js → Preview-CX79dadf.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-iMpRDnN4.js → QBOConnectionScreen-CNoF2iT1.js} +1 -1
- package/dist/assets/{ReferralListScreen-yxuUKjxd.js → ReferralListScreen-BaQmHM5w.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-mwgyiXL7.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CBzX3JSO.js → ReimbursementApprovalRuleDetailScreen-DI_WfNSZ.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-B8qr_kkC.js → ReimbursementRoutes-B57Ww3xn.js} +4 -4
- package/dist/assets/{ReportsRoutes-D1LUbrVF.js → ReportsRoutes-HX8_E7zU.js} +1 -1
- package/dist/assets/RewardsRoutes-CszUbBSt.js +1 -0
- package/dist/assets/ScreenRoutes-BXmEXdCM.js +2 -0
- package/dist/assets/{SettingsRoutes-BATsExuY.js → SettingsRoutes-CvryzcuN.js} +7 -7
- package/dist/assets/{SetupPagesScreen-BVkXSSWw.js → SetupPagesScreen-Bap8l3lK.js} +5 -5
- package/dist/assets/SignInScreen-C1Bdz5-O.js +1 -0
- package/dist/assets/SignOutScreen-DjrE-8HT.js +9 -0
- package/dist/assets/{TaskListScreen-BadjlUfo.js → TaskListScreen-BgQVLwxs.js} +2 -2
- package/dist/assets/{TaskRoutes-sUZt1FTw.js → TaskRoutes-DmrwyMwf.js} +2 -2
- package/dist/assets/{TransactionDetailRoutes-BsU_4MLZ.js → TransactionDetailRoutes-BtJNx8FU.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BQ6sw9a7.js → TransactionDetailScreen-ZjUg5MTR.js} +2 -2
- package/dist/assets/{TransactionListRoutes-Cy_qlp5W.js → TransactionListRoutes-CpUzH2wx.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BRpP2lkX.js → TreasuryRoutes-DGZRuDr3.js} +6 -6
- package/dist/assets/{VendorsRoutes-CTRK7ynr.js → VendorsRoutes-BmMfshWa.js} +15 -15
- package/dist/assets/WiseConfirmationScreen-CAo6wnNv.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-BFhwnSRQ.js → ZeniAccountRoutes-Dt7DM9ni.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-pkvytZBY.js +9 -0
- package/dist/assets/{accountMappingHelper-BOtLSvYe.js → accountMappingHelper-ClJz5V9X.js} +1 -1
- package/dist/assets/{analytics-CoOmPlNt.js → analytics-NZ6ROu06.js} +1 -1
- package/dist/assets/{analyticsHelper-BocYRaaP.js → analyticsHelper-BTp5Ghm5.js} +1 -1
- package/dist/assets/{core-B_XHMrqe.js → core-D-NK-UK9.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-D2C9TGj8.js → decodeURIComponentSafe-C48GZJfu.js} +1 -1
- package/dist/assets/{dnd-CtoU_fHu.js → dnd-C49i2BE4.js} +1 -1
- package/dist/assets/{empty-B3mnnOau.js → empty-CtUkBjnR.js} +1 -1
- package/dist/assets/{empty-Cdv-ZWIg.js → empty-DH2H1-Nx.js} +1 -1
- package/dist/assets/{emptyVideoElement-roYGDErm.js → emptyVideoElement-BCGqnPYV.js} +1 -1
- package/dist/assets/{epic-CAXHXwTI.js → epic-D64Ymfe0.js} +1 -1
- package/dist/assets/getLocaleForTenant-zP94FwPU.js +1 -0
- package/dist/assets/{index-BfaZdimW.js → index-AU1I47Je.js} +1 -1
- package/dist/assets/{index-DcF25xRC.js → index-B-v2HYWQ.js} +13303 -13262
- package/dist/assets/{index-DnWe9s1s.js → index-Bx6iIwrK.js} +1 -1
- package/dist/assets/{index-_X_wZ3pf.js → index-CTaHBGA6.js} +1 -1
- package/dist/assets/{index-BiyNQ4T-.js → index-Cii2mjSS.js} +1 -1
- package/dist/assets/{index-BHo5Qa5_.js → index-CppZNJwq.js} +1 -1
- package/dist/assets/{index-IhJ3VQPC.js → index-DCy8xCNa.js} +1 -1
- package/dist/assets/{index-hGk2kzA3.js → index-DUe_bU79.js} +2 -2
- package/dist/assets/{lexical-Dx9Jj1SY.js → lexical-Bp-0qESw.js} +1 -1
- package/dist/assets/{liveblocks-DyzG7jl-.js → liveblocks-D6iO1SmY.js} +1 -1
- package/dist/assets/{lottie-CqwrfSWf.js → lottie-BWZi4J-8.js} +1 -1
- package/dist/assets/{mui-CfonSYhg.js → mui-DqRlPgPp.js} +1 -1
- package/dist/assets/{pathToGoBack-B-fIvw6x.js → pathToGoBack-DvdlIQjg.js} +1 -1
- package/dist/assets/{pdf-CsFFdLdL.js → pdf-BpZ3cLIj.js} +4 -4
- package/dist/assets/{pdf-lib-BT18iM_Z.js → pdf-lib-CNmHIzRc.js} +1 -1
- package/dist/assets/{plaid-B7Pmnnvt.js → plaid-BzyOi-ir.js} +1 -1
- package/dist/assets/{pusher-wr2FxlsB.js → pusher-BMtiLftw.js} +1 -1
- package/dist/assets/{react-Bvcd48RT.js → react-BJh7Ho8n.js} +1 -1
- package/dist/assets/{react-Ymya1N-w.js → react-CmUCRpgB.js} +1 -1
- package/dist/assets/{react-DDIv_AwX.js → react-D3MVFA0D.js} +1 -1
- package/dist/assets/{react-CH1Ok2Rn.js → react-Djxq7qii.js} +1 -1
- package/dist/assets/{react-B2o52OqD.js → react-DxEGkukB.js} +1 -1
- package/dist/assets/{react-BdDGVOeS.js → react-TFItAO3U.js} +1 -1
- package/dist/assets/{recharts-CaK7MRaR.js → recharts-Dt8dM4EI.js} +2 -2
- package/dist/assets/{routePaths-Dgf8Lpxl.js → routePaths-DPqSbEW8.js} +1 -1
- package/dist/assets/{sentry-Cdif28fl.js → sentry-DJeJwz74.js} +1 -1
- package/dist/assets/{url-DOMbcgX5.js → url-Cab0ioG_.js} +1 -1
- package/dist/assets/{url-x3nND-T-.js → url-CawXuWkK.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-ChY2Lwaz.js → useAiCfoDashboardSuggestedQuestionsChips-B_ZCAUsA.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-h3l_262v.js +1 -0
- package/dist/assets/{useDeviceId-B_i0E4gh.js → useDeviceId-CYAkkrZp.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-B1Dx2jH5.js → useInitialThreadRequest-DZ6IEgJ5.js} +1 -1
- package/dist/assets/{utils-DMgIZDY7.js → utils-CGva6Exy.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-9CO_VCKb.js → withTransactionSidePanel-CklFSvII.js} +3 -3
- package/dist/assets/{zeni-epic-state-D9HDY_8v.js → zeni-epic-state-22WFBgK9.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-tQsdf2VE.js +0 -1
- package/dist/assets/AddressScreen-sxiJIRy-.js +0 -9
- package/dist/assets/AiCfoScreen-CCHEYuBL.js +0 -22
- package/dist/assets/ChargeCardRoutes-DcKS_cxy.js +0 -71
- package/dist/assets/CustomerOnboardingAuthScreen-C5p6u6fC.js +0 -1
- package/dist/assets/DrawerScreen-DOrBrG-6.js +0 -1
- package/dist/assets/EntityDetailRoutes-pbHs2RhY.js +0 -1
- package/dist/assets/FeaturePreviewScreen-2-p5K2P0.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-C10R5m-o.js +0 -12
- package/dist/assets/NotFoundScreen-BUqotHFB.js +0 -1
- package/dist/assets/OAuthConsentScreen-DkF2l_Ng.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-Cg8SffI2.js +0 -1
- package/dist/assets/PeopleRoutes-BnLCJA6K.js +0 -22
- package/dist/assets/PerformanceRoutes-Bqj2LPVg.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-RL8S1isL.js +0 -1
- package/dist/assets/RewardsRoutes-B8Zxnta2.js +0 -1
- package/dist/assets/ScreenRoutes-BYm6h7dp.js +0 -2
- package/dist/assets/SignInScreen-KM09ZzEo.js +0 -1
- package/dist/assets/SignOutScreen-yw_T1K5k.js +0 -9
- package/dist/assets/WiseConfirmationScreen-DdfNZb9c.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-aPQ0-Az6.js +0 -9
- package/dist/assets/getLocaleForTenant-EkX2Npfp.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BYtw9cd1.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-D6iO1SmY.js";import{A as d}from"./AddressScreen-BNN0XhH8.js";import i from"./NotFoundScreen-C4a6Q5Lb.js";import"./sentry-DJeJwz74.js";import{o as s,p as r}from"./core-D-NK-UK9.js";import"./zeni-epic-state-22WFBgK9.js";import"./recharts-Dt8dM4EI.js";import"./index-B-v2HYWQ.js";import"./mui-DqRlPgPp.js";import"./analytics-NZ6ROu06.js";import"./plaid-BzyOi-ir.js";import"./dnd-C49i2BE4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWZi4J-8.js";import"./lexical-Bp-0qESw.js";import"./pdf-BpZ3cLIj.js";import"./utils-CGva6Exy.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]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}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-D6iO1SmY.js";import{a as h}from"./sentry-DJeJwz74.js";import{l as T,h as _,u as j,i as E,g as K,n as B}from"./core-D-NK-UK9.js";import{n as M,m as $,z as D,k as L,x as R,H as z,c as C,e as S,W as F,h as b,q as N}from"./index-B-v2HYWQ.js";import{K8 as k,g_ as U,eQ as q,K9 as G,c2 as H,Ka as O,kj as V}from"./zeni-epic-state-22WFBgK9.js";import{n as Q}from"./mui-DqRlPgPp.js";import W from"./NotFoundScreen-C4a6Q5Lb.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]="d88b1022-9b27-4e9e-9e99-f798281dcd1d",e._sentryDebugIdIdentifier="sentry-dbid-d88b1022-9b27-4e9e-9e99-f798281dcd1d")}catch{}})();const J=Q.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,X=B(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=q(e),a=t.roleMap!=null&&G(t.roleMap),d=i||c==="user_address"||H(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=O(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=N(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(V({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(F);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=M(),x=$(),I=D.getSignedInUser(),[f,v]=h.useState(s==null),p=K(m=>s!=null?k(m,s).fetchState:"Not-Started"),A=L();if(I==null)throw Error("Can't access address page without signing in...");const P=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect(()=>{f||s==null||(v(!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(R,{fetchState:p,style:{backgroundColor:x.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(z,{analytics:C,onLoad:P}),r.jsx(J,{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(W,{})}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,22 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-D6iO1SmY.js";import{a as i}from"./sentry-DJeJwz74.js";import{h as ge,l as Ce,u as Ie,g as q,i as ke,n as be}from"./core-D-NK-UK9.js";import{X as we,cO as Pe,z as xe,n as Ee,cP as Te,cQ as Qe,cR as z,cS as ve,cT as Y,q as D,H,c as E,cU as W,cV as ye,a0 as _e,e as Oe,a6 as Ue,cW as Ae,a1 as Le,r as De,b0 as Fe,cX as Be}from"./index-B-v2HYWQ.js";import{fI as je,f7 as Z,eQ as Re,hE as Me,QL as Ge,eP as Ve,hO as $e,hK as Ne,fy as X,fs as qe,fl as ze,fp as K,ft as He,fu as We,fv as Xe,fw as Ke,fx as Je}from"./zeni-epic-state-22WFBgK9.js";import{D as Ye,n as k,S as Ze,P as et}from"./mui-DqRlPgPp.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-B_ZCAUsA.js";import{p as st}from"./pathToGoBack-DvdlIQjg.js";import"./recharts-Dt8dM4EI.js";import"./analytics-NZ6ROu06.js";import"./plaid-BzyOi-ir.js";import"./dnd-C49i2BE4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWZi4J-8.js";import"./lexical-Bp-0qESw.js";import"./pdf-BpZ3cLIj.js";import"./utils-CGva6Exy.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="33ad90fb-69ad-4d07-9606-22cc3fdf8391",o._sentryDebugIdIdentifier="sentry-dbid-33ad90fb-69ad-4d07-9606-22cc3fdf8391")}catch{}})();const ee="chat-response-generated",ot=be(function(o,n){const t=Z(o),m=n.isSubmitting;return{showSampleQuestions:n.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:n.sessionFromUrl==="new_chat"||n.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Le}/tableDownload`,emailLinkQuestion:n.emailLinkQuestion,autoSubmitEmailLinkQuestion:n.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:n.onEmailLinkQuestionProcessed,routedInitialQuestionSource:n.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:n.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:n.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:n.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:n.isFileUploadEnabled,isUploadPromoVisible:n.isUploadPromoVisible,onUploadPromoClose:n.onUploadPromoClose}},function(o,n){const{location:t,currentTenant:m,userId:r,navigate:g,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:c}=n;return{onEventReceived:(e,l)=>{if(e===ee&&typeof l.text=="string"&&typeof l.metadata=="object"){const u=l,p=We(u.type),d=u.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:b,currentQuestionAnswerSummary:T}=Y(C,d);p!=="answer"?E.trackAICFOChatResponseGenerated(p,b?.question.questionText??"",u.text,d,Be(T,s),u.metadata.message_id??null):E.trackAICFOChatAnswerGenerated(u.text,b?.question.questionText??"",(u.follow_up_questions?.length??0)>0,!!u.assumptions,!!u.insights,u.visualization!=null,Xe(u.visualization?.type??"")??null,d,u.summarized_title,u.metadata.message_id??null),o(Ke({chatSessionId:u.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),o(Je({chatSessionId:u.metadata.chat_session_id,answerPayload:u,userId:r}))}},onSubmit:(e,l,u,p)=>{e&&Fe(o,e,l,S,C,r,p,u)},updateCurrentInput:e=>{o(K(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{o(He(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{g(-1)},onCloseClick:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??st(1);g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),o(K(""))},togglePageView:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),c(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{g(-1)},onNewChatClick:()=>{S!=null&&o(ze());const e=De(t.state?.pathnameStackToGoBack,t.pathname);g(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,l)=>{o(qe({questionAnswerId:e,isCollapsed:l}))},onMenuClick:n.onMenuClick}})(Ue(Ae)),Et=({isFileUploadEnabled:o})=>{const{setIsAiCfoOpen:n}=we(),t=ge(),m=Ce(),r=Ie(),[g,S]=i.useState(!1);i.useEffect(()=>{t(je())},[t]);const{customPageTitle:C}=Pe(),c=q(a=>Z(a)),e=xe.getSignedInUser(),{session_id:l}=ke(),u=Ee(),p=_e(u),d=q(a=>Re(a)),s=c.uiState.currentChatSessionId,b=d.tenantEmailDomain,{handleUploadPromoClose:T,isUploadPromoVisible:te}=Te({isFileUploadEnabled:o,tenantEmailDomain:b}),Q=Qe({currentTenant:d,currentChatSessionId:s,aiCfoView:c}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=r.state,P=w?.aiCfoInitialQuestion,F=!!w?.aiCfoShouldSubmit;i.useEffect(()=>{const a=r.state;if(a?.[z]!==!0)return;S(!0);const h={...a};delete h[z],m(r,{replace:!0,state:h})},[r.pathname,r.search,r.state,m]);const[ae,v]=i.useState(null),[ne,y]=i.useState(!1),[ie,_]=i.useState(void 0),[re,O]=i.useState(void 0),B=i.useRef(!1);i.useEffect(()=>{if(!B.current&&P!=null&&P!==""){const a=r.state;v(P),y(F),_(a?.aiCfoInitialSubmissionSource!=null?a.aiCfoInitialSubmissionSource:void 0);const h=a?.aiCfoSuggestionIndex;O(typeof h=="number"?h:void 0),B.current=!0}},[P,F,r.state]);const le=i.useCallback(()=>{v(null),y(!1),_(void 0),O(void 0)},[]),j=i.useMemo(()=>new URLSearchParams(r.search),[r.search]),R=j.get("ref")??w?.aiCfoRef,U=j.get("emailRefId")??w?.aiCfoEmailRefId,M=i.useRef(!1);i.useEffect(()=>{M.current||R!=="month-end-email"||U==null||s!=null||e==null||(t(Me("controller",e.userId,U,"MONTH_END_EMAIL")),M.current=!0)},[R,U,s,t,e]);const x=c.uiState.lastContextMessage;i.useEffect(()=>{x!=null&&x!==""&&s!=null&&(v(x),y(!0),_(void 0),O(void 0),t(Ge()))},[x,s,t]);const ue=d.masterTOSInfo,I=ue?.isMasterTOSAccepted??!1,{visitedSessions:G}=ve(s),A=c.fetchState,L=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,V=s!=null?c.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",$=s==null||(c.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),N=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ce}=Y(N,s),de=ce.length===0;i.useEffect(()=>{I||p||m("../dashboard",{state:{...r.state,message:"open_ai_cfo_drawer"}})},[I,p,m,r.state]);const me=i.useCallback(()=>{const a=D(r.state?.pathnameStackToGoBack),h=d.tenantEmailDomain;m(a.poppedPathname??(h!=null?`/${h}/dashboard`:".."),{state:{...r.state,pathnameStackToGoBack:a.newStack}})},[d.tenantEmailDomain,r.state,m]);i.useEffect(()=>{s!=null&&l!==s&&m(`../ai-cfo/${s}`,{state:{...r.state}})},[s,l]),i.useEffect(()=>{l!=null&&s==null&&l!=="new_chat"&&l!=="explore"&&t(Ve({sessionId:l,agentId:"controller"}))},[]);const pe=i.useMemo(()=>({events:G.map(a=>`private-encrypted-chat-${a}.${ee}`),eventCallback:(a,h,Se)=>Se.onEventReceived(a,h)}),[G]);i.useEffect(()=>{A!=="In-Progress"&&L&&t($e())},[A,L,t]),i.useEffect(()=>{s!=null&&V!=="In-Progress"&&$&&e!=null&&A==="Completed"&&!L&&t(Ne(s,e.userId))},[V,$,s,e,t]);const fe=a=>a.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||l==null)throw Error("Can't access AI Controller page without signing in...");const he=s!=null&&c.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return!I&&p?f.jsxs(nt,{children:[f.jsx(H,{analytics:E,onLoad:fe}),Q.drawerElement,f.jsx(it,{children:f.jsx(J,{children:f.jsx(W,{isTOSAccepted:!1,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:me,onCompleteClick:()=>{d.userRoleId!=null&&t(X(d.userRoleId))}})})})]}):f.jsxs(at,{children:[f.jsx(H,{analytics:E,onLoad:a=>a.trackPageLoaded(Oe.Event.aiCFOPage)}),p&&Q.drawerElement,f.jsx(ot,{...pe,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>S(!0),userId:e.userId,setIsAiCfoOpen:n,navigate:m,sessionFromUrl:l,location:r,isSubmitting:he,isEmptyChatWithSession:de,customPageTitle:C,currentTenant:d,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:p?Q.open:void 0,isFileUploadEnabled:o,isUploadPromoVisible:te,onUploadPromoClose:T,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),f.jsx(Ye,{anchor:"right",open:g,transitionDuration:250,PaperProps:{component:rt,style:{width:p?"100%":`${ye}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:f.jsx(J,{onClick:a=>a.stopPropagation(),children:f.jsx(W,{isTOSAccepted:I,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>S(!1),onCompleteClick:()=>{I||d.userRoleId==null||t(X(d.userRoleId)),S(!1)}})})})]})},J=k(Ze)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,at=k.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,nt=k.div`
|
|
9
|
+
height: 100vh;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
`,it=k.div`
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
`,rt=k(et)`
|
|
20
|
+
box-shadow: ${({theme:o})=>o.colors.elevation2};
|
|
21
|
+
color: ${({theme:o})=>o.colors.grey4};
|
|
22
|
+
`;export{Et as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-D6iO1SmY.js";import{a as y}from"./sentry-DJeJwz74.js";import{l as U,u as B,h as T,g as v,N,n as j,i as $,o as O,p as h}from"./core-D-NK-UK9.js";import{eQ as L,Nr as R,N7 as b,xR as x,xL as F,xP as I,xE as W,N9 as q,xH as z,xT as H,xS as D}from"./zeni-epic-state-22WFBgK9.js";import{m as P,z as k,x as V,a6 as Q,bD as G,af as _,bE as J}from"./index-B-v2HYWQ.js";import"./mui-DqRlPgPp.js";import{i as K}from"./ReimbursementApprovalRuleDetailScreen-DI_WfNSZ.js";import M from"./NotFoundScreen-C4a6Q5Lb.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]="c6152242-2639-45d4-ba68-938af0ed0090",e._sentryDebugIdIdentifier="sentry-dbid-c6152242-2639-45d4-ba68-938af0ed0090")}catch{}})();const w="bill-approval-rule-update",X=j(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(q(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(W(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(Q(G)),Y=()=>{const e=U(),o=B(),t=T(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[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(I())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...f})},Z=j(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(S=>{const E=!!K(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.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(D(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(D(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(H())},onSaveRuleSuccess:()=>{t("../")}}})(J);function C(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(z(!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(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(C,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(C,{})}),l.jsx(h,{path:"*",element:l.jsx(M,{})})]})}export{se as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-DyzG7jl-.js";import{l as J,h as se,u as Q,i as ae,g as v,N as te,n as Y,k as na,o as ia,p as S}from"./core-B_XHMrqe.js";import{eQ as Z,MJ as Me,bv as It,HD as oa,bo as wt,bF as pe,MK as xt,x9 as Ct,yj as $e,xI as la,bn as De,ML as sa,MM as ra,c2 as ca,MN as da,jD as At,MO as Bt,MP as Et,yU as Ne,xo as Ae,MQ as ua,wZ as tt,MR as pa,C4 as ma,x1 as ba,x7 as Dt,MS as ke,MT as _e,yk as Ge,MU as ha,MV as ga,yn as Oe,MW as ya,yA as Sa,MX as jt,y4 as at,y9 as fa,MY as ka,MZ as ue,M_ as Tt,M$ as Pt,N0 as Ft,fM as va,xt as Le,cx as Rt,N1 as Ia,gQ as wa,N2 as xa,N3 as Ca,eY as Vt,eW as $t,N4 as ze,N5 as Aa,N6 as Ba,Ks as Ze,N7 as Ea,Kt as oe,Ku as He,N8 as Da,N9 as ja,Na as Ta,yb as nt,y8 as Pa,Nb as Fa,Nc as Ra,Nd as Va,xW as $a,Ne as La,Nf as Ua,Ng as Ma,cl as Lt,cN as Ut,jO as Na,bL as _a,bq as Mt,bM as Nt,wf as Ga,Nh as Oa,BT as za,BZ as Za,sM as Ha,yl as Wa,y$ as qa,j$ as fe,Ni as Ka,Nj as _t,kt as Ja,jV as Gt,ke as Ot,kd as it,bE as be,bK as Qa,Nk as Ya,Nl as ve,iy as Xa,Nm as ot,Nn as en,iC as tn,iX as an,zd as nn,No as on,km as ln,z3 as sn,Np as lt,z7 as rn,zc as cn,z9 as dn,z1 as un,Nq as zt,xi as pn,Nr as mn,Ns as bn,fE as hn,fD as gn,fC as yn,k2 as Sn,kk as st,kv as fn,qc as kn,kb as vn,z5 as In,iI as wn,kA as xn,Nt as Cn,iA as An,q3 as Bn,Nu as En,y0 as Dn,bG as jn,bs as Tn,Jn as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-D9HDY_8v.js";import{m as me,z as V,d as Ie,Z as We,a as le,I as y,aN as Be,B as re,o as B,v as je,f as D,ba as Ln,p as z,a1 as qe,q as E,K as we,bb as rt,bc as ct,bd as Un,ak as Mn,y as Nn,aH as _n,w as Zt,O as Ke,Y as Je,be as Gn,at as Ht,bf as On,V as zn,h as Wt,a6 as Zn,bg as Hn,bh as Wn,bi as qn,bj as Kn,bk as Jn,bl as Qn,bm as Yn,bn as Xn,bo as ei,R as ti,bp as ai,b5 as ni,bq as ii,br as oi,a9 as li}from"./index-DcF25xRC.js";import{n as U,S as si}from"./mui-CfonSYhg.js";import{A as dt}from"./AddressScreen-sxiJIRy-.js";import{g as ie,a as Te,i as qt,V as Qe,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-xS5yR7KI.js";import{a as f}from"./sentry-Cdif28fl.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-BYtw9cd1.js";import{u as Kt}from"./useInitialThreadRequest-B1Dx2jH5.js";import Ee from"./NotFoundScreen-BUqotHFB.js";import{D as ui}from"./DrawerScreen-DOrBrG-6.js";import{M as Jt}from"./MobileAppDrawer-CPI95lgy.js";import{F as Qt}from"./FeaturePreviewScreen-2-p5K2P0.js";import{S as Pe}from"./SetupPagesScreen-BVkXSSWw.js";import{B as pi}from"./BillPayApprovalRoutes-Btsu3H48.js";import{FallBackRoute as mi}from"./ScreenRoutes-BYm6h7dp.js";import"./recharts-CaK7MRaR.js";import"./analytics-CoOmPlNt.js";import"./plaid-B7Pmnnvt.js";import"./dnd-CtoU_fHu.js";import"./stripe-DMRn4zHo.js";import"./lottie-CqwrfSWf.js";import"./lexical-Dx9Jj1SY.js";import"./pdf-CsFFdLdL.js";import"./utils-DMgIZDY7.js";import"./analyticsHelper-BocYRaaP.js";import"./routePaths-Dgf8Lpxl.js";import"./BusinessVerificationPageScreen-Bpubo3oO.js";import"./ReimbursementApprovalRuleDetailScreen-CBzX3JSO.js";import"./getLocaleForTenant-EkX2Npfp.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]="b9dbf9c6-5ea3-4f6c-ab4f-93dab9d8bdd0",e._sentryDebugIdIdentifier="sentry-dbid-b9dbf9c6-5ea3-4f6c-ab4f-93dab9d8bdd0")}catch{}})();const bi=Y(function(e,t){const l=Me(e,t.billId),i=V.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:At(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/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(Ae(l,"retry")):e(Ae(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(Ae(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Ne(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}})(Ln);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Me(G,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});We({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),[C,N]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:M}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:_}=M(Be.zeniAssistConfig),A=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=_.user_ids!=null&&r?.userId!=null&&_.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&A===!1?N(!1):N(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,A,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,L,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,L,X,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 ${B.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=V.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:B.sp10,paddingRight:B.sp3,paddingBottom:"15px",paddingLeft:B.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.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(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(_n);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.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(Be.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,N]=f.useState(!1),[T,M]=f.useState(!1),[$,I]=f.useState(!1),[H,_]=f.useState(),A=v(F=>_e(F,m,g,i));let q=A.fetchState,W=A.file,L=A.showAutofill;const K=v(F=>Me(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],L=!1);const X=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?M(!1):!u&&C&&N(!1))},[i]),f.useEffect(()=>{C||i==null||u||(N(!0),t(Ct(i,h,j,!1)),T||(M(!0),t($e(!1,h,j,b,i)))),u&&!T&&(M(!0),t($e(!1,h,j,b,i)))},[C,T,u,i,t]);const G={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",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(X??"",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"||K.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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:_,showActionButtons:!1,isInitialEdit:!!A.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?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:G,isEditPopup:!0}):null,o==="small"||L?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:L,uploadStatus:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,A),setShowConfirmationPopup:I,setPayload:_,showActionButtons:fi(u,A),isInitialEdit:!!A.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();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}
|
|
1
|
+
import{j as a}from"./liveblocks-D6iO1SmY.js";import{l as J,h as se,u as Q,i as ae,g as v,N as te,n as Y,k as na,o as ia,p as S}from"./core-D-NK-UK9.js";import{eQ as Z,MJ as Me,bv as It,HD as oa,bo as wt,bF as pe,MK as xt,x9 as Ct,yj as $e,xI as la,bn as De,ML as sa,MM as ra,c2 as ca,MN as da,jD as At,MO as Bt,MP as Et,yU as Ne,xo as Ae,MQ as ua,wZ as tt,MR as pa,C4 as ma,x1 as ba,x7 as Dt,MS as ke,MT as _e,yk as Ge,MU as ha,MV as ga,yn as Oe,MW as ya,yA as Sa,MX as jt,y4 as at,y9 as fa,MY as ka,MZ as ue,M_ as Tt,M$ as Pt,N0 as Ft,fM as va,xt as Le,cx as Rt,N1 as Ia,gQ as wa,N2 as xa,N3 as Ca,eY as Vt,eW as $t,N4 as ze,N5 as Aa,N6 as Ba,Ks as Ze,N7 as Ea,Kt as oe,Ku as He,N8 as Da,N9 as ja,Na as Ta,yb as nt,y8 as Pa,Nb as Fa,Nc as Ra,Nd as Va,xW as $a,Ne as La,Nf as Ua,Ng as Ma,cl as Lt,cM as Ut,jO as Na,bL as _a,bq as Mt,bM as Nt,wf as Ga,Nh as Oa,BT as za,BZ as Za,sM as Ha,yl as Wa,y$ as qa,j$ as fe,Ni as Ka,Nj as _t,kt as Ja,jV as Gt,ke as Ot,kd as it,bE as be,bK as Qa,Nk as Ya,Nl as ve,iy as Xa,Nm as ot,Nn as en,iC as tn,iX as an,zd as nn,No as on,km as ln,z3 as sn,Np as lt,z7 as rn,zc as cn,z9 as dn,z1 as un,Nq as zt,xi as pn,Nr as mn,Ns as bn,fE as hn,fD as gn,fC as yn,k2 as Sn,kk as st,kv as fn,qc as kn,kb as vn,z5 as In,iI as wn,kA as xn,Nt as Cn,iA as An,q3 as Bn,Nu as En,y0 as Dn,bG as jn,bs as Tn,Jn as Pn,cO as Fn,cN as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-22WFBgK9.js";import{m as me,z as V,k as Ie,_ as We,w as le,I as y,aN as Be,x as re,o as B,H as je,c as D,ba as Ln,q as z,a1 as qe,r as E,n as we,bb as rt,bc as ct,bd as Un,ak as Mn,D as Nn,aH as _n,A as Zt,O as Ke,G as Je,be as Gn,at as Ht,bf as On,Y as zn,e as Wt,a6 as Zn,bg as Hn,bh as Wn,bi as qn,bj as Kn,bk as Jn,bl as Qn,bm as Yn,bn as Xn,bo as ei,s as ti,bp as ai,b5 as ni,bq as ii,br as oi,a9 as li}from"./index-B-v2HYWQ.js";import{n as U,S as si}from"./mui-DqRlPgPp.js";import{A as dt}from"./AddressScreen-BNN0XhH8.js";import{g as ie,a as Te,i as qt,V as Qe,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-DT1-4XE1.js";import{a as f}from"./sentry-DJeJwz74.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-h3l_262v.js";import{u as Kt}from"./useInitialThreadRequest-DZ6IEgJ5.js";import Ee from"./NotFoundScreen-C4a6Q5Lb.js";import{D as ui}from"./DrawerScreen-ueiFgeV8.js";import{M as Jt}from"./MobileAppDrawer-DFwRXpE0.js";import{F as Qt}from"./FeaturePreviewScreen-C2KS_KpA.js";import{S as Pe}from"./SetupPagesScreen-Bap8l3lK.js";import{B as pi}from"./BillPayApprovalRoutes-BpV8hV9h.js";import{FallBackRoute as mi}from"./ScreenRoutes-BXmEXdCM.js";import"./recharts-Dt8dM4EI.js";import"./analytics-NZ6ROu06.js";import"./plaid-BzyOi-ir.js";import"./dnd-C49i2BE4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWZi4J-8.js";import"./lexical-Bp-0qESw.js";import"./pdf-BpZ3cLIj.js";import"./utils-CGva6Exy.js";import"./analyticsHelper-BTp5Ghm5.js";import"./routePaths-DPqSbEW8.js";import"./BusinessVerificationPageScreen-fGxnzjnu.js";import"./ReimbursementApprovalRuleDetailScreen-DI_WfNSZ.js";import"./getLocaleForTenant-zP94FwPU.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]="ce6006a2-bf01-4e89-9ce8-87fdc867e044",e._sentryDebugIdIdentifier="sentry-dbid-ce6006a2-bf01-4e89-9ce8-87fdc867e044")}catch{}})();const bi=Y(function(e,t){const l=Me(e,t.billId),i=V.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:At(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/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(Ae(l,"retry")):e(Ae(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(Ae(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Ne(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}})(Ln);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Me(G,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});We({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),[C,N]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:M}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:_}=M(Be.zeniAssistConfig),A=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=_.user_ids!=null&&r?.userId!=null&&_.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&A===!1?N(!1):N(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,A,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,L,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,L,X,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 ${B.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=V.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:B.sp10,paddingRight:B.sp3,paddingBottom:"15px",paddingLeft:B.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.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(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(_n);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.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(Be.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,N]=f.useState(!1),[T,M]=f.useState(!1),[$,I]=f.useState(!1),[H,_]=f.useState(),A=v(F=>_e(F,m,g,i));let q=A.fetchState,W=A.file,L=A.showAutofill;const K=v(F=>Me(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],L=!1);const X=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?M(!1):!u&&C&&N(!1))},[i]),f.useEffect(()=>{C||i==null||u||(N(!0),t(Ct(i,h,j,!1)),T||(M(!0),t($e(!1,h,j,b,i)))),u&&!T&&(M(!0),t($e(!1,h,j,b,i)))},[C,T,u,i,t]);const G={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",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(X??"",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"||K.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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:_,showActionButtons:!1,isInitialEdit:!!A.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?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:G,isEditPopup:!0}):null,o==="small"||L?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:L,uploadStatus:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,A),setShowConfirmationPopup:I,setPayload:_,showActionButtons:fi(u,A),isInitialEdit:!!A.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();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
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as T}from"./liveblocks-D6iO1SmY.js";import{a as N}from"./sentry-DJeJwz74.js";import{l as ae,u as ne,h as se,i as ie,g as C,N as oe,n as re}from"./core-D-NK-UK9.js";import{k as ce,w as ue,aN as de,z,H as pe,c as B,af as E,e as x,bz as le,at as me,r as P,au as R}from"./index-B-v2HYWQ.js";import{Nf as fe,eQ as G,sb as ye,HH as Se,xW as ge,AD as Ie,Da as be,DP as he,EI as De,NC as ke,ND as Oe,NE as Te,NF as Ce,NG as Ne,K9 as Ve,ME as we,Kl as Ae,kj as _e,fE as Fe,fD as ve,fC as Ee,qc as xe,q3 as ze,q0 as Be,kb as Pe,sk as Re,si as M,bE as L,sw as U,cv as Me}from"./zeni-epic-state-22WFBgK9.js";import{n as Le}from"./mui-DqRlPgPp.js";import{d as j}from"./routePaths-DPqSbEW8.js";import{M as Ue}from"./MobileAppDrawer-DFwRXpE0.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]="fa9030e6-9e23-47e1-a054-98d38eb0fb9b",e._sentryDebugIdIdentifier="sentry-dbid-fa9030e6-9e23-47e1-a054-98d38eb0fb9b")}catch{}})();const je=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-DyzG7jl-.js";import{a as N}from"./sentry-Cdif28f
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},h=Ve(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=we(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:k,companyLegalName:O,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:V,stateOfIncorporation:w,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:b,companySourceOfFunds:q,companySourceOfFundsDescription:H,transactionVolume:K,transactionVolumeDescription:W,purposeOfAccount:Z,purposeOfAccountDescription:$,regulatedStatus:Q,regulatedStatusDescription:J,usNexus:X,usNexusTypes:Y}=t,F=k?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:O,taxIdOrEIN:g,website:m!=""&&m!=null?Me(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:V?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:H,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:W,purposeOfAccount:Z?.selectedOption??"",purposeOfAccountDescription:$,regulatedStatus:Q??"",regulatedStatusDescription:J,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(U({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:k,userId:O,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:V,userVerificationStatus:w,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:k,userId:O,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:V,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(M(i,t,r))},onSendForVerificationClick:t=>{e(M(i,t,r,!0))},onAddressClick:t=>{const s=j(h,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(h,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,s)=>{e(xe(t,s.split(".")[0]))},onGetOtp:t=>{e(Ee(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(Fe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Xe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=N.useState(!1),[l,h]=N.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:k}=p(de.zeniAccountsConfig),O=fe(k),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??z.getSignedInUserTenant(t)?.companyId;if(N.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),N.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]),z.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=Ne(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=Te(a,n);break;case"reimbursement":o=Oe(a,n);break;default:o=ke(a,n)}return o});return u===!1?T.jsx(oe,{to:"../promo"}):T.jsxs(je,{children:[T.jsx(pe,{analytics:B,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(x.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(x.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(x.Event.billPayBusinessVerification,E(i)?"Settings":void 0)}})(a)}),E(i)?T.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,T.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:E(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:O.maxInsuredAmount})]})};export{Xe as B};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-D6iO1SmY.js";import{l as le,i as ca,h as ue,g as y,u as ge,n as pe,N as ga,s as ut,o as Wt,p as te}from"./core-D-NK-UK9.js";import{eQ as ce,bs as Re,Pa as ka,eW as be,eX as ye,eY as Se,fT as $e,cs as ze,Pb as Ye,Pc as Ma,tq as ba,jL as ya,Pd as Sa,gQ as oa,zW as Qe,zY as Ga,zZ as $a,jB as mt,Pe as Ze,zK as Ct,Pf as qt,Pg as Jt,zN as Da,Ph as Xt,Nz as _a,rC as pt,zT as za,g$ as Qt,Pi as ht,Pj as Ke,bq as en,Pk as an,fE as Pa,fD as wa,Ar as tn,fC as Ta,Nf as nn,Pl as ft,cl as gt,cM as rn,Ny as da,B1 as sn,Pm as tt,AD as Fa,Pn as bt,B2 as on,N_ as cn,B3 as dn,BZ as ln,sM as un,BT as mn,Ac as yt,A5 as Cn,Po as pn,fV as hn,Al as St,Ap as It,fU as fn,Pp as gn,AP as At,Pq as bn,Pr as yn,Ps as Sn,An as Et,A8 as kt,zQ as Dt,Ah as _t,Af as Pt,Aj as In,zX as nt,Pt as wt,Pu as va,AA as Ia,Ke as Tt,cN as Ya,Pv as An,Pw as En,Px as kn,Py as Dn,Ax as Na,AW as _n,AS as Pn,At as wn,AU as Tn,AK as Fn,AM as vn,Pz as Ft,B0 as vt,HD as xn,PA as Bn,PB as Ln,PC as Un,PD as xt,PE as Rn,Bn as On,AC as Bt,Aw as ia,AB as jn,PF as Nn,PG as Vn,zH as Hn,PH as Lt,PI as Ut,PJ as Mn,zJ as Gn,zI as rt,PK as $n,PL as zn,PM as Yn,Ka as Zn,PN as Za,PO as Kn,wi as Rt,kj as Wn,gR as qn,Bs as Jn,PP as Ot,PQ as Xn,Bt as Qn,PR as er,de as ar,tk as tr,Bi as nr,Bc as Ue,bv as rr,bF as sr,cx as or,bG as ir,Jn as cr}from"./zeni-epic-state-22WFBgK9.js";import{z as Q,k as je,w as se,I as z,x as la,c1 as xa,cc as dr,q as ve,cd as lr,ce as ur,n as ua,aN as Fe,r as fe,bk as Ka,cf as mr,A as ma,h as Ba,m as Wa,c as J,O as qa,cg as Cr,_ as jt,aq as Ja,bw as Je,ch as Va,ci as pr,H as Xa,a6 as hr,cj as fr,at as Nt,a1 as Ha,Y as Vt,e as Ht,ck as gr,cl as br,cm as yr,cn as Sr,co as Ir,cp as Ar,o as Aa,cq as Er,cr as kr,cs as Ra,s as Dr,ct as _r,cu as Pr,cv as wr,cw as Tr,cx as Fr,a9 as vr}from"./index-B-v2HYWQ.js";import{n as _e,D as Mt,S as xr}from"./mui-DqRlPgPp.js";import{a as c}from"./sentry-DJeJwz74.js";import{g as Ce,a as Ca,b as Gt,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Qa,P as Lr,i as et,s as Xe,j as $t,k as Me,l as zt,m as Ur,n as Yt,p as Rr,S as st}from"./SetupPagesScreen-Bap8l3lK.js";import{u as Or}from"./useInitialThreadRequest-DZ6IEgJ5.js";import La from"./NotFoundScreen-C4a6Q5Lb.js";import{M as Ge}from"./MobileAppDrawer-DFwRXpE0.js";import{u as Zt}from"./useAskAiCfoHostNavButtonProps-h3l_262v.js";import{v as ot}from"./utils-CGva6Exy.js";import{t as jr}from"./AddressScreen-BNN0XhH8.js";import"./recharts-Dt8dM4EI.js";import"./analytics-NZ6ROu06.js";import"./plaid-BzyOi-ir.js";import"./dnd-C49i2BE4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWZi4J-8.js";import"./lexical-Bp-0qESw.js";import"./pdf-BpZ3cLIj.js";import"./analyticsHelper-BTp5Ghm5.js";import"./routePaths-DPqSbEW8.js";import"./BusinessVerificationPageScreen-fGxnzjnu.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]="7dffd121-8842-49d0-840e-6ffb24c48a7d",e._sentryDebugIdIdentifier="sentry-dbid-7dffd121-8842-49d0-840e-6ffb24c48a7d")}catch{}})();function Nr(){const e=le(),{cardId:t}=ca(),a=ue(),r=Q.getSignedInUser(),n=y(X=>ce(X)),C=je(),m=Re(C?.loggedInUserRoleMap),{useFeatureGate:f}=se();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[A,o]=c.useState(!1),i=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const E=n.userRole.includes("charge_card_user"),{isFeatureEnabled:S}=f(z.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=f(z.isDebitCardFeatureEnabled),F=be(n),D=ye(n),p=Se(R,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:p}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:S,isBookKeepingTenant:D,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),_=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>$e(X,n.companyId)),N=ze(v.controllers),{creditAccount:L,creditAccountRepayment:w}=y(X=>Ye(X)),V=y(X=>X.classListState.fetchState),u=!E&&d&&h,l=y(X=>Ma(X,t,u,d)),[P,T]=c.useState(!1),H=l.chargeCard,U=H?.cardCreatedByUser?.userId,K=y(X=>U!=null?ba(X.userRoleState,U):void 0),I=K?.accountingClassIDs[0],B=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,O=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=O?.accountingClassIDs[0],k=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),Y=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&A===!1&&Y&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,A,Y,q]),c.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Qe(t,u,!1)))},[P,l,t,a]),c.useEffect(()=>{if(l.fetchState==="Completed"&&(Y===!1||Y&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||i===!1&&A===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,i);e(X)}},[l.fetchState,i,Y]),c.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&h&&m&&a(Ga()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&h&&m&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,h,m,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",oe=Oe(d,g,_,h),ae=Ca(d,h,m,L,w),ne=Gt(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:i}),s.jsx(dr,{onGotItClick:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:h,productInformation:oe,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:k?.className})]})}const Vr=pe(function(e){const t=Ze(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Hr(){const e=le(),t=ue(),a=ge(),r=Q.getSignedInUser(),n=y(S=>ce(S)),{useFeatureGate:C}=se(),{isFeatureEnabled:m}=C(z.isCardsCommentingEnabled),[f,A]=c.useState(!1),o=y(S=>Ze(S)),i=Or(n.companyId,{clearParams:o.fetchState==="Completed"}),E=c.useCallback(()=>{const S=ve(a.state?.pathnameStackToGoBack),h=S.poppedPathname??Mr(n.tenantEmailDomain);e(h,{state:{pathnameStackToGoBack:S.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{f||o.fetchState==="Completed"||o.fetchState==="In-Progress"||(A(!0),t(Ct()))},[f,o,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return o.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:E}):o.cashbackSummary.cashbackEarned.amount===0&&o.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Vr,{onBackClick:E,isCardsCommentingEnabled:m,initialOpenThreadRequest:i})}const Mr=e=>`/${e}/cards`,Gr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m}=se(),[f,A]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[h,R]=c.useState(!1),F=Q.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const D=y(k=>ce(k));if(n==null)throw Error("Empty card id is not valid...");const{configValue:p}=m(Fe.zeniCardsConfig),b=p.max_charge_card_activation_attempts_by_card_id,g=y(k=>Jt(k,n)),d=g.chargeCard,_=y(k=>k.chargeCardConfigState.fetchState),{useFeatureGate:v}=se(),{isFeatureEnabled:N}=v(z.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(z.isDebitCardFeatureEnabled),w=Se(L,D),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),u=!!D.companyChargeCardInfo?.info?.isChargeCardEnabled,l=D.userRole.includes("charge_card_user"),P=be(D),T=ye(D),H=D.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&U&&u;c.useEffect(()=>{f===!1&&_!=="In-Progress"&&_!=="Completed"&&(a(Da()),A(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(Qe(n,K,U)))},[o,g.fetchState,f,_]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(E===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const k=Ce(D.tenantEmailDomain,n,F,d,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);r(k,{state:{pathnameStackToGoBack:Y}})}else if(E&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const k=Ce(D.tenantEmailDomain,n,F,d,!0),Y=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(k,{state:{pathnameStackToGoBack:Y}})}}},[g.fetchState,d?.type.code,E,g.isRefreshingViewInBackground]);const B=Q.getZeniOtpTokenForCardHolder(n),j=y(k=>pt(k.userState,F.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(k=>k.statusCode==="success")===!0&&E===!1&&(setTimeout(O,3e3),S(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=k=>{R(k)};if(_!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:h,handleDrawerToggle:W}),s.jsx(zr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:B,navigate:r,currentTenant:D,location:C,maxChargeCardActivationAttempts:b[n]!=null?b[n]:p.default_max_charge_card_activation_attempts!=null?p.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Yr,{windowSize:t,children:e}):null]})},zr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Qt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const m=ht(e,n),f=t.updateStatus,A=Ke(e,!1,!1,!1);let o=!1;A.fetchState==="Completed"&&A.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||i,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:m,activationWaitStatus:f,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:m}=t,f=m.chargeCard?.cardProviderID,{tenantEmailDomain:A}=C;return{onGetOtp:o=>{f!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{f!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{f!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(A):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),Yr=_e.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: ${e=>`${Gr.containerWidth.value(e.windowSize)}%`};
|
|
5
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
6
|
+
`,Zr=_e.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
min-height: 100%;
|
|
9
|
+
width: 100%;
|
|
10
|
+
flex: 1 1 auto;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
14
|
+
`,Ea=qa.getLocalizedStrings().dateFormat,Kr={overlayWidth:new ma(100,100,58)},Wr=pe(function(e,t){const a=t.currentTenant?.companyId;return{plaidConnectionDetails:cn(e,a,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:dn(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:a,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:C,isCashbackInfoFetchStateCompleted:m,isCreditCardInfoFetchStateCompleted:f,isDebitCardInfoFetchStateCompleted:A,controllerEmails:o,paymentDetails:i,productInformation:E,cashbackInformation:S,paymentSourceInformation:h,creditAccountInformation:R,debitAccountInformation:F,paymentInitiatedDate:D,sourcePage:p}=t,{tenantEmailDomain:b}=r;return{onBackNavigation:()=>{if(m&&f&&A&&S!=null&&J.trackCardsPayEarlyFormClick(o,E,S,"Back",i.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:i.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:i.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:i.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:i.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:D?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:D?.format(Ea.visual.MMMDCommaYYYYformat)},h,R,F),p==="cardPaymentHistory")t.closeDrawerHandler(!0),e(bt());else{const g=Ne(b);a(g)}},onUpdatePaymentAccountStatus:(g,d,_)=>{e(mn(g,d,"bill_pay","bill_pay_detail",_))},onEstablishConnectionSuccess:()=>{e(Fa(r.companyId,!0))},onFetchLinkTokenClick:g=>{e(un("external_account",g))},onEstablishConnectionClick:g=>{e(ln(g,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${b}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{C?window.open(`/${b}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Cr),at=({isPaymentDrawerOpen:e,closeDrawerHandler:t,pageName:a,creditAccountSpentAmount:r,productInformation:n,sourcePage:C,creditAccountInformation:m,debitAccountInformation:f,cashbackInformation:A,isDebitCardInfoFetchStateCompleted:o,isCreditCardInfoFetchStateCompleted:i,isCashbackInfoFetchStateCompleted:E,paymentInitiatedDate:S,retryRepayment:h})=>{const R=le(),{useDynamicConfig:F}=se(),{configValue:D}=F(Fe.zeniAccountsConfig),p=nn(D),b=y($=>ft($)),{creditAccount:g}=y($=>Ye($)),d=y($=>ce($)),_=Wa(),v=ua(),N=ue(),L=Q.getSignedInUser(),w=je(),[V,u]=c.useState(!1),[l,P]=c.useState(!1),{configValue:T}=F(Fe.zeniCardsConfig),H=T.credit_card_auto_pay_threshold_by_company_id?.[d.companyId]??T.default_credit_card_auto_pay_threshold??Br,U=gt(w?.loggedInUserRoleMap),K=rn(w?.loggedInUserRoleMap),I=!!d.companyZeniAccountInfo?.info?.isZeniAccountEnabled,B=y($=>da($,d.companyId)),j=B.companyChargeCardInfo?.primaryFundingAccount,O=B.allFundingAccounts.find($=>$.id===j?.accountId),W=y($=>$e($,d.companyId)),k=ze(W.controllers);c.useEffect(()=>{if(b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&N(sn()),b.fetchState==="Completed"&&!l){const $=d.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,x=b.transferFromAccounts.find(ae=>ae.id===$);let oe;if(C==="cardPaymentHistory"&&h){const ae=h.paymentAccountId!=null?b.transferFromAccounts.find(ne=>ne.id===h.paymentAccountId):void 0;oe={amount:h.amount,isAutoRepayment:d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:ae??x}}else oe={amount:{amount:g.balance.amount+g.hold.amount,currencyCode:g.balance.currencyCode,currencySymbol:g.balance.currencySymbol},isAutoRepayment:d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:ot(),transferFrom:x};N(tt(oe)),P(!0)}},[b.fetchState,l,C,h,b.transferFromAccounts,d.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,d.companyChargeCardInfo?.info?.isAutoPayEnabled,g.balance.amount,g.balance.currencyCode,g.balance.currencySymbol,g.hold.amount,N]);const Y={isZeniCheckingEnabled:d.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:O?.accType==="depositAccount",creditCardPaymentSourceAccountName:O?.label,creditCardPaymentSourceAccountType:O?.accType,creditCardPaymentSourceLastFourDigits:O?.accountLast4,creditCardPaymentSourceBalance:O?.accountBalance?.available?.amount??0};if(c.useEffect(()=>{B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&N(Fa(d.companyId,!0))},[B.fetchState]),c.useEffect(()=>{b.updateStatus==="Completed"&&A!=null&&E&&i&&o&&J.trackCardsPayEarlyPayNowClick(k,n,A,b.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:b.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:b.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:b.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:b.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:S?.add(3,"day").format(Ea.visual.MMMDCommaYYYYformat),paymentInitiatedDate:S?.format(Ea.visual.MMMDCommaYYYYformat)},Y,m,f)},[b.updateStatus,A,E,i,o,S]),c.useEffect(()=>{b.fetchState==="Completed"&&A!=null&&E&&i&&o&&!V&&e&&l&&A!=null&&(J.trackCardsPayEarlyFormView(k,n,A,a,d.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,g.balance.amount,Y,m,f),u(!0))},[b,E,i,o,V,e,l]),L==null)throw Error("Can't access invite people page without signing in...");const q=()=>{t(!0),N(bt())};return s.jsx(s.Fragment,{children:s.jsx(Mt,{onClose:()=>{q()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Kr.overlayWidth.valuePercentage(v),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:_.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(qr,{onClick:$=>$.stopPropagation(),children:s.jsx(Wr,{closeDrawerHandler:t,navigate:R,paymentDetails:b,creditAccountSpentAmount:r,onTransferClick:()=>{E&&i&&o&&A!=null&&J.trackCardsPayEarlyFormClick(k,n,A,"Pay Now",b.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:b.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:b.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:b.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:b.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},Y,m,f),N(on({companyId:d.companyId}))},onDismissClick:q,onSaveChangesToLocalStore:$=>{N(tt($))},currentTenant:d,hasZeniAccountsAdminAccess:U,isZeniAccountsUser:K,isZeniAccountSetupEnabled:I,productInformation:n,sourcePage:C,controllerEmails:k,autoPayThreshold:H,paymentSourceInformation:Y,creditAccountInformation:m,debitAccountInformation:f,cashbackInformation:A,isCashbackInfoFetchStateCompleted:E,isCreditCardInfoFetchStateCompleted:i,isDebitCardInfoFetchStateCompleted:o,paymentInitiatedDate:S,maxInsuredAmount:p.maxInsuredAmount})})})})},qr=_e(xr)`
|
|
15
|
+
display: flex;
|
|
16
|
+
min-height: 100%;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
`,Kt="charge-card-transaction-update",Oa=qa.getLocalizedStrings().dateFormat,Jr=pe(function(e,t){const{includeCreditAccountInfo:a,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:C}=t,m=Q.getSignedInUser(),f=e.tenantState.currentTenantId,A={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:f??""},o=Ma(e,r,a,C),i=pn(e,r),E=hn(e);return{chargeCardDetailView:o,chargeCardsRecurringExpensesState:i,vgsVaultId:Ba.cardVaultId,transactionAttachmentsEndpointToFetch:`${Ha}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${Ha}/card_transaction_attachment`,authParams:A,isSnackbarOpen:E.isSnackbarOpen,cardsEndPoint:`${Nt.cardMicroServiceBaseUrl}`,signedInUserToken:o.twoFAView.token??n}},function(e,t){const{cardId:a,currentTenant:r,navigate:n,location:C,cardProviderId:m,includeCreditAccountInfo:f,setIsPaymentOpen:A,controllerEmails:o,productInformation:i,cashbackInformation:E,primaryFundingAccountDetails:S,creditAccountInformation:h,debitAccountInformation:R,isChargeCardFeatureEnabled:F}=t,{tenantEmailDomain:D}=r;return{onEventReceived:p=>{p===Kt&&(e(za(a,!0)),e(nt(a,null,null,!0)))},onReloadTransactions:()=>{e(Qe(a,f,F))},onFetchChargeCardTransactionList:(p,b)=>{e(nt(a,p,b))},onUpdateScrollYOffset:p=>{},onGetOtp:p=>{m!=null&&e(Ta(p,"ChargeCardHolder",a))},onResendOtp:p=>{m!=null&&e(wa(p,"ChargeCardHolder",a))},onVerifyOtp:(p,b)=>{m!=null&&e(Pa(p,b,"ChargeCardHolder",a))},onVerifyOtpSuccess:p=>{p!=null&&Q.saveZeniOtpTokenForCardHolder(p,a)},onColorCodeChange:p=>{e(In(a,p))},onLockChargeCard:(p,b)=>{e(Pt(p,a,b))},onUnlockChargeCard:p=>{e(_t(p,a))},onCloseChargeCard:p=>{e(Dt(a,p))},onFetchChargeCardsRecurringExpenses:()=>{e(kt([a]))},updateChargeCardName:(p,b)=>{e(Et(p,a,b))},updateChargeCardTransactionAttachments:(p,b)=>{b!=null&&e(Sn({transactionId:p,data:b}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(p,b,g,d)=>{e(yn({chargeCardId:b,transactionId:p,fetchState:g,error:d}))},updateChargeCardTransactionReceiptsShowTick:(p,b,g)=>{e(bn({chargeCardId:b,transactionId:p,shouldShowTick:g}))},onChargeCardRevokeInviteClick:()=>{e(At(a))},updateChargeCardTransactionIsViewReceiptClicked:(p,b,g)=>{e(gn({chargeCardId:b,transactionId:p,isViewReceiptClicked:g}))},onChargeCardTransactionRowClick:(p,b)=>{const g=fe(C.state?.pathnameStackToGoBack,C.pathname);n(`../../transaction/${p}/${b}`,{state:{pathnameStackToGoBack:g}})},onBackClick:()=>{const p=ve(C.state?.pathnameStackToGoBack),b=Ne(D);n(b,{state:{pathnameStackToGoBack:p.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(fn())},onUpdateDebitCardPinAttempt:p=>{e(It(a,p)),p==="success"&&e(oa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(p,b)=>{p?e(oa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):b!=null&&e(oa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:b.message}]}))},updateSpendLimit(p,b,g,d){e(St(p,b,g.code,d))},shouldOpenCreditCardPaymentDrawer(p){p&&E!=null&&J.trackCardsPayEarlyClick(o,i,E,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:S?.accType==="depositAccount",creditCardPaymentSourceAccountName:S?.label,creditCardPaymentSourceAccountType:S?.accType,creditCardPaymentSourceLastFourDigits:S?.accountLast4,creditCardPaymentSourceBalance:S?.accountBalance?.available?.amount??0},h,R),A(p)}}})(hr(fr));function Xr(){const e=le(),t=ue(),a=ge(),{cardId:r}=ca(),[n,C]=c.useState(!1),[m,f]=c.useState(!1),{useDynamicConfig:A}=se(),o=Q.getSignedInUser(),i=y(M=>ce(M)),E=y(M=>ka(M).firstViewAfterActivation),S=y(M=>M.classListState.fetchState),{configValue:h}=A(Fe.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:R}=A(Fe.zeniCardsConfig),F=R.enable_card_controls_for_company_ids,D=R.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(F)&&F.includes(i.companyId),[p,b]=c.useState(!1),[g,d]=c.useState(!1),{useFeatureGate:_}=se(),{isFeatureEnabled:v}=_(z.isChargeCardFeatureEnabled),{isFeatureEnabled:N}=_(z.isDebitCardFeatureEnabled),L=Se(N,i),w=Ie({isDebitCardFeatureEnabled:N,isBankingOnlyTenant:L}),{isFeatureEnabled:V}=_(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:u}=_(z.isCardsCommentingEnabled),l=ye(i),P=be(i),T=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,H=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:v,isBookKeepingTenant:l,isDebitCardProductVisible:w,chargeCardsCreditAccountLimit:T}),U=!!i.companyDebitCardInfo?.info?.isDebitCardEnabled,K=!!i.companyChargeCardInfo?.info?.isChargeCardEnabled,I=!i.userRole.includes("charge_card_user")&&H&&K;if(r==null)throw Error("Empty card id is not valid...");const B=y(M=>da(M,i.companyId)),{creditAccount:j,creditAccountRepayment:O}=y(M=>Ye(M)),W=Q.getZeniOtpTokenForCardHolder(r),k=y(M=>Ma(M,r,I,H)),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:q}=Zt({mobileExploreReferrer:"Card Detail"});jt({isDataReady:k.fetchState==="Completed"});const $=y(M=>Ze(M)),x=k.chargeCard,oe=je(),ae=Re(oe?.loggedInUserRoleMap),ne=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_virtual_debit_card",X=x?.type.code==="business_physical_debit_card"||x?.type.code==="business_physical_credit_card",re=x?.type.code==="business_virtual_debit_card"||x?.type.code==="business_virtual_credit_card",Ee=x?.type.code==="business_virtual_debit_card",xe=Ca(H,K,ae,j,O),Z=Gt(ne,k),he=Qa(ae,$),ke=Oe(H,w,U,K),Be=k.depositAccountLimitFetchState.fetchState!=="Completed"&&k.depositAccountLimitFetchState.fetchState!=="In-Progress",Pe=y(M=>$e(M,i.companyId)),we=ze(Pe.controllers),ee=y(M=>x?.cardCreatedByUser?.userId!=null?ba(M.userRoleState,x?.cardCreatedByUser?.userId):void 0),pa=y(M=>ee?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ee?.accountingClassIDs[0],reportId:"class_list"}):void 0),ie=y(M=>x?.cardHolderUser?.userId!=null?ba(M.userRoleState,x?.cardHolderUser?.userId):void 0),ea=y(M=>ie?.accountingClassIDs[0]!=null?ya(M.classState,{classId:ie?.accountingClassIDs[0],reportId:"class_list"}):void 0),de=i?.userRole,Le=y(M=>Ke(M,!1,w,v).revokeCardInvite),aa=Ja(Le.saveStatus.fetchState);if(c.useEffect(()=>{if(aa==="In-Progress"&&Le.saveStatus.fetchState==="Completed"){const M=Ne(i.tenantEmailDomain);e(M)}},[aa,Le.saveStatus.fetchState,e,i.tenantEmailDomain]),c.useEffect(()=>{E&&n===!1&&re&&(C(!0),setTimeout(()=>{t(Sa()),Ee&&t(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[E,n,re,Ee]),c.useEffect(()=>{p||k.fetchState==="Completed"||k.fetchState==="In-Progress"||r==null||(b(!0),t(Qe(r,I,H,!1)))},[p,k,r,t]),c.useEffect(()=>{!g&&k.fetchState==="Completed"&&k.chargeCard?.connectedAccountId!=null&&ne&&Be&&ae&&(d(!0),t(yt({depositAccountId:k.chargeCard?.connectedAccountId})))},[g,k,t,Be,ae]),c.useEffect(()=>{$.fetchState!=="Completed"&&$.fetchState!=="In-Progress"&&ae&&t(Ct()),S!=="Completed"&&S!=="In-Progress"&&t(mt()),k.transactionStatistics.fetchState!=="Completed"&&k.transactionStatistics.fetchState!=="In-Progress"&&t(Cn({chargeCardId:r})),B.fetchState!=="Completed"&&B.fetchState!=="In-Progress"&&t(Fa(i.companyId,!0))},[$.fetchState,t,ae,S,k.transactionStatistics.fetchState,B.fetchState]),c.useEffect(()=>{if(!(k.fetchState!=="Completed"||H&&j.fetchState!=="Completed"||x==null||k.transactionStatistics.fetchState!=="Completed"||ne&&ae&&k.depositAccountLimitFetchState.fetchState!=="Completed")){const M=x.type.code.includes("physical"),me=M?x.cardActivationAttemptHistory[0]?.timestamp:x.createTime;J.trackCardsCardDetailView(we,ke,{cardId:r,cardName:x.cardName,cardType:x.type.code.includes("credit")?"credit":"debit",cardCategory:M?"physical":"virtual",cardLimit:Je(x.limit.amount),cardLastFourDigits:x.accountLast4,cardStatus:x.status.code,cardAssignedDate:x.createTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:x.providerCardCreateTime?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:me?.format(Oa.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:x.creditLimitFrequency.name,cardSpentAmount:Je(x.balance.amount),cardAvailableLimit:Je(x.available.amount),cardUtilizationPercent:x.limit.amount>0?Math.round((x.limit.amount-x.available.amount)/x.limit.amount*100):0,cardUtilizationAmount:Je(x.limit.amount-x.available.amount),totalNumberOfDeclinedTransactions:k.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:k.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:k.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:k.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:k.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:k.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:k.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:Va(x.cardCreatedByUser,!1),cardIssuedByEmail:x.cardCreatedByUser?.email,cardIssuedByUserId:x.cardCreatedByUser?.userId,cardIssuedByRole:ee?.userRoles,cardIssuedByDepartment:pa?.className},{cardholderName:Va(x.cardHolderUser,!1),cardholderEmail:x.cardHolderUser?.email,cardholderRole:ie?.userRoles,cardholderUserId:x.cardHolderUser?.userId,cardholderDepartment:ea?.className},xe,Z)}},[k.fetchState,k.depositAccountLimitFetchState.fetchState,k.transactionStatistics.fetchState,j.fetchState,ae]),o==null)throw Error("Can't access card detail page without signing in...");const We=i.companyId??Q.getSignedInUserTenant(i.tenantEmailDomain)?.companyId,ta={events:We!=null?[`private-encrypted-${We}.${Kt}`]:[],eventCallback:(M,me,Te)=>{Te.onEventReceived(M)}},na=()=>{if(r!=null&&x!=null){const{ownerName:M,cardName:me,utilisation:Te,limit:Ve,frequency:qe,cardColor:G}=ja(x),De=x.cardHolderUserId===o.userId;J.trackCardsDetailPageViewed(r,M,me,Te,Ve,qe,G,De)}};c.useEffect(()=>{if(k.fetchState==="Completed"){const M=k.chargeCard;if(M?.status.code==="inactive"||ne&&M?.isPinSet===!1||X&&E){const me=Ce(i.tenantEmailDomain,r,o,x,E);e(me)}}},[k.fetchState]);const ra=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ve,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;J.trackCardsDetailPageClicked(r,Te,Ve,qe,G,De,M,He,me)}},sa=(M,me)=>{if(r!=null&&x!=null){const{ownerName:Te,cardName:Ve,utilisation:qe,limit:G,frequency:De}=ja(x),He=x.cardHolderUserId===o.userId;J.trackCardsVerifyPopUpClick(r,Te,Ve,qe,G,De,M,He,me)}},Ua=j.balance.amount+j.hold.amount,ha=i.companyChargeCardInfo?.info?.primaryFundingAccount,fa=B.allFundingAccounts.find(M=>M.id===ha?.accountId);return r==null||k.fetchState==="Error"?s.jsx(La,{}):k.fetchState==="In-Progress"||k.fetchState==="Not-Started"||Le.saveStatus.fetchState==="In-Progress"||ne&&ae&&k.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(pr,{}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:E}),k.fetchState==="Completed"?s.jsx(Xa,{analytics:J,onLoad:na}):null,m===!0?s.jsx(at,{closeDrawerHandler:()=>f(!1),isPaymentDrawerOpen:m,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:ke,creditAccountInformation:xe,debitAccountInformation:Z,cashbackInformation:he,creditAccountSpentAmount:Ua,isDebitCardInfoFetchStateCompleted:!ne||!ae||k.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!H||j.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!ae||$.fetchState==="Completed",paymentInitiatedDate:O.initiatedRepaymentDate}):null,s.jsx(Jr,{...ta,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:sa,onFireOnClickAnalytics:ra,isSandboxEnv:Ka(),signedInUser:o,location:a,navigate:e,setIsPaymentOpen:f,cardIssuedByRoles:ee?.userRoles,cardIssuedByDepartmentName:pa?.className,cardHolderRoles:ie?.userRoles,cardHolderDepartmentName:ea?.className,loggedInUserRole:de,isChargeCardFeatureEnabled:H,isDebitCardFeatureEnabled:w,isDebitCardSetupEnabled:U,isChargeCardSetupEnabled:K,isCardControlsEnabled:D,isEarlyPayEnabled:V,controllerEmails:we,chargeCardCashbackDetailState:$,productInformation:ke,creditAccountInformation:xe,debitAccountInformation:Z,cashbackInformation:he,classListFetchState:S,primaryFundingAccountDetails:fa,currentTenant:i,cardProviderId:k.chargeCard?.cardProviderID,cardId:r,creditAccount:j,creditAccountRepayment:O,includeCreditAccountInfo:I,signedInUserToken:W,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:h.documentAiReceiptMaxSizeLimitBytes!=null?h.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:Y,onAskAiCfoClick:q,isCardsCommentingEnabled:u})]})}const ja=e=>{const t=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,a=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,C=e.creditLimitFrequency.name;return{ownerName:t,cardName:a,utilisation:r,cardColor:e.cardColorCode??"",frequency:C,limit:n}},Qr=_e.div`
|
|
19
|
+
display: flex;
|
|
20
|
+
width: 100%;
|
|
21
|
+
flex: 1 1 auto;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
+
`,es=pe(function(e,t){const a=Ke(e,t.includeCreditAccountDebitSummaryAndCashbackInfo,t.isDebitCardFeatureEnabled&&t.isDebitCardSetupEnabled,t.isChargeCardFeatureEnabled&&t.isChargeCardSetupEnabled);return{chargeCardListView:a,rowActionView:An(e),bulkActionView:En(e),companyLegalName:t.currentTenant.companyName,admins:t.admins,searchText:a.searchText,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigateAndClearBulkSelection:a,currentTenant:r,location:n,signedInUser:C,chargeCardListState:m,includeCreditAccountDebitSummaryAndCashbackInfo:f,isChargeCardFeatureEnabled:A,isCreditCardProductVisibleForExpressInterest:o,isChargeCardSetupEnabled:i,isDebitCardFeatureEnabled:E,isDebitCardSetupEnabled:S,isDebitCardTOSAccepted:h,isChargeCardTOSAccepted:R,controllerEmails:F,depositAccountListWithDebitCardIssued:D,primaryFundingAccountDetails:p,chargeCardSetUpViewFetchState:b,productInformation:g,cashbackInformation:d,creditAccountInformation:_,debitAccountInformation:v,updatePayNowInfoTooltip:N,isUserHasCardsAdminLevelAccess:L}=t,{tenantEmailDomain:w}=r,{cards:V}=m;return{onChargeCardRowClick:(u,l)=>{const P=zt(V,u);let T;P!=null&&((U=>{const K=U.limit.amount-U.available.amount,I=`${U.cardHolderUser?.firstName.toLowerCase()} ${U.cardHolderUser?.lastName.toLowerCase()}`,B=U.cardName,j=U.department?.className??"",O=U.limit.amount,W=U.creditLimitFrequency.name;J.trackCardsListRowClicked(I,B,j,K,O,W,C.userId===U.cardHolderUserId)})(P),Me(E,S,D)&&J.trackCardsCardListRowClick(F,g,"Card Row Item","row_clicked",l+1,{cardOwner:Va(P.cardHolderUser,!1),cardName:P.cardName,cardType:P.type.code.includes("credit")?"credit":"debit",cardStatus:P.status.code,cardUtilizationAmount:Je(P.limit.amount-P.available.amount),cardUtilizationPercent:P.limit.amount>0?Math.round((P.limit.amount-P.available.amount)/P.limit.amount*100):0,cardLimit:Je(P.limit.amount)},d,_,v)),T=P?.status.code==="request_on_hold"&&C.userId===P.cardHolderUserId?Yt(w):Ce(w,u,C,P);const H=fe(n.state?.pathnameStackToGoBack,n.pathname);a(T,{state:{pathnameStackToGoBack:H}})},onFetchChargeCardsRecurringExpenses:u=>{e(kt(u))},onFetchDepositAccountLimit:u=>{e(yt({depositAccountId:u}))},onChargeCardResendInviteClick:u=>{e(vn(u))},onChargeCardRevokeInviteClick:u=>{e(At(u))},onLockChargeCardList:(u,l)=>{e(Fn(u,l))},onUnlockChargeCardList:u=>{e(Tn(u))},onCloseChargeCardList:(u,l)=>{e(wn(u,l))},onRevokeChargeCardList:u=>{e(Pn(u))},updateChargeCardListSpendLimit(u,l,P){e(_n(u,l,P.code))},onLockChargeCard:(u,l)=>{e(Pt(L,u,l))},onUnlockChargeCard:u=>{e(_t(L,u))},onCloseChargeCard:(u,l)=>{e(Dt(u,l))},onUpdateSpendLimit(u,l,P,T){e(St(u,l,P.code,T))},updateChargeCardName:(u,l)=>{e(Et(L,u,l))},onClickSetupIcon:()=>{J.trackCardsListPageClicked("settings"),Me(E,S,D)&&d!=null&&J.trackCardsSettingsClick(F,g,d,_,v);const u=Ur(w),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},onIssueCardClick:()=>{J.trackCardsListPageClicked("new card"),Me(E,S,D)&&d!=null&&J.trackCardsNewCardClick(F,g,d,"New Button","card_creation_initiated","Card List",_,v);const u=as(w),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},onColumnSortConfigChanged:(u,l)=>{Me(E,S,D)&&d!=null&&J.trackCardsCardListSortClick(F,g,d,"Sort Icon","sort",u,l==="ascending"?"ASC":"DESC","Cards List",_,v),e(Na({uiState:{sortKey:u,sortOrder:l}}))},onSearchTextChanged:u=>{e(Dn(u))},onReloadCards:()=>{e(Ia(f,E&&S,A&&i,!0))},onLetsGoClick:()=>{a("./onboard")},onBackClick:()=>{a("../../")},onTotalCashbackClick:()=>{Me(E,S,D)&&d!=null&&J.trackCardsCashbackOverviewClick(F,g,d,"Cashback Overview","cashback_details_viewed",_,v),a("./cashback")},onClickStatementsIcon:()=>{Me(E,S,D)&&d!=null&&J.trackCardsStatementsClick(F,g,d,_,v),a("./statements")},onCreateNowClick:u=>{Me(E,S,D)&&d!=null&&J.trackCardsNewCardClick(F,g,d,"Promo Banner","card_creation_initiated","Card List",_,v),a(`./new?cardType=${u}`)},onPromoCardClick:u=>{a(u==="debit"&&E&&!h||u==="credit"&&o&&!R?`../promo?cardPromoType=${u}`:"./setup")},navigateToCreditCardPaymentPage:(u,l)=>{b==="Completed"&&r.company!=null&&d!=null&&J.trackCardsPayEarlyClick(F,g,d,"Card List",u,l,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:p?.accType==="depositAccount",creditCardPaymentSourceAccountName:p?.label,creditCardPaymentSourceAccountType:p?.accType,creditCardPaymentSourceLastFourDigits:p?.accountLast4,creditCardPaymentSourceBalance:p?.accountBalance?.available?.amount??0},_,v);const P=ts(w);a(P)},navigateToCreditCardPaymentHistoryPage:()=>{const u=ns(w),l=fe(n.state?.pathnameStackToGoBack,n.pathname);a(u,{state:{pathnameStackToGoBack:l}})},shouldShowPayNowInfoTooltip:N,onSetRowActionCardId:u=>{e(kn(u))},onSetBulkActionCardIds:u=>{e(wt(u))}}})(gr);function it({isPaymentDrawerOpen:e}){const t=le(),a=ue(),r=ge(),n=c.useCallback((G,De)=>{a(wt([])),t(G,De)},[a,t]),[C,m]=c.useState(!1),[f,A]=c.useState(Q.getPayNowInfoTooltip()??!1),o=G=>{Q.savePayNowInfoTooltip(G),A(G)},[i,E]=c.useState(!1),S=Q.getSignedInUser(),h=y(G=>ce(G)),[R,F]=c.useState(!1),[D,p]=c.useState(!1),{isAiCfoAccessEnabled:b,onAskAiCfoClick:g}=Zt({mobileExploreReferrer:"Cards"}),d=h.userRole.includes("charge_card_user"),_=!d,v=!!h.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:N,useDynamicConfig:L}=se(),{isFeatureEnabled:w}=N(z.isCashbackFeatureEnabled),{isFeatureEnabled:V}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=N(z.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=N(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:P}=N(z.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:T}=N(z.isCardsCommentingEnabled),H=Se(u,h),U=Ie({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:H}),K=be(h),I=ye(h),B=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,j=Ae({isCardsOnlyTenant:K,isChargeCardFeatureEnabled:V,isBookKeepingTenant:I,isDebitCardProductVisible:U,chargeCardsCreditAccountLimit:B}),O=$t({isCardsOnlyTenant:K,isChargeCardFeatureEnabled:V,isBookKeepingTenant:I}),{configValue:W}=L(Fe.zeniCardsConfig),k=je(),Y=Re(k?.loggedInUserRoleMap),q=y(G=>$e(G,h.companyId)),$=ze(q.controllers),x=W.charge_card_cashback_rate_per_transaction!=null?W.charge_card_cashback_rate_per_transaction:.0175,oe=W.credit_card_pay_now_threshold_by_company_id?.[h.companyId]??W.default_credit_card_pay_now_threshold??Lr,ae=W.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(W.enable_card_controls_for_company_ids)&&W.enable_card_controls_for_company_ids.includes(h.companyId),ne=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,X=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!h.companyChargeCardInfo?.info?.isChargeCardEnabled,Ee=y(G=>ft(G)),xe=Ja(Ee.updateStatus),Z=y(G=>Ke(G,_,U&&v,j&&re)),he=Z.cards.filter(G=>G.type.code.includes("debit")).map(G=>G.connectedAccountId),ke=[...new Set(he)],Be=y(G=>Ze(G)),Pe=y(G=>va(G,ke)),we=y(G=>da(G,h.companyId)),ee=we.companyChargeCardInfo?.primaryFundingAccount,pa=we.allFundingAccounts.find(G=>G.id===ee?.accountId),ie=Z.fetchState,ea=Z.creditAccount;jt({isDataReady:ie==="Completed"});const{creditAccountRepayment:de}=y(G=>Ye(G)),Le=y(G=>ka(G).firstViewAfterActivation),{areTenantIdsInSync:aa}=Vt(),We=Qa(Y,Be),ta=Ca(j,re,Y,ea,de),na=et(U,v,Y,Pe,Z.debitCardSummary),ra=Oe(j,U,v,re),sa=Z.creditAccount.balance.amount+Z.creditAccount.hold.amount;if(c.useEffect(()=>{ie==="Completed"&&(Q.getPayNowInfoTooltip()==null||sa<oe*Z.creditAccount.limit.amount/100)&&o(!0)},[ie,oe,sa,Z.creditAccount.limit.amount]),c.useEffect(()=>{if(e!=null&&e===!0&&de.initiatedRepayments.amount===0&&de.fetchState==="Completed"||xe==="In-Progress"&&Ee.updateStatus==="Completed")o(!1),m(!0);else if(de.initiatedRepayments.amount>0&&de.fetchState==="Completed"){m(!1),document.body.style.overflow="auto";const G=Ne(h.tenantEmailDomain);n(G)}},[e,de.initiatedRepayments.amount,de.fetchState,xe,Ee.updateStatus,n,h.tenantEmailDomain]),c.useEffect(()=>{!R&&(re||v)&&aa&&(F(!0),a(Ia(_,U&&v,j&&re,!1)))},[R,_,a,aa]),c.useEffect(()=>{Le&&i===!1&&(E(!0),setTimeout(()=>{a(Sa())},5e3))},[Le,i]),c.useEffect(()=>{ie==="Completed"&&d&&Z.cards.length===1&&(Z.cards[0].status.code==="inactive"&&Z.cards[0].type.code==="business_physical_credit_card"?n(`./${Z.cards[0].id}/activate`):Z.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${Z.cards[0].id}`)))},[ie,d,r.state,n,Z.cards]),c.useEffect(()=>{if(ie==="Completed"&&d){const G=Z.cards.length,De=Z.cards.filter(He=>He.cardHolderUserId===S?.userId).filter(He=>He.status.code==="request_on_hold");De.length>0&&G===De.length&&n("./onboard")}},[ie,Z.cards,d,n,S?.userId]),c.useEffect(()=>{ie!=="Completed"||j&&de.fetchState!=="Completed"||U&&v&&Y&&Pe.fetchState!=="Completed"||J.trackCardsCardListView($,ra,We,ta,na)},[ie,ea,de.fetchState,Pe.fetchState,Y]),S==null)throw Error("Can't access charge card list page without signing in...");const Ua=y(G=>Tt(G.userState,G.userRoleState,G.userListViewState,"cardAdmin")),ha=Ya(k?.loggedInUserRoleMap),fa=G=>{p(G)},M=Z.creditAccount.limit,me=()=>{m(!1),n("..")},Te=h.companyChargeCardInfo?.info!=null&&Xe({cardInfo:h.companyChargeCardInfo.info,isProductVisible:j,isTOSAccepted:ne,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha}),Ve=h.companyDebitCardInfo?.info!=null&&Xe({cardInfo:h.companyDebitCardInfo.info,isProductVisible:U,isTOSAccepted:X,isSetupEnabled:v,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:ha});return re||v?s.jsxs(s.Fragment,{children:[ie==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:J,onLoad:()=>{J.trackPageLoaded(Ht.Event.cardsListPage),(j&&!re||U&&!v)&&J.trackCardsPromoView($,{isCreditCardOffered:j,isDebitCardOffered:U,isDebitCardEnabled:v,isCreditCardEnabled:re},"Banner",U&&!v?"Debit Card":j&&!re?"Credit Card":"","Card List")}}),s.jsx(xa,{showConfetti:Le})]}):null,C===!0?s.jsx(at,{closeDrawerHandler:me,isPaymentDrawerOpen:C,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:sa,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isDebitCardInfoFetchStateCompleted:!(U&&v&&Y)||Pe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!j||de.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!Y||Be.fetchState==="Completed",paymentInitiatedDate:de.initiatedRepaymentDate}):null,s.jsxs(Qr,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:fa}),s.jsx(es,{isCashbackFeatureEnabled:w,isChargeCardFeatureEnabled:j,isDebitCardFeatureEnabled:U,isCreditCardProductVisibleForExpressInterest:O,updatePayNowInfoTooltip:o,showPayNowInfoTooltip:f,creditCardPayNowThreshold:oe,signedInUser:S,chargeCardListState:Z,location:r,admins:Ua.users,navigateAndClearBulkSelection:n,currentTenant:h,isCardControlsEnabled:ae,companyChargeCardInfoCreditAccountLimit:h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:h.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:Y,includeCreditAccountDebitSummaryAndCashbackInfo:_,onClickMenuIcon:()=>{fa(!0)},creditLimit:M,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:v,isEarlyPayEnabled:l,isChargeCardPaymentHistoryFeatureEnabled:P,cashbackRate:x,controllerEmails:$,chargeCardCashbackDetailState:Be,depositAccountListWithDebitCardIssued:Pe,isChargeCardTOSAccepted:ne,isDebitCardTOSAccepted:X,primaryFundingAccountDetails:pa,chargeCardSetUpViewFetchState:we.fetchState,productInformation:ra,creditAccountInformation:ta,debitAccountInformation:na,cashbackInformation:We,isAiCfoAccessEnabled:b,onAskAiCfoClick:g,isCardsCommentingEnabled:T})]})]}):(ne||X)&&Y===!0?s.jsx(ga,{to:"../setup"}):Te||Ve?s.jsx(ga,{to:"../promo"}):s.jsx(la,{fetchState:ie})}const as=e=>`/${e}/cards/new`,ts=e=>`/${e}/cards/payment`,ns=e=>`/${e}/cards/payment-history`,rs=pe(function(e){const t=Q.getSignedInUser(),a=ce(e),r=e.tenantState.currentTenantId,n=Ft(e),C={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""},m=a?.companyName??"",f=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:xn(a),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:C,companyName:m,spendManagementEndPoint:`${Ha}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:f}},function(e,t){const{location:a,navigate:r}=t;return{onBackClick:()=>{const n=ve(a.state?.pathnameStackToGoBack),C=n.poppedPathname??"..";r(C,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,C)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:C}}})},onFiltersChange:n=>{e(Ln({filters:n}))},onReloadPayments:()=>{e(vt(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(Bn({uiState:{downloadState:n}}))}}})(br);function ss(){const e=le(),t=ge(),a=ue(),{areTenantIdsInSync:r}=Vt(),{useFeatureGate:n}=se();if(Q.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const C=y(q=>ce(q)),m=y(q=>Ft(q)),[f,A]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[h,R]=c.useState(null),F=!C.userRole.includes("charge_card_user"),D=!!C.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:p}=n(z.isChargeCardFeatureEnabled),{isFeatureEnabled:b}=n(z.isDebitCardFeatureEnabled),g=Se(b,C),d=Ie({isDebitCardFeatureEnabled:b,isBankingOnlyTenant:g}),_=be(C),v=ye(C),N=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Ae({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:p,isBookKeepingTenant:v,isDebitCardProductVisible:d,chargeCardsCreditAccountLimit:N}),w=!!C.companyChargeCardInfo?.info?.isChargeCardEnabled,V=je(),u=Re(V?.loggedInUserRoleMap),l=y(q=>Ke(q,F,d&&D,L&&w)),P=c.useMemo(()=>{const q=l.cards.filter($=>$.type.code.includes("debit"));return[...new Set(q.map($=>$.connectedAccountId))]},[l.cards]),T=y(q=>Ze(q)),H=y(q=>va(q,P)),{creditAccountRepayment:U}=y(q=>Ye(q)),K=c.useMemo(()=>Qa(u,T),[u,T]),I=c.useMemo(()=>Ca(L,w,u,l.creditAccount,U),[L,w,u,l.creditAccount,U]),B=c.useMemo(()=>et(d,D,u,H,l.debitCardSummary),[d,D,u,H,l.debitCardSummary]),j=c.useMemo(()=>Oe(L,d,D,w),[L,d,D,w]),O=l.creditAccount.balance.amount+l.creditAccount.hold.amount,W=c.useMemo(()=>h!=null?m.repaymentHistory.find(q=>q.cardRepaymentId===h):void 0,[h,m.repaymentHistory]),k=c.useCallback(q=>{R(q),a(Ia(F,d&&D,L&&w,!1)),S(!0)},[a,F,d,D,L,w]),Y=c.useCallback(()=>{S(!1),R(null),document.body.style.overflow="auto"},[]);return c.useEffect(()=>{f||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(A(!0),a(vt()))},[f,a,m.fetchState]),c.useEffect(()=>{!o&&(w||D)&&r&&(i(!0),a(Ia(F,!1,L&&w,!1)))},[o,w,D,r,a,F,L]),s.jsxs(s.Fragment,{children:[E?s.jsx(at,{closeDrawerHandler:Y,isPaymentDrawerOpen:E,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:O,productInformation:j,creditAccountInformation:I,debitAccountInformation:B,cashbackInformation:K,isDebitCardInfoFetchStateCompleted:!(d&&D&&u)||H.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!L||U.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!u||T.fetchState==="Completed",paymentInitiatedDate:U.initiatedRepaymentDate,retryRepayment:W}):null,s.jsx(rs,{location:t,navigate:e,accountInfoByAccountId:m.accountInfoByAccountId,onRetryPaymentClick:k})]})}const ct=_e.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
height: 100vh;
|
|
28
|
+
width: 100%;
|
|
29
|
+
flex: 1 1 auto;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
overflow: auto;
|
|
32
|
+
align-items: center;
|
|
33
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
34
|
+
`,dt=qa.getLocalizedStrings().months;function os(){const e=le(),t=ue(),a=ge(),{creditAccount:r,creditAccountRepayment:n}=y(I=>Ye(I)),C=`${Nt.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[m,f]=c.useState(!1),[A,o]=c.useState(!1),i=y(I=>Un(I)),{useFeatureGate:E}=se(),S=y(I=>ce(I)),{isFeatureEnabled:h}=E(z.isChargeCardFeatureEnabled),{isFeatureEnabled:R}=E(z.isDebitCardFeatureEnabled),F=Se(R,S),D=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:F}),p=be(S),b=ye(S),g=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,d=Ae({isCardsOnlyTenant:p,isChargeCardFeatureEnabled:h,isBookKeepingTenant:b,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:g}),_=!!S.companyDebitCardInfo?.info?.isDebitCardEnabled,v=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,N=y(I=>$e(I,S.companyId)),L=ze(N.controllers),w=y(I=>xt(I)),V=w.cards.filter(I=>I.type.code.includes("debit")).map(I=>I.connectedAccountId),u=[...new Set(V)],l=y(I=>va(I,u)),P=y(I=>Rn(I));c.useEffect(()=>{A||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(f(!0),t(Ga()))},[m,t,r.fetchState]),c.useEffect(()=>{A||r.fetchState!=="Completed"||r.id==null||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(o(!0),t(On(r.id)))},[A,t,r.fetchState,r.id,i.fetchState]),c.useEffect(()=>{l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&D&&_&&t(Bt()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&t(ia()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&D&&_&&t(jn()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&d&&v&&t($a())},[l.fetchState,D,_,w.fetchState,P.fetchState,n.fetchState,d,v]),c.useEffect(()=>{if(i.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&w.fetchState==="Completed"&&(!D||!_||l.fetchState==="Completed"&&P.fetchState==="Completed")){let I="",B="";if(i.statements.length>0){const k=i.statements[i.statements.length-1].period,[Y,q]=k.split("-"),$=i.statements[0].period,[x,oe]=$.split("-");I=`${dt[parseInt(q)-1]} ${Y}`,B=`${dt[parseInt(oe)-1]} ${x}`}const j=Oe(d,D,_,v),O=Ca(d,v,!0,r,n),W=et(D,_,!0,l,P);J.trackCardsCreditCardStatementsView(L,j,{numberOfStatements:i.statements.length,oldestStatementMonthYear:I,latestStatementMonthYear:B},O,W)}},[i.fetchState,r.fetchState,n.fetchState,l.fetchState,w.fetchState,P.fetchState]);const T=()=>{const I=ve(a.state?.pathnameStackToGoBack),B=I.poppedPathname??"..";e(B,{state:{pathnameStackToGoBack:I.newStack}})},H=y(I=>Ze(I)),U=Q.getSignedInUser(),K={userId:U?.userId??"",sessionId:U?.zeniSessionId??"",tenantId:S.tenantId??""};if(U==null)throw Error("Can't access address page without signing in...");if(i.fetchState!=="Completed")return s.jsx(ct,{children:s.jsx(yr,{onBackClick:T})});{const I=Oe(d,D,_,v);return s.jsx(ct,{children:s.jsx(Sr,{currentTenantCompanyName:S.companyName,statementListView:i,productInformation:I,onBackClick:T,authParams:K,controllerEmails:L,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:D,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:v,chargeCardCashbackDetailState:H,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:l,debitCardSummary:P,downloadEndPoint:C})})}}const is={containerWidth:new ma(100,58)},cs=({appContent:e})=>{const t=ua(),a=ue(),r=le(),n=ge(),{useDynamicConfig:C}=se(),[m,f]=c.useState(!1),[A,o]=c.useState(!1),[i,E]=c.useState(!1),[S,h]=c.useState(!1),[R,F]=c.useState(!1),[D,p]=c.useState(!1),b=Q.getSignedInUser();if(b==null)throw Error("Can't access onboarding card page without signing in...");const g=y(O=>ce(O)),{configValue:d}=C(Fe.zeniCardsConfig),_=y(O=>Nn(O)),{tenantEmailDomain:v}=g,N=y(O=>O.settingsViewState.profile.fetchState),L=y(O=>O.chargeCardListState.fetchState),w=y(O=>O.settingsViewState.profile.userId),V=y(O=>O.chargeCardConfigState.fetchState);c.useEffect(()=>{m===!1&&N!=="In-Progress"&&N!=="Completed"&&(a(Vn()),f(!0)),A===!1&&V!=="In-Progress"&&V!=="Completed"&&(a(Da()),o(!0)),i===!1&&L==="Not-Started"&&(E(!0),a(ia()))},[m,i,L,A,V]),c.useEffect(()=>{N==="Completed"&&R===!1&&w!=null&&L==="Completed"&&_.cards.length>0&&(a(Hn({userId:w})),a(Lt({cardId:_.cards[_.cards.length-1].id})),F(!0))},[N,R,w,L]),c.useEffect(()=>{if(!S&&_.fetchState==="Completed"&&_.cards.length===0){const O=ve(n.state?.pathnameStackToGoBack),W=O.poppedPathname??Ne(v);r(W,{state:{pathnameStackToGoBack:O.newStack}})}},[_.fetchState,_.cards,S]);const u=y(O=>ka(O)),l=Ja(u.updateStatus.fetchState),P=u.currentDisplayedCardId,{useFeatureGate:T}=se(),{isFeatureEnabled:H}=T(z.isChargeCardFeatureEnabled),U=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,K=!g.userRole.includes("charge_card_user")&&H&&U,I=y(O=>P!=null?Ut(O.chargeCardState,P):null),B=()=>{P!=null&&(a(Qe(P,K,!0)),a(ia()),h(!0))};c.useEffect(()=>{if(S&&P!=null&&I!=null&&I.status.code!=="request_on_hold"){const O=Ce(g.tenantEmailDomain,P,b,I),W=fe(n.state?.pathnameStackToGoBack,n.pathname);a(Mn()),I?.type.code==="business_virtual_credit_card"&&a(_a()),r(O,{state:{pathnameStackToGoBack:W},replace:!0})}},[S,I?.status.code]),c.useEffect(()=>{l==="In-Progress"&&u.updateStatus.fetchState==="Completed"&&setTimeout(B,3e3)},[l,u.updateStatus.fetchState]);const j=O=>{p(O)};if(!S&&L!=="Completed"||N!=="Completed"||_.cards.length===0)return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:j}),s.jsx(Ir,{})]});if(w==null)throw Error("Can't access my userId.");return s.jsxs(lt,{children:[s.jsx(Ge,{isAppContentDrawerOpen:D,handleDrawerToggle:j}),s.jsx(ds,{chargeCardListView:_,cardUserOnboardingView:u,navigate:r,currentTenant:g,myUserId:w,location:n,chargeCardCashbackRatePerTransaction:d.charge_card_cashback_rate_per_transaction!=null?d.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{j(!0)}}),e!=null?s.jsx(ls,{windowSize:t,children:e}):null]})},ds=pe(function(e,{currentTenant:t,cardUserOnboardingView:a,chargeCardListView:r,myUserId:n}){const C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{cards:r.cards,showMenuIcon:m,companyLegalName:t.companyName,twoFAView:a.twoFAView,cardUserOnboardingLocalData:a.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:a.isDOBPresent,onboardingProgressStatus:a.onboardingProgressStatus}},function(e,t){const{navigate:a,cardUserOnboardingView:r,location:n,currentTenant:C}=t,{tenantEmailDomain:m}=C;return{updateCardUserOnboardingLocalData:f=>{e(rt({localData:f}))},onGetOtp:f=>{if(r.cardUserOnboardingLocalData!=null){const A={...r.cardUserOnboardingLocalData,phone:f};e(rt({localData:A}))}e(Ta(f,"CardUserOnboarding"))},onResendOtp:f=>{e(wa(f,"CardUserOnboarding"))},onVerifyOtp:(f,A)=>{e(Pa(f,A,"CardUserOnboarding"))},onVerifyOtpSuccess:f=>{e(Gn()),f!=null&&Q.saveZeniOtpToken(f)},setCurrentDisplayedCardId:f=>{e(Lt({cardId:f}))},onBackClick:()=>{const f=ve(n.state?.pathnameStackToGoBack),A=f.poppedPathname??Ne(m);a(A,{state:{pathnameStackToGoBack:f.newStack}})}}})(Ar),ls=_e.div`
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
width: ${e=>`${is.containerWidth.value(e.windowSize)}%`};
|
|
38
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
39
|
+
`,lt=_e.div`
|
|
40
|
+
display: flex;
|
|
41
|
+
min-height: 100%;
|
|
42
|
+
width: 100%;
|
|
43
|
+
flex: 1 1 auto;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
align-items: center;
|
|
46
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
47
|
+
`,us={containerWidth:new ma(100,58)},ms=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),C=ge(),{useDynamicConfig:m,useFeatureGate:f}=se(),[A,o]=c.useState(!1),[i,E]=c.useState(!1),[S,h]=c.useState(!1),[R,F]=c.useState(!1),D=Q.getSignedInUser();if(D==null)throw Error("Can't access onboarding card page without signing in...");const p=y(B=>ce(B));if(n==null)throw Error("Empty card id is not valid...");const{configValue:b}=m(Fe.zeniCardsConfig),g=y(B=>$n(B,n)),{isFeatureEnabled:d}=f(z.isChargeCardFeatureEnabled),{isFeatureEnabled:_}=f(z.isDebitCardFeatureEnabled),v=Se(_,p),N=Ie({isDebitCardFeatureEnabled:_,isBankingOnlyTenant:v}),L=be(p),w=ye(p),V=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,u=Ae({isCardsOnlyTenant:L,isChargeCardFeatureEnabled:d,isBookKeepingTenant:w,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:V}),l=g.chargeCard,P=y(B=>B.chargeCardConfigState.fetchState);c.useEffect(()=>{A===!1&&P!=="In-Progress"&&P!=="Completed"&&(a(Da()),o(!0)),i===!1&&g.fetchState==="Not-Started"&&(E(!0),a(Qe(n,!1,u)))},[i,g.fetchState,A,P]);const T=l?.type.code==="business_physical_debit_card"||l?.type.code==="business_virtual_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(S===!1&&(T===!1||T&&l.status?.code!=="active"||T&&l.status.code==="active"&&l.isPinSet||l.cardHolderUserId!==D.userId)){const B=Ce(p.tenantEmailDomain,n,D,l,!0),j=fe(C.state?.pathnameStackToGoBack,C.pathname);r(B,{state:{pathnameStackToGoBack:j}})}else if(S&&g.isRefreshingViewInBackground===!1&&l?.isPinSet===!0){a(zn({chargeCardId:n}));const B=Ce(p.tenantEmailDomain,n,D,l,!0),j=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(B,{state:{pathnameStackToGoBack:j}})}}},[g.fetchState,l?.type.code,S,g.isRefreshingViewInBackground]);const H=Q.getZeniOtpTokenForCardHolder(n),U=y(B=>pt(B.userState,D.userId)),K=()=>{l?.isPinSet!==!0&&a(za(n,!0))};c.useEffect(()=>{g.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout(K,3e3),h(!0))},[g.updateDebitCardPinAttemptFetchState.fetchState]);const I=B=>{F(B)};if(P!=="Completed"||l==null)return s.jsx(la,{fetchState:"In-Progress"});if(U?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(hs,{children:[s.jsx(Ge,{isAppContentDrawerOpen:R,handleDrawerToggle:I}),s.jsx(Cs,{cardId:n,card:l,phone:U.phone,signedInUser:D,isSandboxEnv:Ka(),debitCardDetailState:g,signedInUserToken:H,navigate:r,currentTenant:p,location:C,chargeCardCashbackRatePerTransaction:b.charge_card_cashback_rate_per_transaction!=null?b.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{I(!0)}}),e!=null?s.jsx(ps,{windowSize:t,children:e}):null]})},Cs=pe(function(e,{debitCardDetailState:t,cardId:a}){const r=ht(e,a),n=t.updateStatus,C=Ke(e,!1,!1,!1);let m=!1;return C.fetchState==="Completed"&&C.cards.length<=1&&(m=!0),{showMenuIcon:m,vgsVaultId:Ba.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,debitCardDetailState:m}=t,f=m.chargeCard?.cardProviderID,{tenantEmailDomain:A}=C;return{onGetOtp:o=>{f!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:o=>{e(It(r,o))},onResendOtp:o=>{f!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{f!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onSetPinSuccess:()=>{e(Yn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("activate")===!0?Ne(A):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(Er),ps=_e.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
width: ${e=>`${us.containerWidth.value(e.windowSize)}%`};
|
|
51
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
52
|
+
box-shadow: ${e=>`${Aa.sp0} 2px ${Aa.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
53
|
+
`,hs=_e.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
min-height: 100%;
|
|
56
|
+
width: 100%;
|
|
57
|
+
flex: 1 1 auto;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
align-items: center;
|
|
60
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
61
|
+
box-shadow: ${e=>`${Aa.sp0} 2px ${Aa.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
62
|
+
`,fs={overlayWidth:new ma(Ra[12],Ra[12],Ra[9])},gs=pe(function(e,t){const a=Za(e,!1,!1),r=t.lineId,n=a.customAddress[r],C=a.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:t.googleAPIKey,customAddress:n,customAddressStatus:C,lineId:r}},function(e,t){const{newCustomAddressId:a,lineId:r,chargeCardTypeOption:n}=t;return{onSubmitHandler:C=>{a!=null&&e(Rt(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const m=jr(C);e(Wn({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:m})),e(qn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{t.onDismissClick(),a!=null&&e(Kn({addressId:a,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(kr),bs=({lineId:e,closeDrawerHandler:t,chargeCardTypeOption:a})=>{const r=Wa(),n=ua(),C=()=>{t()},m=y(f=>Zn(`${a==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,f))?.newAddressId;return s.jsx(Mt,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:fs.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(f,A)=>(A==="backdropClick"||A==="escapeKeyDown")&&C(),children:s.jsx(gs,{googleAPIKey:Ba.googleMapsAPIKey,onDismissClick:C,lineId:e,chargeCardTypeOption:a,newCustomAddressId:m})})},ys=pe(function(e,t){const{isChargeCardFeatureEnabled:a,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:f}=t,A=Za(e,a&&m,r&&f);return{companyName:t.companyName,signedInUser:t.signedInUser,issueChargeCards:A,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:C,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:a,isChargeCardSetupEnabled:m,isDebitCardSetupEnabled:f,cardHolderCandidates:A.userList.map(o=>o.user).filter(Boolean),allRoles:A.userList.map(o=>o.userRole),allAccountingClasses:A.allAccountingClasses,userList:A.userList}},function(e,t){return{onIssueCardClick:()=>{e(Qn())},onSaveChangesToLocalStore:a=>{e(Xn(a))},onDismissClick:()=>{e(Ot()),t.navigate("../")},resetCustomAddressByLineID:(a,r)=>{e(Rt(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${a}_address`))},openAddAddressDrawerHandler:t.openAddAddressDrawerHandler}})(Pr);function Ss(){const e=Q.getSignedInUser(),t=le(),a=ue(),r=Dr(),[n]=ut(),C=n.get("cardType"),{useFeatureGate:m}=se(),{isFeatureEnabled:f}=m(z.isIssuePhysicalCardEnabled),{isFeatureEnabled:A}=m(z.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:o}=m(z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(z.isChargeCardFeatureEnabled),E=y(I=>ce(I)),S=Se(o,E),h=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:S}),R=be(E),F=ye(E),D=E.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,p=Ae({isCardsOnlyTenant:R,isChargeCardFeatureEnabled:i,isBookKeepingTenant:F,isDebitCardProductVisible:h,chargeCardsCreditAccountLimit:D}),[b,g]=c.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");c.useEffect(()=>{b||(g(!0),a(Jn(h&&_,p&&d,!1)))},[b,g,a]);const d=!!E.companyChargeCardInfo?.info?.isChargeCardEnabled,_=!!E.companyDebitCardInfo?.info?.isDebitCardEnabled,v=E.companyName,N=y(I=>Za(I,p&&d,h&&_)),L=N.fetchState,w=N.issueCardStatus.fetchState,V=N.lastSelfIssuedDebitCardId,u=y(I=>V!=null?Ut(I.chargeCardState,V):void 0),[l,P]=c.useState(null),[T,H]=c.useState(null),U=()=>{P(null)},K=(I,B)=>{P(I),H(B)};return c.useEffect(()=>{if(w==="Completed"){if(V!=null&&u?.type.code==="business_virtual_debit_card"){let I;I=u?.status.code==="request_on_hold"&&e.userId===u.cardHolderUserId?Yt(E.tenantEmailDomain):Ce(E.tenantEmailDomain,V,e,u),t(I)}else t("../");a(Ot())}},[w,V]),L==="Completed"?s.jsxs(s.Fragment,{children:[l!==null&&T!==null?s.jsx(bs,{closeDrawerHandler:U,lineId:l,chargeCardTypeOption:T}):null,s.jsx(ys,{companyName:v,signedInUser:e,themeState:r,isIssuePhysicalCardEnabled:f,isIssuePhysicalDebitCardEnabled:A,isDebitCardFeatureEnabled:h,isChargeCardFeatureEnabled:p,isChargeCardSetupEnabled:d,isDebitCardSetupEnabled:_,navigate:t,fetchState:N.fetchState,openAddAddressDrawerHandler:K,defaultCardType:C==="creditCard"||C==="debitCard"?C:void 0})]}):L==="Error"?s.jsx(La,{}):s.jsx(_r,{})}const Is=_e.div`
|
|
63
|
+
display: flex;
|
|
64
|
+
height: 100vh;
|
|
65
|
+
width: 100%;
|
|
66
|
+
flex: 1 1 auto;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
overflow: auto;
|
|
69
|
+
align-items: center;
|
|
70
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
71
|
+
`,As=pe(function(e,t){const{myPendingActivationChargeCardListState:a}=t;return{myPendingActivationChargeCardListView:a,uiState:a.uiState,signedInUser:t.signedInUser}},function(e,t){const{navigate:a,currentTenant:r,location:n,signedInUser:C,myPendingActivationChargeCardListState:m}=t,{tenantEmailDomain:f}=r,{cards:A}=m;return{onChargeCardRowClick:o=>{const i=zt(A,o),E=Ce(f,o,C,i),S=fe(n.state?.pathnameStackToGoBack,n.pathname);a(E,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(o,i)=>{e(Na({uiState:{sortKey:o,sortOrder:i}}))},onReloadCards:()=>{e(ia())},onBackClick:()=>{const o=r.userRole.includes("charge_card_user");e(Na({uiState:{sortKey:o?"cardName":"owner",sortOrder:"ascending"}})),a("../")}}})(wr);function Es(){const e=le(),t=ue(),a=ge(),r=Wa(),[n,C]=c.useState(!1),m=y(T=>er(T)),f=y(T=>ce(T)),A=y(T=>$e(T,f.companyId)),o=ze(A.controllers),{useFeatureGate:i}=se(),{isFeatureEnabled:E}=i(z.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=i(z.isDebitCardFeatureEnabled),h=Se(S,f),R=Ie({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:h}),F=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,D=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,p=je(),b=be(f),g=ye(f),d=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,_=Ae({isCardsOnlyTenant:b,isChargeCardFeatureEnabled:E,isBookKeepingTenant:g,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:d}),v=Re(p?.loggedInUserRoleMap),N=y(T=>Ze(T)),{creditAccount:L,creditAccountRepayment:w}=y(T=>Ye(T)),V=y(T=>xt(T)).cards.filter(T=>T.type.code.includes("debit")).map(T=>T.connectedAccountId),u=[...new Set(V)],l=y(T=>va(T,u));c.useEffect(()=>{n||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(C(!0),t(ia()),t(Da()))},[n,t,m.fetchState]),c.useEffect(()=>{if(m.fetchState==="Completed"&&m.cards.length===1&&P!=null){const T=Ce(f.tenantEmailDomain,m.cards[0].id,P,m.cards[0]);e(T,{state:{message:a.state?.message}})}},[m.fetchState,m.cards]);const P=Q.getSignedInUser();if(c.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&_&&D&&v&&t(Ga()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&v&&t($a()),l.fetchState!=="Completed"&&l.fetchState!=="In-Progress"&&R&&F&&v&&t(Bt())},[L.fetchState,w.fetchState,t,l.fetchState,R,F,v,_,D]),P==null)throw Error("Can't access address page without signing in...");if(m.fetchState!=="Completed")return s.jsx(la,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}});{const T=Oe(_,R,F,D);return s.jsx(Is,{children:s.jsx(As,{navigate:e,currentTenant:f,signedInUser:P,productInformation:T,myPendingActivationChargeCardListState:m,isChargeCardFeatureEnabled:_,isDebitCardFeatureEnabled:R,isDebitCardSetupEnabled:F,isChargeCardSetupEnabled:D,chargeCardCashbackDetailState:N,creditAccount:L,creditAccountRepayment:w,depositAccountListWithDebitCardIssued:l,controllerEmails:o,location:a})})}}const ks=pe(function(e,t){const{companyId:a,companyLegalName:r}=t;return{chargeCardSetupView:da(e,a),admins:t.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,t){const{navigate:a,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:C,isChargeCardSetupEnabled:m,signedInUser:f,location:A,productInformation:o,isEarlyPayEnabled:i,controllerEmails:E,chargeCardsCreditAccountLimit:S}=t;return{onSetupButtonClick:h=>{if(f!=null&&J.trackCardsPromoPageClicked("enable cards"),n)switch(J.trackCardsEnableCardsClick(E,o,"Cards Promo"),h){case"credit":e(Ue(r,!0,"charge_cards",i,!1));break;case"debit":e(Ue(r,!0,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Ue(r,!0,"debit_cards",i,!0):Ue(r,!0,"charge_cards__debit_cards",i,!1))}else switch(J.trackCardsSetupCardsClick(E,o,"Cards Promo"),h){case"credit":e(Ue(r,!1,"charge_cards",i,!1));break;case"debit":e(Ue(r,!1,"debit_cards",i,!1));break;case"debit_and_credit":e(S===0?Ue(r,!1,"debit_cards",i,!0):Ue(r,!1,"charge_cards__debit_cards",i,!1))}},onBackClick:()=>{const h=ve(A.state?.pathnameStackToGoBack);let R=h.poppedPathname;R==null&&(R=C||m?"..":"../.."),a(R,{state:{pathnameStackToGoBack:h.newStack}})},onLetsGoClick:()=>{a("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(_a()),a("../",{relative:"path"})):a("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(nr(r))}}})(Fr),Ds=()=>{const e=le(),{tenantEmailDomain:t}=ca(),[a]=ut(),r=a.get("cardPromoType"),n=ue(),{useDynamicConfig:C,useFeatureGate:m}=se(),[f,A]=c.useState(!1),{isFeatureEnabled:o}=m(z.isDebitCardFeatureEnabled),{isFeatureEnabled:i}=m(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:E}=m(z.isChargeCardFeatureEnabled),{configValue:S}=C(Fe.zeniCardsConfig),h=y(ee=>ce(ee)),R=y(ee=>$e(ee,h.companyId)),F=ze(R.controllers),D=S.charge_card_cashback_rate_per_transaction!=null?S.charge_card_cashback_rate_per_transaction:.0175,p=ge(),b=Q.getSignedInUserTenant(t)?.companyId??h.companyId,g=y(ee=>da(ee,b)),d=g.primaryFundingAccount,_=h.companyBillPayInfo?.info,v=be(h),N=ye(h),L=Se(o,h),w=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,V=Ie({isDebitCardFeatureEnabled:o,isBankingOnlyTenant:L}),u=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:E,isBookKeepingTenant:N,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:w}),l=$t({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:E,isBookKeepingTenant:N}),P=V&&u===!1,T=_?.businessVerificationStatus?.code==="verified"&&(P||d?.accType==="depositAccount"||ar(d?.providerVerificationStatus?.code??"")),H=Q.getSignedInUser(),U=!!h.companyZeniAccountInfo?.info?.isZeniAccountEnabled,K=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,I=!!h.company?.companyChargeCardInfo.isChargeCardEnabled,B=!!h.company?.companyDebitCardInfo.isDebitCardEnabled,j=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,O=ee=>{A(ee)},W=y(ee=>ee.chargeCardSetupViewState.fetchState);if(H==null)throw Error("Can't access Charge Card promo page without signing in...");const k=je(),Y=Re(k?.loggedInUserRoleMap),q=Ya(k?.loggedInUserRoleMap),[$,x]=c.useState(!1),[oe,ae]=c.useState(!1),[ne,X]=c.useState(!1);c.useEffect(()=>{$===!1&&p.state?.message==="activation"&&x(!0)},[p.state]),c.useEffect(()=>{oe||W!=="Not-Started"||b==null||(ae(!0),n(Fa(b,!0)))},[oe,W,b,n]);const re=h.companyChargeCardInfo?.info!=null&&Xe({cardInfo:h.companyChargeCardInfo.info,isProductVisible:l,isTOSAccepted:K,isSetupEnabled:I,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),Ee=h.companyDebitCardInfo?.info!=null&&Xe({cardInfo:h.companyDebitCardInfo.info,isProductVisible:V,isTOSAccepted:j,isSetupEnabled:B,isUserHasCardsAdminLevelAccess:Y,isUserHasCardsAccess:q}),xe=V&&Ee&&l&&w>=0&&re?"debit_and_credit":V&&Ee?"debit":"credit",Z=Rr(r,xe),he=g?.chargeCardTermsDetails?.fetchStatus?.fetchState,ke=c.useRef(null);c.useEffect(()=>{he==="In-Progress"?ke.current=Z:he!=="Error"&&he!=="Not-Started"||(ke.current=null)},[he,Z]);const Be=he!=="In-Progress"&&he!=="Completed"||ke.current==null?Z:ke.current;c.useEffect(()=>{Z==="credit"&&(I||l===!1&&B)||Z==="debit"&&B||Z==="debit_and_credit"&&B&&I?e("../"):(Z==="debit_and_credit"&&K===!0&&j===!0||Z==="credit"&&(K===!0||l===!1&&j===!0)||Z==="debit"&&j===!0)&&Y===!0&&e("../setup")},[T,I,B,Z,K,j]),c.useEffect(()=>{ne||(n(tr("cardAdmin")),X(!0))},[ne]);const Pe=y(ee=>Tt(ee.userState,ee.userRoleState,ee.userListViewState,"cardAdmin")),we=Oe(l,V,B,I);return(re||Ee)&&W==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(Xa,{analytics:J,onLoad:()=>{if(J.trackPageLoaded(Ht.Event.cardsPromoPage),!!l&&!I||!!V&&!B||!!l&&!!V&&!B&&!I){const ee=_s({isDebitCardSetupEnabled:B,isChargeCardSetupEnabled:I,isCreditCardProductVisibleForExpressInterest:l,isDebitCardProductVisible:V});J.trackCardsPromoView(F,we,"Page",ee,"Promo Page")}}}),s.jsx(xa,{showConfetti:$}),s.jsx(Ge,{isAppContentDrawerOpen:f,handleDrawerToggle:O}),s.jsx(ks,{signedInUser:H,location:p,showEnableCardButton:T,isCompanyBusinessVerificationAndPaymentSetUpDone:T,isChargeCardSetupEnabled:I,isDebitCardSetupEnabled:B,companyLegalName:h.companyName,adminList:Pe.users,isCheckingEnabled:U,navigate:e,companyId:b,cardPromoType:Be,controllerEmails:F,productInformation:we,isCreditCardProductVisible:u,isDebitCardFeatureEnabled:o,isEarlyPayEnabled:i,cashbackRate:D,chargeCardsCreditAccountLimit:w,onClickMenuIcon:()=>{O(!0)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ge,{isAppContentDrawerOpen:f,handleDrawerToggle:O}),s.jsx(Tr,{})]})},_s=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:t,isCreditCardProductVisibleForExpressInterest:a,isDebitCardProductVisible:r})=>a&&r&&!e&&!t?"Credit & Debit Card":a&&!t?"Credit Card":r&&!e?"Debit Card":"";function Js(){const e=ge(),t=y(W=>ce(W)),{useFeatureGate:a}=se(),{isFeatureEnabled:r}=a(z.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=a(z.isDebitCardFeatureEnabled),{isFeatureEnabled:C}=a(z.isEarlyPayFeatureEnabled),{isFeatureEnabled:m}=a(z.isChargeCardPaymentHistoryFeatureEnabled),f=Se(n,t),A=Ie({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:f}),o=vr(t,r,n),i=!!t.company?.companyChargeCardInfo.isChargeCardTOSAccepted,E=!!t.company?.companyDebitCardInfo.isDebitCardTOSAccepted,S=!!t.company?.companyChargeCardInfo.isChargeCardEnabled,h=!!t.company?.companyDebitCardInfo.isDebitCardEnabled,R=je(),F=Re(R?.loggedInUserRoleMap),D=Ya(R?.loggedInUserRoleMap),{isFeatureEnabled:p}=a(z.isCashbackFeatureEnabled),b=t.userRole.includes("charge_card_user"),g=!b,d=!b&&S,_=t?.userRole!=null&&rr(t?.userRole),v=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!_)&&sr(R?.loggedInUserRoleMap),N=or(R?.loggedInUserRoleMap),L=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!_)&&ir(R?.loggedInUserRoleMap),{isFeatureEnabled:w}=a(z.isDepositAccountsFeatureEnabled),V=w&&!_&>(R?.loggedInUserRoleMap),u=S&&!_,l=h&&!_,P=o&&!_&&Re(R?.loggedInUserRoleMap),T=cr(R?.loggedInUserRoleMap),H=be(t),U=ye(t),K=t.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=Ae({isCardsOnlyTenant:H,isChargeCardFeatureEnabled:r,isBookKeepingTenant:U,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:K}),B=t.companyChargeCardInfo?.info!=null&&Xe({cardInfo:t.companyChargeCardInfo.info,isProductVisible:I,isTOSAccepted:i,isSetupEnabled:S,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:D}),j=t.companyDebitCardInfo?.info!=null&&Xe({cardInfo:t.companyDebitCardInfo.info,isProductVisible:A,isTOSAccepted:E,isSetupEnabled:h,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:D}),O=B||j;return s.jsxs(Wt,{children:[F?s.jsx(te,{path:"setup",element:s.jsx(st,{isBillPayAdminLevelAccess:v,isReimbursementAdminLevelAccess:L,isZeniAccountAdminLevelAccess:V,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:N,productType:"charge_cards",type:"setup"})}):null,F?s.jsx(te,{path:"verification",element:s.jsx(st,{isBillPayAdminLevelAccess:v,isUserHasOnlyBillPayAccess:N,isReimbursementAdminLevelAccess:L,isZeniAccountAdminLevelAccess:V,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:T,productType:"charge_cards",type:"verification"})}):null,s.jsx(te,{path:"promo",element:s.jsx(Ds,{})}),u||l?s.jsxs(s.Fragment,{children:[s.jsx(te,{path:"/",element:s.jsx(it,{isPaymentDrawerOpen:!1})}),P&&C?s.jsx(te,{path:"payment",element:s.jsx(it,{isPaymentDrawerOpen:!0})}):null,s.jsx(te,{path:"activate",element:s.jsx(Es,{})}),s.jsx(te,{path:"onboard",element:s.jsx(cs,{})}),F?s.jsx(te,{path:"new",element:s.jsx(Ss,{})}):null,p&&g?s.jsx(te,{path:"cashback",element:s.jsx(Hr,{})}):null,d?s.jsx(te,{path:"statements",element:s.jsx(os,{})}):null,P&&m&&S?s.jsx(te,{path:"payment-history",element:s.jsx(ss,{})}):null,s.jsx(te,{path:":cardId/activate",element:s.jsx($r,{})}),s.jsx(te,{path:":cardId/setPin",element:s.jsx(ms,{})}),s.jsx(te,{path:":cardId/addToWallet",element:s.jsx(Nr,{})}),s.jsx(te,{path:":cardId/*",element:s.jsx(Xr,{})}),s.jsx(te,{path:"*",element:s.jsx(La,{})})]}):(i||E)&&F?s.jsx(te,{path:"*",element:s.jsx(ga,{to:"../setup"})}):O?s.jsx(te,{path:"*",element:s.jsx(ga,{to:"../promo",state:e.state})}):s.jsx(te,{path:"*",element:null})]})}export{Js as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-
|
|
1
|
+
import{j as m}from"./liveblocks-D6iO1SmY.js";import{a as g}from"./sentry-DJeJwz74.js";import{l as w,h as T,u as k,i as x,g as b,n as E}from"./core-D-NK-UK9.js";import{z as C,b5 as F,H as P,c as V,e as A,af as O,b6 as L,at as M,au as j,r as U}from"./index-B-v2HYWQ.js";import{eQ as D,fG as B,sb as _,fB as G,c2 as R,ME as z,bn as H,qc as q,q0 as Y,kb as Q,lH as S,MF as Z,bE as $,cv as N,lP as J,lS as K}from"./zeni-epic-state-22WFBgK9.js";import"./mui-DqRlPgPp.js";import{d as W}from"./routePaths-DPqSbEW8.js";import{M as X}from"./MobileAppDrawer-DFwRXpE0.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="4e6c674e-4832-4bab-acbf-062cfd54ab34",a._sentryDebugIdIdentifier="sentry-dbid-4e6c674e-4832-4bab-acbf-062cfd54ab34")}catch{}})();const ee=E(function(a){const t=G(a),i=C.getSignedInUser(),l=D(a),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(a.companyConfigState),n=a.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${M.fileMicroServiceBaseUrl}`,isZeniUser:H(i)}},function(a,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{a(K())},onAddressClick:e=>{const n=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{a(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:j(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};a(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{a(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{a(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{a(Z(e))},onCompanyOfficerUpdated:e=>{a(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{a(Q({files:e}))},onDeleteFile:e=>{a(Y(e))},onEditFileName:(e,n)=>{a(q(e,n.split(".")[0]))}}})(L);function de(){const a=w(),t=T(),i=k(),{tenantEmailDomain:l}=x(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=b(s=>s.companyViewState.passportView.fetchState),o=b(s=>s.companyConfigState.fetchState),r=b(s=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,n,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>a("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(A.Event.companyPassport,O(i)?"Settings":"Company Passport")}),O(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:a,location:i,isLoading:y,currentTenant:r,isSettings:O(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-
|
|
1
|
+
import{j as C}from"./liveblocks-D6iO1SmY.js";import{a}from"./sentry-DJeJwz74.js";import{h as D,u as v,g as f,N as w}from"./core-D-NK-UK9.js";import{Jj as O,eQ as A,fn as U,mT as j,fP as h,fm as _,eU as L,Jq as F}from"./zeni-epic-state-22WFBgK9.js";import{u as $,z as u,L as g,O as k,o as H}from"./index-B-v2HYWQ.js";import{n as P}from"./mui-DqRlPgPp.js";import{t as z}from"./getLocaleForTenant-zP94FwPU.js";import{g as Q,Q as J}from"./QBOConnectionScreen-CNoF2iT1.js";import"./recharts-Dt8dM4EI.js";import"./analytics-NZ6ROu06.js";import"./plaid-BzyOi-ir.js";import"./dnd-C49i2BE4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWZi4J-8.js";import"./lexical-Bp-0qESw.js";import"./pdf-BpZ3cLIj.js";import"./utils-CGva6Exy.js";import"./empty-DH2H1-Nx.js";import"./pdf-lib-CNmHIzRc.js";import"./index-DCy8xCNa.js";import"./url-CawXuWkK.js";import"./index-AU1I47Je.js";import"./decodeURIComponentSafe-C48GZJfu.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="d937ea5f-77fa-489f-85c1-7204d316c462",t._sentryDebugIdIdentifier="sentry-dbid-d937ea5f-77fa-489f-85c1-7204d316c462")}catch{}})();const R=P.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
flex-direction: row;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-D6iO1SmY.js";import{z as a}from"./index-B-v2HYWQ.js";import{g as n}from"./QBOConnectionScreen-CNoF2iT1.js";import"./sentry-DJeJwz74.js";import{u as p,N as s}from"./core-D-NK-UK9.js";import"./zeni-epic-state-22WFBgK9.js";import"./recharts-Dt8dM4EI.js";import"./mui-DqRlPgPp.js";import"./analytics-NZ6ROu06.js";import"./plaid-BzyOi-ir.js";import"./dnd-C49i2BE4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWZi4J-8.js";import"./lexical-Bp-0qESw.js";import"./pdf-BpZ3cLIj.js";import"./utils-CGva6Exy.js";import"./empty-DH2H1-Nx.js";import"./pdf-lib-CNmHIzRc.js";import"./index-DCy8xCNa.js";import"./url-CawXuWkK.js";import"./index-AU1I47Je.js";import"./decodeURIComponentSafe-C48GZJfu.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]="8d904e89-6b8e-4c86-980c-585a84d9d789",t._sentryDebugIdIdentifier="sentry-dbid-8d904e89-6b8e-4c86-980c-585a84d9d789")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|