@zeniai/web-app-ui 5.1.13-dev → 5.1.14-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-D6k3D3bi.js +1 -0
- package/dist/assets/{AddressScreen-DV_3Y5Dd.js → AddressScreen-CQwbqZZO.js} +1 -1
- package/dist/assets/{AiCfoScreen-DCIpTDLP.js → AiCfoScreen-YbbtKYq2.js} +5 -5
- package/dist/assets/{BillPayApprovalRoutes--jcW2FLc.js → BillPayApprovalRoutes-DnqxL1Pm.js} +1 -1
- package/dist/assets/{BillPayRoutes-BTkfIcjr.js → BillPayRoutes-BoVmu9dV.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-BIP8wMM3.js → BusinessVerificationPageScreen-fuG3Lcvn.js} +1 -1
- package/dist/assets/ChargeCardRoutes-CYl6BatQ.js +71 -0
- package/dist/assets/{CompanyPassportScreen-B0NKP79f.js → CompanyPassportScreen-UQxOttfx.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-PbL1UVqW.js → ConnectionAuthScreen-BfEcNkFe.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-9zjDrwVC.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BL0b6UDv.js → CustomerOnboardingRoutes-j2nqZ4nN.js} +1 -1
- package/dist/assets/{DashboardRoutes-Bk3-k8aA.js → DashboardRoutes-CET83H5d.js} +1 -1
- package/dist/assets/{DefaultTenantHome-DFkDTU6K.js → DefaultTenantHome-CUAONDmN.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-DcF3JBva.js → DomesticWireDetailScreen-Ca6Qf-59.js} +1 -1
- package/dist/assets/{DrawerScreen-CAppKc33.js → DrawerScreen-Ow_jLMvM.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-8to1KFrP.js → EntityDetailRoutes-V54UMsCV.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-DeHhHdWL.js → ExpenseAutomationRoutes-7e4pUHwB.js} +3 -3
- package/dist/assets/{FeaturePreviewScreen-CVjTHQhr.js → FeaturePreviewScreen-BDxXA6T-.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-c7cP9QeX.js → HubSpotOAuthCallbackScreen-CNkgDnl2.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-DwiC1JFw.js → MagicLinkRoutes-DvyUmAhH.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-Dh_yynFR.js → MagicLinkSignInScreen-D20XYpha.js} +1 -1
- package/dist/assets/{MobileAppDrawer-JTau2gld.js → MobileAppDrawer-Bc7CKudX.js} +1 -1
- package/dist/assets/NotFoundScreen-GI1oL7ia.js +1 -0
- package/dist/assets/{NotificationRoutes-_k0Aq1Fs.js → NotificationRoutes-sIw0FPmg.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-CY4uNiVL.js → OAuthConsentScreen-DBBt9RS0.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-CpEu_HR9.js → PandLWithForecastRoutes-CBMfBvBb.js} +1 -1
- package/dist/assets/{PeopleRoutes-D7HYauVQ.js → PeopleRoutes-CKn8w_T_.js} +1 -1
- package/dist/assets/PerformanceRoutes-CsVax378.js +1 -0
- package/dist/assets/{Preview-ClpnAHT1.js → Preview-DV7jcNJq.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DkwRHnzC.js → QBOConnectionScreen-BYQW6Fbt.js} +1 -1
- package/dist/assets/{ReferralListScreen-BH-Gp8hT.js → ReferralListScreen-CJTl6Lt1.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-BWXI6Sq3.js → ReimbursementApprovalRoutes-Bg156JK7.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Bo4KnnNL.js → ReimbursementApprovalRuleDetailScreen-grJQ1C7C.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-Bh1fIujo.js → ReimbursementRoutes-DogJUJY0.js} +1 -1
- package/dist/assets/{ReportsRoutes-Dn3ZLb7S.js → ReportsRoutes-D3gOMB1L.js} +1 -1
- package/dist/assets/RewardsRoutes-DAl2OPwN.js +1 -0
- package/dist/assets/{ScreenRoutes-DI_Y6zjP.js → ScreenRoutes-0OjA87-e.js} +2 -2
- package/dist/assets/{SettingsRoutes-cLe5LZ2H.js → SettingsRoutes-BLqlsIUo.js} +1 -1
- package/dist/assets/{SetupPagesScreen-wxhfN3Z8.js → SetupPagesScreen-BEkDGab7.js} +5 -5
- package/dist/assets/{SignInScreen-Dizp0xaJ.js → SignInScreen-C81XlrtI.js} +1 -1
- package/dist/assets/{SignOutScreen-B7TyW1JW.js → SignOutScreen-TMYVNPPz.js} +1 -1
- package/dist/assets/TaskListScreen-Cp8dPOtz.js +9 -0
- package/dist/assets/{TaskRoutes-C-m0qJMN.js → TaskRoutes-CLpKpONO.js} +2 -2
- package/dist/assets/{TransactionDetailRoutes-C0jV8U26.js → TransactionDetailRoutes-CGf6s8zp.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-edCe6TAq.js → TransactionDetailScreen-CdLgHJKN.js} +1 -1
- package/dist/assets/{TransactionListRoutes-C9KgxSvA.js → TransactionListRoutes-n3uV_ll8.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CtrqvH2f.js → TreasuryRoutes-BEgovLNA.js} +1 -1
- package/dist/assets/{VendorsRoutes-Bmiim9sy.js → VendorsRoutes-DsKNaaC6.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-wMbV2aWQ.js → WiseConfirmationScreen-Hy3U9Jqn.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-45Uq5BHn.js → ZeniAccountRoutes-COD09Wd8.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-dmAnBRff.js → ZeniAccountStatementScreen-CQyapLZT.js} +1 -1
- package/dist/assets/{accountMappingHelper-BHoN3wIo.js → accountMappingHelper-olmW29yz.js} +1 -1
- package/dist/assets/{analytics-CcPtShGs.js → analytics-CaY7rw-O.js} +1 -1
- package/dist/assets/{analyticsHelper-BP1tYnOZ.js → analyticsHelper-Bcz25dEb.js} +1 -1
- package/dist/assets/{core-C75ogUO0.js → core-CZ9_x3uq.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DQFLVwZI.js → decodeURIComponentSafe-COFNvK3Q.js} +1 -1
- package/dist/assets/{dnd-DG0pRIc_.js → dnd-Zw_s-D7Q.js} +1 -1
- package/dist/assets/{empty-D7ifHjqQ.js → empty-7cyPspc8.js} +1 -1
- package/dist/assets/{empty-D2ItSKax.js → empty-9FZm-BqI.js} +1 -1
- package/dist/assets/{emptyVideoElement-B5gglY5n.js → emptyVideoElement-Btt4krqI.js} +1 -1
- package/dist/assets/{epic-DObSEDwz.js → epic-DPPpA4p6.js} +1 -1
- package/dist/assets/{getLocaleForTenant-BmcbxAro.js → getLocaleForTenant-CrEWUw4L.js} +1 -1
- package/dist/assets/{index-CKhAKU0q.js → index-BlTI1Mt8.js} +1 -1
- package/dist/assets/{index-BMDwKfYX.js → index-CL3xKt_a.js} +1 -1
- package/dist/assets/{index-Bym7ptuo.js → index-CgsbeRts.js} +168 -168
- package/dist/assets/{index-C44DvqIE.js → index-CuxNhIGG.js} +1 -1
- package/dist/assets/{index-CR1BQVe9.js → index-DGuD8Ns6.js} +1 -1
- package/dist/assets/{index-BvOiqfCI.js → index-DK4X4Vk8.js} +2 -2
- package/dist/assets/{index-DXbmjv79.js → index-Dddel4wm.js} +1 -1
- package/dist/assets/{index-DVeiidBt.js → index-G8xNq7rD.js} +1 -1
- package/dist/assets/{lexical-CTPa-QlE.js → lexical-DW7Zgdoo.js} +1 -1
- package/dist/assets/{liveblocks-DuKyMpLV.js → liveblocks-CA2qpkTt.js} +1 -1
- package/dist/assets/{lottie-Bo62fehS.js → lottie-DW7v-RpQ.js} +1 -1
- package/dist/assets/{mui-B2yeqyWI.js → mui-_CQ1MGrl.js} +1 -1
- package/dist/assets/{pathToGoBack-DYpgrcVb.js → pathToGoBack-DbVxA-Rx.js} +1 -1
- package/dist/assets/{pdf-Dtw1D9Kk.js → pdf-BRE_7-P-.js} +4 -4
- package/dist/assets/{pdf-lib-D0jHZCU0.js → pdf-lib-8meLjW9k.js} +1 -1
- package/dist/assets/{plaid-CcJBdEKU.js → plaid-bOhNZMPB.js} +1 -1
- package/dist/assets/{pusher-Z7AHhnA8.js → pusher-D5RDWDl8.js} +1 -1
- package/dist/assets/{react-BA8wVqyP.js → react-BH9weH58.js} +1 -1
- package/dist/assets/{react-CztHJcoC.js → react-BkZq36aw.js} +1 -1
- package/dist/assets/{react-CFD0b_tj.js → react-CFWgn4__.js} +1 -1
- package/dist/assets/{react-B4Ecs7tk.js → react-DnPEHWM7.js} +1 -1
- package/dist/assets/{react-CHlpM8wD.js → react-E4pIjTga.js} +1 -1
- package/dist/assets/{react-Cs5E-_WR.js → react-lbjp65Wj.js} +1 -1
- package/dist/assets/{recharts-Dl2dfnxR.js → recharts-DG48H-3-.js} +1 -1
- package/dist/assets/{routePaths-JaK4Z9pA.js → routePaths-Mn-6vq-t.js} +1 -1
- package/dist/assets/{sentry-BQi4rXy4.js → sentry-C8Zmy8eq.js} +1 -1
- package/dist/assets/{url-DjEXgApI.js → url-ByuQXOc6.js} +1 -1
- package/dist/assets/{url-DjAMINLQ.js → url-DZj7kXcI.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DsGQtVKH.js → useAiCfoDashboardSuggestedQuestionsChips-Gq0LNWKr.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-BAHB5Jbs.js → useAskAiCfoHostNavButtonProps-DdIVmTUh.js} +1 -1
- package/dist/assets/{useDeviceId-CYUqfkz1.js → useDeviceId-DA16gBd2.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-dWot1qf-.js → useInitialThreadRequest-BYo-vTVR.js} +1 -1
- package/dist/assets/{utils-f-RGxaD7.js → utils-CmjIXJxz.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-CdFMp5ya.js → withTransactionSidePanel-CeImFm_a.js} +1 -1
- package/dist/assets/{zeni-epic-state-zpzwT5a-.js → zeni-epic-state-CeRetUx9.js} +4 -4
- package/dist/index.html +1 -1
- package/package.json +2 -1
- package/dist/assets/AddressRoutes-Cwp-lkfX.js +0 -1
- package/dist/assets/ChargeCardRoutes-Bdv6G4pt.js +0 -71
- package/dist/assets/CustomerOnboardingAuthScreen-Dgl_tiqQ.js +0 -1
- package/dist/assets/NotFoundScreen-wLs1xbOk.js +0 -1
- package/dist/assets/PerformanceRoutes-m-6V-xwr.js +0 -1
- package/dist/assets/RewardsRoutes-CVa89vUN.js +0 -1
- package/dist/assets/TaskListScreen-BZEaHlUV.js +0 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-CA2qpkTt.js";import{A as d}from"./AddressScreen-CQwbqZZO.js";import i from"./NotFoundScreen-GI1oL7ia.js";import"./sentry-C8Zmy8eq.js";import{o as s,p as r}from"./core-CZ9_x3uq.js";import"./zeni-epic-state-CeRetUx9.js";import"./recharts-DG48H-3-.js";import"./index-CgsbeRts.js";import"./mui-_CQ1MGrl.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-
|
|
1
|
+
import{j as r}from"./liveblocks-CA2qpkTt.js";import{a as h}from"./sentry-C8Zmy8eq.js";import{h as T,u as _,g as E,i as j,j as K,n as B}from"./core-CZ9_x3uq.js";import{J as M,h as $,z as D,k as L,B as R,K as z,c as C,e as S,m as F,i as b,p as N}from"./index-CgsbeRts.js";import{Kd as k,h1 as U,eP as G,Ke as O,c2 as V,Kf as q,km as H}from"./zeni-epic-state-CeRetUx9.js";import{n as J}from"./mui-_CQ1MGrl.js";import Q from"./NotFoundScreen-GI1oL7ia.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]="5562d0b3-3192-460c-a91b-b84ca664803d",e._sentryDebugIdIdentifier="sentry-dbid-5562d0b3-3192-460c-a91b-b84ca664803d")}catch{}})();const W=J.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-
|
|
1
|
+
import{j as c}from"./liveblocks-CA2qpkTt.js";import{a as r}from"./sentry-C8Zmy8eq.js";import{u as ge,h as Ce,g as Ie,j as Y,i as ke,n as be}from"./core-CZ9_x3uq.js";import{V as we,z as xe,J as Pe,cR as Ee,cS as Te,b4 as J,cT as ve,b3 as Z,p as D,K as L,c as I,cU as F,cV as ye,cW as Qe,a1 as _e,e as Oe,a7 as Ae,cX as Ue,a2 as je,n as Le,b0 as Fe,cY as Re}from"./index-CgsbeRts.js";import{fI as De,eO as ee,eP as Be,hH as Me,QY as Ve,eS as Ge,hR as Ne,hN as $e,eQ as R,ft as qe,fm as We,fq as K,fu as ze,fv as He,fw as Ye,fx as Je,fy as Ke}from"./zeni-epic-state-CeRetUx9.js";import{D as Xe,n as k,S as Ze,P as et}from"./mui-_CQ1MGrl.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-Gq0LNWKr.js";import{p as st}from"./pathToGoBack-DbVxA-Rx.js";import"./recharts-DG48H-3-.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="47fab699-dded-4669-8842-5278c2f678e0",a._sentryDebugIdIdentifier="sentry-dbid-47fab699-dded-4669-8842-5278c2f678e0")}catch{}})();const te="chat-response-generated",ot=be(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:S,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:d,setIsAiCfoOpen:f}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,u=He(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:b,currentQuestionAnswerSummary:T}=Z(d,t);u!=="answer"?I.trackAICFOChatResponseGenerated(u,b?.question.questionText??"",o.text,t,Re(T,E),o.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(o.text,b?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Ye(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Je({chatSessionId:o.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),a(Ke({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,u)=>{e&&Fe(a,e,p,h,d,l,u,o)},updateCurrentInput:e=>{a(K(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(ze(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(K(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{h!=null&&a(We());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Ae(Ue)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=we(),s=ge(),m=Ce(),l=Ie(),[S,h]=r.useState(!1);r.useEffect(()=>{s(De())},[s]);const d=Y(n=>ee(n)),f=xe.getSignedInUser(),{session_id:e}=ke(),p=Pe(),o=_e(p),u=Y(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:b,isUploadPromoVisible:T}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),v=Te({currentTenant:u,currentChatSessionId:t,aiCfoView:d}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=l.state,x=w?.aiCfoInitialQuestion,B=!!w?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[J]!==!0)return;h(!0);const g={...n};delete g[J],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,y]=r.useState(null),[ne,Q]=r.useState(!1),[ie,_]=r.useState(void 0),[re,O]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&x!=null&&x!==""){const n=l.state;y(x),Q(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;O(typeof g=="number"?g:void 0),M.current=!0}},[x,B,l.state]);const le=r.useCallback(()=>{y(null),Q(!1),_(void 0),O(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??w?.aiCfoRef,A=V.get("emailRefId")??w?.aiCfoEmailRefId,N=r.useRef(!1);r.useEffect(()=>{N.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),N.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(y(P),Q(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:$}=ve(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",W=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),z=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Z(z,t),de=ue.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=D(l.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[u.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:$.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[$]);r.useEffect(()=>{U!=="In-Progress"&&j&&s(Ne())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&W&&f!=null&&U==="Completed"&&!j&&s($e(t,f.userId))},[q,W,t,f,s]);const H=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=t!=null&&d.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:I,onLoad:H}),v.drawerElement,c.jsx(it,{children:c.jsx(X,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(R(u.userRoleId))}})})})]});const Se=c.jsxs(c.Fragment,{children:[S&&!C?c.jsx(L,{analytics:I,onLoad:H}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:I,onLoad:n=>n.trackPageLoaded(Oe.Event.aiCFOPage)}),o&&v.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:z,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:he,isEmptyChatWithSession:de,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?v.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:T,onUploadPromoClose:b,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Xe,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:c.jsx(X,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})})}):null]}),S&&!o?c.jsx(ye,{open:S,onClose:()=>h(!1),children:c.jsx(Qe,{children:Se})}):null]})},X=k(Ze)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,at=
|
|
5
|
+
`,at=k.div`
|
|
6
6
|
height: 100vh;
|
|
7
7
|
width: 100%;
|
|
8
|
-
`,nt=
|
|
8
|
+
`,nt=k.div`
|
|
9
9
|
height: 100vh;
|
|
10
10
|
width: 100%;
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
min-height: 0;
|
|
14
|
-
`,it=
|
|
14
|
+
`,it=k.div`
|
|
15
15
|
flex: 1;
|
|
16
16
|
min-height: 0;
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
|
-
`,rt=
|
|
19
|
+
`,rt=k(et)`
|
|
20
20
|
box-shadow: ${({theme:a})=>a.colors.elevation2};
|
|
21
21
|
color: ${({theme:a})=>a.colors.grey4};
|
|
22
22
|
`;export{Et as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-CA2qpkTt.js";import{a as f}from"./sentry-C8Zmy8eq.js";import{h as U,g as B,u as j,j as v,N,n as T,i as $,o as O,p as h}from"./core-CZ9_x3uq.js";import{eP as F,Nw as R,Nc as b,xW as x,xQ as L,xU as w,xJ as W,Ne as q,xM as z,xY as G,xX as C}from"./zeni-epic-state-CeRetUx9.js";import{h as P,z as k,B as V,a7 as J,bF as M,af as _,bG as Q}from"./index-CgsbeRts.js";import"./mui-_CQ1MGrl.js";import{i as X}from"./ReimbursementApprovalRuleDetailScreen-grJQ1C7C.js";import Y from"./NotFoundScreen-GI1oL7ia.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]="ed366604-6900-4a1e-9dde-fc51de552f4a",e._sentryDebugIdIdentifier="sentry-dbid-ed366604-6900-4a1e-9dde-fc51de552f4a")}catch{}})();const I="bill-approval-rule-update",H=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(q(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(W(a))},onEditRuleClick:a=>{a!=null?(e(w(a)),t(`./${a}/edit`)):(e(w()),t("./new"))}}})(J(M)),K=()=>{const e=U(),o=B(),t=j(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(w())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${I}`]:[],eventCallback:(i,A,m)=>{i.endsWith(I)&&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(H,{currentTenant:c,location:o,navigate:e,...y})},Z=T(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(S=>{const E=!!X(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:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(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(G())},onSaveRuleSuccess:()=>{t("../")}}})(Q);function D(){const e=U(),o=j(),t=B(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(K,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Y,{})})]})}export{se as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-DuKyMpLV.js";import{h as Y,u as se,g as J,i as ae,j as v,N as te,n as Q,l as na,o as ia,p as S}from"./core-C75ogUO0.js";import{eP as Z,MO as _e,bt as It,HI as oa,bo as wt,bF as pe,MP as xt,xe as Ct,yo as $e,xN as la,bn as De,MQ as sa,MR as ra,c2 as ca,MS as da,jG as Bt,MT as At,MU as Et,yZ as Le,xt as Be,MV as ua,x2 as tt,MW as pa,C9 as ma,x6 as ba,xc as Dt,MX as ke,MY as Me,yp as Ge,MZ as ha,M_ as ga,ys as Oe,M$ as ya,yF as Sa,N0 as jt,y9 as at,ye as fa,N1 as ka,N2 as ue,N3 as Tt,N4 as Pt,N5 as Ft,fM as va,xy as Ne,cx as Rt,N6 as Ia,gT as wa,N7 as xa,N8 as Ca,e_ as Vt,eY as $t,N9 as ze,Na as Ba,Nb as Aa,Kx as Ze,Nc as Ea,Ky as oe,Kz as He,Nd as Da,Ne as ja,Nf as Ta,yg as nt,yd as Pa,Ng as Fa,Nh as Ra,Ni as Va,x$ as $a,Nj as Na,Nk as Ua,Nl as _a,cl as Nt,cM as Ut,jR as La,bL as Ma,bq as _t,bM as Lt,wk as Ga,Nm as Oa,BY as za,C2 as Za,sR as Ha,yq as Wa,z4 as qa,k2 as fe,Nn as Ka,No as Mt,kw as Ya,jY as Gt,kh as Ot,kg as it,bE as be,bK as Ja,Np as Qa,Nq as ve,iB as Xa,Nr as ot,Ns as en,iF as tn,i_ as an,zi as nn,Nt as on,kp as ln,z8 as sn,Nu as lt,zc as rn,zh as cn,ze as dn,z6 as un,Nv as zt,xn as pn,Nw as mn,Nx as bn,fE as hn,fD as gn,fC as yn,k5 as Sn,kn as st,ky as fn,qh as kn,ke as vn,za as In,iL as wn,kD as xn,Ny as Cn,iD as Bn,q8 as An,Nz as En,y5 as Dn,bG as jn,bs as Tn,Js as Pn,cO as Fn,cN as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-zpzwT5a-.js";import{h as me,z as V,k as Ie,_ as We,v as le,I as y,aN as Ae,B as re,o as A,K as je,c as D,bc as Nn,p as z,a2 as qe,n as E,J as we,bd as rt,be as ct,bf as Un,ak as _n,w as Ln,aH as Mn,s as Zt,D as Ke,x as Ye,bg as Gn,at as Ht,bh as On,Y as zn,e as Wt,a7 as Zn,bi as Hn,bj as Wn,bk as qn,bl as Kn,bm as Yn,bn as Jn,bo as Qn,bp as Xn,bq as ei,O as ti,br as ai,b7 as ni,bs as ii,bt as oi,a9 as li}from"./index-Bym7ptuo.js";import{n as U,S as si}from"./mui-B2yeqyWI.js";import{A as dt}from"./AddressScreen-DV_3Y5Dd.js";import{g as ie,a as Te,i as qt,V as Je,b as Qe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-DcF3JBva.js";import{a as f}from"./sentry-BQi4rXy4.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-BAHB5Jbs.js";import{u as Kt}from"./useInitialThreadRequest-dWot1qf-.js";import Ee from"./NotFoundScreen-wLs1xbOk.js";import{D as ui}from"./DrawerScreen-CAppKc33.js";import{M as Yt}from"./MobileAppDrawer-JTau2gld.js";import{F as Jt}from"./FeaturePreviewScreen-CVjTHQhr.js";import{S as Pe}from"./SetupPagesScreen-wxhfN3Z8.js";import{B as pi}from"./BillPayApprovalRoutes--jcW2FLc.js";import{FallBackRoute as mi}from"./ScreenRoutes-DI_Y6zjP.js";import"./recharts-Dl2dfnxR.js";import"./analytics-CcPtShGs.js";import"./plaid-CcJBdEKU.js";import"./dnd-DG0pRIc_.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bo62fehS.js";import"./lexical-CTPa-QlE.js";import"./pdf-Dtw1D9Kk.js";import"./utils-f-RGxaD7.js";import"./analyticsHelper-BP1tYnOZ.js";import"./routePaths-JaK4Z9pA.js";import"./BusinessVerificationPageScreen-BIP8wMM3.js";import"./ReimbursementApprovalRuleDetailScreen-Bo4KnnNL.js";import"./getLocaleForTenant-BmcbxAro.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]="a0527fdc-f1b2-4706-9ca1-43742c087d34",e._sentryDebugIdIdentifier="sentry-dbid-a0527fdc-f1b2-4706-9ca1-43742c087d34")}catch{}})();const bi=Q(function(e,t){const l=_e(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:Bt(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(Be(l,"retry")):e(Be(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(Be(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Le(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Nn);function hi(){const e=Y(),t=se(),l=J(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>_e(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,L]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:_}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=_(Ae.zeniAssistConfig),B=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),N=M.user_ids!=null&&r?.userId!=null&&M.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"&&B===!1?L(!1):L(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,B,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,N,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,N,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 ${A.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:N,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Q(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:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload: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)}}})(Mn);function w({appContent:e}){const t=se(),l=Y(),{billId:i}=ae(),c=J(),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(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,L]=f.useState(!1),[T,_]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),B=v(F=>Me(F,m,g,i));let q=B.fetchState,W=B.file,N=B.showAutofill;const K=v(F=>_e(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],N=!1);const X=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?_(!1):!u&&C&&L(!1))},[i]),f.useEffect(()=>{C||i==null||u||(L(!0),t(Ct(i,h,j,!1)),T||(_(!0),t($e(!1,h,j,b,i)))),u&&!T&&(_(!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:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||N?null:a.jsx(pt,{children:a.jsx(Qt,{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=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[N&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(_n,{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"||N?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:N,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,B),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();return a.jsx(Qt,{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-CA2qpkTt.js";import{h as Y,u as se,g as J,i as ae,j as v,N as te,n as Q,l as na,o as ia,p as S}from"./core-CZ9_x3uq.js";import{eP as Z,MO as _e,bt as It,HI as oa,bo as wt,bF as pe,MP as xt,xe as Ct,yo as $e,xN as la,bn as De,MQ as sa,MR as ra,c2 as ca,MS as da,jG as Bt,MT as At,MU as Et,yZ as Le,xt as Be,MV as ua,x2 as tt,MW as pa,C9 as ma,x6 as ba,xc as Dt,MX as ke,MY as Me,yp as Ge,MZ as ha,M_ as ga,ys as Oe,M$ as ya,yF as Sa,N0 as jt,y9 as at,ye as fa,N1 as ka,N2 as ue,N3 as Tt,N4 as Pt,N5 as Ft,fM as va,xy as Ne,cx as Rt,N6 as Ia,gT as wa,N7 as xa,N8 as Ca,e_ as Vt,eY as $t,N9 as ze,Na as Ba,Nb as Aa,Kx as Ze,Nc as Ea,Ky as oe,Kz as He,Nd as Da,Ne as ja,Nf as Ta,yg as nt,yd as Pa,Ng as Fa,Nh as Ra,Ni as Va,x$ as $a,Nj as Na,Nk as Ua,Nl as _a,cl as Nt,cM as Ut,jR as La,bL as Ma,bq as _t,bM as Lt,wk as Ga,Nm as Oa,BY as za,C2 as Za,sR as Ha,yq as Wa,z4 as qa,k2 as fe,Nn as Ka,No as Mt,kw as Ya,jY as Gt,kh as Ot,kg as it,bE as be,bK as Ja,Np as Qa,Nq as ve,iB as Xa,Nr as ot,Ns as en,iF as tn,i_ as an,zi as nn,Nt as on,kp as ln,z8 as sn,Nu as lt,zc as rn,zh as cn,ze as dn,z6 as un,Nv as zt,xn as pn,Nw as mn,Nx as bn,fE as hn,fD as gn,fC as yn,k5 as Sn,kn as st,ky as fn,qh as kn,ke as vn,za as In,iL as wn,kD as xn,Ny as Cn,iD as Bn,q8 as An,Nz as En,y5 as Dn,bG as jn,bs as Tn,Js as Pn,cO as Fn,cN as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-CeRetUx9.js";import{h as me,z as V,k as Ie,_ as We,v as le,I as y,aN as Ae,B as re,o as A,K as je,c as D,bc as Nn,p as z,a2 as qe,n as E,J as we,bd as rt,be as ct,bf as Un,ak as _n,w as Ln,aH as Mn,s as Zt,D as Ke,x as Ye,bg as Gn,at as Ht,bh as On,Y as zn,e as Wt,a7 as Zn,bi as Hn,bj as Wn,bk as qn,bl as Kn,bm as Yn,bn as Jn,bo as Qn,bp as Xn,bq as ei,O as ti,br as ai,b7 as ni,bs as ii,bt as oi,a9 as li}from"./index-CgsbeRts.js";import{n as U,S as si}from"./mui-_CQ1MGrl.js";import{A as dt}from"./AddressScreen-CQwbqZZO.js";import{g as ie,a as Te,i as qt,V as Je,b as Qe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-Ca6Qf-59.js";import{a as f}from"./sentry-C8Zmy8eq.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-DdIVmTUh.js";import{u as Kt}from"./useInitialThreadRequest-BYo-vTVR.js";import Ee from"./NotFoundScreen-GI1oL7ia.js";import{D as ui}from"./DrawerScreen-Ow_jLMvM.js";import{M as Yt}from"./MobileAppDrawer-Bc7CKudX.js";import{F as Jt}from"./FeaturePreviewScreen-BDxXA6T-.js";import{S as Pe}from"./SetupPagesScreen-BEkDGab7.js";import{B as pi}from"./BillPayApprovalRoutes-DnqxL1Pm.js";import{FallBackRoute as mi}from"./ScreenRoutes-0OjA87-e.js";import"./recharts-DG48H-3-.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.js";import"./analyticsHelper-Bcz25dEb.js";import"./routePaths-Mn-6vq-t.js";import"./BusinessVerificationPageScreen-fuG3Lcvn.js";import"./ReimbursementApprovalRuleDetailScreen-grJQ1C7C.js";import"./getLocaleForTenant-CrEWUw4L.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]="a0527fdc-f1b2-4706-9ca1-43742c087d34",e._sentryDebugIdIdentifier="sentry-dbid-a0527fdc-f1b2-4706-9ca1-43742c087d34")}catch{}})();const bi=Q(function(e,t){const l=_e(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:Bt(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(Be(l,"retry")):e(Be(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(Be(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Le(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Nn);function hi(){const e=Y(),t=se(),l=J(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>_e(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,L]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:_}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=_(Ae.zeniAssistConfig),B=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),N=M.user_ids!=null&&r?.userId!=null&&M.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"&&B===!1?L(!1):L(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,B,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,N,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,N,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 ${A.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:N,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Q(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:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload: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)}}})(Mn);function w({appContent:e}){const t=se(),l=Y(),{billId:i}=ae(),c=J(),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(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,L]=f.useState(!1),[T,_]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),B=v(F=>Me(F,m,g,i));let q=B.fetchState,W=B.file,N=B.showAutofill;const K=v(F=>_e(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],N=!1);const X=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?_(!1):!u&&C&&L(!1))},[i]),f.useEffect(()=>{C||i==null||u||(L(!0),t(Ct(i,h,j,!1)),T||(_(!0),t($e(!1,h,j,b,i)))),u&&!T&&(_(!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:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||N?null:a.jsx(pt,{children:a.jsx(Qt,{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=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[N&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(_n,{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"||N?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:N,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,B),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();return a.jsx(Qt,{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 T}from"./liveblocks-
|
|
1
|
+
import{j as T}from"./liveblocks-CA2qpkTt.js";import{a as N}from"./sentry-C8Zmy8eq.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-CZ9_x3uq.js";import{k as ce,v as ue,aN as de,z as B,K as pe,c as z,af as x,e as E,bB as le,at as me,n as P,au as M}from"./index-CgsbeRts.js";import{Nk as fe,eP as q,sg as ye,HM as Se,x$ as ge,AI as Ie,Df as he,DU as be,EN as De,NH as ke,NI as Oe,NJ as Te,NK as Ce,NL as Ne,Ke as Ve,MJ as we,Kq as Ae,km as _e,fE as ve,fD as Fe,fC as xe,qh as Ee,q8 as Be,q5 as ze,ke as Pe,sp as Me,sn as R,bE as L,sB as U,cv as Re}from"./zeni-epic-state-CeRetUx9.js";import{n as Le}from"./mui-_CQ1MGrl.js";import{d as j}from"./routePaths-Mn-6vq-t.js";import{M as Ue}from"./MobileAppDrawer-Bc7CKudX.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]="64d4516c-661c-48df-8a3f-d20134f24c72",e._sentryDebugIdIdentifier="sentry-dbid-64d4516c-661c-48df-8a3f-d20134f24c72")}catch{}})();const je=Le.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-CA2qpkTt.js";import{h as me,i as ba,u as Ce,j as S,g as Se,n as he,N as Fa,s as jt,o as Rn,p as se}from"./core-CZ9_x3uq.js";import{eP as de,bs as He,Pe as ja,eY as Ie,eZ as Ae,e_ as Ee,fT as qe,cs as Je,Pf as Xe,Pg as lt,tv as xa,jO as Ba,Ph as La,gT as pa,z$ as ca,A1 as Ne,A2 as ut,jE as Vt,Pi as Qe,zP as ha,Pj as On,Pk as Un,zS as Va,Pl as jn,NE as Na,rH as Nt,zY as na,h2 as Vn,Pm as Ht,Pn as ea,bq as Nn,Po as Hn,fE as Ha,fD as Ma,Aw as Mn,fC as $a,Nk as $n,Pp as Mt,cl as $t,cM as Gn,ND as ya,B6 as Gt,Pq as Tt,AI as fa,Pr as zt,B7 as zn,O3 as Yn,B8 as Zn,C2 as Kn,sR as Wn,BY as qn,Ps as Jn,A0 as Ze,Pt as Xn,Pu as Qn,Pv as er,Pw as ar,Px as tr,Py as mt,Pz as nr,Ah as Yt,Aa as rr,PA as sr,fV as cr,Aq as Zt,Au as Kt,fU as or,PB as ir,AU as Wt,PC as dr,PD as lr,PE as ur,As as qt,Ad as Jt,zV as Xt,Am as Qt,Ak as en,Ao as mr,PF as an,PG as Ga,AF as ga,Kj as tn,cN as Ct,PH as Cr,PI as pr,PJ as hr,PK as fr,AC as st,A$ as gr,AX as br,Ay as yr,AZ as Sr,AP as Ir,AR as Ar,PL as nn,B5 as Ta,HI as Er,PM as kr,PN as _r,PO as Dr,PP as rn,PQ as Pr,Bs as wr,AH as sn,AB as ve,AG as vr,PR as Tr,PS as Fr,zM as xr,PT as cn,PU as on,PV as Br,zO as Lr,zN as Ft,PW as Rr,PX as Or,PY as Ur,Kf as jr,PZ as pt,P_ as Vr,wn as dn,km as Nr,gU as Hr,Bx as Mr,P$ as ln,Q0 as $r,By as Gr,Q1 as zr,de as Yr,tp as Zr,Bn as Kr,Bh as Ve,bt as Wr,bF as qr,cx as Jr,bG as Xr,Js as Qr}from"./zeni-epic-state-CeRetUx9.js";import{z as ee,k as $e,v as oe,I as Y,B as Sa,c2 as za,cd as es,ce as as,cf as ts,p as Re,cg as ns,ch as rs,J as Ia,aN as Le,n as ye,bm as ht,ci as ss,s as Aa,i as Ya,h as ft,c as q,D as gt,a7 as Za,cj as cs,_ as un,aq as bt,by as ra,ck as ct,cl as os,K as yt,cm as is,at as mn,a2 as ot,Y as Cn,e as pn,cn as ds,co as ls,cp as us,cq as ms,cr as Cs,cs as ps,o as Ra,ct as hs,cu as fs,cv as at,O as gs,cw as bs,cx as ys,cy as Ss,cz as Is,cA as As,a9 as Es}from"./index-CgsbeRts.js";import{n as Te,D as hn,S as ks}from"./mui-_CQ1MGrl.js";import{a as d}from"./sentry-C8Zmy8eq.js";import{g as pe,a as Ea,b as fn,c as ke,d as _e,e as Me,f as Ge,h as ze,A as _s,i as St,P as Ds,j as It,s as sa,k as gn,l as Ke,m as bn,n as Ps,o as yn,p as ws,S as xt}from"./SetupPagesScreen-BEkDGab7.js";import{u as Sn}from"./useInitialThreadRequest-BYo-vTVR.js";import Ka from"./NotFoundScreen-GI1oL7ia.js";import{M as We}from"./MobileAppDrawer-Bc7CKudX.js";import{u as In}from"./useAskAiCfoHostNavButtonProps-DdIVmTUh.js";import{v as Bt}from"./utils-CmjIXJxz.js";import{d as vs}from"./recharts-DG48H-3-.js";import{t as Ts}from"./AddressScreen-CQwbqZZO.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./analyticsHelper-Bcz25dEb.js";import"./routePaths-Mn-6vq-t.js";import"./BusinessVerificationPageScreen-fuG3Lcvn.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="c9e90059-47c2-4e88-916f-bf1c41bae04a",e._sentryDebugIdIdentifier="sentry-dbid-c9e90059-47c2-4e88-916f-bf1c41bae04a")}catch{}})();function Fs(){const e=me(),{cardId:a}=ba(),t=Ce(),r=ee.getSignedInUser(),n=S(K=>de(K)),f=$e(),p=He(f?.loggedInUserRoleMap),{useFeatureGate:g}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,c]=d.useState(!1),l=S(K=>ja(K).firstViewAfterActivation);if(a==null)throw Error("Empty card id is not valid...");const v=n.userRole.includes("charge_card_user"),{isFeatureEnabled:y}=g(Y.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=g(Y.isDebitCardFeatureEnabled),F=Ie(n),L=Ae(n),C=Ee(B,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=ke({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:C}),o=_e({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:y,isBookKeepingTenant:L,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:u}),I=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S(K=>qe(K,n.companyId)),j=Je(A.controllers),{creditAccount:E,creditAccountRepayment:b}=S(K=>Xe(K)),x=S(K=>K.classListState.fetchState),i=!v&&o&&h,m=S(K=>lt(K,a,i,o)),[O,M]=d.useState(!1),R=m.chargeCard,T=R?.cardCreatedByUser?.userId,$=S(K=>T!=null?xa(K.userRoleState,T):void 0),G=$?.accountingClassIDs[0],V=S(K=>G!=null?Ba(K.classState,{classId:G,reportId:"class_list"}):void 0),P=R?.cardHolderUser?.userId,Z=S(K=>P!=null?xa(K.userRoleState,P):void 0),J=Z?.accountingClassIDs[0],w=S(K=>J!=null?Ba(K.classState,{classId:J,reportId:"class_list"}):void 0),U=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",te=R?.type.code==="business_physical_debit_card";d.useEffect(()=>{l&&_===!1&&U&&(c(!0),setTimeout(()=>{t(La()),te&&t(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[l,_,U,te]),d.useEffect(()=>{O||m.fetchState==="Completed"||m.fetchState==="In-Progress"||a==null||(M(!0),t(ca(a,i,!1)))},[O,m,a,t]),d.useEffect(()=>{if(m.fetchState==="Completed"&&(U===!1||U&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||l===!1&&_===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const K=pe(n.tenantEmailDomain,a,r,R,l);e(K)}},[m.fetchState,l,U]),d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&o&&h&&p&&t(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&o&&h&&p&&t(ut()),x!=="Completed"&&x!=="In-Progress"&&t(Vt())},[E.fetchState,b.fetchState,t,o,h,p,x]);const ae=()=>{if(r!=null&&a!=null){t(La());const K=pe(n.tenantEmailDomain,a,r);e(K)}},k=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",z=Me(o,D,I,h),X=Ea(o,h,p,E,b),Q=fn(k,m);return m.fetchState!=="Completed"?s.jsx(Sa,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:l}),s.jsx(es,{onGotItClick:ae,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:o,isDebitCardFeatureEnabled:D,isDebitCardSetupEnabled:I,isChargeCardSetupEnabled:h,productInformation:z,creditAccountInformation:X,debitAccountInformation:Q,chargeCardDetailView:m,creditAccount:E,classListFetchState:x,creditAccountRepayment:b,cardIssuedByRoles:$?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:Z?.userRoles,cardHolderDepartmentName:w?.className})]})}const At=e=>{const{events:a,onEvent:t,onSubscribed:r}=e,n=as(),f=d.useRef(t),p=d.useRef(r),g=d.useRef(0);d.useEffect(()=>{f.current=t},[t]),d.useEffect(()=>{p.current=r},[r]);const _=d.useMemo(()=>[...a].sort().join("|"),[a]);d.useEffect(()=>{if(n==null||a.length===0)return;const c=[],l=new Set,v=()=>{if(p.current==null)return;const y=Date.now();y-g.current<5e3||(g.current=y,p.current())};return a.forEach(y=>{const[h,B]=ts(y);if(B==="")return;const F=n.channel(h),L=u=>{f.current(B,u)};let C;if(F?.subscribed===!0)C=F,C.bind(B,L),l.has(h)||(l.add(h),v()),c.push(()=>{F.unbind(B,L)});else{if(C=F??n.subscribe(h),C.bind(B,L),!l.has(h)){l.add(h);const u=()=>{v()};C.bind("pusher:subscription_succeeded",u),c.push(()=>{C.unbind("pusher:subscription_succeeded",u)})}c.push(()=>{C.unbind(B,L)})}}),()=>{c.forEach(y=>y())}},[n,_])},An="charge-card-transaction-update",En="charge-card-transaction-created",kn="charge-card-transaction-declined",_n="charge-card-transaction-updated",Dn="charge-card-transaction-receipt-uploaded",aa="charge-card-status-update",Et="charge-card-spending-updated",Wa="credit-account-balance-updated",qa="charge-card-created",kt="charge-card-limit-updated",_t="charge-card-limit-reset",Dt="charge-card-renamed",xs="charge-card-department-updated",Pn="charge-card-repayment-completed",wn="charge-card-payment-date-updated",ka="charge-card-cashback-redeemed",_a="charge-card-cashback-earned",ta=(e,a)=>e==null||e===""?[]:a.map(t=>`private-encrypted-${e}.${t}`),Bs=[_a,ka],Ls=he(function(e){const a=Qe(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(a,t)=>{e(On({uiState:{sortKey:a,sortOrder:t}}))}}})(rs);function Rs(){const e=me(),a=Ce(),t=Se(),r=ee.getSignedInUser(),n=S(B=>de(B)),{useFeatureGate:f}=oe(),{isFeatureEnabled:p}=f(Y.isCardsCommentingEnabled),[g,_]=d.useState(!1),c=S(B=>Qe(B)),l=Sn(n.companyId,{clearParams:c.fetchState==="Completed"}),v=d.useCallback(()=>{const B=Re(t.state?.pathnameStackToGoBack),F=B.poppedPathname??Os(n.tenantEmailDomain);e(F,{state:{pathnameStackToGoBack:B.newStack}})},[e,t,n.tenantEmailDomain]),y=Ge(n);if(At({events:ta(y,Bs),onEvent:B=>{switch(B){case _a:case ka:return void a(ha(!0))}},onSubscribed:()=>{a(ha(!0))}}),d.useEffect(()=>{g||c.fetchState==="Completed"||c.fetchState==="In-Progress"||(_(!0),a(ha()))},[g,c,a]),r==null)throw Error("Can't access cashback detail page without signing in...");const h=c.cashbackSummary?.cashbackEarned?.amount!=null&&c.fetchState!=="Not-Started";return c.fetchState!=="In-Progress"||h?(c.cashbackSummary?.cashbackEarned?.amount??0)===0&&c.fetchState==="Completed"?s.jsx(Ka,{}):s.jsx(Ls,{onBackClick:v,isCardsCommentingEnabled:p,initialOpenThreadRequest:l}):s.jsx(ns,{onBackClick:v})}const Os=e=>`/${e}/cards`,Us={containerWidth:new Aa(100,58)},js=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p}=oe(),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,B]=d.useState(!1),F=ee.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const L=S(w=>de(w));if(n==null)throw Error("Empty card id is not valid...");const{configValue:C}=p(Le.zeniCardsConfig),u=C.max_charge_card_activation_attempts_by_card_id,D=S(w=>Un(w,n)),o=D.chargeCard,I=S(w=>w.chargeCardConfigState.fetchState),{useFeatureGate:A}=oe(),{isFeatureEnabled:j}=A(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=A(Y.isDebitCardFeatureEnabled),b=Ee(E,L),x=ke({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:b}),i=!!L.companyChargeCardInfo?.info?.isChargeCardEnabled,m=L.userRole.includes("charge_card_user"),O=Ie(L),M=Ae(L),R=L.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,T=_e({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:j,isBookKeepingTenant:M,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:R}),$=!m&&T&&i;d.useEffect(()=>{g===!1&&I!=="In-Progress"&&I!=="Completed"&&(t(Va()),_(!0)),c===!1&&D.fetchState==="Not-Started"&&(l(!0),t(ca(n,$,T)))},[c,D.fetchState,g,I]);const G=o?.type.code==="business_physical_credit_card"||o?.type.code==="business_physical_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(v===!1&&(G===!1||G&&o?.status?.code!=="inactive"||o?.cardHolderUserId!==F.userId)){const w=pe(L.tenantEmailDomain,n,F,o,!0),U=ye(f.state?.pathnameStackToGoBack,f.pathname);r(w,{state:{pathnameStackToGoBack:U}})}else if(v&&D.isRefreshingViewInBackground===!1&&o?.status?.code==="active"){t(jn({chargeCardId:n}));const w=pe(L.tenantEmailDomain,n,F,o,!0),U=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(w,{state:{pathnameStackToGoBack:U}})}}},[D.fetchState,o?.type.code,v,D.isRefreshingViewInBackground]);const V=ee.getZeniOtpTokenForCardHolder(n),P=S(w=>Nt(w.userState,F.userId)),Z=()=>{o?.status?.code!=="active"&&t(na(n,!0))};d.useEffect(()=>{D.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&o?.cardActivationAttemptHistory.some(w=>w.statusCode==="success")===!0&&v===!1&&(setTimeout(Z,3e3),y(!0))},[D.updatePhysicalChargeCardAttemptFetchState.fetchState,o?.cardActivationAttemptHistory]);const J=w=>{B(w)};if(I!=="Completed"||o==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(o.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Hs,{children:[s.jsx(We,{isAppContentDrawerOpen:h,handleDrawerToggle:J}),s.jsx(Vs,{cardId:n,card:o,shippingAddressId:o.shippingAddressId,phone:P.phone,signedInUser:F,isSandboxEnv:ht(),chargeCardDetailState:D,signedInUserToken:V,navigate:r,currentTenant:L,location:f,maxChargeCardActivationAttempts:u[n]!=null?u[n]:C.default_max_charge_card_activation_attempts!=null?C.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{J(!0)}}),e!=null?s.jsx(Ns,{windowSize:a,children:e}):null]})},Vs=he(function(e,{chargeCardDetailState:a,shippingAddressId:t,location:r,cardId:n}){const f=Vn(e.addressState,t);if(f==null)throw Error("Can't access shippingAddress.");const p=Ht(e,n),g=a.updateStatus,_=ea(e,!1,!1,!1);let c=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(c=!0);const l=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Nn())||l,showMenuIcon:c,shippingAddress:f,vgsVaultId:Ya.cardVaultId,twoFAView:p,activationWaitStatus:g,isRefreshingViewInBackground:a.isRefreshingViewInBackground}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,chargeCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e($a(c,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:c=>{e(Mn(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ha(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onCVVActivateSuccess:()=>{e(Hn({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("onboard")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(ss),Ns=Te.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: ${e=>`${Us.containerWidth.value(e.windowSize)}%`};
|
|
5
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
6
|
+
`,Hs=Te.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
|
+
`,Oa=gt.getLocalizedStrings().dateFormat,Ms={overlayWidth:new Aa(100,100,58)},vn=[Pn,Wa],$s=new Set(vn),Gs=he(function(e,a){const t=a.currentTenant?.companyId;return{plaidConnectionDetails:Yn(e,t,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Zn(e.depositAccountState,e.depositAccountListState)}},function(e,a){const{navigate:t,currentTenant:r,hasZeniAccountsAdminAccess:n,isZeniAccountsUser:f,isCashbackInfoFetchStateCompleted:p,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:_,controllerEmails:c,paymentDetails:l,productInformation:v,cashbackInformation:y,paymentSourceInformation:h,creditAccountInformation:B,debitAccountInformation:F,paymentInitiatedDate:L,sourcePage:C}=a,{tenantEmailDomain:u}=r,D=()=>{e(Gt(!0));const o=Ge(r);o!=null&&o!==""&&e(fa(o,!0,!0)),e(Ne(!0))};return{onBackNavigation:()=>{if(p&&g&&_&&y!=null&&q.trackCardsPayEarlyFormClick(c,v,y,"Back",l.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:l.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:l.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:l.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:l.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:L?.add(3,"day").format(Oa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:L?.format(Oa.visual.MMMDCommaYYYYformat)},h,B,F),C==="cardPaymentHistory")a.closeDrawerHandler(!0),e(zt());else{const o=ze(u);t(o)}},onUpdatePaymentAccountStatus:(o,I,A)=>{e(qn(o,I,"bill_pay","bill_pay_detail",A))},onEstablishConnectionSuccess:()=>{e(fa(r.companyId,!0))},onFetchLinkTokenClick:o=>{e(Wn("external_account",o))},onEstablishConnectionClick:o=>{e(Kn(o,r.companyId,"charge_card_payment","charge_cards"))},onSignUpAccountClick:()=>{n?window.open(`/${u}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{f?window.open(`/${u}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onEventReceived:o=>{$s.has(o)&&D()},onPusherSubscribed:D}})(Za(cs)),Pt=({isPaymentDrawerOpen:e,closeDrawerHandler:a,pageName:t,creditAccountSpentAmount:r,productInformation:n,sourcePage:f,creditAccountInformation:p,debitAccountInformation:g,cashbackInformation:_,isDebitCardInfoFetchStateCompleted:c,isCreditCardInfoFetchStateCompleted:l,isCashbackInfoFetchStateCompleted:v,paymentInitiatedDate:y,retryRepayment:h})=>{const B=me(),{useDynamicConfig:F}=oe(),{configValue:L}=F(Le.zeniAccountsConfig),C=$n(L),u=S(z=>Mt(z)),{creditAccount:D}=S(z=>Xe(z)),o=S(z=>de(z)),I=ft(),A=Ia(),j=Ce(),E=ee.getSignedInUser(),b=$e(),[x,i]=d.useState(!1),[m,O]=d.useState(!1),{configValue:M}=F(Le.zeniCardsConfig),R=M.credit_card_auto_pay_threshold_by_company_id?.[o.companyId]??M.default_credit_card_auto_pay_threshold??_s,T=$t(b?.loggedInUserRoleMap),$=Gn(b?.loggedInUserRoleMap),G=!!o.companyZeniAccountInfo?.info?.isZeniAccountEnabled,V=S(z=>ya(z,o.companyId)),P=V.companyChargeCardInfo?.primaryFundingAccount,Z=V.allFundingAccounts.find(z=>z.id===P?.accountId),J=S(z=>qe(z,o.companyId)),w=Je(J.controllers);d.useEffect(()=>{if(u.fetchState!=="Completed"&&u.fetchState!=="In-Progress"&&j(Gt()),u.fetchState==="Completed"&&!m){const z=o.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,X=u.transferFromAccounts.find(K=>K.id===z);let Q;if(f==="cardPaymentHistory"&&h){const K=h.paymentAccountId!=null?u.transferFromAccounts.find(re=>re.id===h.paymentAccountId):void 0;Q={amount:h.amount,isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:Bt(),transferFrom:K??X}}else Q={amount:{amount:D.balance.amount+D.hold.amount,currencyCode:D.balance.currencyCode,currencySymbol:D.balance.currencySymbol},isAutoRepayment:o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:Bt(),transferFrom:X};j(Tt(Q)),O(!0)}},[u.fetchState,m,f,h,u.transferFromAccounts,o.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,o.companyChargeCardInfo?.info?.isAutoPayEnabled,D.balance.amount,D.balance.currencyCode,D.balance.currencySymbol,D.hold.amount,j]);const U={isZeniCheckingEnabled:o.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:Z?.accType==="depositAccount",creditCardPaymentSourceAccountName:Z?.label,creditCardPaymentSourceAccountType:Z?.accType,creditCardPaymentSourceLastFourDigits:Z?.accountLast4,creditCardPaymentSourceBalance:Z?.accountBalance?.available?.amount??0};if(d.useEffect(()=>{V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&j(fa(o.companyId,!0))},[V.fetchState]),d.useEffect(()=>{u.updateStatus==="Completed"&&_!=null&&v&&l&&c&&q.trackCardsPayEarlyPayNowClick(w,n,_,u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:y?.add(3,"day").format(Oa.visual.MMMDCommaYYYYformat),paymentInitiatedDate:y?.format(Oa.visual.MMMDCommaYYYYformat)},U,p,g)},[u.updateStatus,_,v,l,c,y]),d.useEffect(()=>{u.fetchState==="Completed"&&_!=null&&v&&l&&c&&!x&&e&&m&&_!=null&&(q.trackCardsPayEarlyFormView(w,n,_,t,o.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,D.balance.amount,U,p,g),i(!0))},[u,v,l,c,x,e,m]),E==null)throw Error("Can't access invite people page without signing in...");const te=()=>{a(!0),j(zt())},ae=Ge(o),k={events:e?ta(ae,vn):[],eventCallback:(z,X,Q)=>{Q.onEventReceived(z)},onSubscribed:z=>{z.onPusherSubscribed()}};return s.jsx(s.Fragment,{children:s.jsx(hn,{onClose:()=>{te()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:Ms.overlayWidth.valuePercentage(A),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:I.colors.black,opacity:.75,cursor:"pointer"}}},children:s.jsx(zs,{onClick:z=>z.stopPropagation(),children:s.jsx(Gs,{...k,closeDrawerHandler:a,navigate:B,paymentDetails:u,creditAccountSpentAmount:r,onTransferClick:()=>{v&&l&&c&&_!=null&&q.trackCardsPayEarlyFormClick(w,n,_,"Pay Now",u.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:u.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:u.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:u.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:u.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},U,p,g),j(zn({companyId:o.companyId}))},onDismissClick:te,onSaveChangesToLocalStore:z=>{j(Tt(z))},currentTenant:o,hasZeniAccountsAdminAccess:T,isZeniAccountsUser:$,isZeniAccountSetupEnabled:G,productInformation:n,sourcePage:f,controllerEmails:w,autoPayThreshold:R,paymentSourceInformation:U,creditAccountInformation:p,debitAccountInformation:g,cashbackInformation:_,isCashbackInfoFetchStateCompleted:v,isCreditCardInfoFetchStateCompleted:l,isDebitCardInfoFetchStateCompleted:c,paymentInitiatedDate:y,maxInsuredAmount:C.maxInsuredAmount})})})})},zs=Te(ks)`
|
|
15
|
+
display: flex;
|
|
16
|
+
min-height: 100%;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
`,wt=e=>e!=null&&typeof e=="object"?e:null,ce=e=>typeof e=="string"?e:void 0,we=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Ua=e=>e!=null&&typeof e=="object"&&typeof e.code=="string"&&typeof e.name=="string",tt=e=>{if(e==null||typeof e!="object")return!1;const a=e;return typeof a.transaction_id=="string"&&typeof a.amount=="number"&&typeof a.currency_code=="string"&&typeof a.currency_symbol=="string"&&typeof a.direction=="string"&&!!Ua(a.transaction_status)&&!!Ua(a.transaction_type)},vt=(e,a)=>{const t=e?.card_status;if(!Ua(t))return null;const r=e?.is_locked_by_admin;return{cardId:a,cardStatus:t,isLockedByAdmin:typeof r=="boolean"?r:void 0}},it=[An,En,kn,_n,Dn,aa,Et,Wa,kt,_t,Dt],Tn=[_a,ka],Ys=new Set([...it,...Tn]),nt=gt.getLocalizedStrings().dateFormat,Zs=he(function(e,a){const{includeCreditAccountInfo:t,cardId:r,signedInUserToken:n,isChargeCardFeatureEnabled:f}=a,p=ee.getSignedInUser(),g=e.tenantState.currentTenantId,_={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:g??""},c=lt(e,r,t,f),l=sr(e,r),v=cr(e);return{chargeCardDetailView:c,chargeCardsRecurringExpensesState:l,vgsVaultId:Ya.cardVaultId,transactionAttachmentsEndpointToFetch:`${ot}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${ot}/card_transaction_attachment`,authParams:_,isSnackbarOpen:v.isSnackbarOpen,cardsEndPoint:`${mn.cardMicroServiceBaseUrl}`,signedInUserToken:c.twoFAView.token??n}},function(e,a){const{cardId:t,currentTenant:r,navigate:n,location:f,cardProviderId:p,includeCreditAccountInfo:g,setIsPaymentOpen:_,controllerEmails:c,productInformation:l,cashbackInformation:v,primaryFundingAccountDetails:y,creditAccountInformation:h,debitAccountInformation:B,isChargeCardFeatureEnabled:F}=a,{tenantEmailDomain:L}=r;return{onEventReceived:(C,u)=>{(({event:D,data:o,cardId:I,dispatch:A,subscribedEvents:j})=>{const E=wt(o);switch(D){case _a:case ka:return void A(ha(!0));case An:{const b=ce(E?.card_id);if(b==null||b!==I)return;const x=ce(E?.transaction_id),i=E?.transaction_status;return x!=null&&Ua(i)?void A(nr({transactionId:x,transactionStatus:i})):void A(Ze(I,null,null,!0))}case aa:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=vt(E,b);return x!=null?void A(mt(x)):void A(na(I,!0))}case Et:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=ce(E?.currency_code),i=ce(E?.currency_symbol),m=we(E?.balance);return x!=null&&i!=null&&m!=null?(A(tr({cardId:b,currencyCode:x,currencySymbol:i,balance:m,hold:we(E?.hold),dailyPurchaseSpends:we(E?.daily_purchase_spends),monthlyPurchaseSpends:we(E?.monthly_purchase_spends),dailyWithdrawals:we(E?.daily_withdrawals),monthlyWithdrawals:we(E?.monthly_withdrawals)})),void A(Ne(!0))):(A(na(I,!0)),void A(Ne(!0)))}case Wa:{const b=ce(E?.currency_code),x=ce(E?.currency_symbol),i=we(E?.available_amount),m=we(E?.balance_amount);return b!=null&&x!=null&&i!=null&&m!=null?void A(ar({currencyCode:b,currencySymbol:x,available:i,balance:m,hold:we(E?.hold_amount),cashback:we(E?.cashback_amount)})):void A(Ne(!0))}case En:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=E?.transaction;return tt(x)?void A(er({cardId:b,transaction:x})):void A(Ze(I,null,null,!0))}case kn:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=E?.transaction;return tt(x)?void A(Qn({cardId:b,declineReason:ce(E?.decline_reason),transaction:x})):void A(Ze(I,null,null,!0))}case _n:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=E?.transaction;return tt(x)?void A(Xn({cardId:b,transaction:x})):void A(Ze(I,null,null,!0))}case Dn:{const b=ce(E?.card_id)??I;if(b!==I)return;const x=ce(E?.transaction_id),i=E?.attachment_file_paths;return x!=null&&Array.isArray(i)&&i.every(m=>typeof m=="string")?void A(Jn({cardId:b,transactionId:x,attachmentFilePaths:i})):void A(Ze(I,null,null,!0))}case kt:case _t:case Dt:{const b=ce(E?.card_id);if(b==null||b!==I)return;A(na(I,!0))}}})({event:C,data:u,cardId:t,dispatch:e,subscribedEvents:Ys})},onPusherSubscribed:()=>{e(na(t,!0)),e(Ze(t,null,null,!0)),e(Ne(!0))},onReloadTransactions:()=>{e(ca(t,g,F))},onFetchChargeCardTransactionList:(C,u)=>{e(Ze(t,C,u))},onUpdateScrollYOffset:C=>{},onGetOtp:C=>{p!=null&&e($a(C,"ChargeCardHolder",t))},onResendOtp:C=>{p!=null&&e(Ma(C,"ChargeCardHolder",t))},onVerifyOtp:(C,u)=>{p!=null&&e(Ha(C,u,"ChargeCardHolder",t))},onVerifyOtpSuccess:C=>{C!=null&&ee.saveZeniOtpTokenForCardHolder(C,t)},onColorCodeChange:C=>{e(mr(t,C))},onLockChargeCard:(C,u)=>{e(en(C,t,u))},onUnlockChargeCard:C=>{e(Qt(C,t))},onCloseChargeCard:C=>{e(Xt(t,C))},onFetchChargeCardsRecurringExpenses:()=>{e(Jt([t]))},updateChargeCardName:(C,u)=>{e(qt(C,t,u))},updateChargeCardTransactionAttachments:(C,u)=>{u!=null&&e(ur({transactionId:C,data:u}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(C,u,D,o)=>{e(lr({chargeCardId:u,transactionId:C,fetchState:D,error:o}))},updateChargeCardTransactionReceiptsShowTick:(C,u,D)=>{e(dr({chargeCardId:u,transactionId:C,shouldShowTick:D}))},onChargeCardRevokeInviteClick:()=>{e(Wt(t))},updateChargeCardTransactionIsViewReceiptClicked:(C,u,D)=>{e(ir({chargeCardId:u,transactionId:C,isViewReceiptClicked:D}))},onChargeCardTransactionRowClick:(C,u)=>{const D=ye(f.state?.pathnameStackToGoBack,f.pathname);n(`../../transaction/${C}/${u}`,{state:{pathnameStackToGoBack:D}})},onBackClick:()=>{const C=Re(f.state?.pathnameStackToGoBack),u=ze(L);n(u,{state:{pathnameStackToGoBack:C.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(or())},onUpdateDebitCardPinAttempt:C=>{e(Kt(t,C)),C==="success"&&e(pa({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(C,u)=>{C?e(pa({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):u!=null&&e(pa({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:u.message}]}))},updateSpendLimit(C,u,D,o){e(Zt(C,u,D.code,o))},shouldOpenCreditCardPaymentDrawer(C){C&&v!=null&&q.trackCardsPayEarlyClick(c,l,v,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:r.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:y?.accType==="depositAccount",creditCardPaymentSourceAccountName:y?.label,creditCardPaymentSourceAccountType:y?.accType,creditCardPaymentSourceLastFourDigits:y?.accountLast4,creditCardPaymentSourceBalance:y?.accountBalance?.available?.amount??0},h,B),_(C)}}})(Za(is));function Ks(){const e=me(),a=Ce(),t=Se(),{cardId:r}=ba(),[n,f]=d.useState(!1),[p,g]=d.useState(!1),{useDynamicConfig:_}=oe(),c=ee.getSignedInUser(),l=S(H=>de(H)),v=S(H=>ja(H).firstViewAfterActivation),y=S(H=>H.classListState.fetchState),{configValue:h}=_(Le.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:B}=_(Le.zeniCardsConfig),F=B.enable_card_controls_for_company_ids,L=B.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(F)&&F.includes(l.companyId),[C,u]=d.useState(!1),[D,o]=d.useState(!1),{useFeatureGate:I}=oe(),{isFeatureEnabled:A}=I(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:j}=I(Y.isDebitCardFeatureEnabled),E=Ee(j,l),b=ke({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:E}),{isFeatureEnabled:x}=I(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:i}=I(Y.isCardsCommentingEnabled),m=Ae(l),O=Ie(l),M=l.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,R=_e({isCardsOnlyTenant:O,isChargeCardFeatureEnabled:A,isBookKeepingTenant:m,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:M}),T=!!l.companyDebitCardInfo?.info?.isDebitCardEnabled,$=!!l.companyChargeCardInfo?.info?.isChargeCardEnabled,G=!l.userRole.includes("charge_card_user")&&R&&$;if(r==null)throw Error("Empty card id is not valid...");const V=S(H=>ya(H,l.companyId)),{creditAccount:P,creditAccountRepayment:Z}=S(H=>Xe(H)),J=ee.getZeniOtpTokenForCardHolder(r),w=S(H=>lt(H,r,G,R)),{isAiCfoAccessEnabled:U,onAskAiCfoClick:te}=In({mobileExploreReferrer:"Card Detail"});un({isDataReady:w.fetchState==="Completed"});const ae=S(H=>Qe(H)),k=w.chargeCard,z=$e(),X=He(z?.loggedInUserRoleMap),Q=k?.type.code==="business_physical_debit_card"||k?.type.code==="business_virtual_debit_card",K=k?.type.code==="business_physical_debit_card"||k?.type.code==="business_physical_credit_card",re=k?.type.code==="business_virtual_debit_card"||k?.type.code==="business_virtual_credit_card",De=k?.type.code==="business_virtual_debit_card",Oe=Ea(R,$,X,P,Z),W=fn(Q,w),fe=St(X,ae),Pe=Me(R,b,T,$),Ue=w.depositAccountLimitFetchState.fetchState!=="Completed"&&w.depositAccountLimitFetchState.fetchState!=="In-Progress",Fe=S(H=>qe(H,l.companyId)),xe=Je(Fe.controllers),ne=S(H=>k?.cardCreatedByUser?.userId!=null?xa(H.userRoleState,k?.cardCreatedByUser?.userId):void 0),Da=S(H=>ne?.accountingClassIDs[0]!=null?Ba(H.classState,{classId:ne?.accountingClassIDs[0],reportId:"class_list"}):void 0),ie=S(H=>k?.cardHolderUser?.userId!=null?xa(H.userRoleState,k?.cardHolderUser?.userId):void 0),oa=S(H=>ie?.accountingClassIDs[0]!=null?Ba(H.classState,{classId:ie?.accountingClassIDs[0],reportId:"class_list"}):void 0),le=l?.userRole,je=S(H=>ea(H,!1,b,A).revokeCardInvite),ia=bt(je.saveStatus.fetchState);if(d.useEffect(()=>{if(ia==="In-Progress"&&je.saveStatus.fetchState==="Completed"){const H=ze(l.tenantEmailDomain);e(H)}},[ia,je.saveStatus.fetchState,e,l.tenantEmailDomain]),d.useEffect(()=>{v&&n===!1&&re&&(f(!0),setTimeout(()=>{a(La()),De&&a(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[v,n,re,De]),d.useEffect(()=>{C||w.fetchState==="Completed"||w.fetchState==="In-Progress"||r==null||(u(!0),a(ca(r,G,R,!1)))},[C,w,r,a]),d.useEffect(()=>{!D&&w.fetchState==="Completed"&&w.chargeCard?.connectedAccountId!=null&&Q&&Ue&&X&&(o(!0),a(Yt({depositAccountId:w.chargeCard?.connectedAccountId})))},[D,w,a,Ue,X]),d.useEffect(()=>{ae.fetchState!=="Completed"&&ae.fetchState!=="In-Progress"&&X&&a(ha()),y!=="Completed"&&y!=="In-Progress"&&a(Vt()),w.transactionStatistics.fetchState!=="Completed"&&w.transactionStatistics.fetchState!=="In-Progress"&&a(rr({chargeCardId:r})),V.fetchState!=="Completed"&&V.fetchState!=="In-Progress"&&a(fa(l.companyId,!0))},[ae.fetchState,a,X,y,w.transactionStatistics.fetchState,V.fetchState]),d.useEffect(()=>{if(!(w.fetchState!=="Completed"||R&&P.fetchState!=="Completed"||k==null||w.transactionStatistics.fetchState!=="Completed"||Q&&X&&w.depositAccountLimitFetchState.fetchState!=="Completed")){const H=k.type.code.includes("physical"),ue=H?k.cardActivationAttemptHistory[0]?.timestamp:k.createTime;q.trackCardsCardDetailView(xe,Pe,{cardId:r,cardName:k.cardName,cardType:k.type.code.includes("credit")?"credit":"debit",cardCategory:H?"physical":"virtual",cardLimit:ra(k.limit.amount),cardLastFourDigits:k.accountLast4,cardStatus:k.status.code,cardAssignedDate:k.createTime?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:k.providerCardCreateTime?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:ue?.format(nt.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:k.creditLimitFrequency.name,cardSpentAmount:ra(k.balance.amount),cardAvailableLimit:ra(k.available.amount),cardUtilizationPercent:k.limit.amount>0?Math.round((k.limit.amount-k.available.amount)/k.limit.amount*100):0,cardUtilizationAmount:ra(k.limit.amount-k.available.amount),totalNumberOfDeclinedTransactions:w.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:w.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:w.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:w.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:w.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:w.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:w.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:ct(k.cardCreatedByUser,!1),cardIssuedByEmail:k.cardCreatedByUser?.email,cardIssuedByUserId:k.cardCreatedByUser?.userId,cardIssuedByRole:ne?.userRoles,cardIssuedByDepartment:Da?.className},{cardholderName:ct(k.cardHolderUser,!1),cardholderEmail:k.cardHolderUser?.email,cardholderRole:ie?.userRoles,cardholderUserId:k.cardHolderUser?.userId,cardholderDepartment:oa?.className},Oe,W)}},[w.fetchState,w.depositAccountLimitFetchState.fetchState,w.transactionStatistics.fetchState,P.fetchState,X]),c==null)throw Error("Can't access card detail page without signing in...");const da=Ge(l),la=X?[...it,...Tn]:it,ua={events:ta(da,la),eventCallback:(H,ue,Be)=>{Be.onEventReceived(H,ue)},onSubscribed:H=>{H.onPusherSubscribed()}},ma=()=>{if(r!=null&&k!=null){const{ownerName:H,cardName:ue,utilisation:Be,limit:Ye,frequency:N,cardColor:ge}=rt(k),be=k.cardHolderUserId===c.userId;q.trackCardsDetailPageViewed(r,H,ue,Be,Ye,N,ge,be)}};d.useEffect(()=>{if(w.fetchState==="Completed"){const H=w.chargeCard;if(H?.status.code==="inactive"||Q&&H?.isPinSet===!1||K&&v){const ue=pe(l.tenantEmailDomain,r,c,k,v);e(ue)}}},[w.fetchState]);const Ca=(H,ue)=>{if(r!=null&&k!=null){const{ownerName:Be,cardName:Ye,utilisation:N,limit:ge,frequency:be}=rt(k),et=k.cardHolderUserId===c.userId;q.trackCardsDetailPageClicked(r,Be,Ye,N,ge,be,H,et,ue)}},Ja=(H,ue)=>{if(r!=null&&k!=null){const{ownerName:Be,cardName:Ye,utilisation:N,limit:ge,frequency:be}=rt(k),et=k.cardHolderUserId===c.userId;q.trackCardsVerifyPopUpClick(r,Be,Ye,N,ge,be,H,et,ue)}},Pa=P.balance.amount+P.hold.amount,wa=l.companyChargeCardInfo?.info?.primaryFundingAccount,Xa=V.allFundingAccounts.find(H=>H.id===wa?.accountId),va=w.chargeCard!=null,Qa=w.depositAccountLimit!=null;return w.fetchState!=="Error"||va?!va&&(w.fetchState==="In-Progress"||w.fetchState==="Not-Started")||je.saveStatus.fetchState==="In-Progress"||!Qa&&Q&&X&&w.depositAccountLimitFetchState.fetchState!=="Completed"?s.jsx(os,{}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:v}),w.fetchState==="Completed"?s.jsx(yt,{analytics:q,onLoad:ma}):null,p===!0?s.jsx(Pt,{closeDrawerHandler:()=>g(!1),isPaymentDrawerOpen:p,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:Pe,creditAccountInformation:Oe,debitAccountInformation:W,cashbackInformation:fe,creditAccountSpentAmount:Pa,isDebitCardInfoFetchStateCompleted:!Q||!X||w.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!R||P.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!X||ae.fetchState==="Completed",paymentInitiatedDate:Z.initiatedRepaymentDate}):null,s.jsx(Zs,{...ua,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:Ja,onFireOnClickAnalytics:Ca,isSandboxEnv:ht(),signedInUser:c,location:t,navigate:e,setIsPaymentOpen:g,cardIssuedByRoles:ne?.userRoles,cardIssuedByDepartmentName:Da?.className,cardHolderRoles:ie?.userRoles,cardHolderDepartmentName:oa?.className,loggedInUserRole:le,isChargeCardFeatureEnabled:R,isDebitCardFeatureEnabled:b,isDebitCardSetupEnabled:T,isChargeCardSetupEnabled:$,isCardControlsEnabled:L,isEarlyPayEnabled:x,controllerEmails:xe,chargeCardCashbackDetailState:ae,productInformation:Pe,creditAccountInformation:Oe,debitAccountInformation:W,cashbackInformation:fe,classListFetchState:y,primaryFundingAccountDetails:Xa,currentTenant:l,cardProviderId:w.chargeCard?.cardProviderID,cardId:r,creditAccount:P,creditAccountRepayment:Z,includeCreditAccountInfo:G,signedInUserToken:J,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:h.documentAiReceiptMaxSizeLimitBytes!=null?h.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:U,onAskAiCfoClick:te,isCardsCommentingEnabled:i})]}):s.jsx(Ka,{})}const rt=e=>{const a=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,t=e.cardName,r=(e.limit.amount??0)-(e.available.amount??0),n=e.limit.amount,f=e.creditLimitFrequency.name;return{ownerName:a,cardName:t,utilisation:r,cardColor:e.cardColorCode??"",frequency:f,limit:n}},Fn=[aa,Wa,wn,ka,_a,qa,Dt,xs,kt,_t,Et],Ws=new Set(Fn),dt=vs((e,a,t,r)=>{e(ga(a,t,r,!0))},400),qs=Te.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
|
+
`,Js=he(function(e,a){const t=ea(e,a.includeCreditAccountDebitSummaryAndCashbackInfo,a.isDebitCardFeatureEnabled&&a.isDebitCardSetupEnabled,a.isChargeCardFeatureEnabled&&a.isChargeCardSetupEnabled);return{chargeCardListView:t,rowActionView:Cr(e),bulkActionView:pr(e),companyLegalName:a.currentTenant.companyName,admins:a.admins,searchText:t.searchText,uiState:t.uiState,signedInUser:a.signedInUser}},function(e,a){const{navigateAndClearBulkSelection:t,currentTenant:r,location:n,signedInUser:f,chargeCardListState:p,includeCreditAccountDebitSummaryAndCashbackInfo:g,isChargeCardFeatureEnabled:_,isCreditCardProductVisibleForExpressInterest:c,isChargeCardSetupEnabled:l,isDebitCardFeatureEnabled:v,isDebitCardSetupEnabled:y,isDebitCardTOSAccepted:h,isChargeCardTOSAccepted:B,controllerEmails:F,depositAccountListWithDebitCardIssued:L,primaryFundingAccountDetails:C,chargeCardSetUpViewFetchState:u,productInformation:D,cashbackInformation:o,creditAccountInformation:I,debitAccountInformation:A,updatePayNowInfoTooltip:j,isUserHasCardsAdminLevelAccess:E}=a,{tenantEmailDomain:b}=r,{cards:x}=p;return{onChargeCardRowClick:(i,m)=>{const O=bn(x,i);let M;O!=null&&((T=>{const $=T.limit.amount-T.available.amount,G=`${T.cardHolderUser?.firstName.toLowerCase()} ${T.cardHolderUser?.lastName.toLowerCase()}`,V=T.cardName,P=T.department?.className??"",Z=T.limit.amount,J=T.creditLimitFrequency.name;q.trackCardsListRowClicked(G,V,P,$,Z,J,f.userId===T.cardHolderUserId)})(O),Ke(v,y,L)&&q.trackCardsCardListRowClick(F,D,"Card Row Item","row_clicked",m+1,{cardOwner:ct(O.cardHolderUser,!1),cardName:O.cardName,cardType:O.type.code.includes("credit")?"credit":"debit",cardStatus:O.status.code,cardUtilizationAmount:ra(O.limit.amount-O.available.amount),cardUtilizationPercent:O.limit.amount>0?Math.round((O.limit.amount-O.available.amount)/O.limit.amount*100):0,cardLimit:ra(O.limit.amount)},o,I,A)),M=O?.status.code==="request_on_hold"&&f.userId===O.cardHolderUserId?yn(b):pe(b,i,f,O);const R=ye(n.state?.pathnameStackToGoBack,n.pathname);t(M,{state:{pathnameStackToGoBack:R}})},onFetchChargeCardsRecurringExpenses:i=>{e(Jt(i))},onFetchDepositAccountLimit:i=>{e(Yt({depositAccountId:i}))},onChargeCardResendInviteClick:i=>{e(Ar(i))},onChargeCardRevokeInviteClick:i=>{e(Wt(i))},onLockChargeCardList:(i,m)=>{e(Ir(i,m))},onUnlockChargeCardList:i=>{e(Sr(i))},onCloseChargeCardList:(i,m)=>{e(yr(i,m))},onRevokeChargeCardList:i=>{e(br(i))},updateChargeCardListSpendLimit(i,m,O){e(gr(i,m,O.code))},onLockChargeCard:(i,m)=>{e(en(E,i,m))},onUnlockChargeCard:i=>{e(Qt(E,i))},onCloseChargeCard:(i,m)=>{e(Xt(i,m))},onUpdateSpendLimit(i,m,O,M){e(Zt(i,m,O.code,M))},updateChargeCardName:(i,m)=>{e(qt(E,i,m))},onClickSetupIcon:()=>{q.trackCardsListPageClicked("settings"),Ke(v,y,L)&&o!=null&&q.trackCardsSettingsClick(F,D,o,I,A);const i=Ps(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},onIssueCardClick:()=>{q.trackCardsListPageClicked("new card"),Ke(v,y,L)&&o!=null&&q.trackCardsNewCardClick(F,D,o,"New Button","card_creation_initiated","Card List",I,A);const i=Xs(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},onColumnSortConfigChanged:(i,m)=>{Ke(v,y,L)&&o!=null&&q.trackCardsCardListSortClick(F,D,o,"Sort Icon","sort",i,m==="ascending"?"ASC":"DESC","Cards List",I,A),e(st({uiState:{sortKey:i,sortOrder:m}}))},onSearchTextChanged:i=>{e(fr(i))},onReloadCards:()=>{e(ga(g,v&&y,_&&l,!0))},onLetsGoClick:()=>{t("./onboard")},onBackClick:()=>{t("../../")},onTotalCashbackClick:()=>{Ke(v,y,L)&&o!=null&&q.trackCardsCashbackOverviewClick(F,D,o,"Cashback Overview","cashback_details_viewed",I,A),t("./cashback")},onClickStatementsIcon:()=>{Ke(v,y,L)&&o!=null&&q.trackCardsStatementsClick(F,D,o,I,A),t("./statements")},onCreateNowClick:i=>{Ke(v,y,L)&&o!=null&&q.trackCardsNewCardClick(F,D,o,"Promo Banner","card_creation_initiated","Card List",I,A),t(`./new?cardType=${i}`)},onPromoCardClick:i=>{t(i==="debit"&&v&&!h||i==="credit"&&c&&!B?`../promo?cardPromoType=${i}`:"./setup")},navigateToCreditCardPaymentPage:(i,m)=>{u==="Completed"&&r.company!=null&&o!=null&&q.trackCardsPayEarlyClick(F,D,o,"Card List",i,m,{isZeniCheckingEnabled:r.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:C?.accType==="depositAccount",creditCardPaymentSourceAccountName:C?.label,creditCardPaymentSourceAccountType:C?.accType,creditCardPaymentSourceLastFourDigits:C?.accountLast4,creditCardPaymentSourceBalance:C?.accountBalance?.available?.amount??0},I,A);const O=Qs(b);t(O)},navigateToCreditCardPaymentHistoryPage:()=>{const i=ec(b),m=ye(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},shouldShowPayNowInfoTooltip:j,onSetRowActionCardId:i=>{e(hr(i))},onSetBulkActionCardIds:i=>{e(an(i))},onEventReceived:i=>{Ws.has(i)&&dt(e,g,v&&y,_&&l)},onPusherSubscribed:()=>{dt(e,g,v&&y,_&&l)}}})(Za(ds));function Lt({isPaymentDrawerOpen:e}){const a=me(),t=Ce(),r=Se(),n=d.useCallback((N,ge)=>{t(an([])),a(N,ge)},[t,a]),[f,p]=d.useState(!1),[g,_]=d.useState(ee.getPayNowInfoTooltip()??!1),c=N=>{ee.savePayNowInfoTooltip(N),_(N)},[l,v]=d.useState(!1),y=ee.getSignedInUser(),h=S(N=>de(N)),[B,F]=d.useState(!1),[L,C]=d.useState(!1),{isAiCfoAccessEnabled:u,onAskAiCfoClick:D}=In({mobileExploreReferrer:"Cards"}),o=h.userRole.includes("charge_card_user"),I=!o,A=!!h.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:j,useDynamicConfig:E}=oe(),{isFeatureEnabled:b}=j(Y.isCashbackFeatureEnabled),{isFeatureEnabled:x}=j(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=j(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=j(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:O}=j(Y.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:M}=j(Y.isCardsCommentingEnabled),R=Ee(i,h),T=ke({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:R}),$=Ie(h),G=Ae(h),V=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,P=_e({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:x,isBookKeepingTenant:G,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:V}),Z=gn({isCardsOnlyTenant:$,isChargeCardFeatureEnabled:x,isBookKeepingTenant:G}),{configValue:J}=E(Le.zeniCardsConfig),w=$e(),U=He(w?.loggedInUserRoleMap),te=S(N=>qe(N,h.companyId)),ae=Je(te.controllers),k=J.charge_card_cashback_rate_per_transaction!=null?J.charge_card_cashback_rate_per_transaction:.0175,z=J.credit_card_pay_now_threshold_by_company_id?.[h.companyId]??J.default_credit_card_pay_now_threshold??Ds,X=J.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(J.enable_card_controls_for_company_ids)&&J.enable_card_controls_for_company_ids.includes(h.companyId),Q=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,K=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!h.companyChargeCardInfo?.info?.isChargeCardEnabled,De=S(N=>Mt(N)),Oe=bt(De.updateStatus),W=S(N=>ea(N,I,T&&A,P&&re)),fe=W.cards.filter(N=>N.type.code.includes("debit")).map(N=>N.connectedAccountId),Pe=[...new Set(fe)],Ue=S(N=>Qe(N)),Fe=S(N=>Ga(N,Pe)),xe=S(N=>ya(N,h.companyId)),ne=xe.companyChargeCardInfo?.primaryFundingAccount,Da=xe.allFundingAccounts.find(N=>N.id===ne?.accountId),ie=W.fetchState,oa=W.creditAccount;un({isDataReady:ie==="Completed"});const{creditAccountRepayment:le}=S(N=>Xe(N)),je=S(N=>ja(N).firstViewAfterActivation),{areTenantIdsInSync:ia}=Cn(),da=St(U,Ue),la=Ea(P,re,U,oa,le),ua=It(T,A,U,Fe,W.debitCardSummary),ma=Me(P,T,A,re),Ca=W.creditAccount.balance.amount+W.creditAccount.hold.amount;if(d.useEffect(()=>{ie==="Completed"&&(ee.getPayNowInfoTooltip()==null||Ca<z*W.creditAccount.limit.amount/100)&&c(!0)},[ie,z,Ca,W.creditAccount.limit.amount]),d.useEffect(()=>{if(e!=null&&e===!0&&le.initiatedRepayments.amount===0&&le.fetchState==="Completed"||Oe==="In-Progress"&&De.updateStatus==="Completed")c(!1),p(!0);else if(le.initiatedRepayments.amount>0&&le.fetchState==="Completed"){p(!1),document.body.style.overflow="auto";const N=ze(h.tenantEmailDomain);n(N)}},[e,le.initiatedRepayments.amount,le.fetchState,Oe,De.updateStatus,n,h.tenantEmailDomain]),d.useEffect(()=>{!B&&(re||A)&&ia&&(F(!0),t(ga(I,T&&A,P&&re,!1)))},[B,I,t,ia]),d.useEffect(()=>{je&&l===!1&&(v(!0),setTimeout(()=>{t(La())},5e3))},[je,l]),d.useEffect(()=>()=>{dt.flush()},[]),d.useEffect(()=>{ie==="Completed"&&o&&W.cards.length===1&&(W.cards[0].status.code==="inactive"&&W.cards[0].type.code==="business_physical_credit_card"?n(`./${W.cards[0].id}/activate`):W.cards[0].status.code!=="request_on_hold"&&(r.state?.message==="comingFromCardDetail"?n("../../"):n(`./${W.cards[0].id}`)))},[ie,o,r.state,n,W.cards]),d.useEffect(()=>{if(ie==="Completed"&&o){const N=W.cards.length,ge=W.cards.filter(be=>be.cardHolderUserId===y?.userId).filter(be=>be.status.code==="request_on_hold");ge.length>0&&N===ge.length&&n("./onboard")}},[ie,W.cards,o,n,y?.userId]),d.useEffect(()=>{ie!=="Completed"||P&&le.fetchState!=="Completed"||T&&A&&U&&Fe.fetchState!=="Completed"||q.trackCardsCardListView(ae,ma,da,la,ua)},[ie,oa,le.fetchState,Fe.fetchState,U]),y==null)throw Error("Can't access charge card list page without signing in...");const Ja=S(N=>tn(N.userState,N.userRoleState,N.userListViewState,"cardAdmin")),Pa=Ct(w?.loggedInUserRoleMap),wa=N=>{C(N)},Xa=W.creditAccount.limit,va=()=>{p(!1),n("..")},Qa=h.companyChargeCardInfo?.info!=null&&sa({cardInfo:h.companyChargeCardInfo.info,isProductVisible:P,isTOSAccepted:Q,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:Pa}),H=h.companyDebitCardInfo?.info!=null&&sa({cardInfo:h.companyDebitCardInfo.info,isProductVisible:T,isTOSAccepted:K,isSetupEnabled:A,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:Pa}),ue=Qa||H,Be=Ge(h),Ye={events:ta(Be,Fn),eventCallback:(N,ge,be)=>{be.onEventReceived(N)},onSubscribed:N=>{N.onPusherSubscribed()}};return re||A?s.jsxs(s.Fragment,{children:[ie==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(yt,{analytics:q,onLoad:()=>{q.trackPageLoaded(pn.Event.cardsListPage),(P&&!re||T&&!A)&&q.trackCardsPromoView(ae,{isCreditCardOffered:P,isDebitCardOffered:T,isDebitCardEnabled:A,isCreditCardEnabled:re},"Banner",T&&!A?"Debit Card":P&&!re?"Credit Card":"","Card List")}}),s.jsx(za,{showConfetti:je})]}):null,f===!0?s.jsx(Pt,{closeDrawerHandler:va,isPaymentDrawerOpen:f,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:Ca,productInformation:ma,creditAccountInformation:la,debitAccountInformation:ua,cashbackInformation:da,isDebitCardInfoFetchStateCompleted:!(T&&A&&U)||Fe.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!P||le.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!U||Ue.fetchState==="Completed",paymentInitiatedDate:le.initiatedRepaymentDate}):null,s.jsxs(qs,{children:[s.jsx(We,{isAppContentDrawerOpen:L,handleDrawerToggle:wa}),s.jsx(Js,{...Ye,isCashbackFeatureEnabled:b,isChargeCardFeatureEnabled:P,isDebitCardFeatureEnabled:T,isCreditCardProductVisibleForExpressInterest:Z,updatePayNowInfoTooltip:c,showPayNowInfoTooltip:g,creditCardPayNowThreshold:z,signedInUser:y,chargeCardListState:W,location:r,admins:Ja.users,navigateAndClearBulkSelection:n,currentTenant:h,isCardControlsEnabled:X,companyChargeCardInfoCreditAccountLimit:h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:h.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:U,includeCreditAccountDebitSummaryAndCashbackInfo:I,onClickMenuIcon:()=>{wa(!0)},creditLimit:Xa,isChargeCardSetupEnabled:re,isDebitCardSetupEnabled:A,isEarlyPayEnabled:m,isChargeCardPaymentHistoryFeatureEnabled:O,cashbackRate:k,controllerEmails:ae,chargeCardCashbackDetailState:Ue,depositAccountListWithDebitCardIssued:Fe,isChargeCardTOSAccepted:Q,isDebitCardTOSAccepted:K,primaryFundingAccountDetails:Da,chargeCardSetUpViewFetchState:xe.fetchState,productInformation:ma,creditAccountInformation:la,debitAccountInformation:ua,cashbackInformation:da,isAiCfoAccessEnabled:u,onAskAiCfoClick:D,isCardsCommentingEnabled:M})]})]}):(Q||K)&&U===!0?s.jsx(Fa,{to:"../setup"}):ue?s.jsx(Fa,{to:"../promo"}):s.jsx(Sa,{fetchState:ie})}const Xs=e=>`/${e}/cards/new`,Qs=e=>`/${e}/cards/payment`,ec=e=>`/${e}/cards/payment-history`,xn=[Pn,wn],ac=new Set(xn),tc=he(function(e){const a=ee.getSignedInUser(),t=de(e),r=e.tenantState.currentTenantId,n=nn(e),f={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:r??""},p=t?.companyName??"",g=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:n.fetchState,filters:n.filters,isZeniTenant:Er(t),repaymentList:n.repaymentHistory,searchText:n.searchText,repaymentHistoryUsers:n.repaymentHistoryUsers,sortConfig:{sortKey:n.uiState.sortKey,sortOrder:n.uiState.sortOrder},downloadParams:{authParams:f,companyName:p,spendManagementEndPoint:`${ot}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:g}},function(e,a){const{location:t,navigate:r}=a;return{onBackClick:()=>{const n=Re(t.state?.pathnameStackToGoBack),f=n.poppedPathname??"..";r(f,{state:{pathnameStackToGoBack:n.newStack}})},onColumnSortConfigChanged:(n,f)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:n,sortOrder:f}}})},onFiltersChange:n=>{e(_r({filters:n}))},onReloadPayments:()=>{e(Ta(!0))},onEventReceived:n=>{ac.has(n)&&e(Ta(!0))},onPusherSubscribed:()=>{e(Ta(!0))},onSearchTextChanged:n=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:n})},updateDownloadStateHandler:n=>{e(kr({uiState:{downloadState:n}}))}}})(Za(ls));function nc(){const e=me(),a=Se(),t=Ce(),{areTenantIdsInSync:r}=Cn(),{useFeatureGate:n}=oe();if(ee.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const f=S(k=>de(k)),p=S(k=>nn(k)),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,B]=d.useState(null),F=!f.userRole.includes("charge_card_user"),L=!!f.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:C}=n(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:u}=n(Y.isDebitCardFeatureEnabled),D=Ee(u,f),o=ke({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:D}),I=Ie(f),A=Ae(f),j=f.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=_e({isCardsOnlyTenant:I,isChargeCardFeatureEnabled:C,isBookKeepingTenant:A,isDebitCardProductVisible:o,chargeCardsCreditAccountLimit:j}),b=!!f.companyChargeCardInfo?.info?.isChargeCardEnabled,x=$e(),i=He(x?.loggedInUserRoleMap),m=S(k=>ea(k,F,o&&L,E&&b)),O=d.useMemo(()=>{const k=m.cards.filter(z=>z.type.code.includes("debit"));return[...new Set(k.map(z=>z.connectedAccountId))]},[m.cards]),M=S(k=>Qe(k)),R=S(k=>Ga(k,O)),{creditAccountRepayment:T}=S(k=>Xe(k)),$=d.useMemo(()=>St(i,M),[i,M]),G=d.useMemo(()=>Ea(E,b,i,m.creditAccount,T),[E,b,i,m.creditAccount,T]),V=d.useMemo(()=>It(o,L,i,R,m.debitCardSummary),[o,L,i,R,m.debitCardSummary]),P=d.useMemo(()=>Me(E,o,L,b),[E,o,L,b]),Z=m.creditAccount.balance.amount+m.creditAccount.hold.amount,J=d.useMemo(()=>h!=null?p.repaymentHistory.find(k=>k.cardRepaymentId===h):void 0,[h,p.repaymentHistory]),w=d.useCallback(k=>{B(k),t(ga(F,o&&L,E&&b,!1)),y(!0)},[t,F,o,L,E,b]),U=d.useCallback(()=>{y(!1),B(null),document.body.style.overflow="auto"},[]);d.useEffect(()=>{g||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(_(!0),t(Ta()))},[g,t,p.fetchState]),d.useEffect(()=>{!c&&(b||L)&&r&&(l(!0),t(ga(F,!1,E&&b,!1)))},[c,b,L,r,t,F,E]);const te=Ge(f),ae={events:ta(te,xn),eventCallback:(k,z,X)=>{X.onEventReceived(k)},onSubscribed:k=>{k.onPusherSubscribed()}};return s.jsxs(s.Fragment,{children:[v?s.jsx(Pt,{closeDrawerHandler:U,isPaymentDrawerOpen:v,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:Z,productInformation:P,creditAccountInformation:G,debitAccountInformation:V,cashbackInformation:$,isDebitCardInfoFetchStateCompleted:!(o&&L&&i)||R.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!E||T.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!i||M.fetchState==="Completed",paymentInitiatedDate:T.initiatedRepaymentDate,retryRepayment:J}):null,s.jsx(tc,{...ae,location:a,navigate:e,accountInfoByAccountId:p.accountInfoByAccountId,onRetryPaymentClick:w})]})}const Rt=Te.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
|
+
`,Ot=gt.getLocalizedStrings().months;function rc(){const e=me(),a=Ce(),t=Se(),{creditAccount:r,creditAccountRepayment:n}=S(P=>Xe(P)),f=`${mn.cardMicroServiceBaseUrl}/1.0/credit-accounts/${r.id}`,[p,g]=d.useState(!1),[_,c]=d.useState(!1),l=S(P=>Dr(P)),{useFeatureGate:v}=oe(),y=S(P=>de(P)),{isFeatureEnabled:h}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:B}=v(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:F}=v(Y.isCardsCommentingEnabled),L=Sn(F?y.companyId:void 0,{clearParams:F&&l.fetchState==="Completed"}),C=Ee(B,y),u=ke({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:C}),D=Ie(y),o=Ae(y),I=y.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=_e({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:h,isBookKeepingTenant:o,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:I}),j=!!y.companyDebitCardInfo?.info?.isDebitCardEnabled,E=!!y.companyChargeCardInfo?.info?.isChargeCardEnabled,b=S(P=>qe(P,y.companyId)),x=Je(b.controllers),i=S(P=>rn(P)),m=i.cards.filter(P=>P.type.code.includes("debit")).map(P=>P.connectedAccountId),O=[...new Set(m)],M=S(P=>Ga(P,O)),R=S(P=>Pr(P));d.useEffect(()=>{_||r.fetchState==="Completed"||r.fetchState==="In-Progress"||(g(!0),a(Ne()))},[p,a,r.fetchState]),d.useEffect(()=>{_||r.fetchState!=="Completed"||r.id==null||l.fetchState==="Completed"||l.fetchState==="In-Progress"||(c(!0),a(wr(r.id)))},[_,a,r.fetchState,r.id,l.fetchState]),d.useEffect(()=>{M.fetchState!=="Completed"&&M.fetchState!=="In-Progress"&&u&&j&&a(sn()),i.fetchState!=="Completed"&&i.fetchState!=="In-Progress"&&a(ve()),R.fetchState!=="Completed"&&R.fetchState!=="In-Progress"&&u&&j&&a(vr()),n.fetchState!=="Completed"&&n.fetchState!=="In-Progress"&&A&&E&&a(ut())},[M.fetchState,u,j,i.fetchState,R.fetchState,n.fetchState,A,E]),d.useEffect(()=>{if(l.fetchState==="Completed"&&r.fetchState==="Completed"&&n.fetchState==="Completed"&&i.fetchState==="Completed"&&(!u||!j||M.fetchState==="Completed"&&R.fetchState==="Completed")){let P="",Z="";if(l.statements.length>0){const te=l.statements[l.statements.length-1].period,[ae,k]=te.split("-"),z=l.statements[0].period,[X,Q]=z.split("-");P=`${Ot[parseInt(k)-1]} ${ae}`,Z=`${Ot[parseInt(Q)-1]} ${X}`}const J=Me(A,u,j,E),w=Ea(A,E,!0,r,n),U=It(u,j,!0,M,R);q.trackCardsCreditCardStatementsView(x,J,{numberOfStatements:l.statements.length,oldestStatementMonthYear:P,latestStatementMonthYear:Z},w,U)}},[l.fetchState,r.fetchState,n.fetchState,M.fetchState,i.fetchState,R.fetchState]);const T=()=>{const P=Re(t.state?.pathnameStackToGoBack),Z=P.poppedPathname??"..";e(Z,{state:{pathnameStackToGoBack:P.newStack}})},$=S(P=>Qe(P)),G=ee.getSignedInUser(),V={userId:G?.userId??"",sessionId:G?.zeniSessionId??"",tenantId:y.tenantId??""};if(G==null)throw Error("Can't access address page without signing in...");if(l.fetchState!=="Completed")return s.jsx(Rt,{children:s.jsx(us,{onBackClick:T})});{const P=Me(A,u,j,E);return s.jsx(Rt,{children:s.jsx(ms,{currentTenantCompanyName:y.companyName,statementListView:l,productInformation:P,onBackClick:T,authParams:V,controllerEmails:x,isChargeCardFeatureEnabled:A,isDebitCardFeatureEnabled:u,isDebitCardSetupEnabled:j,isChargeCardSetupEnabled:E,isCardsCommentingEnabled:F,initialOpenThreadRequest:L,chargeCardCashbackDetailState:$,creditAccount:r,creditAccountRepayment:n,depositAccountListWithDebitCardIssued:M,debitCardSummary:R,downloadEndPoint:f})})}}const Bn=[aa,qa],sc=new Set(Bn),cc={containerWidth:new Aa(100,58)},oc=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),n=Se(),{useDynamicConfig:f}=oe(),[p,g]=d.useState(!1),[_,c]=d.useState(!1),[l,v]=d.useState(!1),[y,h]=d.useState(!1),B=d.useRef(!1),F=d.useRef(null);d.useEffect(()=>()=>{F.current!=null&&(clearTimeout(F.current),F.current=null)},[]);const[L,C]=d.useState(!1),[u,D]=d.useState(!1),o=ee.getSignedInUser();if(o==null)throw Error("Can't access onboarding card page without signing in...");const I=S(U=>de(U)),{configValue:A}=f(Le.zeniCardsConfig),j=S(U=>Tr(U)),{tenantEmailDomain:E}=I,b=S(U=>U.settingsViewState.profile.fetchState),x=S(U=>U.chargeCardListState.fetchState),i=S(U=>U.settingsViewState.profile.userId),m=S(U=>U.chargeCardConfigState.fetchState);d.useEffect(()=>{p===!1&&b!=="In-Progress"&&b!=="Completed"&&(t(Fr()),g(!0)),_===!1&&m!=="In-Progress"&&m!=="Completed"&&(t(Va()),c(!0)),l===!1&&x==="Not-Started"&&(v(!0),t(ve()))},[p,l,x,_,m]),d.useEffect(()=>{b==="Completed"&&L===!1&&i!=null&&x==="Completed"&&j.cards.length>0&&(t(xr({userId:i})),t(cn({cardId:j.cards[j.cards.length-1].id})),C(!0))},[b,L,i,x]),d.useEffect(()=>{if(!y&&j.fetchState==="Completed"&&j.cards.length===0){const U=Re(n.state?.pathnameStackToGoBack),te=U.poppedPathname??ze(E);r(te,{state:{pathnameStackToGoBack:U.newStack}})}},[j.fetchState,j.cards,y]);const O=S(U=>ja(U)),M=bt(O.updateStatus.fetchState),R=O.currentDisplayedCardId,{useFeatureGate:T}=oe(),{isFeatureEnabled:$}=T(Y.isChargeCardFeatureEnabled),G=!!I.companyChargeCardInfo?.info?.isChargeCardEnabled,V=!I.userRole.includes("charge_card_user")&&$&&G,P=S(U=>R!=null?on(U.chargeCardState,R):null),Z=()=>{R!=null&&(B.current=!0,F.current!=null&&clearTimeout(F.current),F.current=setTimeout(()=>{B.current=!1,F.current=null},5e3),t(ca(R,V,!0)),t(ve(!0)),h(!0))},J=Ge(I);At({events:ta(J,Bn),onSubscribed:()=>{t(ve(!0))},onEvent:(U,te)=>{if(!sc.has(U))return;const ae=wt(te),k=B.current;if(U===aa){const X=ce(ae?.card_id)??R;if(X!=null){const Q=vt(ae,X);if(Q!=null)return t(mt(Q)),void(X!==R||k||Z())}}if(U===qa)return void t(ve(!0));const z=ce(ae?.card_id)??R;(R==null||z===R)&&R!=null?k||Z():t(ve(!0))}}),d.useEffect(()=>{if(y&&R!=null&&P!=null&&P.status.code!=="request_on_hold"){const U=pe(I.tenantEmailDomain,R,o,P),te=ye(n.state?.pathnameStackToGoBack,n.pathname);t(Br()),P?.type.code==="business_virtual_credit_card"&&t(Na()),r(U,{state:{pathnameStackToGoBack:te},replace:!0}),B.current=!1,F.current!=null&&(clearTimeout(F.current),F.current=null)}},[y,P?.status.code]),d.useEffect(()=>{M==="In-Progress"&&O.updateStatus.fetchState==="Completed"&&setTimeout(Z,3e3)},[M,O.updateStatus.fetchState]);const w=U=>{D(U)};if(b!=="Completed"||j.cards.length===0)return s.jsxs(Ut,{children:[s.jsx(We,{isAppContentDrawerOpen:u,handleDrawerToggle:w}),s.jsx(Cs,{})]});if(i==null)throw Error("Can't access my userId.");return s.jsxs(Ut,{children:[s.jsx(We,{isAppContentDrawerOpen:u,handleDrawerToggle:w}),s.jsx(ic,{chargeCardListView:j,cardUserOnboardingView:O,navigate:r,currentTenant:I,myUserId:i,location:n,chargeCardCashbackRatePerTransaction:A.charge_card_cashback_rate_per_transaction!=null?A.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{w(!0)}}),e!=null?s.jsx(dc,{windowSize:a,children:e}):null]})},ic=he(function(e,{currentTenant:a,cardUserOnboardingView:t,chargeCardListView:r,myUserId:n}){const f=ea(e,!1,!1,!1);let p=!1;return f.fetchState==="Completed"&&f.cards.length<=1&&(p=!0),{cards:r.cards,showMenuIcon:p,companyLegalName:a.companyName,twoFAView:t.twoFAView,cardUserOnboardingLocalData:t.cardUserOnboardingLocalData??{userId:n},isDOBDisabled:t.isDOBPresent,onboardingProgressStatus:t.onboardingProgressStatus}},function(e,a){const{navigate:t,cardUserOnboardingView:r,location:n,currentTenant:f}=a,{tenantEmailDomain:p}=f;return{updateCardUserOnboardingLocalData:g=>{e(Ft({localData:g}))},onGetOtp:g=>{if(r.cardUserOnboardingLocalData!=null){const _={...r.cardUserOnboardingLocalData,phone:g};e(Ft({localData:_}))}e($a(g,"CardUserOnboarding"))},onResendOtp:g=>{e(Ma(g,"CardUserOnboarding"))},onVerifyOtp:(g,_)=>{e(Ha(g,_,"CardUserOnboarding"))},onVerifyOtpSuccess:g=>{e(Lr()),g!=null&&ee.saveZeniOtpToken(g)},setCurrentDisplayedCardId:g=>{e(cn({cardId:g}))},onBackClick:()=>{const g=Re(n.state?.pathnameStackToGoBack),_=g.poppedPathname??ze(p);t(_,{state:{pathnameStackToGoBack:g.newStack}})}}})(ps),dc=Te.div`
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
width: ${e=>`${cc.containerWidth.value(e.windowSize)}%`};
|
|
38
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
39
|
+
`,Ut=Te.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
|
+
`,lc={containerWidth:new Aa(100,58)},uc=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p,useFeatureGate:g}=oe(),[_,c]=d.useState(!1),[l,v]=d.useState(!1),[y,h]=d.useState(!1),[B,F]=d.useState(!1),L=ee.getSignedInUser();if(L==null)throw Error("Can't access onboarding card page without signing in...");const C=S(V=>de(V));if(n==null)throw Error("Empty card id is not valid...");const{configValue:u}=p(Le.zeniCardsConfig),D=S(V=>Rr(V,n)),{isFeatureEnabled:o}=g(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=g(Y.isDebitCardFeatureEnabled),A=Ee(I,C),j=ke({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:A}),E=Ie(C),b=Ae(C),x=C.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,i=_e({isCardsOnlyTenant:E,isChargeCardFeatureEnabled:o,isBookKeepingTenant:b,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:x}),m=D.chargeCard,O=S(V=>V.chargeCardConfigState.fetchState);d.useEffect(()=>{_===!1&&O!=="In-Progress"&&O!=="Completed"&&(t(Va()),c(!0)),l===!1&&D.fetchState==="Not-Started"&&(v(!0),t(ca(n,!1,i)))},[l,D.fetchState,_,O]);const M=m?.type.code==="business_physical_debit_card"||m?.type.code==="business_virtual_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(y===!1&&(M===!1||M&&m.status?.code!=="active"||M&&m.status.code==="active"&&m.isPinSet||m.cardHolderUserId!==L.userId)){const V=pe(C.tenantEmailDomain,n,L,m,!0),P=ye(f.state?.pathnameStackToGoBack,f.pathname);r(V,{state:{pathnameStackToGoBack:P}})}else if(y&&D.isRefreshingViewInBackground===!1&&m?.isPinSet===!0){t(Or({chargeCardId:n}));const V=pe(C.tenantEmailDomain,n,L,m,!0),P=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(V,{state:{pathnameStackToGoBack:P}})}}},[D.fetchState,m?.type.code,y,D.isRefreshingViewInBackground]);const R=ee.getZeniOtpTokenForCardHolder(n),T=S(V=>Nt(V.userState,L.userId)),$=()=>{m?.isPinSet!==!0&&t(na(n,!0))};d.useEffect(()=>{D.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout($,3e3),h(!0))},[D.updateDebitCardPinAttemptFetchState.fetchState]);const G=V=>{F(V)};if(O!=="Completed"||m==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(T?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(pc,{children:[s.jsx(We,{isAppContentDrawerOpen:B,handleDrawerToggle:G}),s.jsx(mc,{cardId:n,card:m,phone:T.phone,signedInUser:L,isSandboxEnv:ht(),debitCardDetailState:D,signedInUserToken:R,navigate:r,currentTenant:C,location:f,chargeCardCashbackRatePerTransaction:u.charge_card_cashback_rate_per_transaction!=null?u.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{G(!0)}}),e!=null?s.jsx(Cc,{windowSize:a,children:e}):null]})},mc=he(function(e,{debitCardDetailState:a,cardId:t}){const r=Ht(e,t),n=a.updateStatus,f=ea(e,!1,!1,!1);let p=!1;return f.fetchState==="Completed"&&f.cards.length<=1&&(p=!0),{showMenuIcon:p,vgsVaultId:Ya.cardVaultId,twoFAView:r,setPinWaitStatus:n}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,debitCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e($a(c,"ChargeCardHolder",r))},onUpdateDebitCardPinAttempt:c=>{e(Kt(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ha(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onSetPinSuccess:()=>{e(Ur({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("activate")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(hs),Cc=Te.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
width: ${e=>`${lc.containerWidth.value(e.windowSize)}%`};
|
|
51
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
52
|
+
box-shadow: ${e=>`${Ra.sp0} 2px ${Ra.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
53
|
+
`,pc=Te.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=>`${Ra.sp0} 2px ${Ra.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
62
|
+
`,hc={overlayWidth:new Aa(at[12],at[12],at[9])},fc=he(function(e,a){const t=pt(e,!1,!1),r=a.lineId,n=t.customAddress[r],f=t.customAddressStatus[r]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:a.googleAPIKey,customAddress:n,customAddressStatus:f,lineId:r}},function(e,a){const{newCustomAddressId:t,lineId:r,chargeCardTypeOption:n}=a;return{onSubmitHandler:f=>{t!=null&&e(dn(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`));const p=Ts(f);e(Nr({addressType:`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`,addressToCreate:p})),e(Hr(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${r}_address`))},onDismissClick:()=>{a.onDismissClick(),t!=null&&e(Vr({addressId:t,cardLineId:r,cardType:n==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}})(fs),gc=({lineId:e,closeDrawerHandler:a,chargeCardTypeOption:t})=>{const r=ft(),n=Ia(),f=()=>{a()},p=S(g=>jr(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,g))?.newAddressId;return s.jsx(hn,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:hc.overlayWidth.valuePercentage(n),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:(g,_)=>(_==="backdropClick"||_==="escapeKeyDown")&&f(),children:s.jsx(fc,{googleAPIKey:Ya.googleMapsAPIKey,onDismissClick:f,lineId:e,chargeCardTypeOption:t,newCustomAddressId:p})})},bc=he(function(e,a){const{isChargeCardFeatureEnabled:t,isDebitCardFeatureEnabled:r,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:f,isChargeCardSetupEnabled:p,isDebitCardSetupEnabled:g}=a,_=pt(e,t&&p,r&&g);return{issueChargeCards:_,isIssuePhysicalCardEnabled:n,isIssuePhysicalDebitCardEnabled:f,isDebitCardFeatureEnabled:r,isChargeCardFeatureEnabled:t,isChargeCardSetupEnabled:p,isDebitCardSetupEnabled:g,cardHolderCandidates:_.userList.map(c=>c.user).filter(Boolean),allRoles:_.userList.map(c=>c.userRole),allAccountingClasses:_.allAccountingClasses,userList:_.userList}},function(e,a){return{onIssueCardClick:()=>{e(Gr())},onSaveChangesToLocalStore:t=>{e($r(t))},onDismissClick:()=>{e(ln()),a.navigate("../")},resetCustomAddressByLineID:(t,r)=>{e(dn(`${r==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`))},openAddAddressDrawerHandler:a.openAddAddressDrawerHandler}})(ys);function yc(){const e=ee.getSignedInUser(),a=me(),t=Ce(),r=gs(),[n]=jt(),f=n.get("cardType"),{useFeatureGate:p}=oe(),{isFeatureEnabled:g}=p(Y.isIssuePhysicalCardEnabled),{isFeatureEnabled:_}=p(Y.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:c}=p(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(Y.isChargeCardFeatureEnabled),v=S($=>de($)),y=Ee(c,v),h=ke({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:y}),B=Ie(v),F=Ae(v),L=v.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,C=_e({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:l,isBookKeepingTenant:F,isDebitCardProductVisible:h,chargeCardsCreditAccountLimit:L}),[u,D]=d.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");d.useEffect(()=>{u||(D(!0),t(Mr(h&&I,C&&o,!1)))},[u,D,t]);const o=!!v.companyChargeCardInfo?.info?.isChargeCardEnabled,I=!!v.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S($=>pt($,C&&o,h&&I)),j=A.fetchState,E=A.issueCardStatus.fetchState,b=A.lastSelfIssuedDebitCardId,x=S($=>b!=null?on($.chargeCardState,b):void 0),[i,m]=d.useState(null),[O,M]=d.useState(null),R=()=>{m(null)},T=($,G)=>{m($),M(G)};return d.useEffect(()=>{if(E==="Completed"){if(b!=null&&x?.type.code==="business_virtual_debit_card"){let $;$=x?.status.code==="request_on_hold"&&e.userId===x.cardHolderUserId?yn(v.tenantEmailDomain):pe(v.tenantEmailDomain,b,e,x),a($)}else a("../");t(ln())}},[E,b]),j==="Completed"?s.jsxs(s.Fragment,{children:[i!==null&&O!==null?s.jsx(gc,{closeDrawerHandler:R,lineId:i,chargeCardTypeOption:O}):null,s.jsx(bc,{themeState:r,isIssuePhysicalCardEnabled:g,isIssuePhysicalDebitCardEnabled:_,isDebitCardFeatureEnabled:h,isChargeCardFeatureEnabled:C,isChargeCardSetupEnabled:o,isDebitCardSetupEnabled:I,navigate:a,fetchState:A.fetchState,openAddAddressDrawerHandler:T,defaultCardType:f==="creditCard"||f==="debitCard"?f:void 0})]}):j==="Error"?s.jsx(Ka,{}):s.jsx(bs,{})}const Ln=[aa,qa],Sc=new Set(Ln),Ic=Te.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
|
+
`,Ac=he(function(e,a){const{myPendingActivationChargeCardListState:t}=a;return{myPendingActivationChargeCardListView:t,uiState:t.uiState,signedInUser:a.signedInUser}},function(e,a){const{navigate:t,currentTenant:r,location:n,signedInUser:f,myPendingActivationChargeCardListState:p}=a,{tenantEmailDomain:g}=r,{cards:_}=p;return{onChargeCardRowClick:c=>{const l=bn(_,c),v=pe(g,c,f,l),y=ye(n.state?.pathnameStackToGoBack,n.pathname);t(v,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,l)=>{e(st({uiState:{sortKey:c,sortOrder:l}}))},onReloadCards:()=>{e(ve())},onBackClick:()=>{const c=r.userRole.includes("charge_card_user");e(st({uiState:{sortKey:c?"cardName":"owner",sortOrder:"ascending"}})),t("../")}}})(Ss);function Ec(){const e=me(),a=Ce(),t=Se(),r=ft(),[n,f]=d.useState(!1),p=S(T=>zr(T)),g=S(T=>de(T)),_=S(T=>qe(T,g.companyId)),c=Je(_.controllers),{useFeatureGate:l}=oe(),{isFeatureEnabled:v}=l(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(Y.isDebitCardFeatureEnabled),h=Ee(y,g),B=ke({isDebitCardFeatureEnabled:y,isBankingOnlyTenant:h}),F=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,L=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,C=$e(),u=Ie(g),D=Ae(g),o=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=_e({isCardsOnlyTenant:u,isChargeCardFeatureEnabled:v,isBookKeepingTenant:D,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:o}),A=He(C?.loggedInUserRoleMap),j=S(T=>Qe(T)),{creditAccount:E,creditAccountRepayment:b}=S(T=>Xe(T)),x=S(T=>rn(T)).cards.filter(T=>T.type.code.includes("debit")).map(T=>T.connectedAccountId),i=[...new Set(x)],m=S(T=>Ga(T,i));d.useEffect(()=>{n||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(f(!0),a(ve()),a(Va()))},[n,a,p.fetchState]),d.useEffect(()=>{if(p.fetchState==="Completed"&&p.cards.length===1&&O!=null){const T=pe(g.tenantEmailDomain,p.cards[0].id,O,p.cards[0]);e(T,{state:{message:t.state?.message}})}},[p.fetchState,p.cards]);const O=ee.getSignedInUser();d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&I&&L&&A&&a(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&A&&a(ut()),m.fetchState!=="Completed"&&m.fetchState!=="In-Progress"&&B&&F&&A&&a(sn())},[E.fetchState,b.fetchState,a,m.fetchState,B,F,A,I,L]);const M=Ge(g);if(At({events:ta(M,Ln),onEvent:(T,$)=>{if(!Sc.has(T))return;const G=wt($);if(T===aa){const V=ce(G?.card_id);if(V!=null){const P=vt(G,V);if(P!=null)return void a(mt(P))}}a(ve(!0))},onSubscribed:()=>{a(ve(!0))}}),O==null)throw Error("Can't access address page without signing in...");const R=p.cards!=null&&p.cards.length>0;if(p.fetchState==="Completed"||R){const T=Me(I,B,F,L);return s.jsx(Ic,{children:s.jsx(Ac,{navigate:e,currentTenant:g,signedInUser:O,productInformation:T,myPendingActivationChargeCardListState:p,isChargeCardFeatureEnabled:I,isDebitCardFeatureEnabled:B,isDebitCardSetupEnabled:F,isChargeCardSetupEnabled:L,chargeCardCashbackDetailState:j,creditAccount:E,creditAccountRepayment:b,depositAccountListWithDebitCardIssued:m,controllerEmails:c,location:t})})}return s.jsx(Sa,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})}const kc=he(function(e,a){const{companyId:t,companyLegalName:r}=a;return{chargeCardSetupView:ya(e,t),admins:a.adminList,companyLegalName:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-zeni-charge-cards?embed=true"}},function(e,a){const{navigate:t,companyId:r,isCompanyBusinessVerificationAndPaymentSetUpDone:n,isDebitCardSetupEnabled:f,isChargeCardSetupEnabled:p,signedInUser:g,location:_,productInformation:c,isEarlyPayEnabled:l,controllerEmails:v,chargeCardsCreditAccountLimit:y}=a;return{onSetupButtonClick:h=>{if(g!=null&&q.trackCardsPromoPageClicked("enable cards"),n)switch(q.trackCardsEnableCardsClick(v,c,"Cards Promo"),h){case"credit":e(Ve(r,!0,"charge_cards",l,!1));break;case"debit":e(Ve(r,!0,"debit_cards",l,!1));break;case"debit_and_credit":e(y===0?Ve(r,!0,"debit_cards",l,!0):Ve(r,!0,"charge_cards__debit_cards",l,!1))}else switch(q.trackCardsSetupCardsClick(v,c,"Cards Promo"),h){case"credit":e(Ve(r,!1,"charge_cards",l,!1));break;case"debit":e(Ve(r,!1,"debit_cards",l,!1));break;case"debit_and_credit":e(y===0?Ve(r,!1,"debit_cards",l,!0):Ve(r,!1,"charge_cards__debit_cards",l,!1))}},onBackClick:()=>{const h=Re(_.state?.pathnameStackToGoBack);let B=h.poppedPathname;B==null&&(B=f||p?"..":"../.."),t(B,{state:{pathnameStackToGoBack:h.newStack}})},onLetsGoClick:()=>{t("./onboard")},onSetupChargeCardSuccess:()=>{n?(e(Na()),t("../",{relative:"path"})):t("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(Kr(r))}}})(As),_c=()=>{const e=me(),{tenantEmailDomain:a}=ba(),[t]=jt(),r=t.get("cardPromoType"),n=Ce(),{useDynamicConfig:f,useFeatureGate:p}=oe(),[g,_]=d.useState(!1),{isFeatureEnabled:c}=p(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:v}=p(Y.isChargeCardFeatureEnabled),{configValue:y}=f(Le.zeniCardsConfig),h=S(ne=>de(ne)),B=S(ne=>qe(ne,h.companyId)),F=Je(B.controllers),L=y.charge_card_cashback_rate_per_transaction!=null?y.charge_card_cashback_rate_per_transaction:.0175,C=Se(),u=ee.getSignedInUserTenant(a)?.companyId??h.companyId,D=S(ne=>ya(ne,u)),o=D.primaryFundingAccount,I=h.companyBillPayInfo?.info,A=Ie(h),j=Ae(h),E=Ee(c,h),b=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=ke({isDebitCardFeatureEnabled:c,isBankingOnlyTenant:E}),i=_e({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:v,isBookKeepingTenant:j,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:b}),m=gn({isCardsOnlyTenant:A,isChargeCardFeatureEnabled:v,isBookKeepingTenant:j}),O=x&&i===!1,M=I?.businessVerificationStatus?.code==="verified"&&(O||o?.accType==="depositAccount"||Yr(o?.providerVerificationStatus?.code??"")),R=ee.getSignedInUser(),T=!!h.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=!!h.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,G=!!h.company?.companyChargeCardInfo.isChargeCardEnabled,V=!!h.company?.companyDebitCardInfo.isDebitCardEnabled,P=!!h.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,Z=ne=>{_(ne)},J=S(ne=>ne.chargeCardSetupViewState.fetchState);if(R==null)throw Error("Can't access Charge Card promo page without signing in...");const w=$e(),U=He(w?.loggedInUserRoleMap),te=Ct(w?.loggedInUserRoleMap),[ae,k]=d.useState(!1),[z,X]=d.useState(!1),[Q,K]=d.useState(!1);d.useEffect(()=>{ae===!1&&C.state?.message==="activation"&&k(!0)},[C.state]),d.useEffect(()=>{z||J!=="Not-Started"||u==null||(X(!0),n(fa(u,!0)))},[z,J,u,n]);const re=h.companyChargeCardInfo?.info!=null&&sa({cardInfo:h.companyChargeCardInfo.info,isProductVisible:m,isTOSAccepted:$,isSetupEnabled:G,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:te}),De=h.companyDebitCardInfo?.info!=null&&sa({cardInfo:h.companyDebitCardInfo.info,isProductVisible:x,isTOSAccepted:P,isSetupEnabled:V,isUserHasCardsAdminLevelAccess:U,isUserHasCardsAccess:te}),Oe=x&&De&&m&&b>=0&&re?"debit_and_credit":x&&De?"debit":"credit",W=ws(r,Oe),fe=D?.chargeCardTermsDetails?.fetchStatus?.fetchState,Pe=d.useRef(null);d.useEffect(()=>{fe==="In-Progress"?Pe.current=W:fe!=="Error"&&fe!=="Not-Started"||(Pe.current=null)},[fe,W]);const Ue=fe!=="In-Progress"&&fe!=="Completed"||Pe.current==null?W:Pe.current;d.useEffect(()=>{W==="credit"&&(G||m===!1&&V)||W==="debit"&&V||W==="debit_and_credit"&&V&&G?e("../"):(W==="debit_and_credit"&&$===!0&&P===!0||W==="credit"&&($===!0||m===!1&&P===!0)||W==="debit"&&P===!0)&&U===!0&&e("../setup")},[M,G,V,W,$,P]),d.useEffect(()=>{Q||(n(Zr("cardAdmin")),K(!0))},[Q]);const Fe=S(ne=>tn(ne.userState,ne.userRoleState,ne.userListViewState,"cardAdmin")),xe=Me(m,x,V,G);return(re||De)&&J==="Completed"?s.jsxs(s.Fragment,{children:[s.jsx(yt,{analytics:q,onLoad:()=>{if(q.trackPageLoaded(pn.Event.cardsPromoPage),!!m&&!G||!!x&&!V||!!m&&!!x&&!V&&!G){const ne=Dc({isDebitCardSetupEnabled:V,isChargeCardSetupEnabled:G,isCreditCardProductVisibleForExpressInterest:m,isDebitCardProductVisible:x});q.trackCardsPromoView(F,xe,"Page",ne,"Promo Page")}}}),s.jsx(za,{showConfetti:ae}),s.jsx(We,{isAppContentDrawerOpen:g,handleDrawerToggle:Z}),s.jsx(kc,{signedInUser:R,location:C,showEnableCardButton:M,isCompanyBusinessVerificationAndPaymentSetUpDone:M,isChargeCardSetupEnabled:G,isDebitCardSetupEnabled:V,companyLegalName:h.companyName,adminList:Fe.users,isCheckingEnabled:T,navigate:e,companyId:u,cardPromoType:Ue,controllerEmails:F,productInformation:xe,isCreditCardProductVisible:i,isDebitCardFeatureEnabled:c,isEarlyPayEnabled:l,cashbackRate:L,chargeCardsCreditAccountLimit:b,onClickMenuIcon:()=>{Z(!0)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(We,{isAppContentDrawerOpen:g,handleDrawerToggle:Z}),s.jsx(Is,{})]})},Dc=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:a,isCreditCardProductVisibleForExpressInterest:t,isDebitCardProductVisible:r})=>t&&r&&!e&&!a?"Credit & Debit Card":t&&!a?"Credit Card":r&&!e?"Debit Card":"";function Jc(){const e=Se(),a=S(J=>de(J)),{useFeatureGate:t}=oe(),{isFeatureEnabled:r}=t(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:n}=t(Y.isDebitCardFeatureEnabled),{isFeatureEnabled:f}=t(Y.isEarlyPayFeatureEnabled),{isFeatureEnabled:p}=t(Y.isChargeCardPaymentHistoryFeatureEnabled),g=Ee(n,a),_=ke({isDebitCardFeatureEnabled:n,isBankingOnlyTenant:g}),c=Es(a,r,n),l=!!a.company?.companyChargeCardInfo.isChargeCardTOSAccepted,v=!!a.company?.companyDebitCardInfo.isDebitCardTOSAccepted,y=!!a.company?.companyChargeCardInfo.isChargeCardEnabled,h=!!a.company?.companyDebitCardInfo.isDebitCardEnabled,B=$e(),F=He(B?.loggedInUserRoleMap),L=Ct(B?.loggedInUserRoleMap),{isFeatureEnabled:C}=t(Y.isCashbackFeatureEnabled),u=a.userRole.includes("charge_card_user"),D=!u,o=!u&&y,I=a?.userRole!=null&&Wr(a?.userRole),A=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!I)&&qr(B?.loggedInUserRoleMap),j=Jr(B?.loggedInUserRoleMap),E=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!I)&&Xr(B?.loggedInUserRoleMap),{isFeatureEnabled:b}=t(Y.isDepositAccountsFeatureEnabled),x=b&&!I&&$t(B?.loggedInUserRoleMap),i=y&&!I,m=h&&!I,O=c&&!I&&He(B?.loggedInUserRoleMap),M=Qr(B?.loggedInUserRoleMap),R=Ie(a),T=Ae(a),$=a.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,G=_e({isCardsOnlyTenant:R,isChargeCardFeatureEnabled:r,isBookKeepingTenant:T,isDebitCardProductVisible:_,chargeCardsCreditAccountLimit:$}),V=a.companyChargeCardInfo?.info!=null&&sa({cardInfo:a.companyChargeCardInfo.info,isProductVisible:G,isTOSAccepted:l,isSetupEnabled:y,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:L}),P=a.companyDebitCardInfo?.info!=null&&sa({cardInfo:a.companyDebitCardInfo.info,isProductVisible:_,isTOSAccepted:v,isSetupEnabled:h,isUserHasCardsAdminLevelAccess:F,isUserHasCardsAccess:L}),Z=V||P;return s.jsxs(Rn,{children:[F?s.jsx(se,{path:"setup",element:s.jsx(xt,{isBillPayAdminLevelAccess:A,isReimbursementAdminLevelAccess:E,isZeniAccountAdminLevelAccess:x,isChargeCardAdminLevelAccess:O,isUserHasOnlyCardAccess:M,isUserHasOnlyBillPayAccess:j,productType:"charge_cards",type:"setup"})}):null,F?s.jsx(se,{path:"verification",element:s.jsx(xt,{isBillPayAdminLevelAccess:A,isUserHasOnlyBillPayAccess:j,isReimbursementAdminLevelAccess:E,isZeniAccountAdminLevelAccess:x,isChargeCardAdminLevelAccess:O,isUserHasOnlyCardAccess:M,productType:"charge_cards",type:"verification"})}):null,s.jsx(se,{path:"promo",element:s.jsx(_c,{})}),i||m?s.jsxs(s.Fragment,{children:[s.jsx(se,{path:"/",element:s.jsx(Lt,{isPaymentDrawerOpen:!1})}),O&&f?s.jsx(se,{path:"payment",element:s.jsx(Lt,{isPaymentDrawerOpen:!0})}):null,s.jsx(se,{path:"activate",element:s.jsx(Ec,{})}),s.jsx(se,{path:"onboard",element:s.jsx(oc,{})}),F?s.jsx(se,{path:"new",element:s.jsx(yc,{})}):null,C&&D?s.jsx(se,{path:"cashback",element:s.jsx(Rs,{})}):null,o?s.jsx(se,{path:"statements",element:s.jsx(rc,{})}):null,O&&p&&y?s.jsx(se,{path:"payment-history",element:s.jsx(nc,{})}):null,s.jsx(se,{path:":cardId/activate",element:s.jsx(js,{})}),s.jsx(se,{path:":cardId/setPin",element:s.jsx(uc,{})}),s.jsx(se,{path:":cardId/addToWallet",element:s.jsx(Fs,{})}),s.jsx(se,{path:":cardId/*",element:s.jsx(Ks,{})}),s.jsx(se,{path:"*",element:s.jsx(Ka,{})})]}):(l||v)&&F?s.jsx(se,{path:"*",element:s.jsx(Fa,{to:"../setup"})}):Z?s.jsx(se,{path:"*",element:s.jsx(Fa,{to:"../promo",state:e.state})}):s.jsx(se,{path:"*",element:null})]})}export{Jc as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-
|
|
1
|
+
import{j as m}from"./liveblocks-CA2qpkTt.js";import{a as g}from"./sentry-C8Zmy8eq.js";import{h as w,u as k,g as x,i as T,j as O,n as E}from"./core-CZ9_x3uq.js";import{z as N,b7 as P,K as F,c as V,e as j,af as C,b8 as A,at as L,au as M,n as U}from"./index-CgsbeRts.js";import{eP as h,fG as B,sg as _,fB as G,c2 as R,MJ as z,bn as K,qh as q,q5 as Y,ke as H,lK as S,MK as J,bE as Z,cv as b,lS as $,lV as Q}from"./zeni-epic-state-CeRetUx9.js";import"./mui-_CQ1MGrl.js";import{d as W}from"./routePaths-Mn-6vq-t.js";import{M as X}from"./MobileAppDrawer-Bc7CKudX.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="09aeb2d3-d2a8-423a-9c70-12a3d63aed7d",n._sentryDebugIdIdentifier="sentry-dbid-09aeb2d3-d2a8-423a-9c70-12a3d63aed7d")}catch{}})();const ee=E(function(n){const t=G(n),i=N.getSignedInUser(),l=h(n),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(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:K(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n($({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:D}=r,v={companyInfo:{...a,website:u!=""&&u!=null?b(u):void 0,meetingLink:y!=""&&y!=null?b(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.companySubIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?Z(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:D.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(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=>{n(J(e))},onCompanyOfficerUpdated:e=>{n(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=>{n(H({files:e}))},onDeleteFile:e=>{n(Y(e))},onEditFileName:(e,a)=>{n(q(e,a.split(".")[0]))}}})(A);function de(){const n=w(),t=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>h(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(P,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:C(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-CA2qpkTt.js";import{a}from"./sentry-C8Zmy8eq.js";import{u as D,g as v,j as m,N as w}from"./core-CZ9_x3uq.js";import{Jo as A,eP as O,fo as j,mW as U,fP as h,fn as _,eW as L,Jv as F}from"./zeni-epic-state-CeRetUx9.js";import{u as P,z as u,L as g,D as $,o as k}from"./index-CgsbeRts.js";import{n as H}from"./mui-_CQ1MGrl.js";import{t as z}from"./getLocaleForTenant-CrEWUw4L.js";import{g as R,Q as J}from"./QBOConnectionScreen-BYQW6Fbt.js";import"./recharts-DG48H-3-.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.js";import"./empty-9FZm-BqI.js";import"./pdf-lib-8meLjW9k.js";import"./index-G8xNq7rD.js";import"./url-ByuQXOc6.js";import"./index-CuxNhIGG.js";import"./decodeURIComponentSafe-COFNvK3Q.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="e44c546e-ff9e-499b-beb5-5fa29599332f",t._sentryDebugIdIdentifier="sentry-dbid-e44c546e-ff9e-499b-beb5-5fa29599332f")}catch{}})();const W=H.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-CA2qpkTt.js";import{z as n}from"./index-CgsbeRts.js";import{g as d}from"./QBOConnectionScreen-BYQW6Fbt.js";import"./sentry-C8Zmy8eq.js";import{g as p,N as a}from"./core-CZ9_x3uq.js";import"./zeni-epic-state-CeRetUx9.js";import"./recharts-DG48H-3-.js";import"./mui-_CQ1MGrl.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.js";import"./empty-9FZm-BqI.js";import"./pdf-lib-8meLjW9k.js";import"./index-G8xNq7rD.js";import"./url-ByuQXOc6.js";import"./index-CuxNhIGG.js";import"./decodeURIComponentSafe-COFNvK3Q.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]="e53e9b9f-4e1e-4d41-afae-a46e42efc4b3",e._sentryDebugIdIdentifier="sentry-dbid-e53e9b9f-4e1e-4d41-afae-a46e42efc4b3")}catch{}})();const U=()=>{const e=p(),{code:t,realmId:o,state:r}=d(e.search),s=n.getSignedInUser()?.userId??"";if(f(t,o,r,s)===!0){const m=`../../${r}/onboarding?code=${t}&realmId=${o}&state=auth_flow`;return i.jsx(a,{to:m})}return i.jsx(a,{to:"../../"})},f=(e,t,o,r)=>e!=""&&t!=""&&o!=""&&r!=null&&r!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-BL0b6UDv.js → CustomerOnboardingRoutes-j2nqZ4nN.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-CA2qpkTt.js";import{t as $e,A as Ce}from"./AddressScreen-CQwbqZZO.js";import Ke from"./NotFoundScreen-GI1oL7ia.js";import{a as g}from"./sentry-C8Zmy8eq.js";import{h as se,g as oe,u as ie,i as re,j as A,N as E,n as ce,l as ze,o as Me,p as z}from"./core-CZ9_x3uq.js";import{O as de,k as le,z as B,v as ue,h as qe,I as _,n as V,K as J,c as N,B as ve,e as Y,ap as Qe,J as Ze,aq as Ie,i as te,ar as He,as as ke,o as Je,at as We,au as Ee,av as Ye}from"./index-CgsbeRts.js";import{bn as Xe,eP as ee,fg as et,e_ as pe,eY as me,bt as tt,mU as at,fc as nt,bO as st,ji as ae,jl as we,JU as ot,bT as it,c2 as ge,su as he,sf as rt,Ko as X,sv as _e,HM as ct,km as Ue,Kp as Ve,Kq as dt,Kr as lt,Ks as ut,jg as pt,jj as mt,sh as Be,st as gt,bE as Te,cv as ht,sH as xe,qh as ft,q5 as yt,ke as St,fE as bt,fD as Ct,fC as It,Kt as kt,s9 as Et,sI as Tt,sL as xt,sO as Ot,sU as Pt,cT as Dt}from"./zeni-epic-state-CeRetUx9.js";import{n as fe}from"./mui-_CQ1MGrl.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-BYQW6Fbt.js";import"./recharts-DG48H-3-.js";import"./analytics-CaY7rw-O.js";import"./plaid-bOhNZMPB.js";import"./dnd-Zw_s-D7Q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW7v-RpQ.js";import"./lexical-DW7Zgdoo.js";import"./pdf-BRE_7-P-.js";import"./utils-CmjIXJxz.js";import"./empty-9FZm-BqI.js";import"./pdf-lib-8meLjW9k.js";import"./index-G8xNq7rD.js";import"./url-ByuQXOc6.js";import"./index-CuxNhIGG.js";import"./decodeURIComponentSafe-COFNvK3Q.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="e7591494-1744-406d-b646-98552e1ac834",t._sentryDebugIdIdentifier="sentry-dbid-e7591494-1744-406d-b646-98552e1ac834")}catch{}})();const jt=ce(function(t,s){const o=[];s.isApAgingFeatureEnabled===!1&&o.push("accounts_payable_aging"),s.isArAgingFeatureEnabled===!1&&o.push("accounts_receivable_aging"),s.shouldFetchZeniAccountsPromoCard===!1&&o.push("zeni_accounts_promo_card"),s.shouldFetchRewardsPlanCard===!1&&o.push("rewards_card"),s.isExpenseAutomationEnabledForUser===!1&&o.push("expense_automation_card");const u=nt(t,o,s.signedInUser,s.isExpenseAutomationFeatureEnabledV2,s.isExpenseAutomationEnabledForUser,s.isTreasuryEnabled);return{dashboardFetchState:st(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,s){const{themeState:o,navigate:u,location:d}=s;return{onZeniLogoClick:()=>{o.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),vt=()=>{const t=se(),s=oe(),o=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const v=pe(F,c),P=me(c),D=[],Q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,K=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),w=b?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),K===!1&&D.push("task_card"),w===!1&&D.push("bill_pay_card","bill_pay_promo_card"),q===!1&&D.push("reimbursement_card","reimbursement_promo_card"),I===!1&&D.push("zeni_accounts_promo_card"),f===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||v||P||(r(!0),o(at(i.userId,G,c.tenantId,!0,!1,D)))},[d,O,v,P,i,c.tenantId,o]),g.useEffect(()=>{(v||P)&&setTimeout(()=>{S(!0)},5e3)},[v,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(s.state?.pathnameStackToGoBack,s.pathname);if(v)return a.jsx(E,{to:"../../checking",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:s,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(ve,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${t=>t.theme.colors.grey4};
|