@zeniai/web-app-ui 5.1.25-dev → 5.1.25-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.
Files changed (60) hide show
  1. package/dist/assets/{AddressRoutes-BB0ro6wv.js → AddressRoutes-BO7_ztL-.js} +1 -1
  2. package/dist/assets/{AddressScreen-t45pXVvS.js → AddressScreen-qDs8FTIM.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-7mHfCmdb.js → AiCfoScreen-BdfrkE-x.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-DbZZgApj.js → BillPayApprovalRoutes-CHbvFE3b.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DGHURUBB.js → BillPayRoutes-DtWSNOxA.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DRR9km69.js → BusinessVerificationPageScreen-DmTGb48M.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-DSSh6FmN.js → ChargeCardRoutes-Bsiqi1N3.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-03cd6rew.js → CompanyPassportScreen-CBnJsrN4.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-CUXkV4cL.js → ConnectionAuthScreen-oV9xidgd.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-DxioIAXi.js → CustomerOnboardingAuthScreen-CT6vX9lK.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-CJBZR08A.js → CustomerOnboardingRoutes-SknKGVun.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-BWWut7Lp.js → DashboardRoutes-e8rwyA4g.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-D0x0VK8i.js → DefaultTenantHome-CKZbeU4z.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-By9DmOyv.js → DomesticWireDetailScreen-DBmeU2Lc.js} +1 -1
  15. package/dist/assets/{DrawerScreen-DHM1klM-.js → DrawerScreen-BWhuJpJg.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-CETjyGK7.js → EntityDetailRoutes-CTTfstSP.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-BMCXnpCB.js → ExpenseAutomationRoutes-CspHbytv.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-4ttP8nOi.js → FeaturePreviewScreen-cfOOP0Wo.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-CNkM-iq3.js → HubSpotOAuthCallbackScreen-DjPOIxHN.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-BKlgQ_Ie.js → MagicLinkRoutes-CsBDI8QQ.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-CQoHv1Ew.js → MagicLinkSignInScreen-m9ssOXwv.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-Biso_61t.js → MobileAppDrawer-BmawIQiO.js} +1 -1
  23. package/dist/assets/{NotFoundScreen-C0-Skng9.js → NotFoundScreen-CgebWRjN.js} +1 -1
  24. package/dist/assets/{NotificationRoutes-D9fJ9SYM.js → NotificationRoutes-Cl7PLaOs.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-C9NM67kC.js → OAuthConsentScreen-qriEiLoe.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-DTh6WUET.js → PandLWithForecastRoutes-Cl99HhDr.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-CfzOn3nZ.js → PeopleRoutes-OPsUJqGZ.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-BRNqvpgs.js → PerformanceRoutes-CEO5F026.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-CmHLrNN0.js → QBOConnectionScreen-Jf2FDuvS.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-DGyOm6sF.js → ReferralListScreen-CZNvkt7D.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-CCftKChl.js → ReimbursementApprovalRoutes-BwzrkQxk.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DYLPHNtr.js → ReimbursementApprovalRuleDetailScreen-CB9IC8Ue.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-B0uSlLog.js → ReimbursementRoutes-BppSio00.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-RqLKE5WA.js → ReportsRoutes-CpXDACgQ.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-COd7r8nd.js → RewardsRoutes-30RCnxCS.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-nOndy_UK.js → ScreenRoutes-A_nicqZg.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-CzU-HcCn.js → SettingsRoutes-Bf46HJcH.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-Bi9C_-FR.js → SetupPagesScreen-DE1Mdjhy.js} +1 -1
  39. package/dist/assets/{SignInScreen-BfWJdDbb.js → SignInScreen-C3IJUUVm.js} +1 -1
  40. package/dist/assets/{SignOutScreen-DqrJH-ux.js → SignOutScreen-qEnjjx7M.js} +1 -1
  41. package/dist/assets/{TaskListScreen-Bwwbd5X8.js → TaskListScreen-Cf5iv59C.js} +1 -1
  42. package/dist/assets/{TaskRoutes-CBdj5pZX.js → TaskRoutes-Bguabkg5.js} +1 -1
  43. package/dist/assets/{TransactionDetailRoutes-BtVYAo59.js → TransactionDetailRoutes-Cv9DmhGT.js} +1 -1
  44. package/dist/assets/{TransactionDetailScreen-BxH3gBsf.js → TransactionDetailScreen-CIFGLtuW.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-DaBzUpfC.js → TransactionListRoutes-2qkBEL3R.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-opcOBJb-.js → TreasuryRoutes-Bs8jZ6mk.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-Fq7EQRDW.js → VendorsRoutes-Ck9fOO3Y.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-C3f57wCu.js → WiseConfirmationScreen-CSSSMXbe.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-2E4c7VWB.js → ZeniAccountRoutes-B_icMfds.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-CgW4jBMr.js → ZeniAccountStatementScreen-CSKHvFWp.js} +1 -1
  51. package/dist/assets/{analyticsHelper-tq4PT7c_.js → analyticsHelper-BjBUUOIH.js} +1 -1
  52. package/dist/assets/{getLocaleForTenant-DwUbw-k6.js → getLocaleForTenant-DYNL1b9l.js} +1 -1
  53. package/dist/assets/{index-BCP41PwF.js → index-CPHDDMJD.js} +5 -5
  54. package/dist/assets/{routePaths-jIme_4o7.js → routePaths-BZSOS5PJ.js} +1 -1
  55. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Duk5q7Ch.js → useAiCfoDashboardSuggestedQuestionsChips-Cx4eHMO1.js} +1 -1
  56. package/dist/assets/{useAskAiCfoHostNavButtonProps-CVdued0l.js → useAskAiCfoHostNavButtonProps-DEByTqFW.js} +1 -1
  57. package/dist/assets/{useInitialThreadRequest-Du_koxHd.js → useInitialThreadRequest-DhlqNdmZ.js} +1 -1
  58. package/dist/assets/{withTransactionSidePanel-DYnpLjtY.js → withTransactionSidePanel-CQ9Z6rVO.js} +1 -1
  59. package/dist/index.html +1 -1
  60. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-BiGkkGoP.js";import{A as d}from"./AddressScreen-t45pXVvS.js";import i from"./NotFoundScreen-C0-Skng9.js";import"./sentry-DQGl2YSn.js";import{o as s,p as r}from"./core-DYij5xsh.js";import"./zeni-epic-state-YenBAkdY.js";import"./recharts-D0oa1BQl.js";import"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
1
+ import{j as e}from"./liveblocks-BiGkkGoP.js";import{A as d}from"./AddressScreen-qDs8FTIM.js";import i from"./NotFoundScreen-CgebWRjN.js";import"./sentry-DQGl2YSn.js";import{o as s,p as r}from"./core-DYij5xsh.js";import"./zeni-epic-state-YenBAkdY.js";import"./recharts-D0oa1BQl.js";import"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-BiGkkGoP.js";import{a as h}from"./sentry-DQGl2YSn.js";import{h as T,u as _,g as E,i as j,j as B,n as K}from"./core-DYij5xsh.js";import{k as M,h as $,z as D,A as L,B as R,x as z,d as C,f as m,E as F,i as b,p as N}from"./index-BCP41PwF.js";import{Ke as k,h2 as U,eQ as G,Kf as O,c2 as V,Kg as q,kn as H}from"./zeni-epic-state-YenBAkdY.js";import{n as Q}from"./mui-CdvNR06J.js";import J from"./NotFoundScreen-C0-Skng9.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]="5fe7539c-4737-4da2-801a-e9df6adf0e45",e._sentryDebugIdIdentifier="sentry-dbid-5fe7539c-4737-4da2-801a-e9df6adf0e45")}catch{}})();const W=Q.div`
1
+ import{j as r}from"./liveblocks-BiGkkGoP.js";import{a as h}from"./sentry-DQGl2YSn.js";import{h as T,u as _,g as E,i as j,j as B,n as K}from"./core-DYij5xsh.js";import{k as M,h as $,z as D,A as L,B as R,x as z,d as C,f as m,E as F,i as b,p as N}from"./index-CPHDDMJD.js";import{Ke as k,h2 as U,eQ as G,Kf as O,c2 as V,Kg as q,kn as H}from"./zeni-epic-state-YenBAkdY.js";import{n as Q}from"./mui-CdvNR06J.js";import J from"./NotFoundScreen-CgebWRjN.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]="5fe7539c-4737-4da2-801a-e9df6adf0e45",e._sentryDebugIdIdentifier="sentry-dbid-5fe7539c-4737-4da2-801a-e9df6adf0e45")}catch{}})();const W=Q.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as c}from"./liveblocks-BiGkkGoP.js";import{a as r}from"./sentry-DQGl2YSn.js";import{u as ge,h as Ce,g as Ie,j as Y,i as ke,n as be}from"./core-DYij5xsh.js";import{T as xe,z as we,k as Pe,cR as Ee,cS as Te,b4 as J,cT as ve,b3 as Z,p as D,x as L,d as I,cU as F,cV as ye,cW as Qe,a1 as _e,f as Oe,a7 as Ae,cX as Ue,a2 as je,r as Le,b0 as Fe,cY as Re}from"./index-BCP41PwF.js";import{fJ as De,eP as ee,eQ as Be,hI as Me,R0 as Ve,eT as Ge,hS as $e,hO as Ne,eR as R,fu as qe,fn as ze,fr as K,fv as He,fw as We,fx as Ye,fy as Je,fz as Ke}from"./zeni-epic-state-YenBAkdY.js";import{D as Xe,n as k,S as Ze,P as et}from"./mui-CdvNR06J.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-Duk5q7Ch.js";import{p as st}from"./pathToGoBack-DzYXGaMH.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="39492239-1a24-456d-8508-5c5cff4a8cac",a._sentryDebugIdIdentifier="sentry-dbid-39492239-1a24-456d-8508-5c5cff4a8cac")}catch{}})();const te="chat-response-generated",ot=be(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:S,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:d,setIsAiCfoOpen:f}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,u=We(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:b,currentQuestionAnswerSummary:T}=Z(d,t);u!=="answer"?I.trackAICFOChatResponseGenerated(u,b?.question.questionText??"",o.text,t,Re(T,E),o.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(o.text,b?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Ye(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Je({chatSessionId:o.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),a(Ke({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,u)=>{e&&Fe(a,e,p,h,d,l,u,o)},updateCurrentInput:e=>{a(K(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(He(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(K(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{h!=null&&a(ze());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Ae(Ue)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=xe(),s=ge(),m=Ce(),l=Ie(),[S,h]=r.useState(!1);r.useEffect(()=>{s(De())},[s]);const d=Y(n=>ee(n)),f=we.getSignedInUser(),{session_id:e}=ke(),p=Pe(),o=_e(p),u=Y(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:b,isUploadPromoVisible:T}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),v=Te({currentTenant:u,currentChatSessionId:t,aiCfoView:d}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),x=l.state,w=x?.aiCfoInitialQuestion,B=!!x?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[J]!==!0)return;h(!0);const g={...n};delete g[J],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,y]=r.useState(null),[ne,Q]=r.useState(!1),[ie,_]=r.useState(void 0),[re,O]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&w!=null&&w!==""){const n=l.state;y(w),Q(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;O(typeof g=="number"?g:void 0),M.current=!0}},[w,B,l.state]);const le=r.useCallback(()=>{y(null),Q(!1),_(void 0),O(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??x?.aiCfoRef,A=V.get("emailRefId")??x?.aiCfoEmailRefId,$=r.useRef(!1);r.useEffect(()=>{$.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),$.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(y(P),Q(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:N}=ve(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",z=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),H=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Z(H,t),de=ue.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=D(l.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[u.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:N.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[N]);r.useEffect(()=>{U!=="In-Progress"&&j&&s($e())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&z&&f!=null&&U==="Completed"&&!j&&s(Ne(t,f.userId))},[q,z,t,f,s]);const W=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=t!=null&&d.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:I,onLoad:W}),v.drawerElement,c.jsx(it,{children:c.jsx(X,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(R(u.userRoleId))}})})})]});const Se=c.jsxs(c.Fragment,{children:[S&&!C?c.jsx(L,{analytics:I,onLoad:W}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:I,onLoad:n=>n.trackPageLoaded(Oe.Event.aiCFOPage)}),o&&v.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:H,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:he,isEmptyChatWithSession:de,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?v.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:T,onUploadPromoClose:b,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Xe,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:c.jsx(X,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})})}):null]}),S&&!o?c.jsx(ye,{open:S,onClose:()=>h(!1),children:c.jsx(Qe,{children:Se})}):null]})},X=k(Ze)`
1
+ import{j as c}from"./liveblocks-BiGkkGoP.js";import{a as r}from"./sentry-DQGl2YSn.js";import{u as ge,h as Ce,g as Ie,j as Y,i as ke,n as be}from"./core-DYij5xsh.js";import{T as xe,z as we,k as Pe,cR as Ee,cS as Te,b4 as J,cT as ve,b3 as Z,p as D,x as L,d as I,cU as F,cV as ye,cW as Qe,a1 as _e,f as Oe,a7 as Ae,cX as Ue,a2 as je,r as Le,b0 as Fe,cY as Re}from"./index-CPHDDMJD.js";import{fJ as De,eP as ee,eQ as Be,hI as Me,R0 as Ve,eT as Ge,hS as $e,hO as Ne,eR as R,fu as qe,fn as ze,fr as K,fv as He,fw as We,fx as Ye,fy as Je,fz as Ke}from"./zeni-epic-state-YenBAkdY.js";import{D as Xe,n as k,S as Ze,P as et}from"./mui-CdvNR06J.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-Cx4eHMO1.js";import{p as st}from"./pathToGoBack-DzYXGaMH.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="39492239-1a24-456d-8508-5c5cff4a8cac",a._sentryDebugIdIdentifier="sentry-dbid-39492239-1a24-456d-8508-5c5cff4a8cac")}catch{}})();const te="chat-response-generated",ot=be(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:S,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:d,setIsAiCfoOpen:f}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,u=We(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:b,currentQuestionAnswerSummary:T}=Z(d,t);u!=="answer"?I.trackAICFOChatResponseGenerated(u,b?.question.questionText??"",o.text,t,Re(T,E),o.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(o.text,b?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Ye(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Je({chatSessionId:o.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),a(Ke({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,u)=>{e&&Fe(a,e,p,h,d,l,u,o)},updateCurrentInput:e=>{a(K(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(He(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(K(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{h!=null&&a(ze());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Ae(Ue)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=xe(),s=ge(),m=Ce(),l=Ie(),[S,h]=r.useState(!1);r.useEffect(()=>{s(De())},[s]);const d=Y(n=>ee(n)),f=we.getSignedInUser(),{session_id:e}=ke(),p=Pe(),o=_e(p),u=Y(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:b,isUploadPromoVisible:T}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),v=Te({currentTenant:u,currentChatSessionId:t,aiCfoView:d}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),x=l.state,w=x?.aiCfoInitialQuestion,B=!!x?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[J]!==!0)return;h(!0);const g={...n};delete g[J],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,y]=r.useState(null),[ne,Q]=r.useState(!1),[ie,_]=r.useState(void 0),[re,O]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&w!=null&&w!==""){const n=l.state;y(w),Q(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;O(typeof g=="number"?g:void 0),M.current=!0}},[w,B,l.state]);const le=r.useCallback(()=>{y(null),Q(!1),_(void 0),O(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??x?.aiCfoRef,A=V.get("emailRefId")??x?.aiCfoEmailRefId,$=r.useRef(!1);r.useEffect(()=>{$.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),$.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(y(P),Q(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:N}=ve(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",z=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),H=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Z(H,t),de=ue.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=D(l.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[u.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:N.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[N]);r.useEffect(()=>{U!=="In-Progress"&&j&&s($e())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&z&&f!=null&&U==="Completed"&&!j&&s(Ne(t,f.userId))},[q,z,t,f,s]);const W=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=t!=null&&d.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:I,onLoad:W}),v.drawerElement,c.jsx(it,{children:c.jsx(X,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(R(u.userRoleId))}})})})]});const Se=c.jsxs(c.Fragment,{children:[S&&!C?c.jsx(L,{analytics:I,onLoad:W}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:I,onLoad:n=>n.trackPageLoaded(Oe.Event.aiCFOPage)}),o&&v.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:H,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:he,isEmptyChatWithSession:de,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?v.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:T,onUploadPromoClose:b,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Xe,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:c.jsx(X,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})})}):null]}),S&&!o?c.jsx(ye,{open:S,onClose:()=>h(!1),children:c.jsx(Qe,{children:Se})}):null]})},X=k(Ze)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-BiGkkGoP.js";import{a as f}from"./sentry-DQGl2YSn.js";import{h as B,g as U,u as j,j as v,N as _,n as T,i as $,o as O,p as h}from"./core-DYij5xsh.js";import{eQ as F,Nx as R,Nd as b,xX as x,xR as L,xV as I,xK as W,Nf as q,xN as z,xZ as G,xY as C}from"./zeni-epic-state-YenBAkdY.js";import{h as P,z as k,B as V,a7 as K,bF as Q,af as N,bG as X}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import{i as Y}from"./ReimbursementApprovalRuleDetailScreen-DYLPHNtr.js";import Z from"./NotFoundScreen-C0-Skng9.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="99df1aa8-63ad-41fa-8dd4-6c1c3437e7b6",e._sentryDebugIdIdentifier="sentry-dbid-99df1aa8-63ad-41fa-8dd4-6c1c3437e7b6")}catch{}})();const w="bill-approval-rule-update",H=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(w)&&e(q(!1))},onBackClick:()=>{N(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(W(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(K(Q)),J=()=>{const e=B(),o=U(),a=j(),[p,t]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(L(!0)))},[p,n,a]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),a(I())),e("./new"))},[u,r,a]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,S)=>{i.endsWith(w)&&S.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(_,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(H,{currentTenant:c,location:o,navigate:e,...y})},M=T(function(e,o){const a=b(e),p=a.billPaySetupApproverViewUpdateData?.type??"approval_create",t=p==="approval_create"&&a.allApprovalRules.length!==0;let u=a.allApprovalRules.length===0;return o.approvalRuleId&&(u=a.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:a,hideUpperBoundField:t,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:a,approvalUpdateDataView:p,approverViewData:t,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=N(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(m=>({type:"user",userId:m.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(m=>{const E=!!Y(m.value);return{type:E?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),S=i.concat(A);g.push({action:y.stepType.selectedOption,actors:S,operator:S.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{a("../")}}})(X);function D(){const e=B(),o=j(),a=U(),{approvalRuleId:p}=$(),t=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),t==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(M,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:a})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(J,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Z,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-BiGkkGoP.js";import{a as f}from"./sentry-DQGl2YSn.js";import{h as B,g as U,u as j,j as v,N as _,n as T,i as $,o as O,p as h}from"./core-DYij5xsh.js";import{eQ as F,Nx as R,Nd as b,xX as x,xR as L,xV as I,xK as W,Nf as q,xN as z,xZ as G,xY as C}from"./zeni-epic-state-YenBAkdY.js";import{h as P,z as k,B as V,a7 as K,bF as Q,af as N,bG as X}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import{i as Y}from"./ReimbursementApprovalRuleDetailScreen-CB9IC8Ue.js";import Z from"./NotFoundScreen-CgebWRjN.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="99df1aa8-63ad-41fa-8dd4-6c1c3437e7b6",e._sentryDebugIdIdentifier="sentry-dbid-99df1aa8-63ad-41fa-8dd4-6c1c3437e7b6")}catch{}})();const w="bill-approval-rule-update",H=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(w)&&e(q(!1))},onBackClick:()=>{N(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(W(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(K(Q)),J=()=>{const e=B(),o=U(),a=j(),[p,t]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(L(!0)))},[p,n,a]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),a(I())),e("./new"))},[u,r,a]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,S)=>{i.endsWith(w)&&S.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(_,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(H,{currentTenant:c,location:o,navigate:e,...y})},M=T(function(e,o){const a=b(e),p=a.billPaySetupApproverViewUpdateData?.type??"approval_create",t=p==="approval_create"&&a.allApprovalRules.length!==0;let u=a.allApprovalRules.length===0;return o.approvalRuleId&&(u=a.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:a,hideUpperBoundField:t,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:a,approvalUpdateDataView:p,approverViewData:t,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=N(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(m=>({type:"user",userId:m.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(m=>{const E=!!Y(m.value);return{type:E?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),S=i.concat(A);g.push({action:y.stepType.selectedOption,actors:S,operator:S.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{a("../")}}})(X);function D(){const e=B(),o=j(),a=U(),{approvalRuleId:p}=$(),t=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),t==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(M,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:a})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(J,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Z,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BiGkkGoP.js";import{h as J,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-DYij5xsh.js";import{eQ as Z,MP as Le,bt as It,HJ as oa,bo as wt,bF as pe,MQ as xt,xf as Ct,yp as $e,xO as la,bn as De,MR as sa,MS as ra,c2 as ca,MT as da,jH as At,MU as Bt,MV as Et,y_ as _e,xu as Ae,MW as ua,x3 as tt,MX as pa,Ca as ma,x7 as ba,xd as Dt,MY as ke,MZ as Ge,yq as Me,M_ as ha,M$ as ga,yt as Oe,N0 as ya,yG as Sa,N1 as jt,ya as at,yf as fa,N2 as ka,N3 as ue,N4 as Tt,N5 as Pt,N6 as Ft,fN as va,xz as Ne,cx as Rt,N7 as Ia,gU as wa,N8 as xa,N9 as Ca,e$ as Vt,eZ as $t,Na as ze,Nb as Aa,Nc as Ba,Ky as Ze,Nd as Ea,Kz as oe,KA as He,Ne as Da,Nf as ja,Ng as Ta,yh as nt,ye as Pa,Nh as Fa,Ni as Ra,Nj as Va,y0 as $a,Nk as Na,Nl as Ua,Nm as La,cl as Nt,cM as Ut,jS as _a,bL as Ga,bq as Lt,bM as _t,wl as Ma,Nn as Oa,BZ as za,C3 as Za,sS as Ha,yr as Wa,z5 as qa,k3 as fe,No as Ka,Np as Gt,kx as Ja,jZ as Mt,ki as Ot,kh as it,bE as be,bK as Qa,Nq as Xa,Nr as ve,iC as Ya,Ns as ot,Nt as en,iG as tn,i$ as an,zj as nn,Nu as on,kq as ln,z9 as sn,Nv as lt,zd as rn,zi as cn,zf as dn,z7 as un,Nw as zt,xo as pn,Nx as mn,Ny as bn,fF as hn,fE as gn,fD as yn,k6 as Sn,ko as st,kz as fn,qp as kn,kf as vn,zb as In,iM as wn,kE as xn,Nz as Cn,iE as An,qg as Bn,NA as En,y6 as Dn,bG as jn,bs as Tn,Jt as Pn,cO as Fn,cN as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-YenBAkdY.js";import{h as me,z as V,A as Ie,Z as We,n as le,c as y,aN as Be,B as re,o as B,x as je,d as D,bc as Nn,p as z,a2 as qe,r as E,k as we,bd as rt,be as ct,bf as Un,ak as Ln,F as _n,aH as Gn,y as Zt,D as Ke,U as Je,bg as Mn,at as Ht,bh as On,W as zn,f as Wt,a7 as Zn,bi as Hn,bj as Wn,bk as qn,bl as Kn,bm as Jn,bn as Qn,bo as Xn,bp as Yn,bq as ei,v as ti,br as ai,b7 as ni,bs as ii,bt as oi,a9 as li}from"./index-BCP41PwF.js";import{n as U,S as si}from"./mui-CdvNR06J.js";import{A as dt}from"./AddressScreen-t45pXVvS.js";import{g as ie,a as Te,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-By9DmOyv.js";import{a as f}from"./sentry-DQGl2YSn.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import{u as Kt}from"./useInitialThreadRequest-Du_koxHd.js";import Ee from"./NotFoundScreen-C0-Skng9.js";import{D as ui}from"./DrawerScreen-DHM1klM-.js";import{M as Jt}from"./MobileAppDrawer-Biso_61t.js";import{F as Qt}from"./FeaturePreviewScreen-4ttP8nOi.js";import{S as Pe}from"./SetupPagesScreen-Bi9C_-FR.js";import{B as pi}from"./BillPayApprovalRoutes-DbZZgApj.js";import{FallBackRoute as mi}from"./ScreenRoutes-nOndy_UK.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./analyticsHelper-tq4PT7c_.js";import"./routePaths-jIme_4o7.js";import"./BusinessVerificationPageScreen-DRR9km69.js";import"./ReimbursementApprovalRuleDetailScreen-DYLPHNtr.js";import"./getLocaleForTenant-DwUbw-k6.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]="d4463b6c-c342-4c79-b0b4-f046faf297f9",e._sentryDebugIdIdentifier="sentry-dbid-d4463b6c-c342-4c79-b0b4-f046faf297f9")}catch{}})();const bi=X(function(e,t){const l=Le(e,t.billId),i=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:At(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ae(l,"retry")):e(Ae(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ae(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}})(Nn);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(M=>Z(M)),s=v(M=>Le(M,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=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),[j,x]=f.useState(!1),[C,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:L}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=L(Be.zeniAssistConfig),A=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),N=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&A===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(M=>M.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,A,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,N,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,N,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${B.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:M=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(M)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:N,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:B.sp10,paddingRight:B.sp3,paddingBottom:"15px",paddingLeft:B.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Me(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Be.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,_]=f.useState(!1),[T,L]=f.useState(!1),[$,I]=f.useState(!1),[H,G]=f.useState(),A=v(F=>Ge(F,m,g,i));let q=A.fetchState,W=A.file,N=A.showAutofill;const K=v(F=>Le(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],N=!1);const Y=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;f.useEffect(()=>{i==null&&t(Me(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?L(!1):!u&&C&&_(!1))},[i]),f.useEffect(()=>{C||i==null||u||(_(!0),t(Ct(i,h,j,!1)),T||(L(!0),t($e(!1,h,j,b,i)))),u&&!T&&(L(!0),t($e(!1,h,j,b,i)))},[C,T,u,i,t]);const M={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!A.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||N?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[N&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:M,isEditPopup:!0}):null,o==="small"||N?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:N,uploadStatus:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,A),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,A),isInitialEdit:!!A.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Mn();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-BiGkkGoP.js";import{h as J,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-DYij5xsh.js";import{eQ as Z,MP as Le,bt as It,HJ as oa,bo as wt,bF as pe,MQ as xt,xf as Ct,yp as $e,xO as la,bn as De,MR as sa,MS as ra,c2 as ca,MT as da,jH as At,MU as Bt,MV as Et,y_ as _e,xu as Ae,MW as ua,x3 as tt,MX as pa,Ca as ma,x7 as ba,xd as Dt,MY as ke,MZ as Ge,yq as Me,M_ as ha,M$ as ga,yt as Oe,N0 as ya,yG as Sa,N1 as jt,ya as at,yf as fa,N2 as ka,N3 as ue,N4 as Tt,N5 as Pt,N6 as Ft,fN as va,xz as Ne,cx as Rt,N7 as Ia,gU as wa,N8 as xa,N9 as Ca,e$ as Vt,eZ as $t,Na as ze,Nb as Aa,Nc as Ba,Ky as Ze,Nd as Ea,Kz as oe,KA as He,Ne as Da,Nf as ja,Ng as Ta,yh as nt,ye as Pa,Nh as Fa,Ni as Ra,Nj as Va,y0 as $a,Nk as Na,Nl as Ua,Nm as La,cl as Nt,cM as Ut,jS as _a,bL as Ga,bq as Lt,bM as _t,wl as Ma,Nn as Oa,BZ as za,C3 as Za,sS as Ha,yr as Wa,z5 as qa,k3 as fe,No as Ka,Np as Gt,kx as Ja,jZ as Mt,ki as Ot,kh as it,bE as be,bK as Qa,Nq as Xa,Nr as ve,iC as Ya,Ns as ot,Nt as en,iG as tn,i$ as an,zj as nn,Nu as on,kq as ln,z9 as sn,Nv as lt,zd as rn,zi as cn,zf as dn,z7 as un,Nw as zt,xo as pn,Nx as mn,Ny as bn,fF as hn,fE as gn,fD as yn,k6 as Sn,ko as st,kz as fn,qp as kn,kf as vn,zb as In,iM as wn,kE as xn,Nz as Cn,iE as An,qg as Bn,NA as En,y6 as Dn,bG as jn,bs as Tn,Jt as Pn,cO as Fn,cN as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-YenBAkdY.js";import{h as me,z as V,A as Ie,Z as We,n as le,c as y,aN as Be,B as re,o as B,x as je,d as D,bc as Nn,p as z,a2 as qe,r as E,k as we,bd as rt,be as ct,bf as Un,ak as Ln,F as _n,aH as Gn,y as Zt,D as Ke,U as Je,bg as Mn,at as Ht,bh as On,W as zn,f as Wt,a7 as Zn,bi as Hn,bj as Wn,bk as qn,bl as Kn,bm as Jn,bn as Qn,bo as Xn,bp as Yn,bq as ei,v as ti,br as ai,b7 as ni,bs as ii,bt as oi,a9 as li}from"./index-CPHDDMJD.js";import{n as U,S as si}from"./mui-CdvNR06J.js";import{A as dt}from"./AddressScreen-qDs8FTIM.js";import{g as ie,a as Te,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-DBmeU2Lc.js";import{a as f}from"./sentry-DQGl2YSn.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{u as Kt}from"./useInitialThreadRequest-DhlqNdmZ.js";import Ee from"./NotFoundScreen-CgebWRjN.js";import{D as ui}from"./DrawerScreen-BWhuJpJg.js";import{M as Jt}from"./MobileAppDrawer-BmawIQiO.js";import{F as Qt}from"./FeaturePreviewScreen-cfOOP0Wo.js";import{S as Pe}from"./SetupPagesScreen-DE1Mdjhy.js";import{B as pi}from"./BillPayApprovalRoutes-CHbvFE3b.js";import{FallBackRoute as mi}from"./ScreenRoutes-A_nicqZg.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./analyticsHelper-BjBUUOIH.js";import"./routePaths-BZSOS5PJ.js";import"./BusinessVerificationPageScreen-DmTGb48M.js";import"./ReimbursementApprovalRuleDetailScreen-CB9IC8Ue.js";import"./getLocaleForTenant-DYNL1b9l.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]="d4463b6c-c342-4c79-b0b4-f046faf297f9",e._sentryDebugIdIdentifier="sentry-dbid-d4463b6c-c342-4c79-b0b4-f046faf297f9")}catch{}})();const bi=X(function(e,t){const l=Le(e,t.billId),i=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:At(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ae(l,"retry")):e(Ae(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ae(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}})(Nn);function hi(){const e=J(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(M=>Z(M)),s=v(M=>Le(M,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=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),[j,x]=f.useState(!1),[C,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:L}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=L(Be.zeniAssistConfig),A=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),N=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&A===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(M=>M.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,A,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,N,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,N,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${B.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:M=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(M)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:N,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:B.sp10,paddingRight:B.sp3,paddingBottom:"15px",paddingLeft:B.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Me(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Be.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,_]=f.useState(!1),[T,L]=f.useState(!1),[$,I]=f.useState(!1),[H,G]=f.useState(),A=v(F=>Ge(F,m,g,i));let q=A.fetchState,W=A.file,N=A.showAutofill;const K=v(F=>Le(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],N=!1);const Y=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;f.useEffect(()=>{i==null&&t(Me(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?L(!1):!u&&C&&_(!1))},[i]),f.useEffect(()=>{C||i==null||u||(_(!0),t(Ct(i,h,j,!1)),T||(L(!0),t($e(!1,h,j,b,i)))),u&&!T&&(L(!0),t($e(!1,h,j,b,i)))},[C,T,u,i,t]);const M={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!A.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||N?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[N&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:M,isEditPopup:!0}):null,o==="small"||N?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:N,uploadStatus:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,A),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,A),isInitialEdit:!!A.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Mn();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=U.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-BiGkkGoP.js";import{a as N}from"./sentry-DQGl2YSn.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-DYij5xsh.js";import{A as ce,n as ue,aN as de,z as B,x as pe,d as z,af as x,f as E,bB as le,at as me,r as M,au as P}from"./index-BCP41PwF.js";import{Nl as fe,eQ as q,sh as ye,HN as Se,y0 as ge,AJ as Ie,Dg as be,DV as he,EO as De,NI as Oe,NJ as Te,NK as ke,NL as Ce,NM as Ne,Kf as Ve,MK as we,Kr as Ae,kn as _e,fF as Fe,fE as ve,fD as xe,qp as Ee,qg as Be,qd as ze,kf as Me,sq as Pe,so as R,bE as L,sC as U,cv as Re}from"./zeni-epic-state-YenBAkdY.js";import{n as Le}from"./mui-CdvNR06J.js";import{d as j}from"./routePaths-jIme_4o7.js";import{M as Ue}from"./MobileAppDrawer-Biso_61t.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]="9b3b03d1-1f06-4b65-9820-6f91ae61d16b",e._sentryDebugIdIdentifier="sentry-dbid-9b3b03d1-1f06-4b65-9820-6f91ae61d16b")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-BiGkkGoP.js";import{a as N}from"./sentry-DQGl2YSn.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-DYij5xsh.js";import{A as ce,n as ue,aN as de,z as B,x as pe,d as z,af as x,f as E,bB as le,at as me,r as M,au as P}from"./index-CPHDDMJD.js";import{Nl as fe,eQ as q,sh as ye,HN as Se,y0 as ge,AJ as Ie,Dg as be,DV as he,EO as De,NI as Oe,NJ as Te,NK as ke,NL as Ce,NM as Ne,Kf as Ve,MK as we,Kr as Ae,kn as _e,fF as Fe,fE as ve,fD as xe,qp as Ee,qg as Be,qd as ze,kf as Me,sq as Pe,so as R,bE as L,sC as U,cv as Re}from"./zeni-epic-state-YenBAkdY.js";import{n as Le}from"./mui-CdvNR06J.js";import{d as j}from"./routePaths-BZSOS5PJ.js";import{M as Ue}from"./MobileAppDrawer-BmawIQiO.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]="9b3b03d1-1f06-4b65-9820-6f91ae61d16b",e._sentryDebugIdIdentifier="sentry-dbid-9b3b03d1-1f06-4b65-9820-6f91ae61d16b")}catch{}})();const je=Le.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BiGkkGoP.js";import{h as me,i as ba,u as Ce,j as S,g as Se,n as he,N as Ta,s as jt,o as Rn,p as se}from"./core-DYij5xsh.js";import{eQ as de,bs as He,Pf as ja,eZ as Ie,e_ as Ae,e$ as Ee,fU as qe,cs as Je,Pg as Qe,Ph as lt,tw as xa,jP as Ba,Pi as La,gU as pa,A0 as ca,A2 as Ne,A3 as ut,jF as Vt,Pj as Xe,zQ as ha,Pk as Un,Pl as On,zT as Va,Pm as jn,NF as Na,rI as Nt,zZ as na,h3 as Vn,Pn as Ht,Po as ea,bq as Nn,Pp as Hn,fF as Ha,fE as Ma,Ax as Mn,fD as Ga,Nl as Gn,Pq as Mt,cl as Gt,cM as $n,NE as ya,B7 as $t,Pr as Ft,AJ as fa,Ps as zt,B8 as zn,O4 as Zn,B9 as Yn,C3 as Wn,sS as Kn,BZ as qn,Pt as Jn,A1 as Ye,Pu as Qn,Pv as Xn,Pw as er,Px as ar,Py as tr,Pz as mt,PA as nr,Ai as Zt,Ab as rr,PB as sr,fW as cr,Ar as Yt,Av as Wt,fV as or,PC as ir,AV as Kt,PD as dr,PE as lr,PF as ur,At as qt,Ae as Jt,zW as Qt,An as Xt,Al as en,Ap as mr,PG as an,PH as $a,AG as ga,Kk as tn,cN as Ct,PI as Cr,PJ as pr,PK as hr,PL as fr,AD as st,B0 as gr,AY as br,Az as yr,A_ as Sr,AQ as Ir,AS as Ar,PM as nn,B6 as Fa,HJ as Er,PN as kr,PO as _r,PP as Dr,PQ as rn,PR as Pr,Bt as wr,AI as sn,AC as ve,AH as vr,PS as Fr,PT as Tr,zN as xr,PU as cn,PV as on,PW as Br,zP as Lr,zO as Tt,PX as Rr,PY as Ur,PZ as Or,Kg as jr,P_ as pt,P$ as Vr,wo as dn,kn as Nr,gV as Hr,By as Mr,Q0 as ln,Q1 as Gr,Bz as $r,Q2 as zr,de as Zr,tq as Yr,Bo as Wr,Bi as Ve,bt as Kr,bF as qr,cx as Jr,bG as Qr,Jt as Xr}from"./zeni-epic-state-YenBAkdY.js";import{z as ee,A as Ge,n as oe,c as Z,B as Sa,c2 as za,cd as es,ce as as,cf as ts,p as Re,cg as ns,ch as rs,k as Ia,aN as Le,r as ye,bm as ht,ci as ss,y as Aa,i as Za,h as ft,d as q,D as gt,a7 as Ya,cj as cs,Z as un,aq as bt,by as ra,ck as ct,cl as os,x as yt,cm as is,at as mn,a2 as ot,W as Cn,f as pn,cn as ds,co as ls,cp as us,cq as ms,cr as Cs,cs as ps,o as Ra,ct as hs,cu as fs,cv as at,v as gs,cw as bs,cx as ys,cy as Ss,cz as Is,cA as As,a9 as Es}from"./index-BCP41PwF.js";import{n as Fe,D as hn,S as ks}from"./mui-CdvNR06J.js";import{a as d}from"./sentry-DQGl2YSn.js";import{g as pe,a as Ea,b as fn,c as ke,d as _e,e as Me,f as $e,h as ze,A as _s,i as St,P as Ds,j as It,s as sa,k as gn,l as We,m as bn,n as Ps,o as yn,p as ws,S as xt}from"./SetupPagesScreen-Bi9C_-FR.js";import{u as Sn}from"./useInitialThreadRequest-Du_koxHd.js";import Wa from"./NotFoundScreen-C0-Skng9.js";import{M as Ke}from"./MobileAppDrawer-Biso_61t.js";import{u as In}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import{v as Bt}from"./utils-BCjesvPZ.js";import{d as vs}from"./recharts-D0oa1BQl.js";import{t as Fs}from"./AddressScreen-t45pXVvS.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./analyticsHelper-tq4PT7c_.js";import"./routePaths-jIme_4o7.js";import"./BusinessVerificationPageScreen-DRR9km69.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]="9341f246-6d63-4cce-89af-0f3dbd2c1438",e._sentryDebugIdIdentifier="sentry-dbid-9341f246-6d63-4cce-89af-0f3dbd2c1438")}catch{}})();function Ts(){const e=me(),{cardId:a}=ba(),t=Ce(),r=ee.getSignedInUser(),n=S(W=>de(W)),f=Ge(),p=He(f?.loggedInUserRoleMap),{useFeatureGate:g}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,c]=d.useState(!1),l=S(W=>ja(W).firstViewAfterActivation);if(a==null)throw Error("Empty card id is not valid...");const v=n.userRole.includes("charge_card_user"),{isFeatureEnabled:y}=g(Z.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=g(Z.isDebitCardFeatureEnabled),T=Ie(n),L=Ae(n),C=Ee(B,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=ke({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:C}),o=_e({isCardsOnlyTenant:T,isChargeCardFeatureEnabled:y,isBookKeepingTenant:L,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:u}),I=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S(W=>qe(W,n.companyId)),j=Je(A.controllers),{creditAccount:E,creditAccountRepayment:b}=S(W=>Qe(W)),x=S(W=>W.classListState.fetchState),i=!v&&o&&h,m=S(W=>lt(W,a,i,o)),[U,M]=d.useState(!1),R=m.chargeCard,F=R?.cardCreatedByUser?.userId,G=S(W=>F!=null?xa(W.userRoleState,F):void 0),$=G?.accountingClassIDs[0],V=S(W=>$!=null?Ba(W.classState,{classId:$,reportId:"class_list"}):void 0),P=R?.cardHolderUser?.userId,Y=S(W=>P!=null?xa(W.userRoleState,P):void 0),J=Y?.accountingClassIDs[0],w=S(W=>J!=null?Ba(W.classState,{classId:J,reportId:"class_list"}):void 0),O=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",te=R?.type.code==="business_physical_debit_card";d.useEffect(()=>{l&&_===!1&&O&&(c(!0),setTimeout(()=>{t(La()),te&&t(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[l,_,O,te]),d.useEffect(()=>{U||m.fetchState==="Completed"||m.fetchState==="In-Progress"||a==null||(M(!0),t(ca(a,i,!1)))},[U,m,a,t]),d.useEffect(()=>{if(m.fetchState==="Completed"&&(O===!1||O&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||l===!1&&_===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const W=pe(n.tenantEmailDomain,a,r,R,l);e(W)}},[m.fetchState,l,O]),d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&o&&h&&p&&t(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&o&&h&&p&&t(ut()),x!=="Completed"&&x!=="In-Progress"&&t(Vt())},[E.fetchState,b.fetchState,t,o,h,p,x]);const ae=()=>{if(r!=null&&a!=null){t(La());const W=pe(n.tenantEmailDomain,a,r);e(W)}},k=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",z=Me(o,D,I,h),Q=Ea(o,h,p,E,b),X=fn(k,m);return m.fetchState!=="Completed"?s.jsx(Sa,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:l}),s.jsx(es,{onGotItClick:ae,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:o,isDebitCardFeatureEnabled:D,isDebitCardSetupEnabled:I,isChargeCardSetupEnabled:h,productInformation:z,creditAccountInformation:Q,debitAccountInformation:X,chargeCardDetailView:m,creditAccount:E,classListFetchState:x,creditAccountRepayment:b,cardIssuedByRoles:G?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:Y?.userRoles,cardHolderDepartmentName:w?.className})]})}const At=e=>{const{events:a,onEvent:t,onSubscribed:r}=e,n=as(),f=d.useRef(t),p=d.useRef(r),g=d.useRef(0);d.useEffect(()=>{f.current=t},[t]),d.useEffect(()=>{p.current=r},[r]);const _=d.useMemo(()=>[...a].sort().join("|"),[a]);d.useEffect(()=>{if(n==null||a.length===0)return;const c=[],l=new Set,v=()=>{if(p.current==null)return;const y=Date.now();y-g.current<5e3||(g.current=y,p.current())};return a.forEach(y=>{const[h,B]=ts(y);if(B==="")return;const T=n.channel(h),L=u=>{f.current(B,u)};let C;if(T?.subscribed===!0)C=T,C.bind(B,L),l.has(h)||(l.add(h),v()),c.push(()=>{T.unbind(B,L)});else{if(C=T??n.subscribe(h),C.bind(B,L),!l.has(h)){l.add(h);const u=()=>{v()};C.bind("pusher:subscription_succeeded",u),c.push(()=>{C.unbind("pusher:subscription_succeeded",u)})}c.push(()=>{C.unbind(B,L)})}}),()=>{c.forEach(y=>y())}},[n,_])},An="charge-card-transaction-update",En="charge-card-transaction-created",kn="charge-card-transaction-declined",_n="charge-card-transaction-updated",Dn="charge-card-transaction-receipt-uploaded",aa="charge-card-status-update",Et="charge-card-spending-updated",Ka="credit-account-balance-updated",qa="charge-card-created",kt="charge-card-limit-updated",_t="charge-card-limit-reset",Dt="charge-card-renamed",xs="charge-card-department-updated",Pn="charge-card-repayment-completed",wn="charge-card-payment-date-updated",ka="charge-card-cashback-redeemed",_a="charge-card-cashback-earned",ta=(e,a)=>e==null||e===""?[]:a.map(t=>`private-encrypted-${e}.${t}`),Bs=[_a,ka],Ls=he(function(e){const a=Xe(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(a,t)=>{e(Un({uiState:{sortKey:a,sortOrder:t}}))}}})(rs);function Rs(){const e=me(),a=Ce(),t=Se(),r=ee.getSignedInUser(),n=S(B=>de(B)),{useFeatureGate:f}=oe(),{isFeatureEnabled:p}=f(Z.isCardsCommentingEnabled),[g,_]=d.useState(!1),c=S(B=>Xe(B)),l=Sn(n.companyId,{clearParams:c.fetchState==="Completed"}),v=d.useCallback(()=>{const B=Re(t.state?.pathnameStackToGoBack),T=B.poppedPathname??Us(n.tenantEmailDomain);e(T,{state:{pathnameStackToGoBack:B.newStack}})},[e,t,n.tenantEmailDomain]),y=$e(n);if(At({events:ta(y,Bs),onEvent:B=>{switch(B){case _a:case ka:return void a(ha(!0))}},onSubscribed:()=>{a(ha(!0))}}),d.useEffect(()=>{g||c.fetchState==="Completed"||c.fetchState==="In-Progress"||(_(!0),a(ha()))},[g,c,a]),r==null)throw Error("Can't access cashback detail page without signing in...");const h=c.cashbackSummary?.cashbackEarned?.amount!=null&&c.fetchState!=="Not-Started";return c.fetchState!=="In-Progress"||h?(c.cashbackSummary?.cashbackEarned?.amount??0)===0&&c.fetchState==="Completed"?s.jsx(Wa,{}):s.jsx(Ls,{onBackClick:v,isCardsCommentingEnabled:p,initialOpenThreadRequest:l}):s.jsx(ns,{onBackClick:v})}const Us=e=>`/${e}/cards`,Os={containerWidth:new Aa(100,58)},js=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p}=oe(),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,B]=d.useState(!1),T=ee.getSignedInUser();if(T==null)throw Error("Can't access onboarding card page without signing in...");const L=S(w=>de(w));if(n==null)throw Error("Empty card id is not valid...");const{configValue:C}=p(Le.zeniCardsConfig),u=C.max_charge_card_activation_attempts_by_card_id,D=S(w=>On(w,n)),o=D.chargeCard,I=S(w=>w.chargeCardConfigState.fetchState),{useFeatureGate:A}=oe(),{isFeatureEnabled:j}=A(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=A(Z.isDebitCardFeatureEnabled),b=Ee(E,L),x=ke({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:b}),i=!!L.companyChargeCardInfo?.info?.isChargeCardEnabled,m=L.userRole.includes("charge_card_user"),U=Ie(L),M=Ae(L),R=L.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,F=_e({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:j,isBookKeepingTenant:M,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:R}),G=!m&&F&&i;d.useEffect(()=>{g===!1&&I!=="In-Progress"&&I!=="Completed"&&(t(Va()),_(!0)),c===!1&&D.fetchState==="Not-Started"&&(l(!0),t(ca(n,G,F)))},[c,D.fetchState,g,I]);const $=o?.type.code==="business_physical_credit_card"||o?.type.code==="business_physical_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(v===!1&&($===!1||$&&o?.status?.code!=="inactive"||o?.cardHolderUserId!==T.userId)){const w=pe(L.tenantEmailDomain,n,T,o,!0),O=ye(f.state?.pathnameStackToGoBack,f.pathname);r(w,{state:{pathnameStackToGoBack:O}})}else if(v&&D.isRefreshingViewInBackground===!1&&o?.status?.code==="active"){t(jn({chargeCardId:n}));const w=pe(L.tenantEmailDomain,n,T,o,!0),O=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(w,{state:{pathnameStackToGoBack:O}})}}},[D.fetchState,o?.type.code,v,D.isRefreshingViewInBackground]);const V=ee.getZeniOtpTokenForCardHolder(n),P=S(w=>Nt(w.userState,T.userId)),Y=()=>{o?.status?.code!=="active"&&t(na(n,!0))};d.useEffect(()=>{D.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&o?.cardActivationAttemptHistory.some(w=>w.statusCode==="success")===!0&&v===!1&&(setTimeout(Y,3e3),y(!0))},[D.updatePhysicalChargeCardAttemptFetchState.fetchState,o?.cardActivationAttemptHistory]);const J=w=>{B(w)};if(I!=="Completed"||o==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(o.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Hs,{children:[s.jsx(Ke,{isAppContentDrawerOpen:h,handleDrawerToggle:J}),s.jsx(Vs,{cardId:n,card:o,shippingAddressId:o.shippingAddressId,phone:P.phone,signedInUser:T,isSandboxEnv:ht(),chargeCardDetailState:D,signedInUserToken:V,navigate:r,currentTenant:L,location:f,maxChargeCardActivationAttempts:u[n]!=null?u[n]:C.default_max_charge_card_activation_attempts!=null?C.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{J(!0)}}),e!=null?s.jsx(Ns,{windowSize:a,children:e}):null]})},Vs=he(function(e,{chargeCardDetailState:a,shippingAddressId:t,location:r,cardId:n}){const f=Vn(e.addressState,t);if(f==null)throw Error("Can't access shippingAddress.");const p=Ht(e,n),g=a.updateStatus,_=ea(e,!1,!1,!1);let c=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(c=!0);const l=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Nn())||l,showMenuIcon:c,shippingAddress:f,vgsVaultId:Za.cardVaultId,twoFAView:p,activationWaitStatus:g,isRefreshingViewInBackground:a.isRefreshingViewInBackground}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,chargeCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e(Ga(c,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:c=>{e(Mn(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ha(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onCVVActivateSuccess:()=>{e(Hn({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("onboard")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(ss),Ns=Fe.div`
1
+ import{j as s}from"./liveblocks-BiGkkGoP.js";import{h as me,i as ba,u as Ce,j as S,g as Se,n as he,N as Ta,s as jt,o as Rn,p as se}from"./core-DYij5xsh.js";import{eQ as de,bs as He,Pf as ja,eZ as Ie,e_ as Ae,e$ as Ee,fU as qe,cs as Je,Pg as Qe,Ph as lt,tw as xa,jP as Ba,Pi as La,gU as pa,A0 as ca,A2 as Ne,A3 as ut,jF as Vt,Pj as Xe,zQ as ha,Pk as Un,Pl as On,zT as Va,Pm as jn,NF as Na,rI as Nt,zZ as na,h3 as Vn,Pn as Ht,Po as ea,bq as Nn,Pp as Hn,fF as Ha,fE as Ma,Ax as Mn,fD as Ga,Nl as Gn,Pq as Mt,cl as Gt,cM as $n,NE as ya,B7 as $t,Pr as Ft,AJ as fa,Ps as zt,B8 as zn,O4 as Zn,B9 as Yn,C3 as Wn,sS as Kn,BZ as qn,Pt as Jn,A1 as Ye,Pu as Qn,Pv as Xn,Pw as er,Px as ar,Py as tr,Pz as mt,PA as nr,Ai as Zt,Ab as rr,PB as sr,fW as cr,Ar as Yt,Av as Wt,fV as or,PC as ir,AV as Kt,PD as dr,PE as lr,PF as ur,At as qt,Ae as Jt,zW as Qt,An as Xt,Al as en,Ap as mr,PG as an,PH as $a,AG as ga,Kk as tn,cN as Ct,PI as Cr,PJ as pr,PK as hr,PL as fr,AD as st,B0 as gr,AY as br,Az as yr,A_ as Sr,AQ as Ir,AS as Ar,PM as nn,B6 as Fa,HJ as Er,PN as kr,PO as _r,PP as Dr,PQ as rn,PR as Pr,Bt as wr,AI as sn,AC as ve,AH as vr,PS as Fr,PT as Tr,zN as xr,PU as cn,PV as on,PW as Br,zP as Lr,zO as Tt,PX as Rr,PY as Ur,PZ as Or,Kg as jr,P_ as pt,P$ as Vr,wo as dn,kn as Nr,gV as Hr,By as Mr,Q0 as ln,Q1 as Gr,Bz as $r,Q2 as zr,de as Zr,tq as Yr,Bo as Wr,Bi as Ve,bt as Kr,bF as qr,cx as Jr,bG as Qr,Jt as Xr}from"./zeni-epic-state-YenBAkdY.js";import{z as ee,A as Ge,n as oe,c as Z,B as Sa,c2 as za,cd as es,ce as as,cf as ts,p as Re,cg as ns,ch as rs,k as Ia,aN as Le,r as ye,bm as ht,ci as ss,y as Aa,i as Za,h as ft,d as q,D as gt,a7 as Ya,cj as cs,Z as un,aq as bt,by as ra,ck as ct,cl as os,x as yt,cm as is,at as mn,a2 as ot,W as Cn,f as pn,cn as ds,co as ls,cp as us,cq as ms,cr as Cs,cs as ps,o as Ra,ct as hs,cu as fs,cv as at,v as gs,cw as bs,cx as ys,cy as Ss,cz as Is,cA as As,a9 as Es}from"./index-CPHDDMJD.js";import{n as Fe,D as hn,S as ks}from"./mui-CdvNR06J.js";import{a as d}from"./sentry-DQGl2YSn.js";import{g as pe,a as Ea,b as fn,c as ke,d as _e,e as Me,f as $e,h as ze,A as _s,i as St,P as Ds,j as It,s as sa,k as gn,l as We,m as bn,n as Ps,o as yn,p as ws,S as xt}from"./SetupPagesScreen-DE1Mdjhy.js";import{u as Sn}from"./useInitialThreadRequest-DhlqNdmZ.js";import Wa from"./NotFoundScreen-CgebWRjN.js";import{M as Ke}from"./MobileAppDrawer-BmawIQiO.js";import{u as In}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{v as Bt}from"./utils-BCjesvPZ.js";import{d as vs}from"./recharts-D0oa1BQl.js";import{t as Fs}from"./AddressScreen-qDs8FTIM.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./analyticsHelper-BjBUUOIH.js";import"./routePaths-BZSOS5PJ.js";import"./BusinessVerificationPageScreen-DmTGb48M.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]="9341f246-6d63-4cce-89af-0f3dbd2c1438",e._sentryDebugIdIdentifier="sentry-dbid-9341f246-6d63-4cce-89af-0f3dbd2c1438")}catch{}})();function Ts(){const e=me(),{cardId:a}=ba(),t=Ce(),r=ee.getSignedInUser(),n=S(W=>de(W)),f=Ge(),p=He(f?.loggedInUserRoleMap),{useFeatureGate:g}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[_,c]=d.useState(!1),l=S(W=>ja(W).firstViewAfterActivation);if(a==null)throw Error("Empty card id is not valid...");const v=n.userRole.includes("charge_card_user"),{isFeatureEnabled:y}=g(Z.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=g(Z.isDebitCardFeatureEnabled),T=Ie(n),L=Ae(n),C=Ee(B,n),u=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=ke({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:C}),o=_e({isCardsOnlyTenant:T,isChargeCardFeatureEnabled:y,isBookKeepingTenant:L,isDebitCardProductVisible:D,chargeCardsCreditAccountLimit:u}),I=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,A=S(W=>qe(W,n.companyId)),j=Je(A.controllers),{creditAccount:E,creditAccountRepayment:b}=S(W=>Qe(W)),x=S(W=>W.classListState.fetchState),i=!v&&o&&h,m=S(W=>lt(W,a,i,o)),[U,M]=d.useState(!1),R=m.chargeCard,F=R?.cardCreatedByUser?.userId,G=S(W=>F!=null?xa(W.userRoleState,F):void 0),$=G?.accountingClassIDs[0],V=S(W=>$!=null?Ba(W.classState,{classId:$,reportId:"class_list"}):void 0),P=R?.cardHolderUser?.userId,Y=S(W=>P!=null?xa(W.userRoleState,P):void 0),J=Y?.accountingClassIDs[0],w=S(W=>J!=null?Ba(W.classState,{classId:J,reportId:"class_list"}):void 0),O=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",te=R?.type.code==="business_physical_debit_card";d.useEffect(()=>{l&&_===!1&&O&&(c(!0),setTimeout(()=>{t(La()),te&&t(pa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[l,_,O,te]),d.useEffect(()=>{U||m.fetchState==="Completed"||m.fetchState==="In-Progress"||a==null||(M(!0),t(ca(a,i,!1)))},[U,m,a,t]),d.useEffect(()=>{if(m.fetchState==="Completed"&&(O===!1||O&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||l===!1&&_===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const W=pe(n.tenantEmailDomain,a,r,R,l);e(W)}},[m.fetchState,l,O]),d.useEffect(()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&o&&h&&p&&t(Ne()),b.fetchState!=="Completed"&&b.fetchState!=="In-Progress"&&o&&h&&p&&t(ut()),x!=="Completed"&&x!=="In-Progress"&&t(Vt())},[E.fetchState,b.fetchState,t,o,h,p,x]);const ae=()=>{if(r!=null&&a!=null){t(La());const W=pe(n.tenantEmailDomain,a,r);e(W)}},k=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",z=Me(o,D,I,h),Q=Ea(o,h,p,E,b),X=fn(k,m);return m.fetchState!=="Completed"?s.jsx(Sa,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(za,{showConfetti:l}),s.jsx(es,{onGotItClick:ae,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:o,isDebitCardFeatureEnabled:D,isDebitCardSetupEnabled:I,isChargeCardSetupEnabled:h,productInformation:z,creditAccountInformation:Q,debitAccountInformation:X,chargeCardDetailView:m,creditAccount:E,classListFetchState:x,creditAccountRepayment:b,cardIssuedByRoles:G?.userRoles,cardIssuedByDepartmentName:V?.className,cardHolderRoles:Y?.userRoles,cardHolderDepartmentName:w?.className})]})}const At=e=>{const{events:a,onEvent:t,onSubscribed:r}=e,n=as(),f=d.useRef(t),p=d.useRef(r),g=d.useRef(0);d.useEffect(()=>{f.current=t},[t]),d.useEffect(()=>{p.current=r},[r]);const _=d.useMemo(()=>[...a].sort().join("|"),[a]);d.useEffect(()=>{if(n==null||a.length===0)return;const c=[],l=new Set,v=()=>{if(p.current==null)return;const y=Date.now();y-g.current<5e3||(g.current=y,p.current())};return a.forEach(y=>{const[h,B]=ts(y);if(B==="")return;const T=n.channel(h),L=u=>{f.current(B,u)};let C;if(T?.subscribed===!0)C=T,C.bind(B,L),l.has(h)||(l.add(h),v()),c.push(()=>{T.unbind(B,L)});else{if(C=T??n.subscribe(h),C.bind(B,L),!l.has(h)){l.add(h);const u=()=>{v()};C.bind("pusher:subscription_succeeded",u),c.push(()=>{C.unbind("pusher:subscription_succeeded",u)})}c.push(()=>{C.unbind(B,L)})}}),()=>{c.forEach(y=>y())}},[n,_])},An="charge-card-transaction-update",En="charge-card-transaction-created",kn="charge-card-transaction-declined",_n="charge-card-transaction-updated",Dn="charge-card-transaction-receipt-uploaded",aa="charge-card-status-update",Et="charge-card-spending-updated",Ka="credit-account-balance-updated",qa="charge-card-created",kt="charge-card-limit-updated",_t="charge-card-limit-reset",Dt="charge-card-renamed",xs="charge-card-department-updated",Pn="charge-card-repayment-completed",wn="charge-card-payment-date-updated",ka="charge-card-cashback-redeemed",_a="charge-card-cashback-earned",ta=(e,a)=>e==null||e===""?[]:a.map(t=>`private-encrypted-${e}.${t}`),Bs=[_a,ka],Ls=he(function(e){const a=Xe(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(a,t)=>{e(Un({uiState:{sortKey:a,sortOrder:t}}))}}})(rs);function Rs(){const e=me(),a=Ce(),t=Se(),r=ee.getSignedInUser(),n=S(B=>de(B)),{useFeatureGate:f}=oe(),{isFeatureEnabled:p}=f(Z.isCardsCommentingEnabled),[g,_]=d.useState(!1),c=S(B=>Xe(B)),l=Sn(n.companyId,{clearParams:c.fetchState==="Completed"}),v=d.useCallback(()=>{const B=Re(t.state?.pathnameStackToGoBack),T=B.poppedPathname??Us(n.tenantEmailDomain);e(T,{state:{pathnameStackToGoBack:B.newStack}})},[e,t,n.tenantEmailDomain]),y=$e(n);if(At({events:ta(y,Bs),onEvent:B=>{switch(B){case _a:case ka:return void a(ha(!0))}},onSubscribed:()=>{a(ha(!0))}}),d.useEffect(()=>{g||c.fetchState==="Completed"||c.fetchState==="In-Progress"||(_(!0),a(ha()))},[g,c,a]),r==null)throw Error("Can't access cashback detail page without signing in...");const h=c.cashbackSummary?.cashbackEarned?.amount!=null&&c.fetchState!=="Not-Started";return c.fetchState!=="In-Progress"||h?(c.cashbackSummary?.cashbackEarned?.amount??0)===0&&c.fetchState==="Completed"?s.jsx(Wa,{}):s.jsx(Ls,{onBackClick:v,isCardsCommentingEnabled:p,initialOpenThreadRequest:l}):s.jsx(ns,{onBackClick:v})}const Us=e=>`/${e}/cards`,Os={containerWidth:new Aa(100,58)},js=({appContent:e})=>{const a=Ia(),t=Ce(),r=me(),{cardId:n}=ba(),f=Se(),{useDynamicConfig:p}=oe(),[g,_]=d.useState(!1),[c,l]=d.useState(!1),[v,y]=d.useState(!1),[h,B]=d.useState(!1),T=ee.getSignedInUser();if(T==null)throw Error("Can't access onboarding card page without signing in...");const L=S(w=>de(w));if(n==null)throw Error("Empty card id is not valid...");const{configValue:C}=p(Le.zeniCardsConfig),u=C.max_charge_card_activation_attempts_by_card_id,D=S(w=>On(w,n)),o=D.chargeCard,I=S(w=>w.chargeCardConfigState.fetchState),{useFeatureGate:A}=oe(),{isFeatureEnabled:j}=A(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=A(Z.isDebitCardFeatureEnabled),b=Ee(E,L),x=ke({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:b}),i=!!L.companyChargeCardInfo?.info?.isChargeCardEnabled,m=L.userRole.includes("charge_card_user"),U=Ie(L),M=Ae(L),R=L.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,F=_e({isCardsOnlyTenant:U,isChargeCardFeatureEnabled:j,isBookKeepingTenant:M,isDebitCardProductVisible:x,chargeCardsCreditAccountLimit:R}),G=!m&&F&&i;d.useEffect(()=>{g===!1&&I!=="In-Progress"&&I!=="Completed"&&(t(Va()),_(!0)),c===!1&&D.fetchState==="Not-Started"&&(l(!0),t(ca(n,G,F)))},[c,D.fetchState,g,I]);const $=o?.type.code==="business_physical_credit_card"||o?.type.code==="business_physical_debit_card";d.useEffect(()=>{if(D.fetchState==="Completed"){if(v===!1&&($===!1||$&&o?.status?.code!=="inactive"||o?.cardHolderUserId!==T.userId)){const w=pe(L.tenantEmailDomain,n,T,o,!0),O=ye(f.state?.pathnameStackToGoBack,f.pathname);r(w,{state:{pathnameStackToGoBack:O}})}else if(v&&D.isRefreshingViewInBackground===!1&&o?.status?.code==="active"){t(jn({chargeCardId:n}));const w=pe(L.tenantEmailDomain,n,T,o,!0),O=ye(f.state?.pathnameStackToGoBack,f.pathname);t(Na()),r(w,{state:{pathnameStackToGoBack:O}})}}},[D.fetchState,o?.type.code,v,D.isRefreshingViewInBackground]);const V=ee.getZeniOtpTokenForCardHolder(n),P=S(w=>Nt(w.userState,T.userId)),Y=()=>{o?.status?.code!=="active"&&t(na(n,!0))};d.useEffect(()=>{D.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&o?.cardActivationAttemptHistory.some(w=>w.statusCode==="success")===!0&&v===!1&&(setTimeout(Y,3e3),y(!0))},[D.updatePhysicalChargeCardAttemptFetchState.fetchState,o?.cardActivationAttemptHistory]);const J=w=>{B(w)};if(I!=="Completed"||o==null)return s.jsx(Sa,{fetchState:"In-Progress"});if(o.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Hs,{children:[s.jsx(Ke,{isAppContentDrawerOpen:h,handleDrawerToggle:J}),s.jsx(Vs,{cardId:n,card:o,shippingAddressId:o.shippingAddressId,phone:P.phone,signedInUser:T,isSandboxEnv:ht(),chargeCardDetailState:D,signedInUserToken:V,navigate:r,currentTenant:L,location:f,maxChargeCardActivationAttempts:u[n]!=null?u[n]:C.default_max_charge_card_activation_attempts!=null?C.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{J(!0)}}),e!=null?s.jsx(Ns,{windowSize:a,children:e}):null]})},Vs=he(function(e,{chargeCardDetailState:a,shippingAddressId:t,location:r,cardId:n}){const f=Vn(e.addressState,t);if(f==null)throw Error("Can't access shippingAddress.");const p=Ht(e,n),g=a.updateStatus,_=ea(e,!1,!1,!1);let c=!1;_.fetchState==="Completed"&&_.cards.length<=1&&(c=!0);const l=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Nn())||l,showMenuIcon:c,shippingAddress:f,vgsVaultId:Za.cardVaultId,twoFAView:p,activationWaitStatus:g,isRefreshingViewInBackground:a.isRefreshingViewInBackground}},function(e,a){const{navigate:t,cardId:r,location:n,currentTenant:f,chargeCardDetailState:p}=a,g=p.chargeCard?.cardProviderID,{tenantEmailDomain:_}=f;return{onGetOtp:c=>{g!=null&&e(Ga(c,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:c=>{e(Mn(r,c))},onResendOtp:c=>{g!=null&&e(Ma(c,"ChargeCardHolder",r))},onVerifyOtp:(c,l)=>{g!=null&&e(Ha(c,l,"ChargeCardHolder",r))},onVerifyOtpSuccess:c=>{c!=null&&ee.saveZeniOtpTokenForCardHolder(c,r)},onCVVActivateSuccess:()=>{e(Hn({chargeCardId:r}))},onBackClick:()=>{const c=Re(n.state?.pathnameStackToGoBack),l=c.poppedPathname==null||c.poppedPathname.includes("onboard")===!0?ze(_):c.poppedPathname;t(l,{state:{pathnameStackToGoBack:c.newStack}})}}})(ss),Ns=Fe.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Os.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-BiGkkGoP.js";import{a as g}from"./sentry-DQGl2YSn.js";import{h as w,u as T,g as x,i as k,j as O,n as E}from"./core-DYij5xsh.js";import{z as N,b7 as F,x as P,d as L,f as V,af as b,b8 as A,at as j,au as M,r as U}from"./index-BCP41PwF.js";import{eQ as h,fH as B,sh as _,fC as R,c2 as z,MK as G,bn as q,qp as H,qd as Y,kf as K,lL as S,ML as Q,bE as W,cv as C,lT as Z,lW as $}from"./zeni-epic-state-YenBAkdY.js";import"./mui-CdvNR06J.js";import{d as J}from"./routePaths-jIme_4o7.js";import{M as X}from"./MobileAppDrawer-Biso_61t.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="ed27b8fb-224b-4e43-9cc0-d040ed4c13aa",t._sentryDebugIdIdentifier="sentry-dbid-ed27b8fb-224b-4e43-9cc0-d040ed4c13aa")}catch{}})();const ee=E(function(t){const a=R(t),i=N.getSignedInUser(),l=h(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${j.fileMicroServiceBaseUrl}`,isZeniUser:q(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t($())},onAddressClick:e=>{const n=J(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(Z({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:D}=r,v={companyInfo:{...n,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?W(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:D.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(Q(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(K({files:e}))},onDeleteFile:e=>{t(Y(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}})(A);function de(){const t=w(),a=T(),i=x(),{tenantEmailDomain:l}=k(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>h(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-BiGkkGoP.js";import{a as g}from"./sentry-DQGl2YSn.js";import{h as w,u as T,g as x,i as k,j as O,n as E}from"./core-DYij5xsh.js";import{z as N,b7 as F,x as P,d as L,f as V,af as b,b8 as A,at as j,au as M,r as U}from"./index-CPHDDMJD.js";import{eQ as h,fH as B,sh as _,fC as R,c2 as z,MK as G,bn as q,qp as H,qd as Y,kf as K,lL as S,ML as Q,bE as W,cv as C,lT as Z,lW as $}from"./zeni-epic-state-YenBAkdY.js";import"./mui-CdvNR06J.js";import{d as J}from"./routePaths-BZSOS5PJ.js";import{M as X}from"./MobileAppDrawer-BmawIQiO.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="ed27b8fb-224b-4e43-9cc0-d040ed4c13aa",t._sentryDebugIdIdentifier="sentry-dbid-ed27b8fb-224b-4e43-9cc0-d040ed4c13aa")}catch{}})();const ee=E(function(t){const a=R(t),i=N.getSignedInUser(),l=h(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${j.fileMicroServiceBaseUrl}`,isZeniUser:q(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t($())},onAddressClick:e=>{const n=J(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(Z({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:D}=r,v={companyInfo:{...n,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?W(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:D.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(Q(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(K({files:e}))},onDeleteFile:e=>{t(Y(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}})(A);function de(){const t=w(),a=T(),i=x(),{tenantEmailDomain:l}=k(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>h(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-BiGkkGoP.js";import{a}from"./sentry-DQGl2YSn.js";import{u as D,g as w,j as u,N as v}from"./core-DYij5xsh.js";import{Jp as A,eQ as O,fp as j,mX as U,fQ as h,fo as _,eX as L,Jw as F}from"./zeni-epic-state-YenBAkdY.js";import{u as $,z as p,L as g,D as k,o as H}from"./index-BCP41PwF.js";import{n as Q}from"./mui-CdvNR06J.js";import{t as z}from"./getLocaleForTenant-DwUbw-k6.js";import{g as R,Q as J}from"./QBOConnectionScreen-CmHLrNN0.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./empty-zLrsqSwy.js";import"./pdf-lib-CUEF9aFq.js";import"./index-C2zxt7CG.js";import"./url-DRf0E0e8.js";import"./index-3OE7eXoF.js";import"./decodeURIComponentSafe-CSUd4Wt5.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]="2ab73b13-1582-4c88-a6ba-5ec9177d7876",t._sentryDebugIdIdentifier="sentry-dbid-2ab73b13-1582-4c88-a6ba-5ec9177d7876")}catch{}})();const P=Q.div`
1
+ import{j as C}from"./liveblocks-BiGkkGoP.js";import{a}from"./sentry-DQGl2YSn.js";import{u as D,g as w,j as u,N as v}from"./core-DYij5xsh.js";import{Jp as A,eQ as O,fp as j,mX as U,fQ as h,fo as _,eX as L,Jw as F}from"./zeni-epic-state-YenBAkdY.js";import{u as $,z as p,L as g,D as k,o as H}from"./index-CPHDDMJD.js";import{n as Q}from"./mui-CdvNR06J.js";import{t as z}from"./getLocaleForTenant-DYNL1b9l.js";import{g as R,Q as J}from"./QBOConnectionScreen-Jf2FDuvS.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./empty-zLrsqSwy.js";import"./pdf-lib-CUEF9aFq.js";import"./index-C2zxt7CG.js";import"./url-DRf0E0e8.js";import"./index-3OE7eXoF.js";import"./decodeURIComponentSafe-CSUd4Wt5.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]="2ab73b13-1582-4c88-a6ba-5ec9177d7876",t._sentryDebugIdIdentifier="sentry-dbid-2ab73b13-1582-4c88-a6ba-5ec9177d7876")}catch{}})();const P=Q.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-BiGkkGoP.js";import{z as n}from"./index-BCP41PwF.js";import{g as d}from"./QBOConnectionScreen-CmHLrNN0.js";import"./sentry-DQGl2YSn.js";import{g as p,N as a}from"./core-DYij5xsh.js";import"./zeni-epic-state-YenBAkdY.js";import"./recharts-D0oa1BQl.js";import"./mui-CdvNR06J.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./empty-zLrsqSwy.js";import"./pdf-lib-CUEF9aFq.js";import"./index-C2zxt7CG.js";import"./url-DRf0E0e8.js";import"./index-3OE7eXoF.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e53e9b9f-4e1e-4d41-afae-a46e42efc4b3",e._sentryDebugIdIdentifier="sentry-dbid-e53e9b9f-4e1e-4d41-afae-a46e42efc4b3")}catch{}})();const U=()=>{const e=p(),{code:t,realmId:o,state:r}=d(e.search),s=n.getSignedInUser()?.userId??"";if(f(t,o,r,s)===!0){const m=`../../${r}/onboarding?code=${t}&realmId=${o}&state=auth_flow`;return i.jsx(a,{to:m})}return i.jsx(a,{to:"../../"})},f=(e,t,o,r)=>e!=""&&t!=""&&o!=""&&r!=null&&r!="";export{U as default,f as hasValidParams};
1
+ import{j as i}from"./liveblocks-BiGkkGoP.js";import{z as n}from"./index-CPHDDMJD.js";import{g as d}from"./QBOConnectionScreen-Jf2FDuvS.js";import"./sentry-DQGl2YSn.js";import{g as p,N as a}from"./core-DYij5xsh.js";import"./zeni-epic-state-YenBAkdY.js";import"./recharts-D0oa1BQl.js";import"./mui-CdvNR06J.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./empty-zLrsqSwy.js";import"./pdf-lib-CUEF9aFq.js";import"./index-C2zxt7CG.js";import"./url-DRf0E0e8.js";import"./index-3OE7eXoF.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e53e9b9f-4e1e-4d41-afae-a46e42efc4b3",e._sentryDebugIdIdentifier="sentry-dbid-e53e9b9f-4e1e-4d41-afae-a46e42efc4b3")}catch{}})();const U=()=>{const e=p(),{code:t,realmId:o,state:r}=d(e.search),s=n.getSignedInUser()?.userId??"";if(f(t,o,r,s)===!0){const m=`../../${r}/onboarding?code=${t}&realmId=${o}&state=auth_flow`;return i.jsx(a,{to:m})}return i.jsx(a,{to:"../../"})},f=(e,t,o,r)=>e!=""&&t!=""&&o!=""&&r!=null&&r!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BiGkkGoP.js";import{t as $e,A as Ce}from"./AddressScreen-t45pXVvS.js";import Ke from"./NotFoundScreen-C0-Skng9.js";import{a as g}from"./sentry-DQGl2YSn.js";import{h as se,g as oe,u as ie,i as re,j as D,N as E,n as ce,l as ze,o as Me,p as z}from"./core-DYij5xsh.js";import{v as de,A as le,z as B,n as ue,h as qe,c as _,r as V,x as J,d as N,B as je,f as X,ap as Qe,k as Ze,aq as ke,i as te,ar as He,as as Ie,o as Je,at as We,au as Ee,av as Xe}from"./index-BCP41PwF.js";import{bn as Ye,eQ as ee,fh as et,e$ as pe,eZ as me,bt as tt,mV as at,fd as nt,bO as st,jj as ae,jm as ve,JV as ot,bT as it,c2 as ge,sv as fe,sg as rt,Kp as Y,sw as _e,HN as ct,kn as Ue,Kq as Ve,Kr as dt,Ks as lt,Kt as ut,jh as pt,jk as mt,si as Be,su as gt,bE as Te,cv as ft,sI as xe,qp as ht,qd as yt,kf as bt,fF as St,fE as Ct,fD as kt,Ku as It,sa as Et,sJ as Tt,sM as xt,sP as Ot,sV as Pt,cT as At}from"./zeni-epic-state-YenBAkdY.js";import{n as he}from"./mui-CdvNR06J.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-CmHLrNN0.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./empty-zLrsqSwy.js";import"./pdf-lib-CUEF9aFq.js";import"./index-C2zxt7CG.js";import"./url-DRf0E0e8.js";import"./index-3OE7eXoF.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="7bab9640-f08f-4475-81b2-f0473c66a61e",t._sentryDebugIdIdentifier="sentry-dbid-7bab9640-f08f-4475-81b2-f0473c66a61e")}catch{}})();const wt=ce(function(t,s){const o=[];s.isApAgingFeatureEnabled===!1&&o.push("accounts_payable_aging"),s.isArAgingFeatureEnabled===!1&&o.push("accounts_receivable_aging"),s.shouldFetchZeniAccountsPromoCard===!1&&o.push("zeni_accounts_promo_card"),s.shouldFetchRewardsPlanCard===!1&&o.push("rewards_card"),s.isExpenseAutomationEnabledForUser===!1&&o.push("expense_automation_card");const u=nt(t,o,s.signedInUser,s.isExpenseAutomationFeatureEnabledV2,s.isExpenseAutomationEnabledForUser,s.isTreasuryEnabled);return{dashboardFetchState:st(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,s){const{themeState:o,navigate:u,location:d}=s;return{onZeniLogoClick:()=>{o.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),jt=()=>{const t=se(),s=oe(),o=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=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),S=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),P=me(c),A=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,K=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&A.push("top_expenses"),K===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),k===!1&&A.push("zeni_accounts_promo_card"),h===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),o(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,o]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{b(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(s.state?.pathnameStackToGoBack,s.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:s,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-BiGkkGoP.js";import{t as $e,A as Ce}from"./AddressScreen-qDs8FTIM.js";import Ke from"./NotFoundScreen-CgebWRjN.js";import{a as g}from"./sentry-DQGl2YSn.js";import{h as se,g as oe,u as ie,i as re,j as D,N as E,n as ce,l as ze,o as Me,p as z}from"./core-DYij5xsh.js";import{v as de,A as le,z as B,n as ue,h as qe,c as _,r as V,x as J,d as N,B as je,f as X,ap as Qe,k as Ze,aq as ke,i as te,ar as He,as as Ie,o as Je,at as We,au as Ee,av as Xe}from"./index-CPHDDMJD.js";import{bn as Ye,eQ as ee,fh as et,e$ as pe,eZ as me,bt as tt,mV as at,fd as nt,bO as st,jj as ae,jm as ve,JV as ot,bT as it,c2 as ge,sv as fe,sg as rt,Kp as Y,sw as _e,HN as ct,kn as Ue,Kq as Ve,Kr as dt,Ks as lt,Kt as ut,jh as pt,jk as mt,si as Be,su as gt,bE as Te,cv as ft,sI as xe,qp as ht,qd as yt,kf as bt,fF as St,fE as Ct,fD as kt,Ku as It,sa as Et,sJ as Tt,sM as xt,sP as Ot,sV as Pt,cT as At}from"./zeni-epic-state-YenBAkdY.js";import{n as he}from"./mui-CdvNR06J.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-Jf2FDuvS.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./empty-zLrsqSwy.js";import"./pdf-lib-CUEF9aFq.js";import"./index-C2zxt7CG.js";import"./url-DRf0E0e8.js";import"./index-3OE7eXoF.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="7bab9640-f08f-4475-81b2-f0473c66a61e",t._sentryDebugIdIdentifier="sentry-dbid-7bab9640-f08f-4475-81b2-f0473c66a61e")}catch{}})();const wt=ce(function(t,s){const o=[];s.isApAgingFeatureEnabled===!1&&o.push("accounts_payable_aging"),s.isArAgingFeatureEnabled===!1&&o.push("accounts_receivable_aging"),s.shouldFetchZeniAccountsPromoCard===!1&&o.push("zeni_accounts_promo_card"),s.shouldFetchRewardsPlanCard===!1&&o.push("rewards_card"),s.isExpenseAutomationEnabledForUser===!1&&o.push("expense_automation_card");const u=nt(t,o,s.signedInUser,s.isExpenseAutomationFeatureEnabledV2,s.isExpenseAutomationEnabledForUser,s.isTreasuryEnabled);return{dashboardFetchState:st(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,s){const{themeState:o,navigate:u,location:d}=s;return{onZeniLogoClick:()=>{o.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),jt=()=>{const t=se(),s=oe(),o=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=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),S=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),P=me(c),A=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,K=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&A.push("top_expenses"),K===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),k===!1&&A.push("zeni_accounts_promo_card"),h===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),o(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,o]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{b(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(s.state?.pathnameStackToGoBack,s.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:s,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,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-BiGkkGoP.js";import{i as K,j as _,g as H,u as z,h as W,n as te,k as oa,o as gt,p as F}from"./core-DYij5xsh.js";import{eQ as U,KK as Xe,bE as sa,bq as xe,LX as In,i7 as Tn,LY as Nt,LZ as xn,ia as bt,L_ as Qe,L$ as Dn,ig as wn,M0 as $t,M1 as Fn,ik as Ct,M2 as He,M3 as On,cl as St,M4 as Pn,M5 as Mn,L2 as Rn,jd as Bn,M6 as jn,bn as Ge,M7 as ra,Ky as ce,bc as ia,jr as ca,n3 as la,ja as da,KA as le,Kz as ee,eP as ua,eV as Ln,fr as kt,M8 as Un,M9 as Gn,Ma as ma,Mb as Re,un as Ye,uo as Ve,uL as De,uF as de,us as Ne,Mc as Yn,Md as Vn,Me as Nn,Mf as pa,Mg as Be,Mh as $n,dE as Je,qZ as ha,Mi as zn,Mj as Kn,Mk as qn,Ml as yt,JX as At,jH as we,uT as vt,r5 as Zn,Mm as Qn,up as zt,r0 as Ie,qY as fa,Mn as ge,Mo as Hn,Mp as Et,JW as It,sZ as ga,Mq as Wn,Mr as Xn,Ms as Jn,Mt as Tt,ta as eo,Mu as to,ur as Kt,sY as ba,Mv as be,Mw as ao,bt as Ca,uX as ka,Mx as no,My as oo,Mz as so,MA as xt,uS as ro,MB as io,uq as qt,uW as _a,MC as Ce,MD as co,ME as lo,MF as Sa,jw as ya,n0 as Aa,jB as va,m_ as Ea,mZ as Ia,mY as Ta,sl as uo,fh as mo,cN as po,cO as ho,mV as fo,fd as go,na as bo,D$ as Zt,MG as Co,MH as ko,MI as _o,MJ as So,b5 as et,f5 as yo,gS as Ao,fH as vo,n4 as Eo,j3 as Io,n1 as To,m$ as xo,e$ as Do,eZ as wo}from"./zeni-epic-state-YenBAkdY.js";import{z as j,a2 as ae,r as D,d as x,D as q,aU as Fo,Z as $e,x as ze,aV as xa,f as N,aW as Oo,A as _e,aX as Da,n as Se,c as R,h as Po,aY as Mo,aZ as Ro,T as wa,k as Fa,a as Oa,Y as Bo,a_ as jo,O as Lo,aN as Pa,$ as se,a$ as Ma,b0 as Ra,a1 as Ba,b1 as Uo,b2 as Go,aq as Yo,p as Vo,W as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-BCP41PwF.js";import{n as Dt}from"./mui-CdvNR06J.js";import{a as b}from"./sentry-DQGl2YSn.js";import{w as ja}from"./withTransactionSidePanel-DYnpLjtY.js";import{c as La,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-jIme_4o7.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import Ue from"./NotFoundScreen-C0-Skng9.js";import{u as Ft}from"./useInitialThreadRequest-Du_koxHd.js";import{t as Ua}from"./analyticsHelper-tq4PT7c_.js";import{C as Zo}from"./CompanyPassportScreen-03cd6rew.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-Duk5q7Ch.js";import{F as Ho}from"./FeaturePreviewScreen-4ttP8nOi.js";import{R as Wo}from"./ReferralListScreen-DGyOm6sF.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./TransactionDetailScreen-BxH3gBsf.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";import"./MobileAppDrawer-Biso_61t.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]="dfccd8e7-5c8f-4f2c-9e26-40250f20aff7",e._sentryDebugIdIdentifier="sentry-dbid-dfccd8e7-5c8f-4f2c-9e26-40250f20aff7")}catch{}})();const Xo=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(y=>y.tenantState.currentTenantId),c=_(y=>U(y)),{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?sa(r):xe(),[r]),p=z(),f=W(),A=_(y=>In(y,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Tn(o,h))},[h]),S=b.useCallback(()=>{f("../../",{relative:"path"})},[]),I=b.useCallback((y,M)=>{p(Nt({sortKey:y,sortOrder:M}))},[]),T=b.useCallback(y=>{p(Nt({downloadState:y}))},[]),L=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(m!=null){const M=La({id:y.transactionId,type:y.transactionType},m);f(M);const X=D(g.state?.pathnameStackToGoBack,g.pathname);f(M,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&x.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(Fo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:x,onTransactionClick:L,onReload:E,onBackClick:S,onColumnSortConfigChanged:I,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Jo=()=>{const e=z(),a=W(),t=_(I=>xn(I)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(I=>I.tenantState.currentTenantId),i=_(I=>U(I)),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??xe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(I=>{e(Qe({searchString:I}))},[]),p=b.useCallback((I,T)=>{e(Qe({sortKey:T,sortOrder:I}))},[]),f=b.useCallback(I=>{a(`./${I}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(I=>{e(Qe({downloadState:I}))},[]),E=b.useCallback((I,T)=>{},[]),S=b.useCallback((I,T)=>{e(Qe({selectedDate:I,agingDateSelectionType:T})),e(bt(I))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:x,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},es=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(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?sa(r):xe(),[r]),h=z(),p=W(),f=_(k=>Dn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(wn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),S=b.useCallback((k,y)=>{h($t({sortKey:k,sortOrder:y}))},[]),I=b.useCallback(k=>{h($t({downloadState:k}))},[]),T=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const y=La({id:k.transactionId,type:k.transactionType},c);p(y);const M=D(m.state?.pathnameStackToGoBack,m.pathname);p(y,{state:{pathnameStackToGoBack:M}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&x.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(Oo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:x,onTransactionClick:T,onReload:A,onBackClick:E,onColumnSortConfigChanged:S,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ts=()=>{const e=z(),a=W(),t=_(S=>Fn(S)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(S=>U(S)),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??xe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(S=>{e(He({searchString:S}))},[]),h=b.useCallback((S,I)=>{e(He({sortKey:I,sortOrder:S}))},[]),p=b.useCallback(S=>{a(`./${S}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(S=>{e(He({downloadState:S}))},[]),A=b.useCallback((S,I)=>{e(He({selectedDate:S,agingDateSelectionType:I})),e(Ct(S))},[]),E=b.useCallback((S,I)=>{e(On({nodeId:S,isCollapsed:I}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:x,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Rn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Fe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Bn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?x.trackZeniAccountsCashBalancePromoClicked("Move Money"):(x.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else x.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const as=te(function(e){const a=Pn(e).accountsInOrder.map((n,o)=>Ga(n,o)),t=Mn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:x}},Ya)(Da),ns=te(function(e){const a=jn(e).accountsInOrder.map((o,r)=>Ga(o,r)),t=j.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:x}},Ya)(Da);function os(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=St(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(as,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ss(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=St(n?.loggedInUserRoleMap),r=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(ns,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const rs=Dt.div`
1
+ import{j as d}from"./liveblocks-BiGkkGoP.js";import{i as K,j as _,g as H,u as z,h as W,n as te,k as oa,o as gt,p as F}from"./core-DYij5xsh.js";import{eQ as U,KK as Xe,bE as sa,bq as xe,LX as In,i7 as Tn,LY as Nt,LZ as xn,ia as bt,L_ as Qe,L$ as Dn,ig as wn,M0 as $t,M1 as Fn,ik as Ct,M2 as He,M3 as On,cl as St,M4 as Pn,M5 as Mn,L2 as Rn,jd as Bn,M6 as jn,bn as Ge,M7 as ra,Ky as ce,bc as ia,jr as ca,n3 as la,ja as da,KA as le,Kz as ee,eP as ua,eV as Ln,fr as kt,M8 as Un,M9 as Gn,Ma as ma,Mb as Re,un as Ye,uo as Ve,uL as De,uF as de,us as Ne,Mc as Yn,Md as Vn,Me as Nn,Mf as pa,Mg as Be,Mh as $n,dE as Je,qZ as ha,Mi as zn,Mj as Kn,Mk as qn,Ml as yt,JX as At,jH as we,uT as vt,r5 as Zn,Mm as Qn,up as zt,r0 as Ie,qY as fa,Mn as ge,Mo as Hn,Mp as Et,JW as It,sZ as ga,Mq as Wn,Mr as Xn,Ms as Jn,Mt as Tt,ta as eo,Mu as to,ur as Kt,sY as ba,Mv as be,Mw as ao,bt as Ca,uX as ka,Mx as no,My as oo,Mz as so,MA as xt,uS as ro,MB as io,uq as qt,uW as _a,MC as Ce,MD as co,ME as lo,MF as Sa,jw as ya,n0 as Aa,jB as va,m_ as Ea,mZ as Ia,mY as Ta,sl as uo,fh as mo,cN as po,cO as ho,mV as fo,fd as go,na as bo,D$ as Zt,MG as Co,MH as ko,MI as _o,MJ as So,b5 as et,f5 as yo,gS as Ao,fH as vo,n4 as Eo,j3 as Io,n1 as To,m$ as xo,e$ as Do,eZ as wo}from"./zeni-epic-state-YenBAkdY.js";import{z as j,a2 as ae,r as D,d as x,D as q,aU as Fo,Z as $e,x as ze,aV as xa,f as N,aW as Oo,A as _e,aX as Da,n as Se,c as R,h as Po,aY as Mo,aZ as Ro,T as wa,k as Fa,a as Oa,Y as Bo,a_ as jo,O as Lo,aN as Pa,$ as se,a$ as Ma,b0 as Ra,a1 as Ba,b1 as Uo,b2 as Go,aq as Yo,p as Vo,W as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-CPHDDMJD.js";import{n as Dt}from"./mui-CdvNR06J.js";import{a as b}from"./sentry-DQGl2YSn.js";import{w as ja}from"./withTransactionSidePanel-CQ9Z6rVO.js";import{c as La,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-BZSOS5PJ.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import Ue from"./NotFoundScreen-CgebWRjN.js";import{u as Ft}from"./useInitialThreadRequest-DhlqNdmZ.js";import{t as Ua}from"./analyticsHelper-BjBUUOIH.js";import{C as Zo}from"./CompanyPassportScreen-CBnJsrN4.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-Cx4eHMO1.js";import{F as Ho}from"./FeaturePreviewScreen-cfOOP0Wo.js";import{R as Wo}from"./ReferralListScreen-CZNvkt7D.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./TransactionDetailScreen-CIFGLtuW.js";import"./decodeURIComponentSafe-CSUd4Wt5.js";import"./MobileAppDrawer-BmawIQiO.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]="dfccd8e7-5c8f-4f2c-9e26-40250f20aff7",e._sentryDebugIdIdentifier="sentry-dbid-dfccd8e7-5c8f-4f2c-9e26-40250f20aff7")}catch{}})();const Xo=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(y=>y.tenantState.currentTenantId),c=_(y=>U(y)),{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?sa(r):xe(),[r]),p=z(),f=W(),A=_(y=>In(y,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Tn(o,h))},[h]),S=b.useCallback(()=>{f("../../",{relative:"path"})},[]),I=b.useCallback((y,M)=>{p(Nt({sortKey:y,sortOrder:M}))},[]),T=b.useCallback(y=>{p(Nt({downloadState:y}))},[]),L=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(m!=null){const M=La({id:y.transactionId,type:y.transactionType},m);f(M);const X=D(g.state?.pathnameStackToGoBack,g.pathname);f(M,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&x.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(Fo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:x,onTransactionClick:L,onReload:E,onBackClick:S,onColumnSortConfigChanged:I,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Jo=()=>{const e=z(),a=W(),t=_(I=>xn(I)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(I=>I.tenantState.currentTenantId),i=_(I=>U(I)),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??xe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(I=>{e(Qe({searchString:I}))},[]),p=b.useCallback((I,T)=>{e(Qe({sortKey:T,sortOrder:I}))},[]),f=b.useCallback(I=>{a(`./${I}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(I=>{e(Qe({downloadState:I}))},[]),E=b.useCallback((I,T)=>{},[]),S=b.useCallback((I,T)=>{e(Qe({selectedDate:I,agingDateSelectionType:T})),e(bt(I))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:x,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},es=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(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?sa(r):xe(),[r]),h=z(),p=W(),f=_(k=>Dn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(wn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),S=b.useCallback((k,y)=>{h($t({sortKey:k,sortOrder:y}))},[]),I=b.useCallback(k=>{h($t({downloadState:k}))},[]),T=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const y=La({id:k.transactionId,type:k.transactionType},c);p(y);const M=D(m.state?.pathnameStackToGoBack,m.pathname);p(y,{state:{pathnameStackToGoBack:M}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&x.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(Oo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:x,onTransactionClick:T,onReload:A,onBackClick:E,onColumnSortConfigChanged:S,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ts=()=>{const e=z(),a=W(),t=_(S=>Fn(S)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(S=>U(S)),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??xe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(S=>{e(He({searchString:S}))},[]),h=b.useCallback((S,I)=>{e(He({sortKey:I,sortOrder:S}))},[]),p=b.useCallback(S=>{a(`./${S}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(S=>{e(He({downloadState:S}))},[]),A=b.useCallback((S,I)=>{e(He({selectedDate:S,agingDateSelectionType:I})),e(Ct(S))},[]),E=b.useCallback((S,I)=>{e(On({nodeId:S,isCollapsed:I}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:x,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Rn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Fe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Bn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?x.trackZeniAccountsCashBalancePromoClicked("Move Money"):(x.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else x.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const as=te(function(e){const a=Pn(e).accountsInOrder.map((n,o)=>Ga(n,o)),t=Mn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:x}},Ya)(Da),ns=te(function(e){const a=jn(e).accountsInOrder.map((o,r)=>Ga(o,r)),t=j.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:x}},Ya)(Da);function os(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=St(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(as,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ss(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=St(n?.loggedInUserRoleMap),r=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(ns,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const rs=Dt.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-BiGkkGoP.js";import{a as u}from"./sentry-DQGl2YSn.js";import{u as y,j as b,n as w,g as A,N}from"./core-DYij5xsh.js";import{Jp as U,eQ as _,fp as k,Jq as L,mX as R,Jr as z}from"./zeni-epic-state-YenBAkdY.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import{t as P}from"./getLocaleForTenant-DwUbw-k6.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="68c6c8f2-48ad-4b53-9bc9-c97dd2b3c715",t._sentryDebugIdIdentifier="sentry-dbid-68c6c8f2-48ad-4b53-9bc9-c97dd2b3c715")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>U(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],J={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return J[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-BiGkkGoP.js";import{a as u}from"./sentry-DQGl2YSn.js";import{u as y,j as b,n as w,g as A,N}from"./core-DYij5xsh.js";import{Jp as U,eQ as _,fp as k,Jq as L,mX as R,Jr as z}from"./zeni-epic-state-YenBAkdY.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import{t as P}from"./getLocaleForTenant-DYNL1b9l.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="68c6c8f2-48ad-4b53-9bc9-c97dd2b3c715",t._sentryDebugIdIdentifier="sentry-dbid-68c6c8f2-48ad-4b53-9bc9-c97dd2b3c715")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>U(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],J={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return J[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BiGkkGoP.js";import{h as w,g as C,j as h,n as A,i as P}from"./core-DYij5xsh.js";import{Nr as k,Ny as q,fF as K,fE as M,fD as Q,iE as W,Kz as X,qg as J,eQ as V,MZ as D,iC as F,Ns as v,NB as T,iA as G,iX as N}from"./zeni-epic-state-YenBAkdY.js";import{bu as L,k as j,n as R,z as U,h as Z,p,c as S,B as z,bv as Y,o as O,bw as ee,r as te}from"./index-BCP41PwF.js";import{n as H}from"./mui-CdvNR06J.js";import"./sentry-DQGl2YSn.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]="08bbebf8-846d-4aa0-9e97-571ca34c193d",e._sentryDebugIdIdentifier="sentry-dbid-08bbebf8-846d-4aa0-9e97-571ca34c193d")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(X("common")),n!=null&&e(J(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(L);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
1
+ import{j as l}from"./liveblocks-BiGkkGoP.js";import{h as w,g as C,j as h,n as A,i as P}from"./core-DYij5xsh.js";import{Nr as k,Ny as q,fF as K,fE as M,fD as Q,iE as W,Kz as X,qg as J,eQ as V,MZ as D,iC as F,Ns as v,NB as T,iA as G,iX as N}from"./zeni-epic-state-YenBAkdY.js";import{bu as L,k as j,n as R,z as U,h as Z,p,c as S,B as z,bv as Y,o as O,bw as ee,r as te}from"./index-CPHDDMJD.js";import{n as H}from"./mui-CdvNR06J.js";import"./sentry-DQGl2YSn.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]="08bbebf8-846d-4aa0-9e97-571ca34c193d",e._sentryDebugIdIdentifier="sentry-dbid-08bbebf8-846d-4aa0-9e97-571ca34c193d")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(X("common")),n!=null&&e(J(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(L);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-BiGkkGoP.js";import{k as c,y as l,h as f}from"./index-BCP41PwF.js";import{D as b}from"./mui-CdvNR06J.js";import"./sentry-DQGl2YSn.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]="46aa1f46-1cbc-4db3-8963-3dfca34b6304",e._sentryDebugIdIdentifier="sentry-dbid-46aa1f46-1cbc-4db3-8963-3dfca34b6304")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=c(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
1
+ import{j as i}from"./liveblocks-BiGkkGoP.js";import{k as c,y as l,h as f}from"./index-CPHDDMJD.js";import{D as b}from"./mui-CdvNR06J.js";import"./sentry-DQGl2YSn.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]="46aa1f46-1cbc-4db3-8963-3dfca34b6304",e._sentryDebugIdIdentifier="sentry-dbid-46aa1f46-1cbc-4db3-8963-3dfca34b6304")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=c(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BiGkkGoP.js";import{a as d}from"./sentry-DQGl2YSn.js";import{h as A,u as B,g as F,i as L,j as c,N as q,n as H,o as N,p as _}from"./core-DYij5xsh.js";import{LG as z,eQ as K,L3 as O,kH as R,HF as k,LL as M,Ky as W,jH as Y,HG as S,L8 as $,L9 as Q,KA as V,Kz as J}from"./zeni-epic-state-YenBAkdY.js";import{aR as U,d as X,p as Z,r as tt}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import{d as b}from"./decodeURIComponentSafe-CSUd4Wt5.js";import{w as et}from"./withTransactionSidePanel-DYnpLjtY.js";import{f as at,c as nt}from"./routePaths-jIme_4o7.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import"./TransactionDetailScreen-BxH3gBsf.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="5fdf096a-3967-4312-a74a-bbcbc6cf9a17",a._sentryDebugIdIdentifier="sentry-dbid-5fdf096a-3967-4312-a74a-bbcbc6cf9a17")}catch{}})();const ot=H(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:Y(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(V({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=F(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=L(),r=b(j??""),p=b(x??""),f=rt(r,p),G=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=c(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=c(n=>K(n).company?.companyInfo.firstMonthOfFY??1),u=c(n=>O(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(R(i)))},[m,f,i]);const E=c(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:I(G.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
1
+ import{j as s}from"./liveblocks-BiGkkGoP.js";import{a as d}from"./sentry-DQGl2YSn.js";import{h as A,u as B,g as F,i as L,j as c,N as q,n as H,o as N,p as _}from"./core-DYij5xsh.js";import{LG as z,eQ as K,L3 as O,kH as R,HF as k,LL as M,Ky as W,jH as Y,HG as S,L8 as $,L9 as Q,KA as V,Kz as J}from"./zeni-epic-state-YenBAkdY.js";import{aR as U,d as X,p as Z,r as tt}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import{d as b}from"./decodeURIComponentSafe-CSUd4Wt5.js";import{w as et}from"./withTransactionSidePanel-CQ9Z6rVO.js";import{f as at,c as nt}from"./routePaths-BZSOS5PJ.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import"./TransactionDetailScreen-CIFGLtuW.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="5fdf096a-3967-4312-a74a-bbcbc6cf9a17",a._sentryDebugIdIdentifier="sentry-dbid-5fdf096a-3967-4312-a74a-bbcbc6cf9a17")}catch{}})();const ot=H(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:Y(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(V({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=F(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=L(),r=b(j??""),p=b(x??""),f=rt(r,p),G=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=c(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=c(n=>K(n).company?.companyInfo.firstMonthOfFY??1),u=c(n=>O(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(R(i)))},[m,f,i]);const E=c(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:I(G.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
@@ -1,4 +1,4 @@
1
- import{j as S}from"./liveblocks-BiGkkGoP.js";import Fn from"./NotFoundScreen-C0-Skng9.js";import{a,b as wt}from"./sentry-DQGl2YSn.js";import{n as Fe,S as Bn}from"./mui-CdvNR06J.js";import{u as de,h as Pt,g as qe,j as A,n as _n,i as rt,o as Vn,p as Le}from"./core-DYij5xsh.js";import{eQ as Re,Q8 as Mn,n5 as ke,fk as On,qT as jn,nn as xt,nI as Rt,Q9 as Dt,nS as Ln,Qa as Ut,ng as zn,qp as Qn,f4 as fe,Qb as De,sS as Ft,C3 as Bt,Qc as _t,Qd as $n,pZ as Ge,LH as dt,LJ as qn,jK as Gn,LK as Jn,jR as Nn,cV as Kn,tX as Je,nt as Vt,nX as Ue,Qe as Yn,KA as ut,Kz as we,Qf as mt,k6 as Hn,Qg as Zn,Qh as Wn,Qi as Xn,Qj as ea,nA as ta,nl as ue,n_ as Pe,Qk as na,Ql as aa,Qm as oa,o5 as sa,jV as ca,jM as ia,Qn as la,jU as ht,LR as ra,Qo as da,Qp as ua,pV as ma,px as ha,nY as le,pw as ze,Qq as pa,Qr as ga,Qs as Ca,lp as Sa,bq as Ia,lk as pt,l6 as fa,Qt as ka,gU as gt,fV as Ea,lh as va,vQ as ya,Qu as ba,ow as Aa,or as Ta,ov as wa,og as Pa,Qv as xa,f7 as Mt,nL as Ra,nw as Da,fl as Ct,o0 as Ua,Qw as Fa,Qx as Ba,nZ as Ot,Qy as _a,Qz as Va,QA as Ma,QB as Oa,QC as St,q5 as ja,pn as La,Ky as za,QD as Qa,QE as $a,jT as qa,QF as Ga,GB as Ja,jS as Na,jH as Ka,f6 as Ya,oX as jt,pf as Ha,nW as It,n$ as Za,bE as Wa,le as Xa,lb as eo,QG as to,of as ft,pd as kt,pb as no,p0 as ao,oH as oo,pe as so,QH as co,QI as io,oL as lo,QJ as ro,oB as uo,oK as mo,oI as ho,pi as po}from"./zeni-epic-state-YenBAkdY.js";import{n as Lt,c as re,d as L,r as H,W as zt,Z as Qt,cE as go,z as Be,cF as Co,at as xe,cG as So,aT as Et,B as $t,cH as Io,aq as Qe,D as fo,cI as ko,a2 as Eo,cJ as vo,T as yo,cK as bo,cL as Ao,v as To,A as wo,aN as Po,b7 as xo,y as Ro,cM as Do}from"./index-BCP41PwF.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-CVdued0l.js";import{c as vt,C as Uo}from"./TransactionDetailScreen-BxH3gBsf.js";import{w as Fo}from"./withTransactionSidePanel-DYnpLjtY.js";import{h as Bo,v as _o}from"./routePaths-jIme_4o7.js";import{g as $e}from"./accountMappingHelper-EVwRyhXo.js";import{D as Vo}from"./DrawerScreen-DHM1klM-.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./decodeURIComponentSafe-CSUd4Wt5.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]="55723cd3-1e2d-479c-907d-3148bd2b5aa9",t._sentryDebugIdIdentifier="sentry-dbid-55723cd3-1e2d-479c-907d-3148bd2b5aa9")}catch{}})();const Mo=()=>{const t=de(),i=Pt(),T=qe(),f=A(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(re.isRealtimeInsightsFeatureEnabled),u=A(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=A(d=>Mn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:C}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,D,K=!1)=>{t(ke({tenantId:D,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const D=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,D??null),t(On(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],_=a.useCallback(()=>{const d=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(T.state?.pathnameStackToGoBack,T.pathname),w=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(D=>D.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(jn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&_()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=T.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),S.jsx(Oo,{children:S.jsx(go,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:w,onBackClick:()=>{i("../../dashboard")},onReload:_,isAiCfoAccessEnabled:v,onAskAiCfoClick:C})})},Oo=Fe.div`
1
+ import{j as S}from"./liveblocks-BiGkkGoP.js";import Fn from"./NotFoundScreen-CgebWRjN.js";import{a,b as wt}from"./sentry-DQGl2YSn.js";import{n as Fe,S as Bn}from"./mui-CdvNR06J.js";import{u as de,h as Pt,g as qe,j as A,n as _n,i as rt,o as Vn,p as Le}from"./core-DYij5xsh.js";import{eQ as Re,Q8 as Mn,n5 as ke,fk as On,qT as jn,nn as xt,nI as Rt,Q9 as Dt,nS as Ln,Qa as Ut,ng as zn,qp as Qn,f4 as fe,Qb as De,sS as Ft,C3 as Bt,Qc as _t,Qd as $n,pZ as Ge,LH as dt,LJ as qn,jK as Gn,LK as Jn,jR as Nn,cV as Kn,tX as Je,nt as Vt,nX as Ue,Qe as Yn,KA as ut,Kz as we,Qf as mt,k6 as Hn,Qg as Zn,Qh as Wn,Qi as Xn,Qj as ea,nA as ta,nl as ue,n_ as Pe,Qk as na,Ql as aa,Qm as oa,o5 as sa,jV as ca,jM as ia,Qn as la,jU as ht,LR as ra,Qo as da,Qp as ua,pV as ma,px as ha,nY as le,pw as ze,Qq as pa,Qr as ga,Qs as Ca,lp as Sa,bq as Ia,lk as pt,l6 as fa,Qt as ka,gU as gt,fV as Ea,lh as va,vQ as ya,Qu as ba,ow as Aa,or as Ta,ov as wa,og as Pa,Qv as xa,f7 as Mt,nL as Ra,nw as Da,fl as Ct,o0 as Ua,Qw as Fa,Qx as Ba,nZ as Ot,Qy as _a,Qz as Va,QA as Ma,QB as Oa,QC as St,q5 as ja,pn as La,Ky as za,QD as Qa,QE as $a,jT as qa,QF as Ga,GB as Ja,jS as Na,jH as Ka,f6 as Ya,oX as jt,pf as Ha,nW as It,n$ as Za,bE as Wa,le as Xa,lb as eo,QG as to,of as ft,pd as kt,pb as no,p0 as ao,oH as oo,pe as so,QH as co,QI as io,oL as lo,QJ as ro,oB as uo,oK as mo,oI as ho,pi as po}from"./zeni-epic-state-YenBAkdY.js";import{n as Lt,c as re,d as L,r as H,W as zt,Z as Qt,cE as go,z as Be,cF as Co,at as xe,cG as So,aT as Et,B as $t,cH as Io,aq as Qe,D as fo,cI as ko,a2 as Eo,cJ as vo,T as yo,cK as bo,cL as Ao,v as To,A as wo,aN as Po,b7 as xo,y as Ro,cM as Do}from"./index-CPHDDMJD.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-DEByTqFW.js";import{c as vt,C as Uo}from"./TransactionDetailScreen-CIFGLtuW.js";import{w as Fo}from"./withTransactionSidePanel-CQ9Z6rVO.js";import{h as Bo,v as _o}from"./routePaths-BZSOS5PJ.js";import{g as $e}from"./accountMappingHelper-EVwRyhXo.js";import{D as Vo}from"./DrawerScreen-BWhuJpJg.js";import"./recharts-D0oa1BQl.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.js";import"./decodeURIComponentSafe-CSUd4Wt5.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]="55723cd3-1e2d-479c-907d-3148bd2b5aa9",t._sentryDebugIdIdentifier="sentry-dbid-55723cd3-1e2d-479c-907d-3148bd2b5aa9")}catch{}})();const Mo=()=>{const t=de(),i=Pt(),T=qe(),f=A(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(re.isRealtimeInsightsFeatureEnabled),u=A(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=A(d=>Mn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:C}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,D,K=!1)=>{t(ke({tenantId:D,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const D=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,D??null),t(On(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],_=a.useCallback(()=>{const d=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(T.state?.pathnameStackToGoBack,T.pathname),w=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(D=>D.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(jn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&_()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=T.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),S.jsx(Oo,{children:S.jsx(go,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:w,onBackClick:()=>{i("../../dashboard")},onReload:_,isAiCfoAccessEnabled:v,onAskAiCfoClick:C})})},Oo=Fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BiGkkGoP.js";import{a as r}from"./sentry-DQGl2YSn.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-BCP41PwF.js";import"./mui-CdvNR06J.js";import c from"./NotFoundScreen-C0-Skng9.js";import{h as u,g as b}from"./core-DYij5xsh.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]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
1
+ import{j as s}from"./liveblocks-BiGkkGoP.js";import{a as r}from"./sentry-DQGl2YSn.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-CPHDDMJD.js";import"./mui-CdvNR06J.js";import c from"./NotFoundScreen-CgebWRjN.js";import{h as u,g as b}from"./core-DYij5xsh.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]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-DQGl2YSn.js";import{u as f,h as l,g as m}from"./core-DYij5xsh.js";import{gB as p,JN as g,JO as b}from"./zeni-epic-state-YenBAkdY.js";import{u as _,L as h,z as y}from"./index-BCP41PwF.js";import"./liveblocks-BiGkkGoP.js";import"./recharts-D0oa1BQl.js";import"./mui-CdvNR06J.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="9f9bef73-359b-41f5-8e92-59c721cb1b6d",e._sentryDebugIdIdentifier="sentry-dbid-9f9bef73-359b-41f5-8e92-59c721cb1b6d")}catch{}})();function R(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:d}=_(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};
1
+ import{a as r}from"./sentry-DQGl2YSn.js";import{u as f,h as l,g as m}from"./core-DYij5xsh.js";import{gB as p,JN as g,JO as b}from"./zeni-epic-state-YenBAkdY.js";import{u as _,L as h,z as y}from"./index-CPHDDMJD.js";import"./liveblocks-BiGkkGoP.js";import"./recharts-D0oa1BQl.js";import"./mui-CdvNR06J.js";import"./analytics-DyffXLrl.js";import"./plaid-CsGNESZa.js";import"./dnd-BU-7caEQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CCiYx5dW.js";import"./lexical-eKqIIoQI.js";import"./pdf-05F57jtv.js";import"./utils-BCjesvPZ.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]="9f9bef73-359b-41f5-8e92-59c721cb1b6d",e._sentryDebugIdIdentifier="sentry-dbid-9f9bef73-359b-41f5-8e92-59c721cb1b6d")}catch{}})();function R(){const e=f(),n=l(),o=m(),{setLoading:i,clearAllLoading:d}=_(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{R as default};