@zeniai/web-app-ui 5.1.53-dev → 5.1.53-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AddressRoutes-Ct2UHIee.js → AddressRoutes-BA_Za0FR.js} +1 -1
- package/dist/assets/{AddressScreen-DzlfvttE.js → AddressScreen-BrXKW3BZ.js} +1 -1
- package/dist/assets/{AiCfoScreen-D83FklRr.js → AiCfoScreen-C3s-4Li8.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-Dh8a42Hh.js → BillPayApprovalRoutes-C0HhO8Zq.js} +1 -1
- package/dist/assets/{BillPayRoutes-C6_AK3AV.js → BillPayRoutes-DL446uHm.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-6o8gENq-.js → BusinessVerificationPageScreen-BxP_dHBq.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-D5tWDH0n.js → CardsAiCfoScreen-DCEvVdt-.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-2ad2KSI-.js → ChargeCardRoutes-BLCb8cIx.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-DBpHUeez.js → CompanyPassportScreen-CkDV3dle.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-BDQnLY2-.js → ConnectionAuthScreen-BlDRBSBs.js} +1 -1
- package/dist/assets/{CustomerOnboardingAuthScreen-Yzg3cHZm.js → CustomerOnboardingAuthScreen-ClDUuER9.js} +1 -1
- package/dist/assets/{CustomerOnboardingRoutes-Cd6aEpRT.js → CustomerOnboardingRoutes-BySm8MfB.js} +1 -1
- package/dist/assets/{DashboardRoutes-BqteLe-_.js → DashboardRoutes-CEgHKVmd.js} +1 -1
- package/dist/assets/{DefaultTenantHome-BmKNJTAE.js → DefaultTenantHome-9fk_ObXB.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-ByI1UAeb.js → DomesticWireDetailScreen-DCT2WFO9.js} +1 -1
- package/dist/assets/{DrawerScreen-CVn6NI6C.js → DrawerScreen-DAhJy05e.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-CJCW4lau.js → EntityDetailRoutes-DOcGH-23.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-Bw8DwzWR.js → ExpenseAutomationRoutes-CJpBRsLy.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-D7L8dftQ.js → FeaturePreviewScreen-h089v0nG.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-BhR_n_gC.js → HubSpotOAuthCallbackScreen-Bx79fA6b.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-GquONAuy.js → MagicLinkRoutes-DvqPr1uQ.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-D99xSkpp.js → MagicLinkSignInScreen-YSubZawb.js} +1 -1
- package/dist/assets/{MobileAppDrawer-CzOm0Sxs.js → MobileAppDrawer-B8b7sXqB.js} +1 -1
- package/dist/assets/{NotFoundScreen-D51sUkWb.js → NotFoundScreen-C5grvltN.js} +1 -1
- package/dist/assets/{NotificationRoutes-Bk-3HBBq.js → NotificationRoutes-kB86UiyF.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-CnnMYT9D.js → OAuthConsentScreen-DNPWtBCU.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-Cmu8H8NO.js → PandLWithForecastRoutes-E2IJx1NW.js} +1 -1
- package/dist/assets/{PeopleRoutes-BW2q_Dmg.js → PeopleRoutes-DtPRAphk.js} +1 -1
- package/dist/assets/{PerformanceRoutes-B6NZ0t5W.js → PerformanceRoutes-DR3r_m80.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BTT5tOv0.js → QBOConnectionScreen-l87oL02a.js} +1 -1
- package/dist/assets/{ReferralListScreen-xE93Ck03.js → ReferralListScreen-XtU4H9R4.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-D2Kon39b.js → ReimbursementApprovalRoutes-BZBu7fQ8.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CEzdk50o.js → ReimbursementApprovalRuleDetailScreen-ByIZjgyO.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BJgLWv6y.js → ReimbursementRoutes-B0Rnpw8O.js} +1 -1
- package/dist/assets/{ReportsRoutes-ImAHwLCG.js → ReportsRoutes-CnhRcEBw.js} +1 -1
- package/dist/assets/{RewardsRoutes-BQc5zm_c.js → RewardsRoutes-kojWdGBy.js} +1 -1
- package/dist/assets/{ScreenRoutes-BSFeQNd5.js → ScreenRoutes-dCkGsbaX.js} +2 -2
- package/dist/assets/{SettingsRoutes-CAmtpUik.js → SettingsRoutes-B_DWLARM.js} +1 -1
- package/dist/assets/{SetupPagesScreen-BEBa0Bcm.js → SetupPagesScreen-CoEYpzVD.js} +1 -1
- package/dist/assets/{SignInScreen-CoLktDu5.js → SignInScreen-D-GiwcO7.js} +1 -1
- package/dist/assets/{SignOutScreen-DR8PJ_Dr.js → SignOutScreen-KgU4ADq9.js} +1 -1
- package/dist/assets/{TaskListScreen-B0DRrcBn.js → TaskListScreen-DR1N5MLz.js} +1 -1
- package/dist/assets/{TaskRoutes-46kHJnwt.js → TaskRoutes-DzW21iLL.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-B7idB5XF.js → TransactionDetailRoutes-wUBvx13S.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-DhBRM2u-.js → TransactionDetailScreen-SbXBU7LB.js} +1 -1
- package/dist/assets/{TransactionListRoutes-Bmu0vt6n.js → TransactionListRoutes-BmJWlLYy.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BqzqJLAw.js → TreasuryRoutes-CiX59e1b.js} +1 -1
- package/dist/assets/{VendorsRoutes-DnOFtiAo.js → VendorsRoutes-BTJDHiaX.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-f5jOSttP.js → WiseConfirmationScreen-B8PpSiXI.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-Bl_KyIZU.js → ZeniAccountRoutes-Bye-oBEL.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-BhYmNPRG.js → ZeniAccountStatementScreen-DwjBXO74.js} +1 -1
- package/dist/assets/{analyticsHelper-B5EDEZrW.js → analyticsHelper-VUlrCZ3f.js} +1 -1
- package/dist/assets/{getLocaleForTenant-DI_-EIej.js → getLocaleForTenant-ChWLNTj3.js} +1 -1
- package/dist/assets/{index-BHgTWK3A.js → index-C_Y0yMPY.js} +5 -5
- package/dist/assets/{routePaths-CKR4MRfB.js → routePaths-D0rLO8yN.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-C8eUPCD2.js → useAiCfoDashboardSuggestedQuestionsChips-CSjDWCVT.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-DvB8uvB7.js → useAskAiCfoHostNavButtonProps-OU79nJF1.js} +1 -1
- package/dist/assets/{useCashManagementBanner-WDwkWALo.js → useCashManagementBanner-D7ux4QIE.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-ITLu-S1Q.js → useInitialThreadRequest-C_e7mvD1.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-txS5Vf1E.js → withTransactionSidePanel-8QHjmr16.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-DmbDY3sa.js";import{A as d}from"./AddressScreen-
|
|
1
|
+
import{j as e}from"./liveblocks-DmbDY3sa.js";import{A as d}from"./AddressScreen-BrXKW3BZ.js";import i from"./NotFoundScreen-C5grvltN.js";import"./sentry--Yi43Gx7.js";import{o as s,p as r}from"./core-Cj3sxYL7.js";import"./zeni-epic-state-BG_x9wwl.js";import"./recharts-mFhBBFnU.js";import"./index-C_Y0yMPY.js";import"./mui-1V4hRqCa.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.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]="cd0ff2b4-1e27-4329-addf-f475e5a9db34",t._sentryDebugIdIdentifier="sentry-dbid-cd0ff2b4-1e27-4329-addf-f475e5a9db34")}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-DmbDY3sa.js";import{a as h}from"./sentry--Yi43Gx7.js";import{h as T,u as _,g as j,i as M,j as E,n as B}from"./core-Cj3sxYL7.js";import{K as $,m as D,z as K,j as L,B as R,A as z,c as C,e as S,k as F,h as b,n as N}from"./index-
|
|
1
|
+
import{j as r}from"./liveblocks-DmbDY3sa.js";import{a as h}from"./sentry--Yi43Gx7.js";import{h as T,u as _,g as j,i as M,j as E,n as B}from"./core-Cj3sxYL7.js";import{K as $,m as D,z as K,j as L,B as R,A as z,c as C,e as S,k as F,h as b,n as N}from"./index-C_Y0yMPY.js";import{Ml as k,hP as U,eW as G,Mm as O,c7 as V,Mn as q,l8 as H}from"./zeni-epic-state-BG_x9wwl.js";import{n as W}from"./mui-1V4hRqCa.js";import J from"./NotFoundScreen-C5grvltN.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]="47fbef4e-0ebd-40df-8adb-3f9ed1436452",e._sentryDebugIdIdentifier="sentry-dbid-47fbef4e-0ebd-40df-8adb-3f9ed1436452")}catch{}})();const Q=W.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-DmbDY3sa.js";import{a as l}from"./sentry--Yi43Gx7.js";import{u as ge,h as Ce,g as Ie,j as K,i as ke,n as be}from"./core-Cj3sxYL7.js";import{W as we,z as xe,K as Pe,d9 as Ee,da as ye,b6 as X,db as Te,b5 as Y,n as D,A as F,c as I,dc as L,dd as ve,de as Qe,a1 as _e,e as Ae,a7 as Oe,df as je,a2 as Ue,dg as Fe,dh as Le,r as Be,b1 as De,di as Re}from"./index-
|
|
1
|
+
import{j as d}from"./liveblocks-DmbDY3sa.js";import{a as l}from"./sentry--Yi43Gx7.js";import{u as ge,h as Ce,g as Ie,j as K,i as ke,n as be}from"./core-Cj3sxYL7.js";import{W as we,z as xe,K as Pe,d9 as Ee,da as ye,b6 as X,db as Te,b5 as Y,n as D,A as F,c as I,dc as L,dd as ve,de as Qe,a1 as _e,e as Ae,a7 as Oe,df as je,a2 as Ue,dg as Fe,dh as Le,r as Be,b1 as De,di as Re}from"./index-C_Y0yMPY.js";import{gk as Me,eV as ee,eW as Ge,iv as Ve,Ts as $e,f0 as Ne,iF as qe,iB as We,eX as B,f7 as ze,fZ as He,fC as Ke,fG as Z,f_ as Xe,f$ as Ze,g0 as Je,g1 as Ye,g2 as et}from"./zeni-epic-state-BG_x9wwl.js";import{D as tt,n as k,S as st,P as ot}from"./mui-1V4hRqCa.js";import{u as at}from"./useAiCfoDashboardSuggestedQuestionsChips-CSjDWCVT.js";import{p as nt}from"./pathToGoBack-PTW4YbNu.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="9c632d24-86a1-4617-bf8e-e5e613a29380",t._sentryDebugIdIdentifier="sentry-dbid-9c632d24-86a1-4617-bf8e-e5e613a29380")}catch{}})();const te="chat-response-generated",it=be(function(t,r){const s=ee(t),m=r.isSubmitting,n=s.uiState?.currentChatSessionId,p=n!=null?ze(t.aiCfoState,n):[];return{showSampleQuestions:r.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ue}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,syntheticAnswers:p,resolveSyntheticAnswerCardTile:Le(t),resolveSyntheticAnswerPolicyTile:Fe(t)}},function(t,r){const{location:s,currentTenant:m,userId:n,navigate:p,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:c,setIsAiCfoOpen:f}=r;return{onEventReceived:(e,h)=>{if(e===te&&typeof h.text=="string"&&typeof h.metadata=="object"){const a=h,u=Ze(a.type),o=a.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:b,currentQuestionAnswerSummary:y}=Y(c,o);u!=="answer"?I.trackAICFOChatResponseGenerated(u,b?.question.questionText??"",a.text,o,Re(y,E),a.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(a.text,b?.question.questionText??"",(a.follow_up_questions?.length??0)>0,!!a.assumptions,!!a.insights,a.visualization!=null,Je(a.visualization?.type??"")??null,o,a.summarized_title,a.metadata.message_id??null),t(Ye({chatSessionId:a.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),t(et({chatSessionId:a.metadata.chat_session_id,answerPayload:a,userId:n}))}},onSubmit:(e,h,a,u)=>{e&&De(t,e,h,S,c,n,u,a)},updateCurrentInput:e=>{t(Z(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{t(Xe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),h=e.poppedPathname??nt(1);p(h,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),t(Z(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),h=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(h,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{S!=null&&t(Ke());const e=Be(s.state?.pathnameStackToGoBack,s.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,h)=>{t(He({questionAnswerId:e,isCollapsed:h}))},onMenuClick:r.onMenuClick}})(Oe(je)),vt=({isFileUploadEnabled:t})=>{const{setIsAiCfoOpen:r}=we(),s=ge(),m=Ce(),n=Ie(),[p,S]=l.useState(!1);l.useEffect(()=>{s(Me())},[s]);const c=K(i=>ee(i)),f=xe.getSignedInUser(),{session_id:e}=ke(),h=Pe(),a=_e(h),u=K(i=>Ge(i)),o=c.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:b,isUploadPromoVisible:y}=Ee({isFileUploadEnabled:t,tenantEmailDomain:E}),T=ye({currentTenant:u,currentChatSessionId:o,aiCfoView:c}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=at(),w=n.state,x=w?.aiCfoInitialQuestion,R=!!w?.aiCfoShouldSubmit;l.useEffect(()=>{const i=n.state;if(i?.[X]!==!0)return;S(!0);const g={...i};delete g[X],m(n,{replace:!0,state:g})},[n.pathname,n.search,n.state,m]);const[ae,v]=l.useState(null),[ne,Q]=l.useState(!1),[ie,_]=l.useState(void 0),[re,A]=l.useState(void 0),M=l.useRef(!1);l.useEffect(()=>{if(!M.current&&x!=null&&x!==""){const i=n.state;v(x),Q(R),_(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const g=i?.aiCfoSuggestionIndex;A(typeof g=="number"?g:void 0),M.current=!0}},[x,R,n.state]);const le=l.useCallback(()=>{v(null),Q(!1),_(void 0),A(void 0)},[]),G=l.useMemo(()=>new URLSearchParams(n.search),[n.search]),V=G.get("ref")??w?.aiCfoRef,O=G.get("emailRefId")??w?.aiCfoEmailRefId,$=l.useRef(!1);l.useEffect(()=>{$.current||V!=="month-end-email"||O==null||o!=null||f==null||(s(Ve("controller",f.userId,O,"MONTH_END_EMAIL")),$.current=!0)},[V,O,o,s,f]);const P=c.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&o!=null&&(v(P),Q(!0),_(void 0),A(void 0),s($e()))},[P,o,s]);const de=u.masterTOSInfo,C=de?.isMasterTOSAccepted??!1,{visitedSessions:N}=Te(o),j=c.fetchState,U=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,q=o!=null?c.fetchChatSessionHistoryByChatSessionId?.[o]?.fetchState??"Not-Started":"Not-Started",W=o==null||(c.uiState.chatHistoryNextPageToken[o]?.hasMore??!0),z=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Y(z,o),ce=ue.length===0;l.useEffect(()=>{C||a||m("../dashboard",{state:{...n.state,message:"open_ai_cfo_drawer"}})},[C,a,m,n.state]);const me=l.useCallback(()=>{const i=D(n.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...n.state,pathnameStackToGoBack:i.newStack}})},[u.tenantEmailDomain,n.state,m]);l.useEffect(()=>{o!=null&&e!==o&&m(`../ai-cfo/${o}`,{state:{...n.state}})},[o,e]),l.useEffect(()=>{e!=null&&o==null&&e!=="new_chat"&&e!=="explore"&&s(Ne({sessionId:e,agentId:"controller"}))},[]);const pe=l.useMemo(()=>({events:N.map(i=>`private-encrypted-chat-${i}.${te}`),eventCallback:(i,g,fe)=>fe.onEventReceived(i,g)}),[N]);l.useEffect(()=>{j!=="In-Progress"&&U&&s(qe())},[j,U,s]),l.useEffect(()=>{o!=null&&q!=="In-Progress"&&W&&f!=null&&j==="Completed"&&!U&&s(We(o,f.userId))},[q,W,o,f,s]);const H=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=o!=null&&c.responseStateByChatSessionId?.[o]?.answer?.fetchState==="In-Progress";if(!C&&a)return d.jsxs(lt,{children:[d.jsx(F,{analytics:I,onLoad:H}),T.drawerElement,d.jsx(dt,{children:d.jsx(J,{children:d.jsx(L,{isTOSAccepted:!1,acceptMasterTOSState:c.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(B(u.userRoleId))}})})})]});const Se=d.jsxs(d.Fragment,{children:[p&&!C?d.jsx(F,{analytics:I,onLoad:H}):null,d.jsx(L,{isTOSAccepted:C,acceptMasterTOSState:c.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(B(u.userRoleId)),S(!1)}})]});return d.jsxs(d.Fragment,{children:[d.jsxs(rt,{children:[d.jsx(F,{analytics:I,onLoad:i=>i.trackPageLoaded(Ae.Event.aiCFOPage)}),a&&T.drawerElement,d.jsx(it,{...pe,currentChatSessionId:o,allSessionsWithOrderedQuestionAnswers:z,openOnboardingPage:()=>S(!0),userId:f.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:e,location:n,isSubmitting:he,isEmptyChatWithSession:ce,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:a?T.open:void 0,isFileUploadEnabled:t,isUploadPromoVisible:y,onUploadPromoClose:b,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),p&&a?d.jsx(tt,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ut,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:d.jsx(J,{onClick:i=>i.stopPropagation(),children:d.jsx(L,{isTOSAccepted:C,acceptMasterTOSState:c.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(B(u.userRoleId)),S(!1)}})})}):null]}),p&&!a?d.jsx(ve,{open:p,onClose:()=>S(!1),children:d.jsx(Qe,{children:Se})}):null]})},J=k(st)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-DmbDY3sa.js";import{a as v}from"./sentry--Yi43Gx7.js";import{h as B,g as j,u as P,j as y,N as q,n as U,i as K,o as ee,p as C}from"./core-Cj3sxYL7.js";import{eW as k,PD as A,Pj as g,zc as E,z4 as J,z8 as R,yZ as Z,Pl as G,ze as te,z0 as H,zh as M,zd as D}from"./zeni-epic-state-BG_x9wwl.js";import{m as O,z as V,B as T,a7 as Q,bI as ae,af as _,bz as X,bJ as oe,bK as le,bL as pe}from"./index-BHgTWK3A.js";import"./mui-1V4hRqCa.js";import{i as se}from"./ReimbursementApprovalRuleDetailScreen-CEzdk50o.js";import re from"./NotFoundScreen-D51sUkWb.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="2f0e600b-b782-48b4-a04e-a3b7d7ed0043",e._sentryDebugIdIdentifier="sentry-dbid-2f0e600b-b782-48b4-a04e-a3b7d7ed0043")}catch{}})();const N="bill-approval-rule-update",ne=U(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:g(e).billPaySetupApproverViewUpdateData}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(N)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}})(Q(ae)),ie=()=>{const e=B(),p=j(),t=P(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!1)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${N}`]:[],eventCallback:(l,w,h)=>{l.endsWith(N)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ne,{currentTenant:u,location:p,navigate:e,...m})},F="bill-approval-rule-update",ce=U(function(e){const p=A(e),t=g(e).billPaySetupApproverViewUpdateData,s={};for(const i of Object.values(e.contactState.contactById))i?.id!=null&&(s[i.id]=i.fullName);const a={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(a[i.classId]=i.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:s,departmentNamesById:a}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(F)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(te(a,!0))}}})(Q(oe)),ue=()=>{const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(de,{}):c.jsx(ie,{})},de=()=>{const e=B(),p=j(),t=P(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!0)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${F}`]:[],eventCallback:(l,w,h)=>{l.endsWith(F)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ce,{currentTenant:u,location:p,navigate:e,...m})},ve=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=s==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex(r=>r.approvalRuleId===p.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:i,approvalUpdateActionType:s}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=f=>{const m=[];return f.forEach(l=>{const w=l.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),h=l.actors.selectedNonUsers.map(b=>{const I=!!se(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}}),S=w.concat(h);m.push({action:l.stepType.selectedOption,actors:S,operator:S.length>1?l.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m},n={amount:{type:"amount",comparator:"range",min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const f={criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}else{const f={approvalRuleId:i,criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}})(le);function fe(){const e=B(),p=P(),t=j(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ve,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t})}const ye=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],i={};for(const r of Object.values(e.contactState.contactById))r?.id!=null&&(a.push(r.id),i[r.id]=r.fullName);return{localData:t,approvalUpdateActionType:s,allVendorIds:a,vendorNamesById:i,editingRuleId:s==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=S=>{const b=[];return S.forEach(I=>{const $=I.actorKind?.selectedOption,z=I.selectedRole?.selectedOption;let x=[];$==="role"&&z!=null?x=[{type:"attribute",subType:z,userId:void 0,idType:void 0,isImplicitActor:!1}]:$==="specific_person"&&(x=(I.persons?.selectedUsers??[]).map(Y=>({type:"user",userId:Y.userId,isImplicitActor:!1})));const L=I.action??"require_approval";b.push({action:L,actors:x,operator:x.length>1?L==="require_approval"?"or":"and":"is"})}),b},n=o.amountCriteria,f=o.vendorCriteria,m=o.departmentCriteria,l={};if(n!=null&&n.comparator.selectedOption!=null){const S=n.comparator.selectedOption;l.amount={type:"amount",comparator:S,min:S==="less_than"?void 0:n.min,max:S==="greater_than"?void 0:n.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(l.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const h=m?.selection.selectedOptions??[];if(h.length>0&&(l.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:h}),r==="approval_create"){const S={name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}else{const S={approvalRuleId:i,name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:o=>{e(R(o)),t(r==="approval_update"?`../../${o}/edit`:`../${o}/edit`)}}})(pe);function W(){const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(Se,{}):c.jsx(fe,{})}function Se(){const e=B(),p=P(),t=j(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ye,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t},s??"new")}function Ee(){return c.jsxs(ee,{children:[c.jsx(C,{path:"/",element:c.jsx(ue,{})}),c.jsx(C,{path:"/new",element:c.jsx(W,{})}),c.jsx(C,{path:"/:approvalRuleId/edit",element:c.jsx(W,{})}),c.jsx(C,{path:"*",element:c.jsx(re,{})})]})}export{Ee as B};
|
|
1
|
+
import{j as c}from"./liveblocks-DmbDY3sa.js";import{a as v}from"./sentry--Yi43Gx7.js";import{h as B,g as j,u as P,j as y,N as q,n as U,i as K,o as ee,p as C}from"./core-Cj3sxYL7.js";import{eW as k,PD as A,Pj as g,zc as E,z4 as J,z8 as R,yZ as Z,Pl as G,ze as te,z0 as H,zh as M,zd as D}from"./zeni-epic-state-BG_x9wwl.js";import{m as O,z as V,B as T,a7 as Q,bI as ae,af as _,bz as X,bJ as oe,bK as le,bL as pe}from"./index-C_Y0yMPY.js";import"./mui-1V4hRqCa.js";import{i as se}from"./ReimbursementApprovalRuleDetailScreen-ByIZjgyO.js";import re from"./NotFoundScreen-C5grvltN.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="2f0e600b-b782-48b4-a04e-a3b7d7ed0043",e._sentryDebugIdIdentifier="sentry-dbid-2f0e600b-b782-48b4-a04e-a3b7d7ed0043")}catch{}})();const N="bill-approval-rule-update",ne=U(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:g(e).billPaySetupApproverViewUpdateData}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(N)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}})(Q(ae)),ie=()=>{const e=B(),p=j(),t=P(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!1)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${N}`]:[],eventCallback:(l,w,h)=>{l.endsWith(N)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ne,{currentTenant:u,location:p,navigate:e,...m})},F="bill-approval-rule-update",ce=U(function(e){const p=A(e),t=g(e).billPaySetupApproverViewUpdateData,s={};for(const i of Object.values(e.contactState.contactById))i?.id!=null&&(s[i.id]=i.fullName);const a={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(a[i.classId]=i.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:s,departmentNamesById:a}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(F)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(te(a,!0))}}})(Q(oe)),ue=()=>{const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(de,{}):c.jsx(ie,{})},de=()=>{const e=B(),p=j(),t=P(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!0)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${F}`]:[],eventCallback:(l,w,h)=>{l.endsWith(F)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ce,{currentTenant:u,location:p,navigate:e,...m})},ve=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=s==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex(r=>r.approvalRuleId===p.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:i,approvalUpdateActionType:s}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=f=>{const m=[];return f.forEach(l=>{const w=l.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),h=l.actors.selectedNonUsers.map(b=>{const I=!!se(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}}),S=w.concat(h);m.push({action:l.stepType.selectedOption,actors:S,operator:S.length>1?l.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m},n={amount:{type:"amount",comparator:"range",min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const f={criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}else{const f={approvalRuleId:i,criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}})(le);function fe(){const e=B(),p=P(),t=j(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ve,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t})}const ye=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],i={};for(const r of Object.values(e.contactState.contactById))r?.id!=null&&(a.push(r.id),i[r.id]=r.fullName);return{localData:t,approvalUpdateActionType:s,allVendorIds:a,vendorNamesById:i,editingRuleId:s==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=S=>{const b=[];return S.forEach(I=>{const $=I.actorKind?.selectedOption,z=I.selectedRole?.selectedOption;let x=[];$==="role"&&z!=null?x=[{type:"attribute",subType:z,userId:void 0,idType:void 0,isImplicitActor:!1}]:$==="specific_person"&&(x=(I.persons?.selectedUsers??[]).map(Y=>({type:"user",userId:Y.userId,isImplicitActor:!1})));const L=I.action??"require_approval";b.push({action:L,actors:x,operator:x.length>1?L==="require_approval"?"or":"and":"is"})}),b},n=o.amountCriteria,f=o.vendorCriteria,m=o.departmentCriteria,l={};if(n!=null&&n.comparator.selectedOption!=null){const S=n.comparator.selectedOption;l.amount={type:"amount",comparator:S,min:S==="less_than"?void 0:n.min,max:S==="greater_than"?void 0:n.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(l.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const h=m?.selection.selectedOptions??[];if(h.length>0&&(l.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:h}),r==="approval_create"){const S={name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}else{const S={approvalRuleId:i,name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:o=>{e(R(o)),t(r==="approval_update"?`../../${o}/edit`:`../${o}/edit`)}}})(pe);function W(){const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(Se,{}):c.jsx(fe,{})}function Se(){const e=B(),p=P(),t=j(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ye,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t},s??"new")}function Ee(){return c.jsxs(ee,{children:[c.jsx(C,{path:"/",element:c.jsx(ue,{})}),c.jsx(C,{path:"/new",element:c.jsx(W,{})}),c.jsx(C,{path:"/:approvalRuleId/edit",element:c.jsx(W,{})}),c.jsx(C,{path:"*",element:c.jsx(re,{})})]})}export{Ee as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-DmbDY3sa.js";import{h as K,u as se,g as Q,i as ae,j as v,N as te,n as X,l as na,o as ia,p as S}from"./core-Cj3sxYL7.js";import{eW as Z,OV as Ue,bt as It,JS as oa,bo as wt,bJ as pe,OW as At,yu as Bt,zJ as $e,z1 as la,bn as De,OX as sa,OY as ra,c7 as ca,OZ as da,ks as Ct,O_ as xt,O$ as Et,Ai as Ge,yJ as Ce,P0 as ua,yi as tt,P1 as pa,Ee as ma,ym as ba,ys as Dt,P2 as ke,P3 as Me,zK as Oe,P4 as ha,P5 as ga,zN as Ne,P6 as ya,z_ as Sa,P7 as Pt,zu as at,zz as fa,P8 as ka,P9 as ue,Pa as jt,Pb as Tt,Pc as Ft,go as va,yO as Le,cB as Rt,Pd as Ia,f9 as wa,Pe as Aa,Pf as Ba,fe as Vt,fc as $t,Pg as ze,Ph as Ca,Pi as xa,ME as Ze,Pj as Ea,MF as oe,MG as He,Pk as Da,Pl as Pa,Pm as ja,zB as nt,zy as Ta,Pn as Fa,Po as Ra,Pp as Va,zk as $a,Pq as La,Pr as _a,Ps as Ua,cp as Lt,cR as _t,kD as Ga,bP as Ma,bq as Ut,bQ as Gt,xA as Oa,Pt as Na,E1 as za,E7 as Za,t_ as Ha,zL as Wa,Ap as qa,kQ as fe,Pu as Ja,Pv as Mt,li as Ka,kK as Ot,l3 as Nt,l2 as it,bE as be,bO as Qa,Pw as Xa,Px as ve,jn as Ya,Py as ot,Pz as en,jr as tn,jM as an,AD as nn,PA as on,lb as ln,At as sn,PB as lt,Ax as rn,AC as cn,Az as dn,Ar as un,PC as zt,yD as pn,PD as mn,PE as bn,gg as hn,gf as gn,ge as yn,kT as Sn,l9 as st,lk as fn,ry as kn,l0 as vn,Av as In,jx as wn,lp as An,PF as Bn,jp as Cn,rp as xn,PG as En,zq as Dn,bK as Pn,bs as jn,LA as Tn,cT as Fn,cS as Rn,cA as Vn,cH as $n}from"./zeni-epic-state-BG_x9wwl.js";import{m as me,z as V,j as Ie,_ as We,F as le,x as y,aN as xe,B as re,o as x,A as Pe,c as D,be as Ln,n as z,a2 as qe,r as E,K as we,bf as rt,bg as ct,bh as _n,ak as Un,I as Gn,aH as Mn,E as Zt,D as Je,N as Ke,bi as On,at as Ht,bj as Nn,X as zn,e as Wt,a7 as Zn,bk as Hn,bl as Wn,bm as qn,bn as Jn,bo as Kn,bp as Qn,bq as Xn,br as Yn,bs as ei,w as ti,bt as ai,b9 as ni,bu as ii,bv as oi,a9 as li}from"./index-BHgTWK3A.js";import{n as _,S as si}from"./mui-1V4hRqCa.js";import{A as dt}from"./AddressScreen-DzlfvttE.js";import{g as ie,a as je,i as qt,V as Qe,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-ByI1UAeb.js";import{a as f}from"./sentry--Yi43Gx7.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-DvB8uvB7.js";import{u as Jt}from"./useInitialThreadRequest-ITLu-S1Q.js";import Ee from"./NotFoundScreen-D51sUkWb.js";import{D as ui}from"./DrawerScreen-CVn6NI6C.js";import{M as Kt}from"./MobileAppDrawer-CzOm0Sxs.js";import{F as Qt}from"./FeaturePreviewScreen-D7L8dftQ.js";import{S as Te}from"./SetupPagesScreen-BEBa0Bcm.js";import{B as pi}from"./BillPayApprovalRoutes-Dh8a42Hh.js";import{FallBackRoute as mi}from"./ScreenRoutes-BSFeQNd5.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./analyticsHelper-B5EDEZrW.js";import"./routePaths-CKR4MRfB.js";import"./BusinessVerificationPageScreen-6o8gENq-.js";import"./ReimbursementApprovalRuleDetailScreen-CEzdk50o.js";import"./getLocaleForTenant-DI_-EIej.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]="14c1f230-843d-4ffe-adb2-b98e45ab4bf7",e._sentryDebugIdIdentifier="sentry-dbid-14c1f230-843d-4ffe-adb2-b98e45ab4bf7")}catch{}})();const bi=X(function(e,t){const l=Ue(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=De(n);i||!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),n);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=je(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(Ge(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(xt({billId:l}))}}})(Ln);function hi(){const e=K(),t=se(),l=Q(),{billId:n}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({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),[P,A]=f.useState(!1),[B,G]=f.useState(!1),{useFeatureGate:j,useDynamicConfig:U}=le(),{isFeatureEnabled:$}=j(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=j(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=j(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=U(xe.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:J}=j(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=j(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{n!=null&&t(At(n))},[n]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(n??"",$,L,!1)))},[b,s,n,t]),f.useEffect(()=>{P||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,$,L,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[P,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(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 ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:O=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Je.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},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:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=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(xe.zeniAssistConfig),P=k.user_ids!=null&&i?.userId!=null&&k.user_ids.includes(i?.userId),A=v(F=>Z(F)),[B,G]=f.useState(!1),[j,U]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),C=v(F=>Me(F,m,g,n));let q=C.fetchState,W=C.file,L=C.showAutofill;const J=v(F=>Ue(F,n??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],L=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{n==null&&t(Oe(!0))},[n,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&j?U(!1):!u&&B&&G(!1))},[n]),f.useEffect(()=>{B||n==null||u||(G(!0),t(Bt(n,h,P,!1)),j||(U(!0),t($e(!1,h,P,b,n)))),u&&!j&&(U(!0),t($e(!1,h,P,b,n)))},[B,j,u,n,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(H,m,n))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,i?.userEmail??"","no"),t(ha({file:H,billId:n}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(A.tenantEmailDomain);t(ke({billId:n})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return n==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:n,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(_n,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:L,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-DmbDY3sa.js";import{h as K,u as se,g as Q,i as ae,j as v,N as te,n as X,l as na,o as ia,p as S}from"./core-Cj3sxYL7.js";import{eW as Z,OV as Ue,bt as It,JS as oa,bo as wt,bJ as pe,OW as At,yu as Bt,zJ as $e,z1 as la,bn as De,OX as sa,OY as ra,c7 as ca,OZ as da,ks as Ct,O_ as xt,O$ as Et,Ai as Ge,yJ as Ce,P0 as ua,yi as tt,P1 as pa,Ee as ma,ym as ba,ys as Dt,P2 as ke,P3 as Me,zK as Oe,P4 as ha,P5 as ga,zN as Ne,P6 as ya,z_ as Sa,P7 as Pt,zu as at,zz as fa,P8 as ka,P9 as ue,Pa as jt,Pb as Tt,Pc as Ft,go as va,yO as Le,cB as Rt,Pd as Ia,f9 as wa,Pe as Aa,Pf as Ba,fe as Vt,fc as $t,Pg as ze,Ph as Ca,Pi as xa,ME as Ze,Pj as Ea,MF as oe,MG as He,Pk as Da,Pl as Pa,Pm as ja,zB as nt,zy as Ta,Pn as Fa,Po as Ra,Pp as Va,zk as $a,Pq as La,Pr as _a,Ps as Ua,cp as Lt,cR as _t,kD as Ga,bP as Ma,bq as Ut,bQ as Gt,xA as Oa,Pt as Na,E1 as za,E7 as Za,t_ as Ha,zL as Wa,Ap as qa,kQ as fe,Pu as Ja,Pv as Mt,li as Ka,kK as Ot,l3 as Nt,l2 as it,bE as be,bO as Qa,Pw as Xa,Px as ve,jn as Ya,Py as ot,Pz as en,jr as tn,jM as an,AD as nn,PA as on,lb as ln,At as sn,PB as lt,Ax as rn,AC as cn,Az as dn,Ar as un,PC as zt,yD as pn,PD as mn,PE as bn,gg as hn,gf as gn,ge as yn,kT as Sn,l9 as st,lk as fn,ry as kn,l0 as vn,Av as In,jx as wn,lp as An,PF as Bn,jp as Cn,rp as xn,PG as En,zq as Dn,bK as Pn,bs as jn,LA as Tn,cT as Fn,cS as Rn,cA as Vn,cH as $n}from"./zeni-epic-state-BG_x9wwl.js";import{m as me,z as V,j as Ie,_ as We,F as le,x as y,aN as xe,B as re,o as x,A as Pe,c as D,be as Ln,n as z,a2 as qe,r as E,K as we,bf as rt,bg as ct,bh as _n,ak as Un,I as Gn,aH as Mn,E as Zt,D as Je,N as Ke,bi as On,at as Ht,bj as Nn,X as zn,e as Wt,a7 as Zn,bk as Hn,bl as Wn,bm as qn,bn as Jn,bo as Kn,bp as Qn,bq as Xn,br as Yn,bs as ei,w as ti,bt as ai,b9 as ni,bu as ii,bv as oi,a9 as li}from"./index-C_Y0yMPY.js";import{n as _,S as si}from"./mui-1V4hRqCa.js";import{A as dt}from"./AddressScreen-BrXKW3BZ.js";import{g as ie,a as je,i as qt,V as Qe,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-DCT2WFO9.js";import{a as f}from"./sentry--Yi43Gx7.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-OU79nJF1.js";import{u as Jt}from"./useInitialThreadRequest-C_e7mvD1.js";import Ee from"./NotFoundScreen-C5grvltN.js";import{D as ui}from"./DrawerScreen-DAhJy05e.js";import{M as Kt}from"./MobileAppDrawer-B8b7sXqB.js";import{F as Qt}from"./FeaturePreviewScreen-h089v0nG.js";import{S as Te}from"./SetupPagesScreen-CoEYpzVD.js";import{B as pi}from"./BillPayApprovalRoutes-C0HhO8Zq.js";import{FallBackRoute as mi}from"./ScreenRoutes-dCkGsbaX.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./analyticsHelper-VUlrCZ3f.js";import"./routePaths-D0rLO8yN.js";import"./BusinessVerificationPageScreen-BxP_dHBq.js";import"./ReimbursementApprovalRuleDetailScreen-ByIZjgyO.js";import"./getLocaleForTenant-ChWLNTj3.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]="14c1f230-843d-4ffe-adb2-b98e45ab4bf7",e._sentryDebugIdIdentifier="sentry-dbid-14c1f230-843d-4ffe-adb2-b98e45ab4bf7")}catch{}})();const bi=X(function(e,t){const l=Ue(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=De(n);i||!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),n);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=je(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(Ge(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(xt({billId:l}))}}})(Ln);function hi(){const e=K(),t=se(),l=Q(),{billId:n}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({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),[P,A]=f.useState(!1),[B,G]=f.useState(!1),{useFeatureGate:j,useDynamicConfig:U}=le(),{isFeatureEnabled:$}=j(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=j(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=j(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=U(xe.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:J}=j(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=j(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{n!=null&&t(At(n))},[n]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(n??"",$,L,!1)))},[b,s,n,t]),f.useEffect(()=>{P||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,$,L,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[P,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(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 ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:O=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Je.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},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:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=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(xe.zeniAssistConfig),P=k.user_ids!=null&&i?.userId!=null&&k.user_ids.includes(i?.userId),A=v(F=>Z(F)),[B,G]=f.useState(!1),[j,U]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),C=v(F=>Me(F,m,g,n));let q=C.fetchState,W=C.file,L=C.showAutofill;const J=v(F=>Ue(F,n??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],L=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{n==null&&t(Oe(!0))},[n,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&j?U(!1):!u&&B&&G(!1))},[n]),f.useEffect(()=>{B||n==null||u||(G(!0),t(Bt(n,h,P,!1)),j||(U(!0),t($e(!1,h,P,b,n)))),u&&!j&&(U(!0),t($e(!1,h,P,b,n)))},[B,j,u,n,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(H,m,n))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,i?.userEmail??"","no"),t(ha({file:H,billId:n}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(A.tenantEmailDomain);t(ke({billId:n})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return n==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:n,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(_n,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:L,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const pt=_.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-DmbDY3sa.js";import{a as V}from"./sentry--Yi43Gx7.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-Cj3sxYL7.js";import{j as ce,F as ue,aN as de,z,A as pe,c as E,af as x,e as P,bE as le,at as me,r as B,au as R}from"./index-
|
|
1
|
+
import{j as k}from"./liveblocks-DmbDY3sa.js";import{a as V}from"./sentry--Yi43Gx7.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-Cj3sxYL7.js";import{j as ce,F as ue,aN as de,z,A as pe,c as E,af as x,e as P,bE as le,at as me,r as B,au as R}from"./index-C_Y0yMPY.js";import{Pr as fe,eW as G,tp as ye,JV as Se,zk as ge,CL as Ie,Fn as he,G0 as be,H0 as Oe,PO as Te,PP as De,PQ as ke,PR as Ce,PS as Ve,Mm as we,OQ as Ae,Mx as Ne,l8 as Fe,gg as _e,gf as ve,ge as xe,ry as Pe,rp as ze,rm as Ee,l0 as Be,ty as Re,tw as M,bE as L,tK as j,cz as Me}from"./zeni-epic-state-BG_x9wwl.js";import{n as Le}from"./mui-1V4hRqCa.js";import{d as U}from"./routePaths-D0rLO8yN.js";import{M as je}from"./MobileAppDrawer-B8b7sXqB.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]="746cf1de-8f00-4a6e-8c0a-5e6d44053b89",e._sentryDebugIdIdentifier="sentry-dbid-746cf1de-8f00-4a6e-8c0a-5e6d44053b89")}catch{}})();const Ue=Le.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as b}from"./liveblocks-DmbDY3sa.js";import{a as i}from"./sentry--Yi43Gx7.js";import{n as W}from"./utils-Bt5dYICv.js";import{u as Ie,h as we,g as Ee,j as T,i as ke,n as Ae}from"./core-Cj3sxYL7.js";import{W as ve,F as Te,x as z,z as Fe,d9 as Oe,db as Ue,b5 as ee,A as _e,c as V,dc as G,dj as xe,D as Qe,e as De,a7 as Le,df as $e,a2 as Ve,dk as je,b1 as Re,di as Me}from"./index-
|
|
1
|
+
import{j as b}from"./liveblocks-DmbDY3sa.js";import{a as i}from"./sentry--Yi43Gx7.js";import{n as W}from"./utils-Bt5dYICv.js";import{u as Ie,h as we,g as Ee,j as T,i as ke,n as Ae}from"./core-Cj3sxYL7.js";import{W as ve,F as Te,x as z,z as Fe,d9 as Oe,db as Ue,b5 as ee,A as _e,c as V,dc as G,dj as xe,D as Qe,e as De,a7 as Le,df as $e,a2 as Ve,dk as je,b1 as Re,di as Me}from"./index-C_Y0yMPY.js";import{gk as He,g5 as Ne,g6 as X,g7 as qe,fQ as te,g8 as Be,g9 as We,eV as se,eW as ze,ga as Ge,f0 as Xe,iF as Ye,iB as Je,eX as Y,fJ as Ke,fK as Ze,fL as et,fM as tt,fN as st,fO as at,fP as ot,fR as nt,fS as it,fT as J,bE as K,fU as rt,fV as lt,fW as dt,fX as ct,fY as ut,fZ as mt,fC as ft,fG as Z,f_ as pt,f$ as Ct,g0 as ht,g1 as St,g2 as gt,g3 as bt,g4 as Pt}from"./zeni-epic-state-BG_x9wwl.js";import{D as yt,n as R,P as It,S as wt}from"./mui-1V4hRqCa.js";import{d as Et}from"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="2f12563a-fef6-4423-9168-50dec7a260d1",e._sentryDebugIdIdentifier="sentry-dbid-2f12563a-fef6-4423-9168-50dec7a260d1")}catch{}})();const kt=e=>Pt(e,!1),At=e=>bt(e.name,!1),ae="chat-response-generated",oe="cards/ask",ne="card_policy_hero";function j(e){return`/${e}/cards`}function ie(e){return`/${e}/cards/policy`}const vt=Ae(function(e,r){const s=se(e),C=r.isSubmitting,c=e.cardPolicyState,m=Ke(c),d=Ze(c),h=et(c);return{showSampleQuestions:r.sessionFromUrl==="new_chat"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:C,isNewChatSession:r.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${Ve}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,allUsers:r.allUsers,cardPolicyCategorySearchOptions:m.map(kt),cardPolicyVendorSearchOptions:d.map(At),cardPolicyIsVendorSearchLoading:h==="In-Progress",cardPolicyDocumentUploadState:ot(c),cardPolicyUploadedFileName:at(c),cardPolicyFormDraft:st(e.createCardPolicyState),cardsCreationFormDraft:tt(e)}},function(e,r){const{location:s,currentTenant:C,userId:c,navigate:m,currentChatSessionId:d,allSessionsWithOrderedQuestionAnswers:h,isAiCardCreationEnabled:E,isCardPolicyEnabled:P,cardPolicyPageContext:k}=r,f=C.tenantEmailDomain,O=s.state?.referrer,u=O===ne?ie(f):j(f);return{onEventReceived:(a,l)=>{if(a===ae&&typeof l.text=="string"&&typeof l.metadata=="object"){const t=l,n=Ct(t.type),p=t.metadata.chat_session_id??null,{currentChatSession:U,currentQuestionAnswer:A,currentQuestionAnswerSummary:y}=ee(h,p);n!=="answer"?V.trackAICFOChatResponseGenerated(n,A?.question.questionText??"",t.text,p,Me(y,U),t.metadata.message_id??null):V.trackAICFOChatAnswerGenerated(t.text,A?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,ht(t.visualization?.type??"")??null,p,t.summarized_title,t.metadata.message_id??null),e(St({chatSessionId:t.metadata.chat_session_id,responseType:n,fetchState:{fetchState:"Completed",error:void 0}})),e(gt({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(a,l,t,n)=>{a&&Re(e,a,l,d,h,c,n,t,k)},updateCurrentInput:a=>{e(Z(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{e(pt(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(u,{state:{...s.state}}),e(Z(""))},togglePageView:()=>{m(u,{state:{...s.state}}),r.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{d!=null&&e(ft()),m(function(a){return`/${a}/${oe}`}(f),{state:{...s.state}})},onToggleCotCollapsed:(a,l)=>{e(mt({questionAnswerId:a,isCollapsed:l}))},onCardsCreationFormChange:E?a=>{e(ut(a))}:void 0,onCardsCreationFormSubmit:E?(a,l)=>{const t=lt(a);t.length!==0&&(e(dt(t)),e(ct({sourceChatSessionId:d??void 0})),d!=null&&e(J({chatSessionId:d,id:W(),kind:"creating_cards",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(j(f),{state:{...s.state}}))}:void 0,onCardPolicyFormChange:P?a=>{e(rt(a))}:void 0,onCardPolicyFormSubmit:P?(a,l)=>{const t=je({values:a});e(it({templates:[t],sourceChatSessionId:d})),d!=null&&e(J({chatSessionId:d,id:W(),kind:"creating_policy",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(`/${f}/cards/policy`,{state:{...s.state}})}:void 0,onCardPolicyUploadDocument:P?(a,l,t)=>{a.length!==0&&e(nt(a,l,t))}:void 0,onCardPolicyRemoveDocument:P?()=>{e(te())}:void 0}})(Le($e)),{spendManagement:{chargeCard:{cardsAiCfoHero:re,cardPolicyAiCfoHero:le}}}=Qe.getLocalizedStrings(),F=re.pageTitle,Tt=le.pageTitle,Ft=re.chatHeaderSubtitle,Ot=le.chatHeaderSubtitle,Xt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:r}=ve(),s=Ie(),C=we(),c=Ee(),[m,d]=i.useState(!1),{useFeatureGate:h}=Te(),{isFeatureEnabled:E}=h(z.isAiCardCreationEnabled),{isFeatureEnabled:P}=h(z.isCardPolicyEnabled);i.useEffect(()=>{s(He())},[s]),i.useEffect(()=>(s(Ne()),s(X()),s(qe("cardHolderCandidate",!1)),()=>{s(te())}),[s]);const k=T(o=>Be(o).fetchState);i.useEffect(()=>{k==="Not-Started"&&s(We(!1,!1,!1))},[k,s]);const f=i.useMemo(()=>Et(o=>{s(X(o))},250),[s]);i.useEffect(()=>()=>{f.cancel()},[f]);const O=i.useCallback(o=>{f(o)},[f]),u=T(o=>se(o)),a=Fe.getSignedInUser(),{session_id:l}=ke(),t=T(o=>ze(o)),n=u.uiState.currentChatSessionId,p=t.tenantEmailDomain,{handleUploadPromoClose:U,isUploadPromoVisible:A}=Oe({isFileUploadEnabled:e,tenantEmailDomain:p}),y=c.state,S=y?.aiCfoInitialQuestion??null,_=!!y?.aiCfoShouldSubmit,I=y?.referrer===ne,de=I?"card_policy":void 0,ce=i.useMemo(()=>({title:I?Tt:F,subtitle:I?Ot:Ft}),[I]),[ue,x]=i.useState(null),[me,Q]=i.useState(!1),D=i.useRef(!1);i.useEffect(()=>{D.current||S==null||S===""||(x(S),Q(_),D.current=!0)},[S,_]);const fe=i.useCallback(()=>{x(null),Q(!1)},[]),pe=t.masterTOSInfo,g=pe?.isMasterTOSAccepted??!1,v=i.useRef(null);i.useEffect(()=>{if(g&&v.current!=null){const{question:o,shouldSubmit:w}=v.current;v.current=null,x(o),Q(w),D.current=!1}},[g]);const{visitedSessions:M}=Ue(n),L=u.fetchState,$=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,H=n!=null?u.fetchChatSessionHistoryByChatSessionId?.[n]?.fetchState??"Not-Started":"Not-Started",N=n==null||(u.uiState.chatHistoryNextPageToken[n]?.hasMore??!0),q=u.allSessionsWithOrderedQuestionAnswers,B=T(o=>Ge(o.userState,o.userRoleState,o.userListViewState,"cardHolderCandidate")).users,Ce=i.useMemo(()=>B.map(o=>o.user).filter(o=>o!=null),[B]),{currentSessionQuestionAnswers:he}=ee(q,n),Se=he.length===0;i.useEffect(()=>{n!=null&&l!==n&&C(function(o,w){return`/${o}/${oe}/${w}`}(p,n),{state:{...c.state},replace:!0})},[n,l,p,C,c.state]),i.useEffect(()=>{l!=null&&n==null&&l!=="new_chat"&&s(Xe({sessionId:l,agentId:"controller"}))},[]);const ge=i.useMemo(()=>({events:M.map(o=>`private-encrypted-chat-${o}.${ae}`),eventCallback:(o,w,ye)=>ye.onEventReceived(o,w)}),[M]);if(i.useEffect(()=>{L!=="In-Progress"&&$&&s(Ye())},[L,$,s]),i.useEffect(()=>{n!=null&&H!=="In-Progress"&&N&&a!=null&&L==="Completed"&&!$&&s(Je(n,a.userId))},[H,N,n,a,s]),a==null)throw Error("Can't access Cards AI CFO page without signing in...");const be=l??"new_chat",Pe=n!=null&&u.responseStateByChatSessionId?.[n]?.answer?.fetchState==="In-Progress";return b.jsxs(_t,{children:[b.jsx(_e,{analytics:V,onLoad:o=>o.trackPageLoaded(De.Event.aiCFOPage)}),g?b.jsx(vt,{...ge,currentChatSessionId:n,allSessionsWithOrderedQuestionAnswers:q,allUsers:Ce,isAiCardCreationEnabled:E,isCardPolicyEnabled:P,openOnboardingPage:()=>d(!0),userId:a.userId,setIsAiCfoOpen:r,navigate:C,sessionFromUrl:be,location:c,isSubmitting:Pe,isEmptyChatWithSession:Se,customPageTitle:F,chatHeader:ce,currentTenant:t,emailLinkQuestion:ue??void 0,autoSubmitEmailLinkQuestion:me,onEmailLinkQuestionProcessed:fe,isFileUploadEnabled:e,isUploadPromoVisible:A,onUploadPromoClose:U,onCardPolicyVendorSearchTextChange:O,cardPolicyPageContext:de}):b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:F,onCloseClick:()=>{C(I?ie(p):j(p),{state:{...c.state}})},onCompleteClick:()=>{g||t.userRoleId==null||(S!=null&&S!==""&&(v.current={question:S,shouldSubmit:_}),s(Y(t.userRoleId)))}}),b.jsx(yt,{anchor:"right",open:m,transitionDuration:250,PaperProps:{component:xt,style:{width:`${xe}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>d(!1),children:b.jsx(Ut,{onClick:o=>o.stopPropagation(),children:b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:F,onCloseClick:()=>d(!1),onCompleteClick:()=>{g||t.userRoleId==null||s(Y(t.userRoleId)),d(!1)}})})})]})},Ut=R(wt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-DmbDY3sa.js";import{h as de,g as Ce,i as Me,u as pe,j as o,N as Sa,s as Dt,n as De,t as In,o as es,p as se}from"./core-Cj3sxYL7.js";import{bs as Pe,Rq as as,Rr as ts,fQ as un,Rs as kn,fJ as En,Rt as An,Ru as Dn,Rv as _n,Rw as Pn,fK as wn,fL as vn,Rx as Tn,g5 as Fn,g6 as $a,Ry as xn,Rz as ns,fP as rs,fO as ss,RA as cs,g8 as Rn,g9 as ca,RB as os,RC as is,fS as ds,fR as ls,f9 as ze,g4 as Bn,g3 as Ln,RD as us,eY as ms,Bl as Cs,Bk as ps,Bo as hs,Bq as fs,f2 as gs,eV as On,RE as bs,RF as Ss,f7 as Un,RG as ys,f8 as St,Bw as Is,Bt as ks,eW as fe,RH as Qa,fc as we,fd as ve,fe as Te,gv as oa,cw as ia,RI as da,RJ as _t,uD as za,kA as Wa,RK as Za,C3 as ka,C5 as Qe,C6 as Pt,kq as jn,RL as la,BT as _a,RM as Es,RN as As,BW as Ja,RO as Ds,PL as Xa,e_ as Mn,C0 as ga,hQ as _s,RP as Nn,RQ as ua,bq as Ps,RR as ws,gg as et,gf as at,CA as vs,ge as tt,Pr as Ts,RS as Vn,cp as Hn,cR as Fs,PK as wa,D9 as Gn,RT as mn,CL as Pa,RU as $n,Da as xs,Qa as Rs,Db as Bs,E7 as Ls,t_ as Os,E1 as Us,RV as js,C4 as ra,RW as Ms,RX as Ns,RY as Vs,RZ as Hs,R_ as Gs,R$ as wt,S0 as $s,Cl as zn,Ce as zs,S1 as Ws,gx as Zs,Cu as Wn,Cy as Zn,gw as Ks,S2 as Ys,CX as Kn,S3 as qs,S4 as Qs,S5 as Js,Cw as Yn,Ch as qn,BZ as Qn,Cq as Jn,Co as Xn,Cs as Xs,S6 as er,S7 as ec,f4 as ac,f5 as tc,f6 as nc,S8 as nt,ga as ar,cS as vt,S9 as rc,Sa as sc,Sb as cc,Sc as oc,CG as yt,D2 as ic,C_ as dc,CC as lc,D0 as uc,CS as mc,CU as Cc,Sd as tr,D8 as Ga,JS as pc,Se as hc,Sf as fc,Sg as gc,Sh as nr,Si as bc,Dv as Sc,CK as rr,CF as je,CJ as yc,Sj as Ic,Sk as kc,BQ as Ec,Sl as sr,eZ as cr,Sm as Ac,BS as Dc,BR as Cn,Sn as _c,So as Pc,Sp as wc,Mn as vc,Sq as Tt,Sr as Tc,xD as or,l8 as Fc,hG as xc,DA as Rc,Ss as ir,fW as Bc,fX as Lc,St as Oc,di as Uc,g7 as jc,Dq as Mc,Dk as qe,bt as Nc,bJ as Vc,cB as Hc,bK as Gc,LA as $c}from"./zeni-epic-state-BG_x9wwl.js";import{j as Fe,cm as dr,n as _e,cn as lr,co as ur,cp as zc,D as Xe,_ as Ft,cq as Wc,cr as Zc,W as mr,a as Cr,Z as pr,r as ye,F as le,x as K,aq as ya,cs as hr,ct as Kc,cu as Yc,z as re,B as va,cb as rt,cv as qc,cw as Qc,cx as Jc,cy as Xc,cz as eo,K as Ta,aN as We,bo as xt,cA as ao,E as Fa,h as st,m as Rt,c as J,a7 as ct,cB as to,bB as ba,cC as It,cD as no,A as Bt,cE as ro,at as fr,a2 as kt,cF as so,X as gr,e as br,cG as co,cH as oo,cI as io,cJ as lo,cK as uo,cL as mo,o as Ka,cM as Co,cN as po,cO as pt,w as ho,cP as fo,cQ as go,cR as bo,cS as So,cT as yo,a9 as Io}from"./index-BHgTWK3A.js";import{n as Ne,D as Sr,S as ko}from"./mui-1V4hRqCa.js";import{a as r}from"./sentry--Yi43Gx7.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-DvB8uvB7.js";import{M as Ie}from"./MobileAppDrawer-CzOm0Sxs.js";import{d as Lt}from"./recharts-mFhBBFnU.js";import{g as Ae,a as Ra,b as yr,c as xe,d as Re,e as Je,f as ea,h as aa,A as Eo,i as Ot,P as Ao,j as Ut,s as Ia,k as Ir,l as sa,m as kr,n as Do,o as Er,p as _o,S as pn}from"./SetupPagesScreen-BEBa0Bcm.js";import{u as Ar}from"./useInitialThreadRequest-ITLu-S1Q.js";import ot from"./NotFoundScreen-D51sUkWb.js";import{n as hn}from"./utils-Bt5dYICv.js";import{t as Po}from"./AddressScreen-DzlfvttE.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./analyticsHelper-B5EDEZrW.js";import"./routePaths-CKR4MRfB.js";import"./BusinessVerificationPageScreen-6o8gENq-.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="11ba4115-c1ce-4338-9072-c46f924e6eec",e._sentryDebugIdIdentifier="sentry-dbid-11ba4115-c1ce-4338-9072-c46f924e6eec")}catch{}})();const wo=e=>{const n=e.cardHolderUser,t=`${n.firstName??""} ${n.lastName??""}`.trim()||n.email||n.userId;return{userId:n.userId,displayName:t,roleLabel:e.cardHolderRoles?.titleAtCompany}},Dr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:wo(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)}),{spendManagement:{chargeCard:{cardPolicyPage:fn}}}=Xe.getLocalizedStrings(),vo=e=>Bn(e,!1),To=e=>Ln(e.name,!1);function Fo(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(T=>{g(T)},[]),i=r.useCallback(()=>{_(!0)},[_]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:B}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect(()=>()=>{a(as()),a(ts()),a(un())},[a]);const D=o(T=>kn(T.cardPolicyState)),d=o(T=>En(T.cardPolicyState)),j=o(T=>An(T.cardPolicyState)),P=o(T=>Dn(T.cardPolicyState)),F=o(T=>_n(T.cardPolicyState)),C=o(T=>Pn(T.cardPolicyState)),h=o(T=>wn(T.cardPolicyState)),w=o(T=>vn(T.cardPolicyState)),u=o(T=>Tn(T.cardPolicyState)),v=o(T=>T.chargeCardConfigState.receiptRequiredAboveAmount.amount),k=o(T=>T.chargeCardConfigState.fetchState);r.useEffect(()=>{D!=="Completed"&&D!=="In-Progress"&&a(Fn())},[a,D]),r.useEffect(()=>{w==="Completed"&&u===""||w==="In-Progress"||a($a())},[a,w,u]);const M=o(T=>xn(T.createCardPolicyState)),A=o(T=>ns(T.createCardPolicyState)),I=o(T=>rs(T.cardPolicyState)),L=o(T=>ss(T.cardPolicyState)),l=o(T=>cs(T.createCardPolicyState)),p=o(T=>Rn(T));r.useEffect(()=>{p.fetchState==="Not-Started"&&a(ca(!1,!1,!1))},[p.fetchState,a]);const N=r.useMemo(()=>d.map(vo),[d]),G=r.useMemo(()=>h.map(To),[h]),O=r.useMemo(()=>p.cards.filter(T=>!dr(T.status.code)).map(Dr),[p.cards]),U=D==="Completed"&&p.fetchState==="Completed"&&k==="Completed";r.useEffect(()=>{U&&l==null&&a(os({cardsMasterList:O,defaultRequireReceiptAmount:v,suggestedAllowMerchants:j,suggestedBlockMerchants:P,suggestedAllowCategories:F,suggestedBlockCategories:C}))},[k,a,U,l,O,v,j,P,F,C]);const z=r.useMemo(()=>Lt(T=>{a($a(T))},250),[a]);r.useEffect(()=>()=>{z.cancel()},[z]);const W=r.useCallback(T=>{z(T)},[z]),y=M.fetchState,x=t!=null?`/${t}/cards/policy`:"..",Z=r.useCallback(()=>{const T=_e(n.state?.pathnameStackToGoBack),ee=T.poppedPathname??x;e(ee,{state:{pathnameStackToGoBack:T.newStack}})},[n.state,e,x]),q=r.useCallback(()=>{e(x)},[e,x]),E=r.useCallback(T=>{a(is(T))},[a]),V=r.useCallback(T=>{const ee=lr(T);a(ds({templates:[ee]}))},[a]),Q=r.useCallback(T=>{T.length!==0&&a(ls(T))},[a]),X=r.useCallback(()=>{a(un())},[a]),S=r.useRef(y);r.useEffect(()=>{const T=S.current;S.current=y,y==="Completed"&&T!=="Completed"&&A!=null&&(a(ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(x))},[a,y,A,e,x]);const R=y==="Error"?M.error?.message??fn.createPolicyGenericErrorMessage:void 0;return b&&t!=null?l==null?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(ur,{showUploadDocumentSection:!0,navBarTitle:fn.createPageTitle,onBackClick:Z,onClickMenuIcon:i,isAiCfoAccessEnabled:m,onAskAiCfoClick:B})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(zc,{formDraft:l,vendorSearchOptions:G,categorySearchOptions:N,isVendorSearchLoading:w==="In-Progress",onVendorSearchTextChange:W,submitState:y,submitErrorMessage:R,documentUploadState:I,uploadedFileName:L,isAiCfoAccessEnabled:m,onAskAiCfoClick:B,onBackClick:Z,onCancelClick:q,onClickMenuIcon:i,onFormChange:E,onSubmit:V,onUploadDocument:Q,onRemoveDocument:X})]}):c.jsx(Sa,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:xo}}}=Xe.getLocalizedStrings(),Ro=e=>Bn(e,!1),Bo=e=>Ln(e.name,!1);function Lo(){const e=de(),n=Ce(),{tenantEmailDomain:t,templateId:a}=Me(),s=pe(),b=Fe(),f=Pe(b?.loggedInUserRoleMap),[g,_]=r.useState(!1),i=r.useCallback(R=>{_(R)},[]),m=r.useCallback(()=>{i(!0)},[i]),{isAiCfoAccessEnabled:B,onAskAiCfoClick:D}=xa({mobileExploreReferrer:"Card Policy"}),d=o(R=>us(R)),j=o(R=>kn(R.cardPolicyState)),P=o(R=>En(R.cardPolicyState)),F=o(R=>An(R.cardPolicyState)),C=o(R=>Dn(R.cardPolicyState)),h=o(R=>_n(R.cardPolicyState)),w=o(R=>Pn(R.cardPolicyState)),u=o(R=>wn(R.cardPolicyState)),v=o(R=>vn(R.cardPolicyState)),k=o(R=>Tn(R.cardPolicyState)),M=o(R=>Rn(R)),A=o(R=>a!=null?ms(R.cardPolicyState,a):void 0),I=r.useMemo(()=>d.templateId===a&&d.formDraft!=null?d.formDraft:A!=null?Cs(A):void 0,[d.templateId,d.formDraft,A,a]);r.useEffect(()=>{if(a==null)return;const R=d.detailFetchState.fetchState;d.templateId===a&&(R==="Completed"||R==="In-Progress")||A!=null||s(ps(a))},[s,a,d.templateId,d.detailFetchState.fetchState,A]),r.useEffect(()=>{j!=="Completed"&&j!=="In-Progress"&&s(Fn())},[s,j]),r.useEffect(()=>{v==="Completed"&&k===""||v==="In-Progress"||s($a())},[s,v,k]);const L=o(R=>R.chargeCardConfigState.receiptRequiredAboveAmount.amount);r.useEffect(()=>{M.fetchState==="Not-Started"&&s(ca(!1,!1,!1))},[M.fetchState,s]);const l=r.useMemo(()=>P.map(Ro),[P]),p=r.useMemo(()=>u.map(Bo),[u]),N=r.useMemo(()=>M.cards.filter(R=>!dr(R.status.code)).map(Dr),[M.cards]);Ft({isDataReady:I!=null});const G=r.useMemo(()=>{if(I!=null)return Wc({draft:I,cardRows:N,categorySearchOptions:l,vendorSearchOptions:p,defaultRequireReceiptAmount:L,suggestedAllowMerchants:F,suggestedBlockMerchants:C,suggestedAllowCategories:h,suggestedBlockCategories:w})},[I,N,l,p,L,F,C,h,w]),[O,U]=r.useState(void 0),z=r.useRef(!1);r.useEffect(()=>{z.current||O!=null||G==null||(z.current=!0,U(G))},[O,G]);const W=r.useCallback(R=>{U(R)},[]),y=r.useMemo(()=>Lt(R=>{s($a(R))},250),[s]);r.useEffect(()=>()=>{y.cancel()},[y]);const x=r.useCallback(R=>{y(R)},[y]),Z=d.updateFetchState.fetchState,q=t!=null?`/${t}/cards/policy`:"..",E=r.useCallback(()=>{const R=_e(n.state?.pathnameStackToGoBack),T=R.poppedPathname??q;e(T,{state:{pathnameStackToGoBack:R.newStack}})},[n.state,e,q]),V=r.useCallback(()=>{e(q)},[e,q]),Q=r.useCallback(R=>{if(a==null)return;const T=lr(R);s(hs(T)),s(fs(a))},[s,a]),X=r.useRef(Z);r.useEffect(()=>{const R=X.current;X.current=Z,Z==="Completed"&&R!=="Completed"&&(s(ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(q))},[s,Z,e,q]);const S=Z==="Error"?d.updateFetchState.error?.message??xo.updatePolicyGenericErrorMessage:void 0;return!f||t==null||a==null?c.jsx(Sa,{to:"..",replace:!0}):O!=null&&j==="Completed"&&M.fetchState==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(Zc,{templateName:d.template?.name??"",formDraft:O,vendorSearchOptions:p,categorySearchOptions:l,isVendorSearchLoading:v==="In-Progress",onVendorSearchTextChange:x,submitState:Z,submitErrorMessage:S,isAiCfoAccessEnabled:B,onAskAiCfoClick:D,onBackClick:E,onCancelClick:V,onClickMenuIcon:m,onFormChange:W,onSubmit:Q})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(ur,{showUploadDocumentSection:!1,navBarTitle:d.template?.name,onBackClick:E,onClickMenuIcon:m,isAiCfoAccessEnabled:B,onAskAiCfoClick:D})]})}function _r(e,n,t){return n?e.filter(a=>a!=null&&a.trim().length>0).slice(0,t):[]}function Pr(e){return o(n=>e==null||e===""?{chips:ht,isResolved:!1}:function(t){const a=t?.fetchState,s=a==="Completed"||a==="Error";return{chips:a==="Completed"?t?.suggestedQuestions??ht:ht,isResolved:s}}(gs(n,e)),Dt)}const ht=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Oo,subheadline:Uo,pageTitle:jo}}}}=Xe.getLocalizedStrings(),Mo=e=>{const n=e.cardsCount>0?e.cardsCount:e.appliedCards.length,t=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,a=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:n,vendorRestrictionsCount:t,categoryRestrictionsCount:a}};function No(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(y=>{g(y)},[]),i=r.useCallback(()=>{_(!0)},[_]),{useFeatureGate:m}=le(),{isFeatureEnabled:B}=m(K.isAiCfoFileUploadEnabled),{isFeatureEnabled:D}=m(K.isCardPolicyEnabled),{isAiCfoAccessEnabled:d,onAskAiCfoClick:j}=xa({mobileExploreReferrer:"Card Policy"}),P=o(y=>bs(y)),F=o(y=>xn(y.createCardPolicyState)),C=o(y=>Ss(y.createCardPolicyState)),h=o(y=>C==null?[]:Un(y.aiCfoState,C).filter(x=>x.kind==="creating_policy"),Dt),w=F.fetchState==="In-Progress"?Math.max(h.length,1):0,u=o(y=>ys(y.createCardPolicyState)),v=ya(F.fetchState);r.useEffect(()=>{if(v==="In-Progress"&&F.fetchState==="Completed"&&C!=null)h.forEach(y=>{a(St({chatSessionId:C,id:y.id,entityIds:u,kind:"created_policy"}))});else if(v==="In-Progress"&&F.fetchState==="Error"&&C!=null){h.forEach(x=>{a(St({chatSessionId:C,id:x.id,kind:"errored_policy"}))});const y=F.error?.message!=null&&F.error.message.length>0?F.error.message:Xe.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;a(ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:y}]}))}},[F.error?.message,F.fetchState,a,C,u,h,v]);const k=P.fetchState.fetchState;r.useEffect(()=>{k!=="Not-Started"&&k!=="Error"||a(Is())},[a,k]);const M=P.archiveFetchState.fetchState,A=ya(M);r.useEffect(()=>{A==="In-Progress"&&M==="Completed"&&a(ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))},[M,a,A]);const I=r.useMemo(()=>P.templates.map(Mo),[P.templates]);Ft({isDataReady:P.fetchState.fetchState==="Completed"});const L=I.length>0||w>0,l=function(y){const{hasAnyPolicies:x,isChargeCardAdmin:Z,isFileUploadEnabled:q}=y,E=de(),V=Ce(),{tenantEmailDomain:Q}=Me(),{isAiCfoOpen:X,setIsAiCfoOpen:S}=mr(),R=Cr(),T=pr(),ee=o(ce=>On(ce)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:Y,isResolved:ke}=Pr("card_policy"),be=r.useMemo(()=>_r(Y,ke,3),[Y,ke]),[ge,ae]=r.useState(""),ue=T&&R&&Q!=null&&!X,oe=r.useCallback(ce=>{if(Q==null)return;const Ea=ye(V.state?.pathnameStackToGoBack,V.pathname);E(`/${Q}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:Ea,referrer:"card_policy_hero",aiCfoInitialQuestion:ce,aiCfoShouldSubmit:ce!=null&&ce.trim().length>0}})},[V.pathname,V.state,E,Q]),te=r.useCallback(ce=>{ce.trim().length!==0&&(ae(""),oe(ce))},[oe]),Ze=r.useCallback(()=>{const ce=ge.trim();ce.length!==0&&(ae(""),oe(ce))},[ge,oe]),Ee=r.useCallback(()=>{},[]),ne=r.useCallback(ce=>{ae(ce)},[]),Ke=r.useCallback(()=>{S(!0)},[S]),Be=r.useCallback(()=>{oe(void 0)},[oe]);return r.useMemo(()=>{if(ue&&!x&&Z)return{aiAgentName:jo,headline:Oo,subheadline:Uo,promptChips:be,composer:{currentInput:ge,isSubmitting:ee,isFileUploadEnabled:q,onInputChange:ne,onSubmit:Ze,onStopSubmit:Ee},onPromptClick:te,onOpenSidePanel:Ke,onOpenFullView:Be,dataTestIdPrefix:"card-policy-ai-cfo-hero"}},[ge,x,ue,Z,q,ee,ne,Be,Ke,te,Ee,Ze,be])}({hasAnyPolicies:L,isChargeCardAdmin:b,isFileUploadEnabled:B}),p=D&&l!=null?c.jsx(hr,{...l}):null,N=d&&p==null,G=r.useCallback(()=>{const y=_e(n.state?.pathnameStackToGoBack),x=y.poppedPathname??"..";e(x,{state:{pathnameStackToGoBack:y.newStack}})},[n.state,e]),O=r.useCallback(()=>{t!=null&&e(`/${t}/cards/policy/new`)},[e,t]),U=r.useCallback(y=>{t!=null&&e(`/${t}/cards/policy/${y}/edit`)},[e,t]),z=r.useCallback(y=>{a(ks(y))},[a]),W=P.fetchState.fetchState;return!L&&W!=="Completed"&&W!=="Error"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Kc,{onBackClick:G,onNewPolicyClick:O,onClickMenuIcon:i,isAiCfoAccessEnabled:d,onAskAiCfoClick:j})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Yc,{policies:I,archivingTemplateId:P.archiveTargetTemplateId,pendingCreationCount:w,onBackClick:G,onNewPolicyClick:O,onEditPolicyClick:U,onArchivePolicyClick:z,onClickMenuIcon:i,policyAiCfoHero:p,isAiCfoAccessEnabled:N,onAskAiCfoClick:j})]})}function Vo(){const e=de(),{cardId:n}=Me(),t=pe(),a=re.getSignedInUser(),s=o(Y=>fe(Y)),b=Fe(),f=Pe(b?.loggedInUserRoleMap),{useFeatureGate:g}=le();if(a==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,i]=r.useState(!1),m=o(Y=>Qa(Y).firstViewAfterActivation);if(n==null)throw Error("Empty card id is not valid...");const B=s.userRole.includes("charge_card_user"),{isFeatureEnabled:D}=g(K.isChargeCardFeatureEnabled),d=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:j}=g(K.isDebitCardFeatureEnabled),P=we(s),F=ve(s),C=Te(j,s),h=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,w=xe({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:C}),u=Re({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:D,isBookKeepingTenant:F,isDebitCardProductVisible:w,chargeCardsCreditAccountLimit:h}),v=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,k=o(Y=>oa(Y,s.companyId)),M=ia(k.controllers),{creditAccount:A,creditAccountRepayment:I}=o(Y=>da(Y)),L=o(Y=>Y.classListState.fetchState),l=!B&&u&&d,p=o(Y=>_t(Y,n,l,u)),[N,G]=r.useState(!1),O=p.chargeCard,U=O?.cardCreatedByUser?.userId,z=o(Y=>U!=null?za(Y.userRoleState,U):void 0),W=z?.accountingClassIDs[0],y=o(Y=>W!=null?Wa(Y.classState,{classId:W,reportId:"class_list"}):void 0),x=O?.cardHolderUser?.userId,Z=o(Y=>x!=null?za(Y.userRoleState,x):void 0),q=Z?.accountingClassIDs[0],E=o(Y=>q!=null?Wa(Y.classState,{classId:q,reportId:"class_list"}):void 0),V=O?.type.code==="business_physical_credit_card"||O?.type.code==="business_physical_debit_card",Q=O?.type.code==="business_physical_debit_card";r.useEffect(()=>{m&&_===!1&&V&&(i(!0),setTimeout(()=>{t(Za()),Q&&t(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[m,_,V,Q]),r.useEffect(()=>{N||p.fetchState==="Completed"||p.fetchState==="In-Progress"||n==null||(G(!0),t(ka(n,l,!1)))},[N,p,n,t]),r.useEffect(()=>{if(p.fetchState==="Completed"&&(V===!1||V&&O?.status?.code!=="active"||O?.cardHolderUserId!==a.userId||m===!1&&_===!1||O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card")){const Y=Ae(s.tenantEmailDomain,n,a,O,m);e(Y)}},[p.fetchState,m,V]),r.useEffect(()=>{A.fetchState!=="Completed"&&A.fetchState!=="In-Progress"&&u&&d&&f&&t(Qe()),I.fetchState!=="Completed"&&I.fetchState!=="In-Progress"&&u&&d&&f&&t(Pt()),L!=="Completed"&&L!=="In-Progress"&&t(jn())},[A.fetchState,I.fetchState,t,u,d,f,L]);const X=()=>{if(a!=null&&n!=null){t(Za());const Y=Ae(s.tenantEmailDomain,n,a);e(Y)}},S=O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card",R=Je(u,w,v,d),T=Ra(u,d,f,A,I),ee=yr(S,p);return p.fetchState!=="Completed"?c.jsx(va,{fetchState:"In-Progress"}):c.jsxs(c.Fragment,{children:[c.jsx(rt,{showConfetti:m}),c.jsx(qc,{onGotItClick:X,isDebitCard:O?.type.code==="business_physical_debit_card",controllerEmails:M,isChargeCardFeatureEnabled:u,isDebitCardFeatureEnabled:w,isDebitCardSetupEnabled:v,isChargeCardSetupEnabled:d,productInformation:R,creditAccountInformation:T,debitAccountInformation:ee,chargeCardDetailView:p,creditAccount:A,classListFetchState:L,creditAccountRepayment:I,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:y?.className,cardHolderRoles:Z?.userRoles,cardHolderDepartmentName:E?.className})]})}const jt=e=>{const{events:n,onEvent:t,onSubscribed:a}=e,s=Qc(),b=r.useRef(t),f=r.useRef(a),g=r.useRef(0);r.useEffect(()=>{b.current=t},[t]),r.useEffect(()=>{f.current=a},[a]);const _=r.useMemo(()=>[...n].sort().join("|"),[n]);r.useEffect(()=>{if(s==null||n.length===0)return;const i=[],m=new Set,B=()=>{if(f.current==null)return;const D=Date.now();D-g.current<5e3||(g.current=D,f.current())};return n.forEach(D=>{const[d,j]=Jc(D);if(j==="")return;const P=s.channel(d),F=h=>{b.current(j,h)};let C;if(P?.subscribed===!0)C=P,C.bind(j,F),m.has(d)||(m.add(d),B()),i.push(()=>{P.unbind(j,F)});else{if(C=P??s.subscribe(d),C.bind(j,F),!m.has(d)){m.add(d);const h=()=>{B()};C.bind("pusher:subscription_succeeded",h),i.push(()=>{C.unbind("pusher:subscription_succeeded",h)})}i.push(()=>{C.unbind(j,F)})}}),()=>{i.forEach(D=>D())}},[s,_])},wr="charge-card-transaction-update",vr="charge-card-transaction-created",Tr="charge-card-transaction-declined",Fr="charge-card-transaction-updated",xr="charge-card-transaction-receipt-uploaded",ma="charge-card-status-update",Mt="charge-card-spending-updated",it="credit-account-balance-updated",dt="charge-card-created",Nt="charge-card-limit-updated",Vt="charge-card-limit-reset",Ht="charge-card-renamed",Ho="charge-card-department-updated",Rr="charge-card-repayment-completed",Br="charge-card-payment-date-updated",Ba="charge-card-cashback-redeemed",La="charge-card-cashback-earned",Ca=(e,n)=>e==null||e===""?[]:n.map(t=>`private-encrypted-${e}.${t}`),Go=[La,Ba],$o=De(function(e){const n=la(e);return{insightsData:n.insight,cashbackByPeriod:n.cashbackByPeriod,uiState:n.uiState,cashbackSummary:n.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(n,t)=>{e(Es({uiState:{sortKey:n,sortOrder:t}}))}}})(eo);function zo(){const e=de(),n=pe(),t=Ce(),a=re.getSignedInUser(),s=o(j=>fe(j)),{useFeatureGate:b}=le(),{isFeatureEnabled:f}=b(K.isCardsCommentingEnabled),[g,_]=r.useState(!1),i=o(j=>la(j)),m=Ar(s.companyId,{clearParams:i.fetchState==="Completed"}),B=r.useCallback(()=>{const j=_e(t.state?.pathnameStackToGoBack),P=j.poppedPathname??Wo(s.tenantEmailDomain);e(P,{state:{pathnameStackToGoBack:j.newStack}})},[e,t,s.tenantEmailDomain]),D=ea(s);if(jt({events:Ca(D,Go),onEvent:j=>{switch(j){case La:case Ba:return void n(_a(!0))}},onSubscribed:()=>{n(_a(!0))}}),r.useEffect(()=>{g||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(_(!0),n(_a()))},[g,i,n]),a==null)throw Error("Can't access cashback detail page without signing in...");const d=i.cashbackSummary?.cashbackEarned?.amount!=null&&i.fetchState!=="Not-Started";return i.fetchState!=="In-Progress"||d?(i.cashbackSummary?.cashbackEarned?.amount??0)===0&&i.fetchState==="Completed"?c.jsx(ot,{}):c.jsx($o,{onBackClick:B,isCardsCommentingEnabled:f,initialOpenThreadRequest:m}):c.jsx(Xc,{onBackClick:B})}const Wo=e=>`/${e}/cards`,Zo={containerWidth:new Fa(100,58)},Ko=({appContent:e})=>{const n=Ta(),t=pe(),a=de(),{cardId:s}=Me(),b=Ce(),{useDynamicConfig:f}=le(),[g,_]=r.useState(!1),[i,m]=r.useState(!1),[B,D]=r.useState(!1),[d,j]=r.useState(!1),P=re.getSignedInUser();if(P==null)throw Error("Can't access onboarding card page without signing in...");const F=o(E=>fe(E));if(s==null)throw Error("Empty card id is not valid...");const{configValue:C}=f(We.zeniCardsConfig),h=C.max_charge_card_activation_attempts_by_card_id,w=o(E=>As(E,s)),u=w.chargeCard,v=o(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:k}=le(),{isFeatureEnabled:M}=k(K.isChargeCardFeatureEnabled),{isFeatureEnabled:A}=k(K.isDebitCardFeatureEnabled),I=Te(A,F),L=xe({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:I}),l=!!F.companyChargeCardInfo?.info?.isChargeCardEnabled,p=F.userRole.includes("charge_card_user"),N=we(F),G=ve(F),O=F.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Re({isCardsOnlyTenant:N,isChargeCardFeatureEnabled:M,isBookKeepingTenant:G,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:O}),z=!p&&U&&l;r.useEffect(()=>{g===!1&&v!=="In-Progress"&&v!=="Completed"&&(t(Ja()),_(!0)),i===!1&&w.fetchState==="Not-Started"&&(m(!0),t(ka(s,z,U)))},[i,w.fetchState,g,v]);const W=u?.type.code==="business_physical_credit_card"||u?.type.code==="business_physical_debit_card";r.useEffect(()=>{if(w.fetchState==="Completed"){if(B===!1&&(W===!1||W&&u?.status?.code!=="inactive"||u?.cardHolderUserId!==P.userId)){const E=Ae(F.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);a(E,{state:{pathnameStackToGoBack:V}})}else if(B&&w.isRefreshingViewInBackground===!1&&u?.status?.code==="active"){t(Ds({chargeCardId:s}));const E=Ae(F.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Xa()),a(E,{state:{pathnameStackToGoBack:V}})}}},[w.fetchState,u?.type.code,B,w.isRefreshingViewInBackground]);const y=re.getZeniOtpTokenForCardHolder(s),x=o(E=>Mn(E.userState,P.userId)),Z=()=>{u?.status?.code!=="active"&&t(ga(s,!0))};r.useEffect(()=>{w.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&u?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&B===!1&&(setTimeout(Z,3e3),D(!0))},[w.updatePhysicalChargeCardAttemptFetchState.fetchState,u?.cardActivationAttemptHistory]);const q=E=>{j(E)};if(v!=="Completed"||u==null)return c.jsx(va,{fetchState:"In-Progress"});if(u.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(x?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(Qo,{children:[c.jsx(Ie,{isAppContentDrawerOpen:d,handleDrawerToggle:q}),c.jsx(Yo,{cardId:s,card:u,shippingAddressId:u.shippingAddressId,phone:x.phone,signedInUser:P,isSandboxEnv:xt(),chargeCardDetailState:w,signedInUserToken:y,navigate:a,currentTenant:F,location:b,maxChargeCardActivationAttempts:h[s]!=null?h[s]: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:()=>{q(!0)}}),e!=null?c.jsx(qo,{windowSize:n,children:e}):null]})},Yo=De(function(e,{chargeCardDetailState:n,shippingAddressId:t,location:a,cardId:s}){const b=_s(e.addressState,t);if(b==null)throw Error("Can't access shippingAddress.");const f=Nn(e,s),g=n.updateStatus,_=ua(e,!1,!1,!1);let i=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(i=!0);const m=a.state?.message==="comingFromV2UrlPath";return{showActivatePage:n.chargeCard?.providerCardCreateTime!=null&&n.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Ps())||m,showMenuIcon:i,shippingAddress:b,vgsVaultId:st.cardVaultId,twoFAView:f,activationWaitStatus:g,isRefreshingViewInBackground:n.isRefreshingViewInBackground}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,chargeCardDetailState:f}=n,g=f.chargeCard?.cardProviderID,{tenantEmailDomain:_}=b;return{onGetOtp:i=>{g!=null&&e(tt(i,"ChargeCardHolder",a))},onUpdatePhysicalChargeCardAttempt:i=>{e(vs(a,i))},onResendOtp:i=>{g!=null&&e(at(i,"ChargeCardHolder",a))},onVerifyOtp:(i,m)=>{g!=null&&e(et(i,m,"ChargeCardHolder",a))},onVerifyOtpSuccess:i=>{i!=null&&re.saveZeniOtpTokenForCardHolder(i,a)},onCVVActivateSuccess:()=>{e(ws({chargeCardId:a}))},onBackClick:()=>{const i=_e(s.state?.pathnameStackToGoBack),m=i.poppedPathname==null||i.poppedPathname.includes("onboard")===!0?aa(_):i.poppedPathname;t(m,{state:{pathnameStackToGoBack:i.newStack}})}}})(ao),qo=Ne.div`
|
|
1
|
+
import{j as c}from"./liveblocks-DmbDY3sa.js";import{h as de,g as Ce,i as Me,u as pe,j as o,N as Sa,s as Dt,n as De,t as In,o as es,p as se}from"./core-Cj3sxYL7.js";import{bs as Pe,Rq as as,Rr as ts,fQ as un,Rs as kn,fJ as En,Rt as An,Ru as Dn,Rv as _n,Rw as Pn,fK as wn,fL as vn,Rx as Tn,g5 as Fn,g6 as $a,Ry as xn,Rz as ns,fP as rs,fO as ss,RA as cs,g8 as Rn,g9 as ca,RB as os,RC as is,fS as ds,fR as ls,f9 as ze,g4 as Bn,g3 as Ln,RD as us,eY as ms,Bl as Cs,Bk as ps,Bo as hs,Bq as fs,f2 as gs,eV as On,RE as bs,RF as Ss,f7 as Un,RG as ys,f8 as St,Bw as Is,Bt as ks,eW as fe,RH as Qa,fc as we,fd as ve,fe as Te,gv as oa,cw as ia,RI as da,RJ as _t,uD as za,kA as Wa,RK as Za,C3 as ka,C5 as Qe,C6 as Pt,kq as jn,RL as la,BT as _a,RM as Es,RN as As,BW as Ja,RO as Ds,PL as Xa,e_ as Mn,C0 as ga,hQ as _s,RP as Nn,RQ as ua,bq as Ps,RR as ws,gg as et,gf as at,CA as vs,ge as tt,Pr as Ts,RS as Vn,cp as Hn,cR as Fs,PK as wa,D9 as Gn,RT as mn,CL as Pa,RU as $n,Da as xs,Qa as Rs,Db as Bs,E7 as Ls,t_ as Os,E1 as Us,RV as js,C4 as ra,RW as Ms,RX as Ns,RY as Vs,RZ as Hs,R_ as Gs,R$ as wt,S0 as $s,Cl as zn,Ce as zs,S1 as Ws,gx as Zs,Cu as Wn,Cy as Zn,gw as Ks,S2 as Ys,CX as Kn,S3 as qs,S4 as Qs,S5 as Js,Cw as Yn,Ch as qn,BZ as Qn,Cq as Jn,Co as Xn,Cs as Xs,S6 as er,S7 as ec,f4 as ac,f5 as tc,f6 as nc,S8 as nt,ga as ar,cS as vt,S9 as rc,Sa as sc,Sb as cc,Sc as oc,CG as yt,D2 as ic,C_ as dc,CC as lc,D0 as uc,CS as mc,CU as Cc,Sd as tr,D8 as Ga,JS as pc,Se as hc,Sf as fc,Sg as gc,Sh as nr,Si as bc,Dv as Sc,CK as rr,CF as je,CJ as yc,Sj as Ic,Sk as kc,BQ as Ec,Sl as sr,eZ as cr,Sm as Ac,BS as Dc,BR as Cn,Sn as _c,So as Pc,Sp as wc,Mn as vc,Sq as Tt,Sr as Tc,xD as or,l8 as Fc,hG as xc,DA as Rc,Ss as ir,fW as Bc,fX as Lc,St as Oc,di as Uc,g7 as jc,Dq as Mc,Dk as qe,bt as Nc,bJ as Vc,cB as Hc,bK as Gc,LA as $c}from"./zeni-epic-state-BG_x9wwl.js";import{j as Fe,cm as dr,n as _e,cn as lr,co as ur,cp as zc,D as Xe,_ as Ft,cq as Wc,cr as Zc,W as mr,a as Cr,Z as pr,r as ye,F as le,x as K,aq as ya,cs as hr,ct as Kc,cu as Yc,z as re,B as va,cb as rt,cv as qc,cw as Qc,cx as Jc,cy as Xc,cz as eo,K as Ta,aN as We,bo as xt,cA as ao,E as Fa,h as st,m as Rt,c as J,a7 as ct,cB as to,bB as ba,cC as It,cD as no,A as Bt,cE as ro,at as fr,a2 as kt,cF as so,X as gr,e as br,cG as co,cH as oo,cI as io,cJ as lo,cK as uo,cL as mo,o as Ka,cM as Co,cN as po,cO as pt,w as ho,cP as fo,cQ as go,cR as bo,cS as So,cT as yo,a9 as Io}from"./index-C_Y0yMPY.js";import{n as Ne,D as Sr,S as ko}from"./mui-1V4hRqCa.js";import{a as r}from"./sentry--Yi43Gx7.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-OU79nJF1.js";import{M as Ie}from"./MobileAppDrawer-B8b7sXqB.js";import{d as Lt}from"./recharts-mFhBBFnU.js";import{g as Ae,a as Ra,b as yr,c as xe,d as Re,e as Je,f as ea,h as aa,A as Eo,i as Ot,P as Ao,j as Ut,s as Ia,k as Ir,l as sa,m as kr,n as Do,o as Er,p as _o,S as pn}from"./SetupPagesScreen-CoEYpzVD.js";import{u as Ar}from"./useInitialThreadRequest-C_e7mvD1.js";import ot from"./NotFoundScreen-C5grvltN.js";import{n as hn}from"./utils-Bt5dYICv.js";import{t as Po}from"./AddressScreen-BrXKW3BZ.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./analyticsHelper-VUlrCZ3f.js";import"./routePaths-D0rLO8yN.js";import"./BusinessVerificationPageScreen-BxP_dHBq.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="11ba4115-c1ce-4338-9072-c46f924e6eec",e._sentryDebugIdIdentifier="sentry-dbid-11ba4115-c1ce-4338-9072-c46f924e6eec")}catch{}})();const wo=e=>{const n=e.cardHolderUser,t=`${n.firstName??""} ${n.lastName??""}`.trim()||n.email||n.userId;return{userId:n.userId,displayName:t,roleLabel:e.cardHolderRoles?.titleAtCompany}},Dr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:wo(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)}),{spendManagement:{chargeCard:{cardPolicyPage:fn}}}=Xe.getLocalizedStrings(),vo=e=>Bn(e,!1),To=e=>Ln(e.name,!1);function Fo(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(T=>{g(T)},[]),i=r.useCallback(()=>{_(!0)},[_]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:B}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect(()=>()=>{a(as()),a(ts()),a(un())},[a]);const D=o(T=>kn(T.cardPolicyState)),d=o(T=>En(T.cardPolicyState)),j=o(T=>An(T.cardPolicyState)),P=o(T=>Dn(T.cardPolicyState)),F=o(T=>_n(T.cardPolicyState)),C=o(T=>Pn(T.cardPolicyState)),h=o(T=>wn(T.cardPolicyState)),w=o(T=>vn(T.cardPolicyState)),u=o(T=>Tn(T.cardPolicyState)),v=o(T=>T.chargeCardConfigState.receiptRequiredAboveAmount.amount),k=o(T=>T.chargeCardConfigState.fetchState);r.useEffect(()=>{D!=="Completed"&&D!=="In-Progress"&&a(Fn())},[a,D]),r.useEffect(()=>{w==="Completed"&&u===""||w==="In-Progress"||a($a())},[a,w,u]);const M=o(T=>xn(T.createCardPolicyState)),A=o(T=>ns(T.createCardPolicyState)),I=o(T=>rs(T.cardPolicyState)),L=o(T=>ss(T.cardPolicyState)),l=o(T=>cs(T.createCardPolicyState)),p=o(T=>Rn(T));r.useEffect(()=>{p.fetchState==="Not-Started"&&a(ca(!1,!1,!1))},[p.fetchState,a]);const N=r.useMemo(()=>d.map(vo),[d]),G=r.useMemo(()=>h.map(To),[h]),O=r.useMemo(()=>p.cards.filter(T=>!dr(T.status.code)).map(Dr),[p.cards]),U=D==="Completed"&&p.fetchState==="Completed"&&k==="Completed";r.useEffect(()=>{U&&l==null&&a(os({cardsMasterList:O,defaultRequireReceiptAmount:v,suggestedAllowMerchants:j,suggestedBlockMerchants:P,suggestedAllowCategories:F,suggestedBlockCategories:C}))},[k,a,U,l,O,v,j,P,F,C]);const z=r.useMemo(()=>Lt(T=>{a($a(T))},250),[a]);r.useEffect(()=>()=>{z.cancel()},[z]);const W=r.useCallback(T=>{z(T)},[z]),y=M.fetchState,x=t!=null?`/${t}/cards/policy`:"..",Z=r.useCallback(()=>{const T=_e(n.state?.pathnameStackToGoBack),ee=T.poppedPathname??x;e(ee,{state:{pathnameStackToGoBack:T.newStack}})},[n.state,e,x]),q=r.useCallback(()=>{e(x)},[e,x]),E=r.useCallback(T=>{a(is(T))},[a]),V=r.useCallback(T=>{const ee=lr(T);a(ds({templates:[ee]}))},[a]),Q=r.useCallback(T=>{T.length!==0&&a(ls(T))},[a]),X=r.useCallback(()=>{a(un())},[a]),S=r.useRef(y);r.useEffect(()=>{const T=S.current;S.current=y,y==="Completed"&&T!=="Completed"&&A!=null&&(a(ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(x))},[a,y,A,e,x]);const R=y==="Error"?M.error?.message??fn.createPolicyGenericErrorMessage:void 0;return b&&t!=null?l==null?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(ur,{showUploadDocumentSection:!0,navBarTitle:fn.createPageTitle,onBackClick:Z,onClickMenuIcon:i,isAiCfoAccessEnabled:m,onAskAiCfoClick:B})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(zc,{formDraft:l,vendorSearchOptions:G,categorySearchOptions:N,isVendorSearchLoading:w==="In-Progress",onVendorSearchTextChange:W,submitState:y,submitErrorMessage:R,documentUploadState:I,uploadedFileName:L,isAiCfoAccessEnabled:m,onAskAiCfoClick:B,onBackClick:Z,onCancelClick:q,onClickMenuIcon:i,onFormChange:E,onSubmit:V,onUploadDocument:Q,onRemoveDocument:X})]}):c.jsx(Sa,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:xo}}}=Xe.getLocalizedStrings(),Ro=e=>Bn(e,!1),Bo=e=>Ln(e.name,!1);function Lo(){const e=de(),n=Ce(),{tenantEmailDomain:t,templateId:a}=Me(),s=pe(),b=Fe(),f=Pe(b?.loggedInUserRoleMap),[g,_]=r.useState(!1),i=r.useCallback(R=>{_(R)},[]),m=r.useCallback(()=>{i(!0)},[i]),{isAiCfoAccessEnabled:B,onAskAiCfoClick:D}=xa({mobileExploreReferrer:"Card Policy"}),d=o(R=>us(R)),j=o(R=>kn(R.cardPolicyState)),P=o(R=>En(R.cardPolicyState)),F=o(R=>An(R.cardPolicyState)),C=o(R=>Dn(R.cardPolicyState)),h=o(R=>_n(R.cardPolicyState)),w=o(R=>Pn(R.cardPolicyState)),u=o(R=>wn(R.cardPolicyState)),v=o(R=>vn(R.cardPolicyState)),k=o(R=>Tn(R.cardPolicyState)),M=o(R=>Rn(R)),A=o(R=>a!=null?ms(R.cardPolicyState,a):void 0),I=r.useMemo(()=>d.templateId===a&&d.formDraft!=null?d.formDraft:A!=null?Cs(A):void 0,[d.templateId,d.formDraft,A,a]);r.useEffect(()=>{if(a==null)return;const R=d.detailFetchState.fetchState;d.templateId===a&&(R==="Completed"||R==="In-Progress")||A!=null||s(ps(a))},[s,a,d.templateId,d.detailFetchState.fetchState,A]),r.useEffect(()=>{j!=="Completed"&&j!=="In-Progress"&&s(Fn())},[s,j]),r.useEffect(()=>{v==="Completed"&&k===""||v==="In-Progress"||s($a())},[s,v,k]);const L=o(R=>R.chargeCardConfigState.receiptRequiredAboveAmount.amount);r.useEffect(()=>{M.fetchState==="Not-Started"&&s(ca(!1,!1,!1))},[M.fetchState,s]);const l=r.useMemo(()=>P.map(Ro),[P]),p=r.useMemo(()=>u.map(Bo),[u]),N=r.useMemo(()=>M.cards.filter(R=>!dr(R.status.code)).map(Dr),[M.cards]);Ft({isDataReady:I!=null});const G=r.useMemo(()=>{if(I!=null)return Wc({draft:I,cardRows:N,categorySearchOptions:l,vendorSearchOptions:p,defaultRequireReceiptAmount:L,suggestedAllowMerchants:F,suggestedBlockMerchants:C,suggestedAllowCategories:h,suggestedBlockCategories:w})},[I,N,l,p,L,F,C,h,w]),[O,U]=r.useState(void 0),z=r.useRef(!1);r.useEffect(()=>{z.current||O!=null||G==null||(z.current=!0,U(G))},[O,G]);const W=r.useCallback(R=>{U(R)},[]),y=r.useMemo(()=>Lt(R=>{s($a(R))},250),[s]);r.useEffect(()=>()=>{y.cancel()},[y]);const x=r.useCallback(R=>{y(R)},[y]),Z=d.updateFetchState.fetchState,q=t!=null?`/${t}/cards/policy`:"..",E=r.useCallback(()=>{const R=_e(n.state?.pathnameStackToGoBack),T=R.poppedPathname??q;e(T,{state:{pathnameStackToGoBack:R.newStack}})},[n.state,e,q]),V=r.useCallback(()=>{e(q)},[e,q]),Q=r.useCallback(R=>{if(a==null)return;const T=lr(R);s(hs(T)),s(fs(a))},[s,a]),X=r.useRef(Z);r.useEffect(()=>{const R=X.current;X.current=Z,Z==="Completed"&&R!=="Completed"&&(s(ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(q))},[s,Z,e,q]);const S=Z==="Error"?d.updateFetchState.error?.message??xo.updatePolicyGenericErrorMessage:void 0;return!f||t==null||a==null?c.jsx(Sa,{to:"..",replace:!0}):O!=null&&j==="Completed"&&M.fetchState==="Completed"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(Zc,{templateName:d.template?.name??"",formDraft:O,vendorSearchOptions:p,categorySearchOptions:l,isVendorSearchLoading:v==="In-Progress",onVendorSearchTextChange:x,submitState:Z,submitErrorMessage:S,isAiCfoAccessEnabled:B,onAskAiCfoClick:D,onBackClick:E,onCancelClick:V,onClickMenuIcon:m,onFormChange:W,onSubmit:Q})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:g,handleDrawerToggle:i}),c.jsx(ur,{showUploadDocumentSection:!1,navBarTitle:d.template?.name,onBackClick:E,onClickMenuIcon:m,isAiCfoAccessEnabled:B,onAskAiCfoClick:D})]})}function _r(e,n,t){return n?e.filter(a=>a!=null&&a.trim().length>0).slice(0,t):[]}function Pr(e){return o(n=>e==null||e===""?{chips:ht,isResolved:!1}:function(t){const a=t?.fetchState,s=a==="Completed"||a==="Error";return{chips:a==="Completed"?t?.suggestedQuestions??ht:ht,isResolved:s}}(gs(n,e)),Dt)}const ht=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Oo,subheadline:Uo,pageTitle:jo}}}}=Xe.getLocalizedStrings(),Mo=e=>{const n=e.cardsCount>0?e.cardsCount:e.appliedCards.length,t=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,a=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:n,vendorRestrictionsCount:t,categoryRestrictionsCount:a}};function No(){const e=de(),n=Ce(),{tenantEmailDomain:t}=Me(),a=pe(),s=Fe(),b=Pe(s?.loggedInUserRoleMap),[f,g]=r.useState(!1),_=r.useCallback(y=>{g(y)},[]),i=r.useCallback(()=>{_(!0)},[_]),{useFeatureGate:m}=le(),{isFeatureEnabled:B}=m(K.isAiCfoFileUploadEnabled),{isFeatureEnabled:D}=m(K.isCardPolicyEnabled),{isAiCfoAccessEnabled:d,onAskAiCfoClick:j}=xa({mobileExploreReferrer:"Card Policy"}),P=o(y=>bs(y)),F=o(y=>xn(y.createCardPolicyState)),C=o(y=>Ss(y.createCardPolicyState)),h=o(y=>C==null?[]:Un(y.aiCfoState,C).filter(x=>x.kind==="creating_policy"),Dt),w=F.fetchState==="In-Progress"?Math.max(h.length,1):0,u=o(y=>ys(y.createCardPolicyState)),v=ya(F.fetchState);r.useEffect(()=>{if(v==="In-Progress"&&F.fetchState==="Completed"&&C!=null)h.forEach(y=>{a(St({chatSessionId:C,id:y.id,entityIds:u,kind:"created_policy"}))});else if(v==="In-Progress"&&F.fetchState==="Error"&&C!=null){h.forEach(x=>{a(St({chatSessionId:C,id:x.id,kind:"errored_policy"}))});const y=F.error?.message!=null&&F.error.message.length>0?F.error.message:Xe.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;a(ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:y}]}))}},[F.error?.message,F.fetchState,a,C,u,h,v]);const k=P.fetchState.fetchState;r.useEffect(()=>{k!=="Not-Started"&&k!=="Error"||a(Is())},[a,k]);const M=P.archiveFetchState.fetchState,A=ya(M);r.useEffect(()=>{A==="In-Progress"&&M==="Completed"&&a(ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))},[M,a,A]);const I=r.useMemo(()=>P.templates.map(Mo),[P.templates]);Ft({isDataReady:P.fetchState.fetchState==="Completed"});const L=I.length>0||w>0,l=function(y){const{hasAnyPolicies:x,isChargeCardAdmin:Z,isFileUploadEnabled:q}=y,E=de(),V=Ce(),{tenantEmailDomain:Q}=Me(),{isAiCfoOpen:X,setIsAiCfoOpen:S}=mr(),R=Cr(),T=pr(),ee=o(ce=>On(ce)).createSessionAndSubmitState.fetchState==="In-Progress",{chips:Y,isResolved:ke}=Pr("card_policy"),be=r.useMemo(()=>_r(Y,ke,3),[Y,ke]),[ge,ae]=r.useState(""),ue=T&&R&&Q!=null&&!X,oe=r.useCallback(ce=>{if(Q==null)return;const Ea=ye(V.state?.pathnameStackToGoBack,V.pathname);E(`/${Q}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:Ea,referrer:"card_policy_hero",aiCfoInitialQuestion:ce,aiCfoShouldSubmit:ce!=null&&ce.trim().length>0}})},[V.pathname,V.state,E,Q]),te=r.useCallback(ce=>{ce.trim().length!==0&&(ae(""),oe(ce))},[oe]),Ze=r.useCallback(()=>{const ce=ge.trim();ce.length!==0&&(ae(""),oe(ce))},[ge,oe]),Ee=r.useCallback(()=>{},[]),ne=r.useCallback(ce=>{ae(ce)},[]),Ke=r.useCallback(()=>{S(!0)},[S]),Be=r.useCallback(()=>{oe(void 0)},[oe]);return r.useMemo(()=>{if(ue&&!x&&Z)return{aiAgentName:jo,headline:Oo,subheadline:Uo,promptChips:be,composer:{currentInput:ge,isSubmitting:ee,isFileUploadEnabled:q,onInputChange:ne,onSubmit:Ze,onStopSubmit:Ee},onPromptClick:te,onOpenSidePanel:Ke,onOpenFullView:Be,dataTestIdPrefix:"card-policy-ai-cfo-hero"}},[ge,x,ue,Z,q,ee,ne,Be,Ke,te,Ee,Ze,be])}({hasAnyPolicies:L,isChargeCardAdmin:b,isFileUploadEnabled:B}),p=D&&l!=null?c.jsx(hr,{...l}):null,N=d&&p==null,G=r.useCallback(()=>{const y=_e(n.state?.pathnameStackToGoBack),x=y.poppedPathname??"..";e(x,{state:{pathnameStackToGoBack:y.newStack}})},[n.state,e]),O=r.useCallback(()=>{t!=null&&e(`/${t}/cards/policy/new`)},[e,t]),U=r.useCallback(y=>{t!=null&&e(`/${t}/cards/policy/${y}/edit`)},[e,t]),z=r.useCallback(y=>{a(ks(y))},[a]),W=P.fetchState.fetchState;return!L&&W!=="Completed"&&W!=="Error"?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Kc,{onBackClick:G,onNewPolicyClick:O,onClickMenuIcon:i,isAiCfoAccessEnabled:d,onAskAiCfoClick:j})]}):c.jsxs(c.Fragment,{children:[c.jsx(Ie,{isAppContentDrawerOpen:f,handleDrawerToggle:_}),c.jsx(Yc,{policies:I,archivingTemplateId:P.archiveTargetTemplateId,pendingCreationCount:w,onBackClick:G,onNewPolicyClick:O,onEditPolicyClick:U,onArchivePolicyClick:z,onClickMenuIcon:i,policyAiCfoHero:p,isAiCfoAccessEnabled:N,onAskAiCfoClick:j})]})}function Vo(){const e=de(),{cardId:n}=Me(),t=pe(),a=re.getSignedInUser(),s=o(Y=>fe(Y)),b=Fe(),f=Pe(b?.loggedInUserRoleMap),{useFeatureGate:g}=le();if(a==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,i]=r.useState(!1),m=o(Y=>Qa(Y).firstViewAfterActivation);if(n==null)throw Error("Empty card id is not valid...");const B=s.userRole.includes("charge_card_user"),{isFeatureEnabled:D}=g(K.isChargeCardFeatureEnabled),d=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:j}=g(K.isDebitCardFeatureEnabled),P=we(s),F=ve(s),C=Te(j,s),h=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,w=xe({isDebitCardFeatureEnabled:j,isBankingOnlyTenant:C}),u=Re({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:D,isBookKeepingTenant:F,isDebitCardProductVisible:w,chargeCardsCreditAccountLimit:h}),v=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,k=o(Y=>oa(Y,s.companyId)),M=ia(k.controllers),{creditAccount:A,creditAccountRepayment:I}=o(Y=>da(Y)),L=o(Y=>Y.classListState.fetchState),l=!B&&u&&d,p=o(Y=>_t(Y,n,l,u)),[N,G]=r.useState(!1),O=p.chargeCard,U=O?.cardCreatedByUser?.userId,z=o(Y=>U!=null?za(Y.userRoleState,U):void 0),W=z?.accountingClassIDs[0],y=o(Y=>W!=null?Wa(Y.classState,{classId:W,reportId:"class_list"}):void 0),x=O?.cardHolderUser?.userId,Z=o(Y=>x!=null?za(Y.userRoleState,x):void 0),q=Z?.accountingClassIDs[0],E=o(Y=>q!=null?Wa(Y.classState,{classId:q,reportId:"class_list"}):void 0),V=O?.type.code==="business_physical_credit_card"||O?.type.code==="business_physical_debit_card",Q=O?.type.code==="business_physical_debit_card";r.useEffect(()=>{m&&_===!1&&V&&(i(!0),setTimeout(()=>{t(Za()),Q&&t(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[m,_,V,Q]),r.useEffect(()=>{N||p.fetchState==="Completed"||p.fetchState==="In-Progress"||n==null||(G(!0),t(ka(n,l,!1)))},[N,p,n,t]),r.useEffect(()=>{if(p.fetchState==="Completed"&&(V===!1||V&&O?.status?.code!=="active"||O?.cardHolderUserId!==a.userId||m===!1&&_===!1||O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card")){const Y=Ae(s.tenantEmailDomain,n,a,O,m);e(Y)}},[p.fetchState,m,V]),r.useEffect(()=>{A.fetchState!=="Completed"&&A.fetchState!=="In-Progress"&&u&&d&&f&&t(Qe()),I.fetchState!=="Completed"&&I.fetchState!=="In-Progress"&&u&&d&&f&&t(Pt()),L!=="Completed"&&L!=="In-Progress"&&t(jn())},[A.fetchState,I.fetchState,t,u,d,f,L]);const X=()=>{if(a!=null&&n!=null){t(Za());const Y=Ae(s.tenantEmailDomain,n,a);e(Y)}},S=O?.type.code==="business_physical_debit_card"||O?.type.code==="business_virtual_debit_card",R=Je(u,w,v,d),T=Ra(u,d,f,A,I),ee=yr(S,p);return p.fetchState!=="Completed"?c.jsx(va,{fetchState:"In-Progress"}):c.jsxs(c.Fragment,{children:[c.jsx(rt,{showConfetti:m}),c.jsx(qc,{onGotItClick:X,isDebitCard:O?.type.code==="business_physical_debit_card",controllerEmails:M,isChargeCardFeatureEnabled:u,isDebitCardFeatureEnabled:w,isDebitCardSetupEnabled:v,isChargeCardSetupEnabled:d,productInformation:R,creditAccountInformation:T,debitAccountInformation:ee,chargeCardDetailView:p,creditAccount:A,classListFetchState:L,creditAccountRepayment:I,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:y?.className,cardHolderRoles:Z?.userRoles,cardHolderDepartmentName:E?.className})]})}const jt=e=>{const{events:n,onEvent:t,onSubscribed:a}=e,s=Qc(),b=r.useRef(t),f=r.useRef(a),g=r.useRef(0);r.useEffect(()=>{b.current=t},[t]),r.useEffect(()=>{f.current=a},[a]);const _=r.useMemo(()=>[...n].sort().join("|"),[n]);r.useEffect(()=>{if(s==null||n.length===0)return;const i=[],m=new Set,B=()=>{if(f.current==null)return;const D=Date.now();D-g.current<5e3||(g.current=D,f.current())};return n.forEach(D=>{const[d,j]=Jc(D);if(j==="")return;const P=s.channel(d),F=h=>{b.current(j,h)};let C;if(P?.subscribed===!0)C=P,C.bind(j,F),m.has(d)||(m.add(d),B()),i.push(()=>{P.unbind(j,F)});else{if(C=P??s.subscribe(d),C.bind(j,F),!m.has(d)){m.add(d);const h=()=>{B()};C.bind("pusher:subscription_succeeded",h),i.push(()=>{C.unbind("pusher:subscription_succeeded",h)})}i.push(()=>{C.unbind(j,F)})}}),()=>{i.forEach(D=>D())}},[s,_])},wr="charge-card-transaction-update",vr="charge-card-transaction-created",Tr="charge-card-transaction-declined",Fr="charge-card-transaction-updated",xr="charge-card-transaction-receipt-uploaded",ma="charge-card-status-update",Mt="charge-card-spending-updated",it="credit-account-balance-updated",dt="charge-card-created",Nt="charge-card-limit-updated",Vt="charge-card-limit-reset",Ht="charge-card-renamed",Ho="charge-card-department-updated",Rr="charge-card-repayment-completed",Br="charge-card-payment-date-updated",Ba="charge-card-cashback-redeemed",La="charge-card-cashback-earned",Ca=(e,n)=>e==null||e===""?[]:n.map(t=>`private-encrypted-${e}.${t}`),Go=[La,Ba],$o=De(function(e){const n=la(e);return{insightsData:n.insight,cashbackByPeriod:n.cashbackByPeriod,uiState:n.uiState,cashbackSummary:n.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(n,t)=>{e(Es({uiState:{sortKey:n,sortOrder:t}}))}}})(eo);function zo(){const e=de(),n=pe(),t=Ce(),a=re.getSignedInUser(),s=o(j=>fe(j)),{useFeatureGate:b}=le(),{isFeatureEnabled:f}=b(K.isCardsCommentingEnabled),[g,_]=r.useState(!1),i=o(j=>la(j)),m=Ar(s.companyId,{clearParams:i.fetchState==="Completed"}),B=r.useCallback(()=>{const j=_e(t.state?.pathnameStackToGoBack),P=j.poppedPathname??Wo(s.tenantEmailDomain);e(P,{state:{pathnameStackToGoBack:j.newStack}})},[e,t,s.tenantEmailDomain]),D=ea(s);if(jt({events:Ca(D,Go),onEvent:j=>{switch(j){case La:case Ba:return void n(_a(!0))}},onSubscribed:()=>{n(_a(!0))}}),r.useEffect(()=>{g||i.fetchState==="Completed"||i.fetchState==="In-Progress"||(_(!0),n(_a()))},[g,i,n]),a==null)throw Error("Can't access cashback detail page without signing in...");const d=i.cashbackSummary?.cashbackEarned?.amount!=null&&i.fetchState!=="Not-Started";return i.fetchState!=="In-Progress"||d?(i.cashbackSummary?.cashbackEarned?.amount??0)===0&&i.fetchState==="Completed"?c.jsx(ot,{}):c.jsx($o,{onBackClick:B,isCardsCommentingEnabled:f,initialOpenThreadRequest:m}):c.jsx(Xc,{onBackClick:B})}const Wo=e=>`/${e}/cards`,Zo={containerWidth:new Fa(100,58)},Ko=({appContent:e})=>{const n=Ta(),t=pe(),a=de(),{cardId:s}=Me(),b=Ce(),{useDynamicConfig:f}=le(),[g,_]=r.useState(!1),[i,m]=r.useState(!1),[B,D]=r.useState(!1),[d,j]=r.useState(!1),P=re.getSignedInUser();if(P==null)throw Error("Can't access onboarding card page without signing in...");const F=o(E=>fe(E));if(s==null)throw Error("Empty card id is not valid...");const{configValue:C}=f(We.zeniCardsConfig),h=C.max_charge_card_activation_attempts_by_card_id,w=o(E=>As(E,s)),u=w.chargeCard,v=o(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:k}=le(),{isFeatureEnabled:M}=k(K.isChargeCardFeatureEnabled),{isFeatureEnabled:A}=k(K.isDebitCardFeatureEnabled),I=Te(A,F),L=xe({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:I}),l=!!F.companyChargeCardInfo?.info?.isChargeCardEnabled,p=F.userRole.includes("charge_card_user"),N=we(F),G=ve(F),O=F.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Re({isCardsOnlyTenant:N,isChargeCardFeatureEnabled:M,isBookKeepingTenant:G,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:O}),z=!p&&U&&l;r.useEffect(()=>{g===!1&&v!=="In-Progress"&&v!=="Completed"&&(t(Ja()),_(!0)),i===!1&&w.fetchState==="Not-Started"&&(m(!0),t(ka(s,z,U)))},[i,w.fetchState,g,v]);const W=u?.type.code==="business_physical_credit_card"||u?.type.code==="business_physical_debit_card";r.useEffect(()=>{if(w.fetchState==="Completed"){if(B===!1&&(W===!1||W&&u?.status?.code!=="inactive"||u?.cardHolderUserId!==P.userId)){const E=Ae(F.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);a(E,{state:{pathnameStackToGoBack:V}})}else if(B&&w.isRefreshingViewInBackground===!1&&u?.status?.code==="active"){t(Ds({chargeCardId:s}));const E=Ae(F.tenantEmailDomain,s,P,u,!0),V=ye(b.state?.pathnameStackToGoBack,b.pathname);t(Xa()),a(E,{state:{pathnameStackToGoBack:V}})}}},[w.fetchState,u?.type.code,B,w.isRefreshingViewInBackground]);const y=re.getZeniOtpTokenForCardHolder(s),x=o(E=>Mn(E.userState,P.userId)),Z=()=>{u?.status?.code!=="active"&&t(ga(s,!0))};r.useEffect(()=>{w.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&u?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&B===!1&&(setTimeout(Z,3e3),D(!0))},[w.updatePhysicalChargeCardAttemptFetchState.fetchState,u?.cardActivationAttemptHistory]);const q=E=>{j(E)};if(v!=="Completed"||u==null)return c.jsx(va,{fetchState:"In-Progress"});if(u.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(x?.phone==null)throw Error("Can't access user phone number.");return c.jsxs(Qo,{children:[c.jsx(Ie,{isAppContentDrawerOpen:d,handleDrawerToggle:q}),c.jsx(Yo,{cardId:s,card:u,shippingAddressId:u.shippingAddressId,phone:x.phone,signedInUser:P,isSandboxEnv:xt(),chargeCardDetailState:w,signedInUserToken:y,navigate:a,currentTenant:F,location:b,maxChargeCardActivationAttempts:h[s]!=null?h[s]: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:()=>{q(!0)}}),e!=null?c.jsx(qo,{windowSize:n,children:e}):null]})},Yo=De(function(e,{chargeCardDetailState:n,shippingAddressId:t,location:a,cardId:s}){const b=_s(e.addressState,t);if(b==null)throw Error("Can't access shippingAddress.");const f=Nn(e,s),g=n.updateStatus,_=ua(e,!1,!1,!1);let i=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(i=!0);const m=a.state?.message==="comingFromV2UrlPath";return{showActivatePage:n.chargeCard?.providerCardCreateTime!=null&&n.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Ps())||m,showMenuIcon:i,shippingAddress:b,vgsVaultId:st.cardVaultId,twoFAView:f,activationWaitStatus:g,isRefreshingViewInBackground:n.isRefreshingViewInBackground}},function(e,n){const{navigate:t,cardId:a,location:s,currentTenant:b,chargeCardDetailState:f}=n,g=f.chargeCard?.cardProviderID,{tenantEmailDomain:_}=b;return{onGetOtp:i=>{g!=null&&e(tt(i,"ChargeCardHolder",a))},onUpdatePhysicalChargeCardAttempt:i=>{e(vs(a,i))},onResendOtp:i=>{g!=null&&e(at(i,"ChargeCardHolder",a))},onVerifyOtp:(i,m)=>{g!=null&&e(et(i,m,"ChargeCardHolder",a))},onVerifyOtpSuccess:i=>{i!=null&&re.saveZeniOtpTokenForCardHolder(i,a)},onCVVActivateSuccess:()=>{e(ws({chargeCardId:a}))},onBackClick:()=>{const i=_e(s.state?.pathnameStackToGoBack),m=i.poppedPathname==null||i.poppedPathname.includes("onboard")===!0?aa(_):i.poppedPathname;t(m,{state:{pathnameStackToGoBack:i.newStack}})}}})(ao),qo=Ne.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: ${e=>`${Zo.containerWidth.value(e.windowSize)}%`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-DmbDY3sa.js";import{a as g}from"./sentry--Yi43Gx7.js";import{h as w,u as x,g as T,i as k,j as S,n as E}from"./core-Cj3sxYL7.js";import{z as N,b9 as F,A as P,c as V,e as A,af as C,ba as L,at as j,au as U,r as B}from"./index-
|
|
1
|
+
import{j as m}from"./liveblocks-DmbDY3sa.js";import{a as g}from"./sentry--Yi43Gx7.js";import{h as w,u as x,g as T,i as k,j as S,n as E}from"./core-Cj3sxYL7.js";import{z as N,b9 as F,A as P,c as V,e as A,af as C,ba as L,at as j,au as U,r as B}from"./index-C_Y0yMPY.js";import{eW as D,gi as M,tp as R,gd as _,c7 as z,OQ as G,bn as Y,ry as H,rm as Q,l0 as W,mB as O,OR as Z,bE as $,cz as b,mL as q,mO as J}from"./zeni-epic-state-BG_x9wwl.js";import"./mui-1V4hRqCa.js";import{d as K}from"./routePaths-D0rLO8yN.js";import{M as X}from"./MobileAppDrawer-B8b7sXqB.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]="00e86f30-44a6-4e30-a9bf-81ef8e87a92e",n._sentryDebugIdIdentifier="sentry-dbid-00e86f30-44a6-4e30-a9bf-81ef8e87a92e")}catch{}})();const ee=E(function(n){const t=_(n),i=N.getSignedInUser(),p=D(n),c=p.tenantId,l={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(p?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(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:l,filesEndPoint:`${j.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,t){const{companyId:i,currentTenant:p,navigate:c,location:l}=t,{tenantEmailDomain:f}=p;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(J())},onAddressClick:e=>{const a=K(f,e),o=B(l.state?.pathnameStackToGoBack,l.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(q({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:h}=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:U(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?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(O({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(O({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(O({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(Z(e))},onCompanyOfficerUpdated:e=>{n(O({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(W({files:e}))},onDeleteFile:e=>{n(Q(e))},onEditFileName:(e,a)=>{n(H(e,a.split(".")[0]))}}})(L);function de(){const n=w(),t=x(),i=T(),{tenantEmailDomain:p}=k(),[c,l]=g.useState(!1),[f,e]=g.useState(!1),a=S(s=>s.companyViewState.passportView.fetchState),o=S(s=>s.companyConfigState.fetchState),r=S(s=>D(s)),d=r.companyId??N.getSignedInUserTenant(p)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(l(!0),t(M(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(R())},[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(F,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(A.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-DmbDY3sa.js";import{a}from"./sentry--Yi43Gx7.js";import{u as S,g as w,j as u,N as v}from"./core-Cj3sxYL7.js";import{Lw as A,eW as L,fE as O,o5 as _,gr as h,fD as j,fa as U,LD as F}from"./zeni-epic-state-BG_x9wwl.js";import{u as $,z as m,L as g,D as k,o as H}from"./index-
|
|
1
|
+
import{j as C}from"./liveblocks-DmbDY3sa.js";import{a}from"./sentry--Yi43Gx7.js";import{u as S,g as w,j as u,N as v}from"./core-Cj3sxYL7.js";import{Lw as A,eW as L,fE as O,o5 as _,gr as h,fD as j,fa as U,LD as F}from"./zeni-epic-state-BG_x9wwl.js";import{u as $,z as m,L as g,D as k,o as H}from"./index-C_Y0yMPY.js";import{n as z}from"./mui-1V4hRqCa.js";import{t as R}from"./getLocaleForTenant-ChWLNTj3.js";import{g as P,Q as G}from"./QBOConnectionScreen-l87oL02a.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./empty-DFc-bsca.js";import"./pdf-lib-ovfXHDuI.js";import"./index-B5wYRZoC.js";import"./url-10vNaoth.js";import"./index-BW1XqAyr.js";import"./decodeURIComponentSafe-CyYkfiHv.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="23f4bc6c-d07a-4984-9583-00b38bac6c29",t._sentryDebugIdIdentifier="sentry-dbid-23f4bc6c-d07a-4984-9583-00b38bac6c29")}catch{}})();const Q=z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
flex-direction: row;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-DmbDY3sa.js";import{z as n}from"./index-
|
|
1
|
+
import{j as i}from"./liveblocks-DmbDY3sa.js";import{z as n}from"./index-C_Y0yMPY.js";import{g as d}from"./QBOConnectionScreen-l87oL02a.js";import"./sentry--Yi43Gx7.js";import{g as p,N as s}from"./core-Cj3sxYL7.js";import"./zeni-epic-state-BG_x9wwl.js";import"./recharts-mFhBBFnU.js";import"./mui-1V4hRqCa.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./empty-DFc-bsca.js";import"./pdf-lib-ovfXHDuI.js";import"./index-B5wYRZoC.js";import"./url-10vNaoth.js";import"./index-BW1XqAyr.js";import"./decodeURIComponentSafe-CyYkfiHv.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]="817363c8-7f1d-4590-b58b-cef70b99ca15",t._sentryDebugIdIdentifier="sentry-dbid-817363c8-7f1d-4590-b58b-cef70b99ca15")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=d(t.search),m=n.getSignedInUser()?.userId??"";if(f(o,r,e,m)===!0){const a=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:a})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-Cd6aEpRT.js → CustomerOnboardingRoutes-BySm8MfB.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-DmbDY3sa.js";import{t as Me,A as Ce}from"./AddressScreen-
|
|
1
|
+
import{j as a}from"./liveblocks-DmbDY3sa.js";import{t as Me,A as Ce}from"./AddressScreen-BrXKW3BZ.js";import $e from"./NotFoundScreen-C5grvltN.js";import{a as g}from"./sentry--Yi43Gx7.js";import{h as oe,g as se,u as ie,i as re,j as D,N as E,n as ce,l as ze,o as qe,p as z}from"./core-Cj3sxYL7.js";import{w as de,j as le,z as B,F as ue,m as Qe,x as _,r as V,A as Y,c as N,B as je,e as J,ap as Ke,K as Ze,aq as ke,h as te,ar as We,as as Ie,o as Ye,at as He,au as Ee,av as Je}from"./index-C_Y0yMPY.js";import{bn as Xe,eW as ee,fw as et,fe as pe,fc as me,bt as tt,o3 as at,fs as nt,bS as ot,k4 as ae,k7 as ve,M0 as st,bY as it,c7 as ge,tD as fe,to as rt,Mv as X,tE as _e,JV as ct,l8 as Ue,Mw as Ve,Mx as dt,My as lt,Mz as ut,k2 as pt,k5 as mt,tq as Be,tC as gt,bE as xe,cz as ft,tQ as Te,ry as ht,rm as yt,l0 as St,gg as bt,gf as Ct,ge as kt,MA as It,ti as Et,tR as xt,tU as Tt,tX as Ot,u1 as At,cY as Pt}from"./zeni-epic-state-BG_x9wwl.js";import{n as he}from"./mui-1V4hRqCa.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-l87oL02a.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./empty-DFc-bsca.js";import"./pdf-lib-ovfXHDuI.js";import"./index-B5wYRZoC.js";import"./url-10vNaoth.js";import"./index-BW1XqAyr.js";import"./decodeURIComponentSafe-CyYkfiHv.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]="7cb240fb-6184-4a32-8440-df5e21f1df48",t._sentryDebugIdIdentifier="sentry-dbid-7cb240fb-6184-4a32-8440-df5e21f1df48")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),I=Qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),M=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(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 j=pe(F,c),A=me(c),P=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!q,Q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&P.push("top_expenses"),$===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),Q===!1&&P.push("reimbursement_card","reimbursement_promo_card"),k===!1&&P.push("zeni_accounts_promo_card"),h===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||A||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,P)))},[d,O,j,A,i,c.tenantId,s]),g.useEffect(()=>{(j||A)&&setTimeout(()=>{S(!0)},5e3)},[j,A]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(Y,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(J.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:M,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${t=>t.theme.colors.grey4};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-DmbDY3sa.js";import{i as K,j as S,g as H,u as z,h as W,n as te,k as ca,o as Ct,p as w}from"./core-Cj3sxYL7.js";import{eW as U,MQ as Xe,bE as la,bq as Oe,O2 as Pn,iW as Fn,O3 as Zt,O4 as Rn,iZ as kt,O5 as Qe,O6 as Bn,j2 as jn,O7 as Qt,O8 as Mn,j6 as St,O9 as He,Oa as Ln,cp as vt,Ob as Un,Oc as Gn,N8 as Vn,j_ as Yn,Od as Nn,bn as Ge,Oe as da,ME as ie,bc as ua,kc as ma,od as pa,jX as ha,MG as ce,MF as ee,eV as fa,f2 as $n,fG as _t,Of as zn,Og as Kn,Oh as ga,Oi as Be,vC as Ve,vD as Ye,v_ as xe,vU as le,vH as Ne,Oj as qn,Ok as Zn,Ol as Qn,Om as ba,On as je,Oo as Hn,dJ as Je,s6 as Ca,Op as Wn,Oq as Xn,Or as Jn,Os as At,M2 as Et,ks as De,w6 as It,se as eo,Ot as to,vE as Ht,s9 as Ie,s5 as ka,Ou as ge,Ov as ao,Ow as Tt,M1 as Ot,u5 as Sa,Ox as no,Oy as oo,Oz as so,OA as xt,ui as ro,OB as io,vG as Wt,u4 as _a,OC as be,OD as co,bt as ya,wa as va,OE as lo,OF as uo,OG as mo,OH as Dt,w5 as po,OI as ho,vF as Xt,w9 as Aa,OJ as Ce,OK as fo,OL as go,OM as Ea,kh as Ia,oa as Ta,km as Oa,o8 as xa,o7 as Da,o6 as wa,tt as bo,fw as Co,cS as ko,cT as So,o3 as _o,fs as yo,ok as vo,Ge as ut,G6 as Ao,Ga as Eo,ON as Io,OO as To,OP as Oo,b5 as et,fk as xo,hE as Do,gi as wo,oe as Po,jQ as Fo,ob as Ro,o9 as Bo,fe as jo,fc as Mo}from"./zeni-epic-state-BG_x9wwl.js";import{z as M,a2 as ae,r as x,c as O,D as q,aV as Lo,_ as $e,A as ze,aW as Pa,e as N,aX as Uo,j as Se,aY as Fa,F as _e,x as R,m as Go,aZ as Vo,a_ as Yo,W as Ra,K as Ba,a as ja,Z as No,a$ as $o,U as zo,aN as Ma,$ as oe,b0 as La,b1 as Ua,a1 as Ga,b2 as Ko,b3 as qo,aq as Zo,n as Qo,X as Ho,b4 as Wo,b5 as Xo,b6 as Jo,b7 as es,b8 as ke}from"./index-BHgTWK3A.js";import{n as wt}from"./mui-1V4hRqCa.js";import{a as b}from"./sentry--Yi43Gx7.js";import{w as Va}from"./withTransactionSidePanel-txS5Vf1E.js";import{c as Ya,t as we,f as de,a as Pt,v as ts}from"./routePaths-CKR4MRfB.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-DvB8uvB7.js";import Ue from"./NotFoundScreen-D51sUkWb.js";import{u as Ft}from"./useInitialThreadRequest-ITLu-S1Q.js";import{t as Na}from"./analyticsHelper-B5EDEZrW.js";import{C as as}from"./CompanyPassportScreen-DBpHUeez.js";import{u as ns}from"./useAiCfoDashboardSuggestedQuestionsChips-C8eUPCD2.js";import{F as os}from"./FeaturePreviewScreen-D7L8dftQ.js";import{R as ss}from"./ReferralListScreen-xE93Ck03.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./TransactionDetailScreen-DhBRM2u-.js";import"./decodeURIComponentSafe-CyYkfiHv.js";import"./MobileAppDrawer-CzOm0Sxs.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]="87ff0c11-efbc-4216-a884-3624bd6e2ef9",e._sentryDebugIdIdentifier="sentry-dbid-87ff0c11-efbc-4216-a884-3624bd6e2ef9")}catch{}})();const rs=Va(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(v=>v.tenantState.currentTenantId),c=S(v=>U(v)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?la(r):Oe(),[r]),p=z(),f=W(),A=S(v=>Pn(v,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Fn(o,h))},[h]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),T=b.useCallback((v,B)=>{p(Zt({sortKey:v,sortOrder:B}))},[]),I=b.useCallback(v=>{p(Zt({downloadState:v}))},[]),L=b.useCallback(v=>{if(e)e(v.transactionId,v.transactionType);else if(m!=null){const B=Ya({id:v.transactionId,type:v.transactionType},m);f(B);const X=x(g.state?.pathnameStackToGoBack,g.pathname);f(B,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&O.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Lo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:O,onTransactionClick:L,onReload:E,onBackClick:_,onColumnSortConfigChanged:T,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),is=()=>{const e=z(),a=W(),t=S(T=>Rn(T)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(T=>T.tenantState.currentTenantId),i=S(T=>U(T)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??Oe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(T=>{e(Qe({searchString:T}))},[]),p=b.useCallback((T,I)=>{e(Qe({sortKey:I,sortOrder:T}))},[]),f=b.useCallback(T=>{a(`./${T}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(T=>{e(Qe({downloadState:T}))},[]),E=b.useCallback((T,I)=>{},[]),_=b.useCallback((T,I)=>{e(Qe({selectedDate:T,agingDateSelectionType:I})),e(kt(T))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:O,onLoad:T=>T.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Pa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:O,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:_,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Va(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(k=>U(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?la(r):Oe(),[r]),h=z(),p=W(),f=S(k=>Bn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(jn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),_=b.useCallback((k,v)=>{h(Qt({sortKey:k,sortOrder:v}))},[]),T=b.useCallback(k=>{h(Qt({downloadState:k}))},[]),I=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const v=Ya({id:k.transactionId,type:k.transactionType},c);p(v);const B=x(m.state?.pathnameStackToGoBack,m.pathname);p(v,{state:{pathnameStackToGoBack:B}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&O.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),d.jsx(Uo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:O,onTransactionClick:I,onReload:A,onBackClick:E,onColumnSortConfigChanged:_,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ls=()=>{const e=z(),a=W(),t=S(_=>Mn(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(_=>U(_)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??Oe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(St(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(_=>{e(He({searchString:_}))},[]),h=b.useCallback((_,T)=>{e(He({sortKey:T,sortOrder:_}))},[]),p=b.useCallback(_=>{a(`./${_}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(_=>{e(He({downloadState:_}))},[]),A=b.useCallback((_,T)=>{e(He({selectedDate:_,agingDateSelectionType:T})),e(St(_))},[]),E=b.useCallback((_,T)=>{e(Ln({nodeId:_,isCollapsed:T}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:O,onLoad:_=>_.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Pa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:O,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},$a=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function za(e,a){const t=Vn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=we(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Yn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?O.trackZeniAccountsCashBalancePromoClicked("Move Money"):(O.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else O.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=te(function(e){const a=Un(e).accountsInOrder.map((n,o)=>$a(n,o)),t=Gn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:O}},za)(Fa),us=te(function(e){const a=Nn(e).accountsInOrder.map((o,r)=>$a(o,r)),t=M.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:O}},za)(Fa);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=vt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=vt(n?.loggedInUserRoleMap),r=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=wt.div`
|
|
1
|
+
import{j as d}from"./liveblocks-DmbDY3sa.js";import{i as K,j as S,g as H,u as z,h as W,n as te,k as ca,o as Ct,p as w}from"./core-Cj3sxYL7.js";import{eW as U,MQ as Xe,bE as la,bq as Oe,O2 as Pn,iW as Fn,O3 as Zt,O4 as Rn,iZ as kt,O5 as Qe,O6 as Bn,j2 as jn,O7 as Qt,O8 as Mn,j6 as St,O9 as He,Oa as Ln,cp as vt,Ob as Un,Oc as Gn,N8 as Vn,j_ as Yn,Od as Nn,bn as Ge,Oe as da,ME as ie,bc as ua,kc as ma,od as pa,jX as ha,MG as ce,MF as ee,eV as fa,f2 as $n,fG as _t,Of as zn,Og as Kn,Oh as ga,Oi as Be,vC as Ve,vD as Ye,v_ as xe,vU as le,vH as Ne,Oj as qn,Ok as Zn,Ol as Qn,Om as ba,On as je,Oo as Hn,dJ as Je,s6 as Ca,Op as Wn,Oq as Xn,Or as Jn,Os as At,M2 as Et,ks as De,w6 as It,se as eo,Ot as to,vE as Ht,s9 as Ie,s5 as ka,Ou as ge,Ov as ao,Ow as Tt,M1 as Ot,u5 as Sa,Ox as no,Oy as oo,Oz as so,OA as xt,ui as ro,OB as io,vG as Wt,u4 as _a,OC as be,OD as co,bt as ya,wa as va,OE as lo,OF as uo,OG as mo,OH as Dt,w5 as po,OI as ho,vF as Xt,w9 as Aa,OJ as Ce,OK as fo,OL as go,OM as Ea,kh as Ia,oa as Ta,km as Oa,o8 as xa,o7 as Da,o6 as wa,tt as bo,fw as Co,cS as ko,cT as So,o3 as _o,fs as yo,ok as vo,Ge as ut,G6 as Ao,Ga as Eo,ON as Io,OO as To,OP as Oo,b5 as et,fk as xo,hE as Do,gi as wo,oe as Po,jQ as Fo,ob as Ro,o9 as Bo,fe as jo,fc as Mo}from"./zeni-epic-state-BG_x9wwl.js";import{z as M,a2 as ae,r as x,c as O,D as q,aV as Lo,_ as $e,A as ze,aW as Pa,e as N,aX as Uo,j as Se,aY as Fa,F as _e,x as R,m as Go,aZ as Vo,a_ as Yo,W as Ra,K as Ba,a as ja,Z as No,a$ as $o,U as zo,aN as Ma,$ as oe,b0 as La,b1 as Ua,a1 as Ga,b2 as Ko,b3 as qo,aq as Zo,n as Qo,X as Ho,b4 as Wo,b5 as Xo,b6 as Jo,b7 as es,b8 as ke}from"./index-C_Y0yMPY.js";import{n as wt}from"./mui-1V4hRqCa.js";import{a as b}from"./sentry--Yi43Gx7.js";import{w as Va}from"./withTransactionSidePanel-8QHjmr16.js";import{c as Ya,t as we,f as de,a as Pt,v as ts}from"./routePaths-D0rLO8yN.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-OU79nJF1.js";import Ue from"./NotFoundScreen-C5grvltN.js";import{u as Ft}from"./useInitialThreadRequest-C_e7mvD1.js";import{t as Na}from"./analyticsHelper-VUlrCZ3f.js";import{C as as}from"./CompanyPassportScreen-CkDV3dle.js";import{u as ns}from"./useAiCfoDashboardSuggestedQuestionsChips-CSjDWCVT.js";import{F as os}from"./FeaturePreviewScreen-h089v0nG.js";import{R as ss}from"./ReferralListScreen-XtU4H9R4.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./TransactionDetailScreen-SbXBU7LB.js";import"./decodeURIComponentSafe-CyYkfiHv.js";import"./MobileAppDrawer-B8b7sXqB.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]="87ff0c11-efbc-4216-a884-3624bd6e2ef9",e._sentryDebugIdIdentifier="sentry-dbid-87ff0c11-efbc-4216-a884-3624bd6e2ef9")}catch{}})();const rs=Va(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(v=>v.tenantState.currentTenantId),c=S(v=>U(v)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?la(r):Oe(),[r]),p=z(),f=W(),A=S(v=>Pn(v,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Fn(o,h))},[h]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),T=b.useCallback((v,B)=>{p(Zt({sortKey:v,sortOrder:B}))},[]),I=b.useCallback(v=>{p(Zt({downloadState:v}))},[]),L=b.useCallback(v=>{if(e)e(v.transactionId,v.transactionType);else if(m!=null){const B=Ya({id:v.transactionId,type:v.transactionType},m);f(B);const X=x(g.state?.pathnameStackToGoBack,g.pathname);f(B,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&O.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Lo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:O,onTransactionClick:L,onReload:E,onBackClick:_,onColumnSortConfigChanged:T,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),is=()=>{const e=z(),a=W(),t=S(T=>Rn(T)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(T=>T.tenantState.currentTenantId),i=S(T=>U(T)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??Oe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(kt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(T=>{e(Qe({searchString:T}))},[]),p=b.useCallback((T,I)=>{e(Qe({sortKey:I,sortOrder:T}))},[]),f=b.useCallback(T=>{a(`./${T}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(T=>{e(Qe({downloadState:T}))},[]),E=b.useCallback((T,I)=>{},[]),_=b.useCallback((T,I)=>{e(Qe({selectedDate:T,agingDateSelectionType:I})),e(kt(T))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:O,onLoad:T=>T.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Pa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:O,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:_,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},cs=Va(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=M.getSignedInUser(),i=S(k=>U(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?la(r):Oe(),[r]),h=z(),p=W(),f=S(k=>Bn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(jn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),_=b.useCallback((k,v)=>{h(Qt({sortKey:k,sortOrder:v}))},[]),T=b.useCallback(k=>{h(Qt({downloadState:k}))},[]),I=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const v=Ya({id:k.transactionId,type:k.transactionType},c);p(v);const B=x(m.state?.pathnameStackToGoBack,m.pathname);p(v,{state:{pathnameStackToGoBack:B}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&O.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),d.jsx(Uo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:O,onTransactionClick:I,onReload:A,onBackClick:E,onColumnSortConfigChanged:_,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ls=()=>{const e=z(),a=W(),t=S(_=>Mn(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=M.getSignedInUser(),s=S(_=>U(_)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??Oe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(St(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(_=>{e(He({searchString:_}))},[]),h=b.useCallback((_,T)=>{e(He({sortKey:T,sortOrder:_}))},[]),p=b.useCallback(_=>{a(`./${_}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(_=>{e(He({downloadState:_}))},[]),A=b.useCallback((_,T)=>{e(He({selectedDate:_,agingDateSelectionType:T})),e(St(_))},[]),E=b.useCallback((_,T)=>{e(Ln({nodeId:_,isCollapsed:T}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:O,onLoad:_=>_.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Pa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:O,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},$a=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function za(e,a){const t=Vn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=we(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Yn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?O.trackZeniAccountsCashBalancePromoClicked("Move Money"):(O.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=x(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else O.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ds=te(function(e){const a=Un(e).accountsInOrder.map((n,o)=>$a(n,o)),t=Gn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:O}},za)(Fa),us=te(function(e){const a=Nn(e).accountsInOrder.map((o,r)=>$a(o,r)),t=M.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:O}},za)(Fa);function ms(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=vt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(ds,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ps(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=Se(),o=vt(n?.loggedInUserRoleMap),r=S(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(us,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const hs=wt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|