@zeniai/web-app-ui 5.0.22-dev → 5.0.22-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 (58) hide show
  1. package/dist/assets/{AddressRoutes-BJrRevGa.js → AddressRoutes-DO2AMO4C.js} +1 -1
  2. package/dist/assets/{AddressScreen-BQPPe7pR.js → AddressScreen-TNOlKW9-.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-C5DOIEt_.js → AiCfoScreen-rcLklXCc.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-Qtg1Jo5l.js → BillPayApprovalRoutes-BS_D0je9.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DkAPd68y.js → BillPayRoutes-CJuUX28E.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-CktedTYt.js → BusinessVerificationPageScreen-Ct3CJnEw.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-B8s0w6So.js → ChargeCardRoutes-D_xq2_5H.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-C8EcswEA.js → CompanyPassportScreen-DKFPDRmC.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-Zh5E4_CJ.js → ConnectionAuthScreen-D-2Rr6lB.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-HXUuepjr.js → CustomerOnboardingAuthScreen-clFIvqKE.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-RiQ255x9.js → CustomerOnboardingRoutes-C8OrkodX.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-DD6E0pG7.js → DashboardRoutes-CjS7HJYX.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-feQeI0F_.js → DefaultTenantHome-xuRYKgB0.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-eW-I-lqX.js → DomesticWireDetailScreen-Ca6CaUgR.js} +1 -1
  15. package/dist/assets/{DrawerScreen-HBFMcVvk.js → DrawerScreen-C1N2vxzH.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-Bh44Er44.js → EntityDetailRoutes-EMHOSBah.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-CgCGvHQG.js → ExpenseAutomationRoutes-CnueZmCh.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-Bd18oGQj.js → FeaturePreviewScreen-DFD5zg_r.js} +1 -1
  19. package/dist/assets/{MagicLinkRoutes-DFA8OahA.js → MagicLinkRoutes-DBNJfJLb.js} +1 -1
  20. package/dist/assets/{MagicLinkSignInScreen-CLhGIPxm.js → MagicLinkSignInScreen-CwJKRjV0.js} +1 -1
  21. package/dist/assets/{MobileAppDrawer-CwjUL5yD.js → MobileAppDrawer-voD2LpO-.js} +1 -1
  22. package/dist/assets/{NotFoundScreen-DZbU-KCv.js → NotFoundScreen-Cryu2QFy.js} +1 -1
  23. package/dist/assets/{NotificationRoutes-BOGZiZZG.js → NotificationRoutes-BD0OYkg7.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-DZ6jC1bX.js → PandLWithForecastRoutes-XYkyX6Zd.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-DD_GpPXZ.js → PeopleRoutes-D1WRsJRH.js} +1 -1
  26. package/dist/assets/{PerformanceRoutes-BEO8LXrv.js → PerformanceRoutes-DOMszLDU.js} +1 -1
  27. package/dist/assets/{QBOConnectionScreen-ZhIN2-uP.js → QBOConnectionScreen-DuZo1yzm.js} +1 -1
  28. package/dist/assets/{ReferralListScreen-CWHCaSQw.js → ReferralListScreen-BTF2hmjO.js} +1 -1
  29. package/dist/assets/{ReimbursementApprovalRoutes-DLby1pC7.js → ReimbursementApprovalRoutes-WG3WahZX.js} +1 -1
  30. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-roSj06Ji.js → ReimbursementApprovalRuleDetailScreen-B5d9VJOs.js} +1 -1
  31. package/dist/assets/{ReimbursementRoutes-BQAXwJX9.js → ReimbursementRoutes-NrYMBi1J.js} +1 -1
  32. package/dist/assets/{ReportsRoutes-COAdHt4D.js → ReportsRoutes-iQbBEqit.js} +1 -1
  33. package/dist/assets/{RewardsRoutes-Dw-aqOm5.js → RewardsRoutes-CJcbxkYG.js} +1 -1
  34. package/dist/assets/{ScreenRoutes-DV65D9fc.js → ScreenRoutes-C6aVSF4T.js} +2 -2
  35. package/dist/assets/{SettingsRoutes-XQ9e9KID.js → SettingsRoutes-DdJgAtqN.js} +1 -1
  36. package/dist/assets/{SetupPagesScreen-BcfdYSeZ.js → SetupPagesScreen-CT-3H_u9.js} +1 -1
  37. package/dist/assets/{SignInScreen-Cc84lO8c.js → SignInScreen-BLhSO9X9.js} +1 -1
  38. package/dist/assets/{SignOutScreen-DzSDmVnc.js → SignOutScreen-CYSC9fTl.js} +1 -1
  39. package/dist/assets/{TaskListScreen-B_Yspya7.js → TaskListScreen-CQhH6Qhp.js} +1 -1
  40. package/dist/assets/{TaskRoutes-DkUNX7ep.js → TaskRoutes-Ba2ZPNgS.js} +1 -1
  41. package/dist/assets/{TransactionDetailRoutes-C5W6mPZ3.js → TransactionDetailRoutes-BQ0pIg0n.js} +1 -1
  42. package/dist/assets/{TransactionDetailScreen-CbyG0n1m.js → TransactionDetailScreen-D4rokNI1.js} +1 -1
  43. package/dist/assets/{TransactionListRoutes-Uz8iUZDH.js → TransactionListRoutes-WmX0p3n5.js} +1 -1
  44. package/dist/assets/{TreasuryRoutes-DMgnld7f.js → TreasuryRoutes-E8ubjS7Q.js} +1 -1
  45. package/dist/assets/{VendorsRoutes-JX67ErLJ.js → VendorsRoutes-B7y1YfME.js} +1 -1
  46. package/dist/assets/{WiseConfirmationScreen-B_bo1Cpn.js → WiseConfirmationScreen-ByuVB3n7.js} +1 -1
  47. package/dist/assets/{ZeniAccountRoutes-Cy1TFPrS.js → ZeniAccountRoutes-BlNqWDSd.js} +1 -1
  48. package/dist/assets/{ZeniAccountStatementScreen-Dvs4m1EF.js → ZeniAccountStatementScreen-Bl764lap.js} +1 -1
  49. package/dist/assets/{analyticsHelper-BlP3gsal.js → analyticsHelper-DkI5fHpv.js} +1 -1
  50. package/dist/assets/{getLocaleForTenant-BZ9xLliJ.js → getLocaleForTenant-CdAyQ18u.js} +1 -1
  51. package/dist/assets/{index-Drj6C88E.js → index-NPabbksF.js} +5 -5
  52. package/dist/assets/{routePaths-Cqx2U__X.js → routePaths-DuYx1box.js} +1 -1
  53. package/dist/assets/{useAskAiCfoHostNavButtonProps-wDzGPcQn.js → useAskAiCfoHostNavButtonProps-BTitwH51.js} +1 -1
  54. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-D4I-78Sf.js → useFetchSuggestedQuestionsWhenReady-Dv4iLJ0Q.js} +1 -1
  55. package/dist/assets/{useInitialThreadRequest-sUCtW719.js → useInitialThreadRequest-D34WQTSQ.js} +1 -1
  56. package/dist/assets/{withTransactionSidePanel-DTDtCDdY.js → withTransactionSidePanel-Bz9MapFR.js} +1 -1
  57. package/dist/index.html +1 -1
  58. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-it_Rhm8-.js";import{A as d}from"./AddressScreen-BQPPe7pR.js";import i from"./NotFoundScreen-DZbU-KCv.js";import"./sentry-C-hGmJ4T.js";import{n as s,o as r}from"./core-BF8mCLAO.js";import"./zeni-epic-state-Ds1G4QGX.js";import"./recharts-BBMAmq_A.js";import"./index-Drj6C88E.js";import"./mui-B87RTrAV.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
1
+ import{j as e}from"./liveblocks-it_Rhm8-.js";import{A as d}from"./AddressScreen-TNOlKW9-.js";import i from"./NotFoundScreen-Cryu2QFy.js";import"./sentry-C-hGmJ4T.js";import{n as s,o as r}from"./core-BF8mCLAO.js";import"./zeni-epic-state-Ds1G4QGX.js";import"./recharts-BBMAmq_A.js";import"./index-NPabbksF.js";import"./mui-B87RTrAV.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-it_Rhm8-.js";import{a as m}from"./sentry-C-hGmJ4T.js";import{j as P,h as _,u as j,l as E,g as M,k as $}from"./core-BF8mCLAO.js";import{K as B,h as D,z as K,S as L,r as R,v as z,e as I,g as S,k as F,j as h,p as N}from"./index-Drj6C88E.js";import{IY as C,gI as U,eM as G,IZ as O,b$ as V,I_ as q,k2 as H}from"./zeni-epic-state-Ds1G4QGX.js";import{n as Y}from"./mui-B87RTrAV.js";import Z from"./NotFoundScreen-DZbU-KCv.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]="8678b53c-1bbb-4b96-b6aa-d37339df4020",e._sentryDebugIdIdentifier="sentry-dbid-8678b53c-1bbb-4b96-b6aa-d37339df4020")}catch{}})();const J=Y.div`
1
+ import{j as d}from"./liveblocks-it_Rhm8-.js";import{a as m}from"./sentry-C-hGmJ4T.js";import{j as P,h as _,u as j,l as E,g as M,k as $}from"./core-BF8mCLAO.js";import{K as B,h as D,z as K,S as L,r as R,v as z,e as I,g as S,k as F,j as h,p as N}from"./index-NPabbksF.js";import{IY as C,gI as U,eM as G,IZ as O,b$ as V,I_ as q,k2 as H}from"./zeni-epic-state-Ds1G4QGX.js";import{n as Y}from"./mui-B87RTrAV.js";import Z from"./NotFoundScreen-Cryu2QFy.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]="8678b53c-1bbb-4b96-b6aa-d37339df4020",e._sentryDebugIdIdentifier="sentry-dbid-8678b53c-1bbb-4b96-b6aa-d37339df4020")}catch{}})();const J=Y.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-it_Rhm8-.js";import{a as r}from"./sentry-C-hGmJ4T.js";import{h as oe,j as ne,u as ie,g as G,l as re,k as le}from"./core-BF8mCLAO.js";import{H as ce,cC as ue,z as de,K as me,cD as pe,cE as fe,cF as he,cG as q,v as Se,e as x,N,cH as ge,cI as Ce,g as be,a1 as ke,cJ as we,Q as Ie,n as Ee,p as V,cK as Pe,cL as Te}from"./index-Drj6C88E.js";import{fD as ye,f2 as H,eM as _e,hm as ve,Pu as xe,eL as Ue,hw as Qe,hs as Ae,ft as De,fn as Oe,fg as Fe,fk as $,fo as Le,fp as Me,fq as Be,fr as Re,fs as je}from"./zeni-epic-state-Ds1G4QGX.js";import{D as Ge,n as U,P as Ne,S as Ve}from"./mui-B87RTrAV.js";import{p as $e}from"./pathToGoBack-_pwiC6EH.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="fd1d9653-5bf8-40e0-97b1-b9d904e00f7d",s._sentryDebugIdIdentifier="sentry-dbid-fd1d9653-5bf8-40e0-97b1-b9d904e00f7d")}catch{}})();const W="chat-response-generated",qe=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Me(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:E}=q(S,t);c!=="answer"?x.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(E,I),n.metadata.message_id??null):x.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(je({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Pe(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s($(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Le(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??$e(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s($(""))},togglePageView:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Ee(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Oe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=G(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=G(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),Q=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,A=!!C?.aiCfoShouldSubmit,[z,P]=r.useState(null),[K,T]=r.useState(!1),D=r.useRef(!1);r.useEffect(()=>{D.current||b==null||b===""||(P(b),T(A),D.current=!0)},[b,A]);const J=r.useCallback(()=>{P(null),T(!1)},[]),O=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=O.get("ref")??C?.aiCfoRef,y=O.get("emailRefId")??C?.aiCfoEmailRefId,L=r.useRef(!1);r.useEffect(()=>{L.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(ve("controller",e.userId,y,"MONTH_END_EMAIL")),L.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(P(k),T(!0),a(xe()))},[k,t,a]);const Y=c.masterTOSInfo,w=Y?.isMasterTOSAccepted??!1,{visitedSessions:M}=he(t),_=l.fetchState,v=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),j=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=q(j,t),X=Z.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:M.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[M]);if(r.useEffect(()=>{_!=="In-Progress"&&v&&a(Qe())},[_,v,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!v&&a(Ae(t,e.userId))},[B,R,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:x,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),N(n)&&Q.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:j,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:X,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:J,onMenuClick:N(n)?Q.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,onUploadPromoClose:g}),h.jsx(Ge,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(De(c.userRoleId)),f(!1)}})})})]})},He=U(Ve)`
1
+ import{j as h}from"./liveblocks-it_Rhm8-.js";import{a as r}from"./sentry-C-hGmJ4T.js";import{h as oe,j as ne,u as ie,g as G,l as re,k as le}from"./core-BF8mCLAO.js";import{H as ce,cC as ue,z as de,K as me,cD as pe,cE as fe,cF as he,cG as q,v as Se,e as x,N,cH as ge,cI as Ce,g as be,a1 as ke,cJ as we,Q as Ie,n as Ee,p as V,cK as Pe,cL as Te}from"./index-NPabbksF.js";import{fD as ye,f2 as H,eM as _e,hm as ve,Pu as xe,eL as Ue,hw as Qe,hs as Ae,ft as De,fn as Oe,fg as Fe,fk as $,fo as Le,fp as Me,fq as Be,fr as Re,fs as je}from"./zeni-epic-state-Ds1G4QGX.js";import{D as Ge,n as U,P as Ne,S as Ve}from"./mui-B87RTrAV.js";import{p as $e}from"./pathToGoBack-_pwiC6EH.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="fd1d9653-5bf8-40e0-97b1-b9d904e00f7d",s._sentryDebugIdIdentifier="sentry-dbid-fd1d9653-5bf8-40e0-97b1-b9d904e00f7d")}catch{}})();const W="chat-response-generated",qe=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Me(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:E}=q(S,t);c!=="answer"?x.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(E,I),n.metadata.message_id??null):x.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(je({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Pe(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s($(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Le(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??$e(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s($(""))},togglePageView:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Ee(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Oe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=G(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=G(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),Q=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,A=!!C?.aiCfoShouldSubmit,[z,P]=r.useState(null),[K,T]=r.useState(!1),D=r.useRef(!1);r.useEffect(()=>{D.current||b==null||b===""||(P(b),T(A),D.current=!0)},[b,A]);const J=r.useCallback(()=>{P(null),T(!1)},[]),O=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=O.get("ref")??C?.aiCfoRef,y=O.get("emailRefId")??C?.aiCfoEmailRefId,L=r.useRef(!1);r.useEffect(()=>{L.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(ve("controller",e.userId,y,"MONTH_END_EMAIL")),L.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(P(k),T(!0),a(xe()))},[k,t,a]);const Y=c.masterTOSInfo,w=Y?.isMasterTOSAccepted??!1,{visitedSessions:M}=he(t),_=l.fetchState,v=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),j=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=q(j,t),X=Z.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:M.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[M]);if(r.useEffect(()=>{_!=="In-Progress"&&v&&a(Qe())},[_,v,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!v&&a(Ae(t,e.userId))},[B,R,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:x,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),N(n)&&Q.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:j,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:X,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:J,onMenuClick:N(n)?Q.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,onUploadPromoClose:g}),h.jsx(Ge,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(De(c.userRoleId)),f(!1)}})})})]})},He=U(Ve)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-it_Rhm8-.js";import{a as y}from"./sentry-C-hGmJ4T.js";import{j as U,u as B,h as T,g as v,N as $,k as j,l as L,n as O,o as h}from"./core-BF8mCLAO.js";import{eM as N,Mf as R,LX as b,x4 as w,w_ as F,x2 as I,wT as W,LZ as M,wW as q,x6 as z,x5 as C}from"./zeni-epic-state-Ds1G4QGX.js";import{h as P,z as k,r as V,a1 as X,bu as Z,aa as _,bv as G}from"./index-Drj6C88E.js";import"./mui-B87RTrAV.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-roSj06Ji.js";import J from"./NotFoundScreen-DZbU-KCv.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]="3282d33b-2ece-4d91-84bf-3a79d0657c59",e._sentryDebugIdIdentifier="sentry-dbid-3282d33b-2ece-4d91-84bf-3a79d0657c59")}catch{}})();const x="bill-approval-rule-update",K=j(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(x)&&e(M(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(W(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(X(Z)),Q=()=>{const e=U(),o=B(),t=T(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-${c.companyId}.${x}`]:[],eventCallback:(i,A,m)=>{i.endsWith(x)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...f})},Y=j(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(S=>{const E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{t("../")}}})(G);function D(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=L(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(q(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Y,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Q,{})}),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(J,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-it_Rhm8-.js";import{a as y}from"./sentry-C-hGmJ4T.js";import{j as U,u as B,h as T,g as v,N as $,k as j,l as L,n as O,o as h}from"./core-BF8mCLAO.js";import{eM as N,Mf as R,LX as b,x4 as w,w_ as F,x2 as I,wT as W,LZ as M,wW as q,x6 as z,x5 as C}from"./zeni-epic-state-Ds1G4QGX.js";import{h as P,z as k,r as V,a1 as X,bu as Z,aa as _,bv as G}from"./index-NPabbksF.js";import"./mui-B87RTrAV.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-B5d9VJOs.js";import J from"./NotFoundScreen-Cryu2QFy.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]="3282d33b-2ece-4d91-84bf-3a79d0657c59",e._sentryDebugIdIdentifier="sentry-dbid-3282d33b-2ece-4d91-84bf-3a79d0657c59")}catch{}})();const x="bill-approval-rule-update",K=j(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(x)&&e(M(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(W(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(X(Z)),Q=()=>{const e=U(),o=B(),t=T(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const f={events:c.companyId!=null?[`private-${c.companyId}.${x}`]:[],eventCallback:(i,A,m)=>{i.endsWith(x)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...f})},Y=j(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(S=>{const E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{t("../")}}})(G);function D(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=L(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(q(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Y,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Q,{})}),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(J,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-it_Rhm8-.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as X,i as la,n as sa,o as S}from"./core-BF8mCLAO.js";import{eM as Z,Lx as Ge,bu as At,Gz as ra,bn as xt,bC as pe,Ly as Bt,wo as Et,xy as Ue,wX as ca,bm as je,Lz as da,LA as ua,b$ as pa,LB as ma,jm as Dt,LC as jt,LD as Tt,y7 as Oe,wD as Be,LE as ba,wc as it,LF as ha,Bj as ga,wg as ya,wm as Pt,LG as Ie,LH as Ne,xz as ze,LI as Sa,LJ as fa,xC as Ze,LK as Ia,xP as va,LL as Ft,xj as ot,xo as ka,LM as wa,LN as ue,LO as Rt,LP as Lt,LQ as Vt,fG as Ca,wI as _e,ct as $t,LR as Aa,gy as xa,LS as Ba,LT as Ea,eS as Ut,eQ as _t,LU as He,LV as Da,LW as ja,Jg as We,LX as Ta,Jh as ie,Ji as qe,LY as Pa,LZ as Fa,L_ as Ra,xq as lt,xn as La,L$ as Va,M0 as $a,M1 as Ua,x9 as _a,M2 as Ma,M3 as Ga,M4 as Oa,cN as Mt,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vu as Za,M5 as Ha,B6 as Wa,Bc as qa,s1 as Ja,xA as Ka,ye as Qa,jK as fe,M6 as Xa,M7 as zt,kc as Ya,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M8 as tn,M9 as ve,ig as an,Ma as rt,Mb as nn,ik as on,iG as ln,ys as sn,Mc as rn,k5 as cn,yi as dn,Md as ct,ym as un,yr as pn,yo as mn,yg as bn,Me as Wt,wx as hn,Mf as gn,Mg as yn,fz as Sn,fy as fn,fx as In,jN as vn,k3 as dt,ke as kn,pA as wn,jW as Cn,yk as An,ir as xn,kj as Bn,Mh as En,ii as Dn,pr as jn,Mi as Tn,xf as Pn,bD as Fn,br as Rn,If as Ln,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-Ds1G4QGX.js";import{h as me,z as L,S as ke,H as Je,s as oe,d as y,aI as Ee,r as ce,o as E,v as Te,e as j,b1 as Mn,p as z,Q as Ke,n as D,K as we,b2 as ut,b3 as pt,b4 as Gn,af as On,E as Nn,aC as zn,A as qt,O as Qe,F as Xe,b5 as Zn,ao as Jt,b6 as Hn,I as Wn,g as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Xn,bb as Yn,bc as ei,bd as ti,be as ai,bf as ni,q as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-Drj6C88E.js";import{n as V,S as di}from"./mui-B87RTrAV.js";import{A as mt}from"./AddressScreen-BQPPe7pR.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-eW-I-lqX.js";import{a as f}from"./sentry-C-hGmJ4T.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-wDzGPcQn.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-D4I-78Sf.js";import{u as Xt}from"./useInitialThreadRequest-sUCtW719.js";import De from"./NotFoundScreen-DZbU-KCv.js";import{D as bi}from"./DrawerScreen-HBFMcVvk.js";import{M as Yt}from"./MobileAppDrawer-CwjUL5yD.js";import{F as ea}from"./FeaturePreviewScreen-Bd18oGQj.js";import{S as Re}from"./SetupPagesScreen-BcfdYSeZ.js";import{B as hi}from"./BillPayApprovalRoutes-Qtg1Jo5l.js";import{FallBackRoute as gi}from"./ScreenRoutes-DV65D9fc.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./analyticsHelper-BlP3gsal.js";import"./routePaths-Cqx2U__X.js";import"./BusinessVerificationPageScreen-CktedTYt.js";import"./ReimbursementApprovalRuleDetailScreen-roSj06Ji.js";import"./getLocaleForTenant-BZ9xLliJ.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]="7de62bc6-7d66-4be4-857b-42e71df8c1ad",e._sentryDebugIdIdentifier="sentry-dbid-7de62bc6-7d66-4be4-857b-42e71df8c1ad")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Mn);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ke(),o=v(w=>Z(w)),s=v(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[_,M]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?M(!1):M(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[_,M]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&_?M(!1):!u&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||u||(H(!0),t(Et(n,g,T,!1)),_||(M(!0),t(Ue(!1,g,T,b,n)))),u&&!_&&(M(!0),t(Ue(!1,g,T,b,n)))},[k,_,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-it_Rhm8-.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as X,i as la,n as sa,o as S}from"./core-BF8mCLAO.js";import{eM as Z,Lx as Ge,bu as At,Gz as ra,bn as xt,bC as pe,Ly as Bt,wo as Et,xy as Ue,wX as ca,bm as je,Lz as da,LA as ua,b$ as pa,LB as ma,jm as Dt,LC as jt,LD as Tt,y7 as Oe,wD as Be,LE as ba,wc as it,LF as ha,Bj as ga,wg as ya,wm as Pt,LG as Ie,LH as Ne,xz as ze,LI as Sa,LJ as fa,xC as Ze,LK as Ia,xP as va,LL as Ft,xj as ot,xo as ka,LM as wa,LN as ue,LO as Rt,LP as Lt,LQ as Vt,fG as Ca,wI as _e,ct as $t,LR as Aa,gy as xa,LS as Ba,LT as Ea,eS as Ut,eQ as _t,LU as He,LV as Da,LW as ja,Jg as We,LX as Ta,Jh as ie,Ji as qe,LY as Pa,LZ as Fa,L_ as Ra,xq as lt,xn as La,L$ as Va,M0 as $a,M1 as Ua,x9 as _a,M2 as Ma,M3 as Ga,M4 as Oa,cN as Mt,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vu as Za,M5 as Ha,B6 as Wa,Bc as qa,s1 as Ja,xA as Ka,ye as Qa,jK as fe,M6 as Xa,M7 as zt,kc as Ya,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M8 as tn,M9 as ve,ig as an,Ma as rt,Mb as nn,ik as on,iG as ln,ys as sn,Mc as rn,k5 as cn,yi as dn,Md as ct,ym as un,yr as pn,yo as mn,yg as bn,Me as Wt,wx as hn,Mf as gn,Mg as yn,fz as Sn,fy as fn,fx as In,jN as vn,k3 as dt,ke as kn,pA as wn,jW as Cn,yk as An,ir as xn,kj as Bn,Mh as En,ii as Dn,pr as jn,Mi as Tn,xf as Pn,bD as Fn,br as Rn,If as Ln,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-Ds1G4QGX.js";import{h as me,z as L,S as ke,H as Je,s as oe,d as y,aI as Ee,r as ce,o as E,v as Te,e as j,b1 as Mn,p as z,Q as Ke,n as D,K as we,b2 as ut,b3 as pt,b4 as Gn,af as On,E as Nn,aC as zn,A as qt,O as Qe,F as Xe,b5 as Zn,ao as Jt,b6 as Hn,I as Wn,g as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Xn,bb as Yn,bc as ei,bd as ti,be as ai,bf as ni,q as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-NPabbksF.js";import{n as V,S as di}from"./mui-B87RTrAV.js";import{A as mt}from"./AddressScreen-TNOlKW9-.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-Ca6CaUgR.js";import{a as f}from"./sentry-C-hGmJ4T.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-BTitwH51.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-Dv4iLJ0Q.js";import{u as Xt}from"./useInitialThreadRequest-D34WQTSQ.js";import De from"./NotFoundScreen-Cryu2QFy.js";import{D as bi}from"./DrawerScreen-C1N2vxzH.js";import{M as Yt}from"./MobileAppDrawer-voD2LpO-.js";import{F as ea}from"./FeaturePreviewScreen-DFD5zg_r.js";import{S as Re}from"./SetupPagesScreen-CT-3H_u9.js";import{B as hi}from"./BillPayApprovalRoutes-BS_D0je9.js";import{FallBackRoute as gi}from"./ScreenRoutes-C6aVSF4T.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./analyticsHelper-DkI5fHpv.js";import"./routePaths-DuYx1box.js";import"./BusinessVerificationPageScreen-Ct3CJnEw.js";import"./ReimbursementApprovalRuleDetailScreen-B5d9VJOs.js";import"./getLocaleForTenant-CdAyQ18u.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]="7de62bc6-7d66-4be4-857b-42e71df8c1ad",e._sentryDebugIdIdentifier="sentry-dbid-7de62bc6-7d66-4be4-857b-42e71df8c1ad")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Mn);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ke(),o=v(w=>Z(w)),s=v(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[_,M]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?M(!1):M(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[_,M]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&_?M(!1):!u&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||u||(H(!0),t(Et(n,g,T,!1)),_||(M(!0),t(Ue(!1,g,T,b,n)))),u&&!_&&(M(!0),t(Ue(!1,g,T,b,n)))},[k,_,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function ki(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-it_Rhm8-.js";import{a as V}from"./sentry-C-hGmJ4T.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-BF8mCLAO.js";import{S as ce,s as ue,aI as de,z as M,v as pe,e as B,aa as x,g as z,bq as le,ao as me,n as E,ap as P}from"./index-Drj6C88E.js";import{M3 as fe,eM as G,rs as ye,GD as Se,x9 as ge,zS as Ie,Cp as he,D2 as be,DX as De,Mq as Oe,Mr as Te,Ms as ke,Mt as Ce,Mu as Ve,IZ as we,Ls as Ae,J9 as Ne,k2 as _e,fz as ve,fy as Fe,fx as xe,pA as ze,pr as Me,po as Be,jW as Ee,rB as Pe,rz as R,bB as L,rN as U,cr as Re}from"./zeni-epic-state-Ds1G4QGX.js";import{n as Le}from"./mui-B87RTrAV.js";import{c as j}from"./routePaths-Cqx2U__X.js";import{M as Ue}from"./MobileAppDrawer-CwjUL5yD.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]="f6a6e1c9-1c74-49c6-99a5-ceffdd03348c",e._sentryDebugIdIdentifier="sentry-dbid-f6a6e1c9-1c74-49c6-99a5-ceffdd03348c")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-it_Rhm8-.js";import{a as V}from"./sentry-C-hGmJ4T.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-BF8mCLAO.js";import{S as ce,s as ue,aI as de,z as M,v as pe,e as B,aa as x,g as z,bq as le,ao as me,n as E,ap as P}from"./index-NPabbksF.js";import{M3 as fe,eM as G,rs as ye,GD as Se,x9 as ge,zS as Ie,Cp as he,D2 as be,DX as De,Mq as Oe,Mr as Te,Ms as ke,Mt as Ce,Mu as Ve,IZ as we,Ls as Ae,J9 as Ne,k2 as _e,fz as ve,fy as Fe,fx as xe,pA as ze,pr as Me,po as Be,jW as Ee,rB as Pe,rz as R,bB as L,rN as U,cr as Re}from"./zeni-epic-state-Ds1G4QGX.js";import{n as Le}from"./mui-B87RTrAV.js";import{c as j}from"./routePaths-DuYx1box.js";import{M as Ue}from"./MobileAppDrawer-voD2LpO-.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]="f6a6e1c9-1c74-49c6-99a5-ceffdd03348c",e._sentryDebugIdIdentifier="sentry-dbid-f6a6e1c9-1c74-49c6-99a5-ceffdd03348c")}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-it_Rhm8-.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Jt,o as te}from"./core-BF8mCLAO.js";import{eM as ie,br as Le,NW as _a,eQ as Se,eR as Ie,eS as Ae,fK as Me,co as ze,NX as $e,NY as $a,sH as Sa,ju as Ia,NZ as Aa,gy as ca,z9 as aa,zb as Ga,zc as Za,jk as Ct,N_ as Ge,yZ as pt,N$ as Xt,O0 as Qt,z0 as wa,O1 as en,Mn as Pa,qT as ht,z6 as Ya,gJ as an,O2 as ft,O3 as Ze,bp as tn,O4 as nn,fz as Ta,fy as Fa,zG as rn,fx as va,M3 as sn,O5 as gt,cN as bt,cJ as on,Mm as ua,Ag as cn,O6 as rt,zS as xa,O7 as yt,Ah as dn,MN as ln,Ai as un,Bc as mn,s1 as Cn,B6 as pn,zr as St,zk as hn,O8 as fn,fM as gn,zA as It,zE as At,fL as bn,O9 as yn,A2 as Et,Oa as Sn,Ob as In,Oc as An,zC as kt,zn as Dt,z3 as _t,zw as wt,zu as Pt,zy as En,za as st,Od as Tt,Oe as Oa,zP as Ea,J2 as Ft,cK as Ka,Of as kn,Og as Dn,Oh as _n,Oi as wn,zM as Ha,A9 as Pn,A5 as Tn,zI as Fn,A7 as vn,zZ as xn,z$ as On,Oj as vt,Af as xt,Gz as Ln,Ok as Bn,Ol as Rn,Om as Un,On as Ot,Oo as jn,AC as Nn,zR as Lt,zL as da,zQ as Vn,Op as Hn,Oq as Mn,yW as zn,Or as Bt,Os as Rt,Ot as $n,yY as Gn,yX as ot,Ou as Zn,Ov as Yn,Ow as Kn,I_ as Wn,Ox as Wa,Oy as qn,vx as Ut,k2 as Jn,gz as Xn,AH as Qn,Oz as jt,OA as er,AI as ar,OB as tr,db as nr,sB as rr,Ax as sr,Ar as Oe,bu as or,bC as ir,ct as cr,bD as dr,If as lr}from"./zeni-epic-state-Ds1G4QGX.js";import{z as Q,S as Re,s as oe,d as Y,r as Ye,bU as La,c3 as ur,p as ve,c4 as mr,c5 as Cr,K as ma,aI as Fe,n as be,bb as qa,c6 as pr,A as Ca,j as Ba,h as Ja,e as J,O as Xa,c7 as hr,H as Nt,al as Qa,bn as Qe,c8 as Ma,c9 as fr,v as et,a1 as gr,ca as br,ao as Vt,Q as za,I as Ht,g as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as ja,q as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-Drj6C88E.js";import{n as _e,D as zt,S as xr}from"./mui-B87RTrAV.js";import{a as c}from"./sentry-C-hGmJ4T.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Be,f as Ue,A as Or,h as at,P as Lr,i as tt,s as ea,j as Gt,k as He,l as Zt,m as Br,n as Yt,p as Rr,S as it}from"./SetupPagesScreen-BcfdYSeZ.js";import Ra from"./NotFoundScreen-DZbU-KCv.js";import{M as ha}from"./MobileAppDrawer-CwjUL5yD.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-wDzGPcQn.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-D4I-78Sf.js";import{v as ct}from"./utils-C4NhxqJn.js";import{t as Ur}from"./AddressScreen-BQPPe7pR.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./analyticsHelper-BlP3gsal.js";import"./routePaths-Cqx2U__X.js";import"./BusinessVerificationPageScreen-CktedTYt.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]="8cf6a15f-9828-4e85-b237-228d8aec6d3b",e._sentryDebugIdIdentifier="sentry-dbid-8cf6a15f-9828-4e85-b237-228d8aec6d3b")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=Q.getSignedInUser(),n=S(G=>ie(G)),u=Re(),m=Le(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:L}=C(Y.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(L,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,B=S(G=>Me(G,n.companyId)),j=ze(B.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],x=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Z=R?.accountingClassIDs[0],E=S(G=>Z!=null?Ia(G.classState,{classId:Z,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Za()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Be(l,g,w,f),O=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ye,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(La,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:O,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:x?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=Q.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ra,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,L]=c.useState(!1),v=Q.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Qt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:B}=oe(),{isFeatureEnabled:j}=B(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=B(Y.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:U}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const x=Q.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Ya(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Z=E=>{L(E)};if(w!=="Completed"||l==null)return s.jsx(Ye,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Z}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:x,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Z(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ze(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:Ba.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
1
+ import{j as s}from"./liveblocks-it_Rhm8-.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Jt,o as te}from"./core-BF8mCLAO.js";import{eM as ie,br as Le,NW as _a,eQ as Se,eR as Ie,eS as Ae,fK as Me,co as ze,NX as $e,NY as $a,sH as Sa,ju as Ia,NZ as Aa,gy as ca,z9 as aa,zb as Ga,zc as Za,jk as Ct,N_ as Ge,yZ as pt,N$ as Xt,O0 as Qt,z0 as wa,O1 as en,Mn as Pa,qT as ht,z6 as Ya,gJ as an,O2 as ft,O3 as Ze,bp as tn,O4 as nn,fz as Ta,fy as Fa,zG as rn,fx as va,M3 as sn,O5 as gt,cN as bt,cJ as on,Mm as ua,Ag as cn,O6 as rt,zS as xa,O7 as yt,Ah as dn,MN as ln,Ai as un,Bc as mn,s1 as Cn,B6 as pn,zr as St,zk as hn,O8 as fn,fM as gn,zA as It,zE as At,fL as bn,O9 as yn,A2 as Et,Oa as Sn,Ob as In,Oc as An,zC as kt,zn as Dt,z3 as _t,zw as wt,zu as Pt,zy as En,za as st,Od as Tt,Oe as Oa,zP as Ea,J2 as Ft,cK as Ka,Of as kn,Og as Dn,Oh as _n,Oi as wn,zM as Ha,A9 as Pn,A5 as Tn,zI as Fn,A7 as vn,zZ as xn,z$ as On,Oj as vt,Af as xt,Gz as Ln,Ok as Bn,Ol as Rn,Om as Un,On as Ot,Oo as jn,AC as Nn,zR as Lt,zL as da,zQ as Vn,Op as Hn,Oq as Mn,yW as zn,Or as Bt,Os as Rt,Ot as $n,yY as Gn,yX as ot,Ou as Zn,Ov as Yn,Ow as Kn,I_ as Wn,Ox as Wa,Oy as qn,vx as Ut,k2 as Jn,gz as Xn,AH as Qn,Oz as jt,OA as er,AI as ar,OB as tr,db as nr,sB as rr,Ax as sr,Ar as Oe,bu as or,bC as ir,ct as cr,bD as dr,If as lr}from"./zeni-epic-state-Ds1G4QGX.js";import{z as Q,S as Re,s as oe,d as Y,r as Ye,bU as La,c3 as ur,p as ve,c4 as mr,c5 as Cr,K as ma,aI as Fe,n as be,bb as qa,c6 as pr,A as Ca,j as Ba,h as Ja,e as J,O as Xa,c7 as hr,H as Nt,al as Qa,bn as Qe,c8 as Ma,c9 as fr,v as et,a1 as gr,ca as br,ao as Vt,Q as za,I as Ht,g as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as ja,q as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-NPabbksF.js";import{n as _e,D as zt,S as xr}from"./mui-B87RTrAV.js";import{a as c}from"./sentry-C-hGmJ4T.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Be,f as Ue,A as Or,h as at,P as Lr,i as tt,s as ea,j as Gt,k as He,l as Zt,m as Br,n as Yt,p as Rr,S as it}from"./SetupPagesScreen-CT-3H_u9.js";import Ra from"./NotFoundScreen-Cryu2QFy.js";import{M as ha}from"./MobileAppDrawer-voD2LpO-.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-BTitwH51.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-Dv4iLJ0Q.js";import{v as ct}from"./utils-C4NhxqJn.js";import{t as Ur}from"./AddressScreen-TNOlKW9-.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./analyticsHelper-DkI5fHpv.js";import"./routePaths-DuYx1box.js";import"./BusinessVerificationPageScreen-Ct3CJnEw.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]="8cf6a15f-9828-4e85-b237-228d8aec6d3b",e._sentryDebugIdIdentifier="sentry-dbid-8cf6a15f-9828-4e85-b237-228d8aec6d3b")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=Q.getSignedInUser(),n=S(G=>ie(G)),u=Re(),m=Le(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:L}=C(Y.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(L,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,B=S(G=>Me(G,n.companyId)),j=ze(B.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],x=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Z=R?.accountingClassIDs[0],E=S(G=>Z!=null?Ia(G.classState,{classId:Z,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Za()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Be(l,g,w,f),O=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ye,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(La,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:O,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:x?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=Q.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ra,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,L]=c.useState(!1),v=Q.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Qt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:B}=oe(),{isFeatureEnabled:j}=B(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=B(Y.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:U}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const x=Q.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Ya(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Z=E=>{L(E)};if(w!=="Completed"||l==null)return s.jsx(Ye,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Z}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:x,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Z(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ze(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:Ba.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-it_Rhm8-.js";import{a as g}from"./sentry-C-hGmJ4T.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-BF8mCLAO.js";import{z as N,aZ as F,v as P,e as L,g as V,aa as C,a_ as j,ao as A,ap as B,n as U}from"./index-Drj6C88E.js";import{eM as b,fB as M,rs as _,fw as R,b$ as z,Ls as G,bm as Y,pA as Z,po as $,jW as q,lq as S,Lt as H,bB as W,cr as D,ly as J,lB as K}from"./zeni-epic-state-Ds1G4QGX.js";import"./mui-B87RTrAV.js";import{c as Q}from"./routePaths-Cqx2U__X.js";import{M as X}from"./MobileAppDrawer-CwjUL5yD.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="d3798e88-5a11-4b26-aa99-1e8a330d2565",n._sentryDebugIdIdentifier="sentry-dbid-d3798e88-5a11-4b26-aa99-1e8a330d2565")}catch{}})();const ee=E(function(n){const t=R(n),i=N.getSignedInUser(),l=b(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(K())},onAddressClick:e=>{const a=Q(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?D(u):void 0,meetingLink:y!=""&&y!=null?D(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.companySubIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:B(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?W(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(H(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n(q({files:e}))},onDeleteFile:e=>{n($(e))},onEditFileName:(e,a)=>{n(Z(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>b(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(M(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(F,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-it_Rhm8-.js";import{a as g}from"./sentry-C-hGmJ4T.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-BF8mCLAO.js";import{z as N,aZ as F,v as P,e as L,g as V,aa as C,a_ as j,ao as A,ap as B,n as U}from"./index-NPabbksF.js";import{eM as b,fB as M,rs as _,fw as R,b$ as z,Ls as G,bm as Y,pA as Z,po as $,jW as q,lq as S,Lt as H,bB as W,cr as D,ly as J,lB as K}from"./zeni-epic-state-Ds1G4QGX.js";import"./mui-B87RTrAV.js";import{c as Q}from"./routePaths-DuYx1box.js";import{M as X}from"./MobileAppDrawer-voD2LpO-.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="d3798e88-5a11-4b26-aa99-1e8a330d2565",n._sentryDebugIdIdentifier="sentry-dbid-d3798e88-5a11-4b26-aa99-1e8a330d2565")}catch{}})();const ee=E(function(n){const t=R(n),i=N.getSignedInUser(),l=b(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(K())},onAddressClick:e=>{const a=Q(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?D(u):void 0,meetingLink:y!=""&&y!=null?D(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.companySubIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:B(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?W(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(H(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n(q({files:e}))},onDeleteFile:e=>{n($(e))},onEditFileName:(e,a)=>{n(Z(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>b(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(M(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(F,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-it_Rhm8-.js";import{a}from"./sentry-C-hGmJ4T.js";import{h as D,u as v,g as m,N as w}from"./core-BF8mCLAO.js";import{Ib as O,eM as A,fi as _,mh as j,fJ as E,fh as U,eN as L,Ij as F}from"./zeni-epic-state-Ds1G4QGX.js";import{u as $,z as u,L as g,O as k,o as H}from"./index-Drj6C88E.js";import{n as z}from"./mui-B87RTrAV.js";import{t as R}from"./getLocaleForTenant-BZ9xLliJ.js";import{g as P,Q as G}from"./QBOConnectionScreen-ZhIN2-uP.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./empty-CH1gmPwH.js";import"./pdf-lib-BX9OJ6Nl.js";import"./index-Cuo-3WZY.js";import"./url-0lwNJByp.js";import"./index-DzmJ6hZq.js";import"./decodeURIComponentSafe-BogCAdat.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]="ebdc1798-a0a6-417e-926d-90f370c4f50f",t._sentryDebugIdIdentifier="sentry-dbid-ebdc1798-a0a6-417e-926d-90f370c4f50f")}catch{}})();const J=z.div`
1
+ import{j as C}from"./liveblocks-it_Rhm8-.js";import{a}from"./sentry-C-hGmJ4T.js";import{h as D,u as v,g as m,N as w}from"./core-BF8mCLAO.js";import{Ib as O,eM as A,fi as _,mh as j,fJ as E,fh as U,eN as L,Ij as F}from"./zeni-epic-state-Ds1G4QGX.js";import{u as $,z as u,L as g,O as k,o as H}from"./index-NPabbksF.js";import{n as z}from"./mui-B87RTrAV.js";import{t as R}from"./getLocaleForTenant-CdAyQ18u.js";import{g as P,Q as G}from"./QBOConnectionScreen-DuZo1yzm.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./empty-CH1gmPwH.js";import"./pdf-lib-BX9OJ6Nl.js";import"./index-Cuo-3WZY.js";import"./url-0lwNJByp.js";import"./index-DzmJ6hZq.js";import"./decodeURIComponentSafe-BogCAdat.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]="ebdc1798-a0a6-417e-926d-90f370c4f50f",t._sentryDebugIdIdentifier="sentry-dbid-ebdc1798-a0a6-417e-926d-90f370c4f50f")}catch{}})();const J=z.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -1 +1 @@
1
- import{j as d}from"./liveblocks-it_Rhm8-.js";import{z as n}from"./index-Drj6C88E.js";import{g as p}from"./QBOConnectionScreen-ZhIN2-uP.js";import"./sentry-C-hGmJ4T.js";import{u as a,N as i}from"./core-BF8mCLAO.js";import"./zeni-epic-state-Ds1G4QGX.js";import"./recharts-BBMAmq_A.js";import"./mui-B87RTrAV.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./empty-CH1gmPwH.js";import"./pdf-lib-BX9OJ6Nl.js";import"./index-Cuo-3WZY.js";import"./url-0lwNJByp.js";import"./index-DzmJ6hZq.js";import"./decodeURIComponentSafe-BogCAdat.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]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
1
+ import{j as d}from"./liveblocks-it_Rhm8-.js";import{z as n}from"./index-NPabbksF.js";import{g as p}from"./QBOConnectionScreen-DuZo1yzm.js";import"./sentry-C-hGmJ4T.js";import{u as a,N as i}from"./core-BF8mCLAO.js";import"./zeni-epic-state-Ds1G4QGX.js";import"./recharts-BBMAmq_A.js";import"./mui-B87RTrAV.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./empty-CH1gmPwH.js";import"./pdf-lib-BX9OJ6Nl.js";import"./index-Cuo-3WZY.js";import"./url-0lwNJByp.js";import"./index-DzmJ6hZq.js";import"./decodeURIComponentSafe-BogCAdat.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]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-it_Rhm8-.js";import{t as $e,A as Ce}from"./AddressScreen-BQPPe7pR.js";import ze from"./NotFoundScreen-DZbU-KCv.js";import{a as g}from"./sentry-C-hGmJ4T.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Me,n as Qe,o as M}from"./core-BF8mCLAO.js";import{q as de,S as le,z as B,s as ue,h as qe,d as _,n as V,v as H,e as N,r as je,g as X,ak as Ke,K as Je,al as Ie,j as te,am as Ze,an as ke,o as He,ao as We,ap as Ee,aq as Xe}from"./index-Drj6C88E.js";import{bm as Ye,eM as ee,fa as et,eS as pe,eQ as me,bu as tt,mf as at,f6 as nt,bL as ot,i_ as ae,j1 as ve,IX as st,bQ as it,b$ as ge,rG as he,rr as rt,J7 as Y,rH as _e,GD as ct,k2 as Ue,J8 as Ve,J9 as dt,Ja as lt,Jb as ut,iY as pt,i$ as mt,rt as Be,rF as gt,bB as Te,cr as ht,rT as xe,pA as ft,po as yt,jW as bt,fz as St,fy as Ct,fx as It,Jc as kt,rl as Et,rU as Tt,rX as xt,r_ as Ot,s4 as Pt,cR as At}from"./zeni-epic-state-Ds1G4QGX.js";import{n as fe}from"./mui-B87RTrAV.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-ZhIN2-uP.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./empty-CH1gmPwH.js";import"./pdf-lib-BX9OJ6Nl.js";import"./index-Cuo-3WZY.js";import"./url-0lwNJByp.js";import"./index-DzmJ6hZq.js";import"./decodeURIComponentSafe-BogCAdat.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]="14ed362e-9c33-41da-9b0a-0dac5dcbb476",t._sentryDebugIdIdentifier="sentry-dbid-14ed362e-9c33-41da-9b0a-0dac5dcbb476")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Ye(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),G=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,R=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=[],K=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!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"),I===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{b(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(J=>J.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-it_Rhm8-.js";import{t as $e,A as Ce}from"./AddressScreen-TNOlKW9-.js";import ze from"./NotFoundScreen-Cryu2QFy.js";import{a as g}from"./sentry-C-hGmJ4T.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Me,n as Qe,o as M}from"./core-BF8mCLAO.js";import{q as de,S as le,z as B,s as ue,h as qe,d as _,n as V,v as H,e as N,r as je,g as X,ak as Ke,K as Je,al as Ie,j as te,am as Ze,an as ke,o as He,ao as We,ap as Ee,aq as Xe}from"./index-NPabbksF.js";import{bm as Ye,eM as ee,fa as et,eS as pe,eQ as me,bu as tt,mf as at,f6 as nt,bL as ot,i_ as ae,j1 as ve,IX as st,bQ as it,b$ as ge,rG as he,rr as rt,J7 as Y,rH as _e,GD as ct,k2 as Ue,J8 as Ve,J9 as dt,Ja as lt,Jb as ut,iY as pt,i$ as mt,rt as Be,rF as gt,bB as Te,cr as ht,rT as xe,pA as ft,po as yt,jW as bt,fz as St,fy as Ct,fx as It,Jc as kt,rl as Et,rU as Tt,rX as xt,r_ as Ot,s4 as Pt,cR as At}from"./zeni-epic-state-Ds1G4QGX.js";import{n as fe}from"./mui-B87RTrAV.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-DuZo1yzm.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./empty-CH1gmPwH.js";import"./pdf-lib-BX9OJ6Nl.js";import"./index-Cuo-3WZY.js";import"./url-0lwNJByp.js";import"./index-DzmJ6hZq.js";import"./decodeURIComponentSafe-BogCAdat.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]="14ed362e-9c33-41da-9b0a-0dac5dcbb476",t._sentryDebugIdIdentifier="sentry-dbid-14ed362e-9c33-41da-9b0a-0dac5dcbb476")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Ye(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),G=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,R=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=[],K=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!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"),I===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{b(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(J=>J.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as i}from"./liveblocks-it_Rhm8-.js";import{l as G,g as k,u as $,h as V,j as q,k as Z,n as Qe,o as D}from"./core-BF8mCLAO.js";import{eM as j,Js as Oe,bB as Ut,bp as de,KF as Va,hO as Na,KG as Et,KH as Ga,hR as Xe,KI as Te,KJ as za,hW as $a,KK as Tt,KL as qa,h_ as et,KM as xe,KN as Za,cN as at,KO as Ha,KP as Ja,JM as Wa,iU as Qa,KQ as Xa,bm as _e,KR as Yt,Jg as X,bc as Kt,j6 as Vt,mp as Nt,iR as Gt,Ji as ee,Jh as z,KS as en,KT as tn,KU as zt,KV as pe,tw as ke,tx as ye,tU as ue,tO as te,tB as Se,KW as an,KX as nn,KY as on,KZ as $t,K_ as he,K$ as sn,dA as Fe,q8 as qt,L0 as rn,L1 as cn,L2 as ln,L3 as nt,ID as ot,jm as st,u0 as rt,qg as dn,L4 as un,ty as xt,qb as ie,q7 as Zt,L5 as oe,L6 as mn,L7 as ct,IC as it,s8 as Ht,L8 as pn,L9 as hn,La as fn,Lb as lt,sl as gn,Lc as bn,tA as Dt,s7 as Jt,Ld as se,Le as Cn,bu as Wt,u4 as Qt,Lf as _n,Lg as kn,Lh as yn,Li as dt,t$ as Sn,Lj as vn,tz as Ot,u3 as Xt,Lk as re,Ll as In,Lm as An,Ln as ea,jb as ta,mm as aa,jg as na,mk as oa,mj as sa,mi as ra,rw as wn,fa as En,cK as Tn,cL as xn,mf as Dn,f6 as On,mv as Fn,Lo as Pn,D8 as Bn,Lp as Rn,Lq as jn,Lr as Ln,b5 as ut,eY as Mn,gw as Un,fB as Yn,mq as Kn,iK as Vn,mn as Nn,ml as Gn,eS as zn,eQ as $n}from"./zeni-epic-state-Ds1G4QGX.js";import{z as B,Q as H,n as O,e as S,O as N,aP as qn,H as Pe,v as ve,aQ as ca,g as Y,aR as Zn,S as Ie,aS as ia,s as mt,d as L,h as Hn,aT as Jn,aU as Wn,aV as Ae,aW as Qn,a as Xn,al as eo,aI as to,p as ao,I as no,aX as oo,aY as ge}from"./index-Drj6C88E.js";import{n as pt}from"./mui-B87RTrAV.js";import{a as _}from"./sentry-C-hGmJ4T.js";import{w as la}from"./withTransactionSidePanel-DTDtCDdY.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-Cqx2U__X.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-wDzGPcQn.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-D4I-78Sf.js";import Ce from"./NotFoundScreen-DZbU-KCv.js";import{t as ua}from"./analyticsHelper-BlP3gsal.js";import{C as ro}from"./CompanyPassportScreen-C8EcswEA.js";import{F as co}from"./FeaturePreviewScreen-Bd18oGQj.js";import{R as io}from"./ReferralListScreen-CWHCaSQw.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./TransactionDetailScreen-CbyG0n1m.js";import"./decodeURIComponentSafe-BogCAdat.js";import"./MobileAppDrawer-CwjUL5yD.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]="48424f5b-7195-47d4-8bb0-0f0897eee38b",e._sentryDebugIdIdentifier="sentry-dbid-48424f5b-7195-47d4-8bb0-0f0897eee38b")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(E=>E.tenantState.currentTenantId),u=k(E=>j(E)),{tenantEmailDomain:m}=G(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Oe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=V(),g=q(),f=k(E=>Va(E,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Na(o,d))},[d]),w=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((E,J)=>{p(Et({sortKey:E,sortOrder:J}))},[]),A=_.useCallback(E=>{p(Et({downloadState:E}))},[]),I=_.useCallback(E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const J=da({id:E.transactionId,type:E.transactionType},m);g(J);const Le=O(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Le}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(qn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:w,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=q(),o=k(I=>Ga(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Oe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Xe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(Te({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(Te({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),w=_.useCallback(I=>{t(Te({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(Te({selectedDate:I,agingDateSelectionType:x})),t(Xe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:w,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=G(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Oe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=V(),p=q(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),w=_.useCallback((x,E)=>{d(Tt({sortKey:x,sortOrder:E}))},[]),R=_.useCallback(x=>{d(Tt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const E=da({id:x.transactionId,type:x.transactionType},u);p(E);const J=O(m.state?.pathnameStackToGoBack,m.pathname);p(E,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(Zn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:w,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=q(),o=k(A=>qa(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Oe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),w=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(Za({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:w,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Wa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Qa(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=Z(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:N.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=Z(function(e){const a=Xa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:N.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
1
+ import{j as i}from"./liveblocks-it_Rhm8-.js";import{l as G,g as k,u as $,h as V,j as q,k as Z,n as Qe,o as D}from"./core-BF8mCLAO.js";import{eM as j,Js as Oe,bB as Ut,bp as de,KF as Va,hO as Na,KG as Et,KH as Ga,hR as Xe,KI as Te,KJ as za,hW as $a,KK as Tt,KL as qa,h_ as et,KM as xe,KN as Za,cN as at,KO as Ha,KP as Ja,JM as Wa,iU as Qa,KQ as Xa,bm as _e,KR as Yt,Jg as X,bc as Kt,j6 as Vt,mp as Nt,iR as Gt,Ji as ee,Jh as z,KS as en,KT as tn,KU as zt,KV as pe,tw as ke,tx as ye,tU as ue,tO as te,tB as Se,KW as an,KX as nn,KY as on,KZ as $t,K_ as he,K$ as sn,dA as Fe,q8 as qt,L0 as rn,L1 as cn,L2 as ln,L3 as nt,ID as ot,jm as st,u0 as rt,qg as dn,L4 as un,ty as xt,qb as ie,q7 as Zt,L5 as oe,L6 as mn,L7 as ct,IC as it,s8 as Ht,L8 as pn,L9 as hn,La as fn,Lb as lt,sl as gn,Lc as bn,tA as Dt,s7 as Jt,Ld as se,Le as Cn,bu as Wt,u4 as Qt,Lf as _n,Lg as kn,Lh as yn,Li as dt,t$ as Sn,Lj as vn,tz as Ot,u3 as Xt,Lk as re,Ll as In,Lm as An,Ln as ea,jb as ta,mm as aa,jg as na,mk as oa,mj as sa,mi as ra,rw as wn,fa as En,cK as Tn,cL as xn,mf as Dn,f6 as On,mv as Fn,Lo as Pn,D8 as Bn,Lp as Rn,Lq as jn,Lr as Ln,b5 as ut,eY as Mn,gw as Un,fB as Yn,mq as Kn,iK as Vn,mn as Nn,ml as Gn,eS as zn,eQ as $n}from"./zeni-epic-state-Ds1G4QGX.js";import{z as B,Q as H,n as O,e as S,O as N,aP as qn,H as Pe,v as ve,aQ as ca,g as Y,aR as Zn,S as Ie,aS as ia,s as mt,d as L,h as Hn,aT as Jn,aU as Wn,aV as Ae,aW as Qn,a as Xn,al as eo,aI as to,p as ao,I as no,aX as oo,aY as ge}from"./index-NPabbksF.js";import{n as pt}from"./mui-B87RTrAV.js";import{a as _}from"./sentry-C-hGmJ4T.js";import{w as la}from"./withTransactionSidePanel-Bz9MapFR.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-DuYx1box.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-BTitwH51.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-Dv4iLJ0Q.js";import Ce from"./NotFoundScreen-Cryu2QFy.js";import{t as ua}from"./analyticsHelper-DkI5fHpv.js";import{C as ro}from"./CompanyPassportScreen-DKFPDRmC.js";import{F as co}from"./FeaturePreviewScreen-DFD5zg_r.js";import{R as io}from"./ReferralListScreen-BTF2hmjO.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./TransactionDetailScreen-D4rokNI1.js";import"./decodeURIComponentSafe-BogCAdat.js";import"./MobileAppDrawer-voD2LpO-.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]="48424f5b-7195-47d4-8bb0-0f0897eee38b",e._sentryDebugIdIdentifier="sentry-dbid-48424f5b-7195-47d4-8bb0-0f0897eee38b")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(E=>E.tenantState.currentTenantId),u=k(E=>j(E)),{tenantEmailDomain:m}=G(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Oe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=V(),g=q(),f=k(E=>Va(E,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Na(o,d))},[d]),w=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((E,J)=>{p(Et({sortKey:E,sortOrder:J}))},[]),A=_.useCallback(E=>{p(Et({downloadState:E}))},[]),I=_.useCallback(E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const J=da({id:E.transactionId,type:E.transactionType},m);g(J);const Le=O(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Le}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(qn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:w,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=q(),o=k(I=>Ga(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Oe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Xe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(Te({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(Te({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),w=_.useCallback(I=>{t(Te({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(Te({selectedDate:I,agingDateSelectionType:x})),t(Xe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:w,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=G(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Oe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=V(),p=q(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),w=_.useCallback((x,E)=>{d(Tt({sortKey:x,sortOrder:E}))},[]),R=_.useCallback(x=>{d(Tt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const E=da({id:x.transactionId,type:x.transactionType},u);p(E);const J=O(m.state?.pathnameStackToGoBack,m.pathname);p(E,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(Zn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:w,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=q(),o=k(A=>qa(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Oe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),w=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(Za({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:w,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Wa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Qa(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=Z(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:N.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=Z(function(e){const a=Xa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:N.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.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-it_Rhm8-.js";import{a as u}from"./sentry-C-hGmJ4T.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-BF8mCLAO.js";import{Ib as N,eM as _,fi as U,Ic as L,mh as R,Id as z}from"./zeni-epic-state-Ds1G4QGX.js";import{u as O,z as h,L as T,t as S,O as $,b as j}from"./index-Drj6C88E.js";import"./mui-B87RTrAV.js";import{t as P}from"./getLocaleForTenant-BZ9xLliJ.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.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]="20ea8c61-1a72-44ea-8ece-a88d3bca98ac",t._sentryDebugIdIdentifier="sentry-dbid-20ea8c61-1a72-44ea-8ece-a88d3bca98ac")}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:f}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=f.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,I=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,I=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=j(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),f=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(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=h.getSignedInUser();return u.useLayoutEffect(()=>{const e=h.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,f.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!f.current||a!=="Completed"&&a!=="Error"||(f.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=h.getActiveTenantForUser()?.tenantId;f.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(f.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=h.getSignedInUser(),g=h.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{h.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(h.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!h.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.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"],G={"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 G[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-it_Rhm8-.js";import{a as u}from"./sentry-C-hGmJ4T.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-BF8mCLAO.js";import{Ib as N,eM as _,fi as U,Ic as L,mh as R,Id as z}from"./zeni-epic-state-Ds1G4QGX.js";import{u as O,z as h,L as T,t as S,O as $,b as j}from"./index-NPabbksF.js";import"./mui-B87RTrAV.js";import{t as P}from"./getLocaleForTenant-CdAyQ18u.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.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]="20ea8c61-1a72-44ea-8ece-a88d3bca98ac",t._sentryDebugIdIdentifier="sentry-dbid-20ea8c61-1a72-44ea-8ece-a88d3bca98ac")}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:f}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=f.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,I=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,I=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=j(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),f=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(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=h.getSignedInUser();return u.useLayoutEffect(()=>{const e=h.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,f.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!f.current||a!=="Completed"&&a!=="Error"||(f.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=h.getActiveTenantForUser()?.tenantId;f.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(f.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=h.getSignedInUser(),g=h.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{h.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(h.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!h.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.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"],G={"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 G[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-it_Rhm8-.js";import{j as w,u as C,g as h,k as A,l as V}from"./core-BF8mCLAO.js";import{M9 as k,Mg as _,fz as J,fy as K,fx as L,ii as W,Jh as q,pr as Q,eM as B,LH as D,ig as T,Ma as S,Mj as F,id as G,iC as j}from"./zeni-epic-state-Ds1G4QGX.js";import{bj as X,K as R,s as N,z as U,h as M,p,d as v,r as z,bk as Y,o as H,bl as ee,n as te}from"./index-Drj6C88E.js";import{n as O}from"./mui-B87RTrAV.js";import"./sentry-C-hGmJ4T.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]="0b6810dd-89a9-4e24-9ac8-a95116402453",e._sentryDebugIdIdentifier="sentry-dbid-0b6810dd-89a9-4e24-9ac8-a95116402453")}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(q("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(L(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function Z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
1
+ import{j as l}from"./liveblocks-it_Rhm8-.js";import{j as w,u as C,g as h,k as A,l as V}from"./core-BF8mCLAO.js";import{M9 as k,Mg as _,fz as J,fy as K,fx as L,ii as W,Jh as q,pr as Q,eM as B,LH as D,ig as T,Ma as S,Mj as F,id as G,iC as j}from"./zeni-epic-state-Ds1G4QGX.js";import{bj as X,K as R,s as N,z as U,h as M,p,d as v,r as z,bk as Y,o as H,bl as ee,n as te}from"./index-NPabbksF.js";import{n as O}from"./mui-B87RTrAV.js";import"./sentry-C-hGmJ4T.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]="0b6810dd-89a9-4e24-9ac8-a95116402453",e._sentryDebugIdIdentifier="sentry-dbid-0b6810dd-89a9-4e24-9ac8-a95116402453")}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(q("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(L(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function Z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as d}from"./liveblocks-it_Rhm8-.js";import{K as c,A as l,h as f}from"./index-Drj6C88E.js";import{D as p}from"./mui-B87RTrAV.js";import"./sentry-C-hGmJ4T.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]="2fa64745-7920-402f-ba89-c26a2e8cc932",e._sentryDebugIdIdentifier="sentry-dbid-2fa64745-7920-402f-ba89-c26a2e8cc932")}catch{}})();const u={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)??u.drawerLeftMargin.valuePx(n),i=f();return d.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
1
+ import{j as d}from"./liveblocks-it_Rhm8-.js";import{K as c,A as l,h as f}from"./index-NPabbksF.js";import{D as p}from"./mui-B87RTrAV.js";import"./sentry-C-hGmJ4T.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]="2fa64745-7920-402f-ba89-c26a2e8cc932",e._sentryDebugIdIdentifier="sentry-dbid-2fa64745-7920-402f-ba89-c26a2e8cc932")}catch{}})();const u={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)??u.drawerLeftMargin.valuePx(n),i=f();return d.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-it_Rhm8-.js";import{a as d}from"./sentry-C-hGmJ4T.js";import{j as A,h as B,u as J,l as N,g as l,N as q,k as F,n as M,o as O}from"./core-BF8mCLAO.js";import{Ko as _,eM as K,JN as R,km as W,Gv as k,Kt as Y,Jg as $,jm as z,Gw as P,JS as V,JT as H,Ji as L,Jh as Q}from"./zeni-epic-state-Ds1G4QGX.js";import{aM as U,e as X,p as Z,n as tt}from"./index-Drj6C88E.js";import"./mui-B87RTrAV.js";import{d as S}from"./decodeURIComponentSafe-BogCAdat.js";import{w as et}from"./withTransactionSidePanel-DTDtCDdY.js";import{e as at,b as nt}from"./routePaths-Cqx2U__X.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./useAskAiCfoHostNavButtonProps-wDzGPcQn.js";import"./useFetchSuggestedQuestionsWhenReady-D4I-78Sf.js";import"./TransactionDetailScreen-CbyG0n1m.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]="b6eb3dcb-12a8-42d1-b40b-27e795e7302f",a._sentryDebugIdIdentifier="sentry-dbid-b6eb3dcb-12a8-42d1-b40b-27e795e7302f")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(H()),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(P(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(P(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=N(),r=S(j??""),p=S(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(W(i)))},[m,u,i]);const b=l(n=>n.trendState.fetchState),E=f?.selectedPeriod?.timePeriod??D,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&b==="Completed"&&(g(!0),E!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,b]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{to:I(x.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 wt({entityType:a}){return s.jsx(M,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
1
+ import{j as s}from"./liveblocks-it_Rhm8-.js";import{a as d}from"./sentry-C-hGmJ4T.js";import{j as A,h as B,u as J,l as N,g as l,N as q,k as F,n as M,o as O}from"./core-BF8mCLAO.js";import{Ko as _,eM as K,JN as R,km as W,Gv as k,Kt as Y,Jg as $,jm as z,Gw as P,JS as V,JT as H,Ji as L,Jh as Q}from"./zeni-epic-state-Ds1G4QGX.js";import{aM as U,e as X,p as Z,n as tt}from"./index-NPabbksF.js";import"./mui-B87RTrAV.js";import{d as S}from"./decodeURIComponentSafe-BogCAdat.js";import{w as et}from"./withTransactionSidePanel-Bz9MapFR.js";import{e as at,b as nt}from"./routePaths-DuYx1box.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./useAskAiCfoHostNavButtonProps-BTitwH51.js";import"./useFetchSuggestedQuestionsWhenReady-Dv4iLJ0Q.js";import"./TransactionDetailScreen-D4rokNI1.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]="b6eb3dcb-12a8-42d1-b40b-27e795e7302f",a._sentryDebugIdIdentifier="sentry-dbid-b6eb3dcb-12a8-42d1-b40b-27e795e7302f")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(H()),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(P(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(P(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=N(),r=S(j??""),p=S(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(W(i)))},[m,u,i]);const b=l(n=>n.trendState.fetchState),E=f?.selectedPeriod?.timePeriod??D,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&b==="Completed"&&(g(!0),E!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,b]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{to:I(x.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 wt({entityType:a}){return s.jsx(M,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
@@ -1,4 +1,4 @@
1
- import{j as p}from"./liveblocks-it_Rhm8-.js";import xn from"./NotFoundScreen-DZbU-KCv.js";import{a as s,b as Pt}from"./sentry-C-hGmJ4T.js";import{n as De,S as Rn}from"./mui-B87RTrAV.js";import{h as se,j as wt,u as Ge,g as B,k as Dn,l as rt,n as On,o as je}from"./core-BF8mCLAO.js";import{eM as we,OH as Un,e$ as Ce,fd as Bn,q2 as Fn,mI as xt,mO as Rt,OI as Dt,nb as _n,OJ as Ot,mB as Vn,pA as Mn,eX as he,OK as xe,s1 as Ut,Bc as Bt,OL as Ft,OM as jn,pf as qe,Kp as dt,Kr as zn,jp as Ln,Ks as $n,jw as Gn,cT as qn,t4 as Je,jm as Jn,mP as _t,ng as Re,ON as Nn,Ji as ut,Jh as Ae,OO as mt,jN as Yn,OP as Kn,OQ as Zn,OR as Hn,OS as Qn,mY as Wn,mG as ce,nj as Te,OT as Xn,OU as ea,OV as ta,nq as na,jA as aa,jr as oa,OW as sa,jz as ht,Kz as ca,OX as ia,OY as la,pb as ra,oS as da,nh as pe,oR as ze,OZ as ua,O_ as ma,l4 as ha,bp as pa,k$ as pt,kN as ga,O$ as Ca,gy as gt,fL as Sa,kY as fa,uZ as Ia,P0 as ka,nR as Ea,nM as ya,nQ as va,nB as ba,P1 as Aa,e_ as Vt,n4 as Ta,mV as Pa,fe as Ct,nl as wa,P2 as xa,ni as Mt,P3 as Ra,P4 as Da,P5 as Oa,P6 as Ua,P7 as St,pn as Ba,oB as Fa,Jg as _a,jy as Va,P8 as Ma,Fw as ja,jx as za,eZ as La,ob as jt,oJ as $a,nf as ft,nk as Ga,bB as qa,kV as Ja,kS as Na,P9 as Ya,nA as It,ok as kt,ot as Ka,og as Za,oG as Ha,ol as Qa,Pa as Wa,Pb as Xa,n_ as eo,Pc as to,nY as no,nZ as ao,nW as oo,ov as so}from"./zeni-epic-state-Ds1G4QGX.js";import{H as zt,s as Lt,d as ge,e as L,n as Q,I as $t,cq as co,z as Oe,cr as io,ao as Pe,cs as lo,aO as Et,r as Gt,ct as ro,al as Le,O as uo,cu as mo,Q as ho,cv as po,cw as go,cx as Co,q as So,S as fo,aI as Io,aZ as ko,A as Eo,cy as yo}from"./index-Drj6C88E.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-wDzGPcQn.js";import{c as Jt}from"./useFetchSuggestedQuestionsWhenReady-D4I-78Sf.js";import{c as yt,C as vo}from"./TransactionDetailScreen-CbyG0n1m.js";import{w as bo}from"./withTransactionSidePanel-DTDtCDdY.js";import{h as Ao,v as To}from"./routePaths-Cqx2U__X.js";import{g as $e}from"./accountMappingHelper-DpblOBXy.js";import{D as Po}from"./DrawerScreen-HBFMcVvk.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./decodeURIComponentSafe-BogCAdat.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="580df9b9-fbc6-4873-970e-9c9f09fced9e",t._sentryDebugIdIdentifier="sentry-dbid-580df9b9-fbc6-4873-970e-9c9f09fced9e")}catch{}})();const wo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:d}=zt(),O=se(),E=wt(),S=Ge(),u=B(g=>we(g)),{useFeatureGate:c}=Lt(),{isFeatureEnabled:F}=c(ge.isRealtimeInsightsFeatureEnabled),m=B(g=>g.expenseAutomationViewState.selectedPeriodByTenantId),o=B(g=>Un(g,u.tenantId)),{isAiCfoAccessEnabled:y,onAskAiCfoClick:I}=qt({isAiCfoOpen:t,setIsAiCfoOpen:d,mobileExploreReferrer:"Month-End Close Overview"}),v=s.useCallback((g,T,_=!1)=>{O(Ce({tenantId:T,period:{month:g.month,year:g.year},refreshViewInBackground:_}))},[]),V=s.useCallback(g=>{const T=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(g.month,g.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,T??null),O(Bn(u.tenantId,g))},[u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),i=m[u.tenantId],h=s.useCallback(()=>{const g=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(i.month,i.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,g??null),v(i,u.tenantId,!0)},[v,i,u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),w=Q(S.state?.pathnameStackToGoBack,S.pathname),A=s.useCallback(()=>{if(o.monthEndCloseChecks!=null&&i!=null){const g=o.monthEndCloseChecks.monthEndCloseCheckList.find(T=>T.progress<100);if(g!=null)return void E(`./${g.id}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}});E(`./month_end_insights/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,i]),{areTenantIdsInSync:x}=$t();return Jt({isDataReady:o.fetchState==="Completed"}),s.useEffect(()=>{i!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&x&&v(i,u.tenantId)},[v,i,o.fetchState,u.tenantId,x]),s.useEffect(()=>{i!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&x&&O(Fn(i))},[i,o.monthClosePerformanceTrendFetchStatus.fetchState,x]),s.useEffect(()=>{const g=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&h()},3e5);return()=>clearInterval(g)},[o.fetchState]),s.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const g=S.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,g??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),p.jsx(xo,{children:p.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:F,onMonthEndCheckClick:g=>{E(`./${g}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:V,handleReviewButtonClick:A,onBackClick:()=>{E("../../dashboard")},onReload:h,isAiCfoAccessEnabled:y,onAskAiCfoClick:I})})},xo=De.div`
1
+ import{j as p}from"./liveblocks-it_Rhm8-.js";import xn from"./NotFoundScreen-Cryu2QFy.js";import{a as s,b as Pt}from"./sentry-C-hGmJ4T.js";import{n as De,S as Rn}from"./mui-B87RTrAV.js";import{h as se,j as wt,u as Ge,g as B,k as Dn,l as rt,n as On,o as je}from"./core-BF8mCLAO.js";import{eM as we,OH as Un,e$ as Ce,fd as Bn,q2 as Fn,mI as xt,mO as Rt,OI as Dt,nb as _n,OJ as Ot,mB as Vn,pA as Mn,eX as he,OK as xe,s1 as Ut,Bc as Bt,OL as Ft,OM as jn,pf as qe,Kp as dt,Kr as zn,jp as Ln,Ks as $n,jw as Gn,cT as qn,t4 as Je,jm as Jn,mP as _t,ng as Re,ON as Nn,Ji as ut,Jh as Ae,OO as mt,jN as Yn,OP as Kn,OQ as Zn,OR as Hn,OS as Qn,mY as Wn,mG as ce,nj as Te,OT as Xn,OU as ea,OV as ta,nq as na,jA as aa,jr as oa,OW as sa,jz as ht,Kz as ca,OX as ia,OY as la,pb as ra,oS as da,nh as pe,oR as ze,OZ as ua,O_ as ma,l4 as ha,bp as pa,k$ as pt,kN as ga,O$ as Ca,gy as gt,fL as Sa,kY as fa,uZ as Ia,P0 as ka,nR as Ea,nM as ya,nQ as va,nB as ba,P1 as Aa,e_ as Vt,n4 as Ta,mV as Pa,fe as Ct,nl as wa,P2 as xa,ni as Mt,P3 as Ra,P4 as Da,P5 as Oa,P6 as Ua,P7 as St,pn as Ba,oB as Fa,Jg as _a,jy as Va,P8 as Ma,Fw as ja,jx as za,eZ as La,ob as jt,oJ as $a,nf as ft,nk as Ga,bB as qa,kV as Ja,kS as Na,P9 as Ya,nA as It,ok as kt,ot as Ka,og as Za,oG as Ha,ol as Qa,Pa as Wa,Pb as Xa,n_ as eo,Pc as to,nY as no,nZ as ao,nW as oo,ov as so}from"./zeni-epic-state-Ds1G4QGX.js";import{H as zt,s as Lt,d as ge,e as L,n as Q,I as $t,cq as co,z as Oe,cr as io,ao as Pe,cs as lo,aO as Et,r as Gt,ct as ro,al as Le,O as uo,cu as mo,Q as ho,cv as po,cw as go,cx as Co,q as So,S as fo,aI as Io,aZ as ko,A as Eo,cy as yo}from"./index-NPabbksF.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-BTitwH51.js";import{c as Jt}from"./useFetchSuggestedQuestionsWhenReady-Dv4iLJ0Q.js";import{c as yt,C as vo}from"./TransactionDetailScreen-D4rokNI1.js";import{w as bo}from"./withTransactionSidePanel-Bz9MapFR.js";import{h as Ao,v as To}from"./routePaths-DuYx1box.js";import{g as $e}from"./accountMappingHelper-DpblOBXy.js";import{D as Po}from"./DrawerScreen-C1N2vxzH.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.js";import"./decodeURIComponentSafe-BogCAdat.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="580df9b9-fbc6-4873-970e-9c9f09fced9e",t._sentryDebugIdIdentifier="sentry-dbid-580df9b9-fbc6-4873-970e-9c9f09fced9e")}catch{}})();const wo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:d}=zt(),O=se(),E=wt(),S=Ge(),u=B(g=>we(g)),{useFeatureGate:c}=Lt(),{isFeatureEnabled:F}=c(ge.isRealtimeInsightsFeatureEnabled),m=B(g=>g.expenseAutomationViewState.selectedPeriodByTenantId),o=B(g=>Un(g,u.tenantId)),{isAiCfoAccessEnabled:y,onAskAiCfoClick:I}=qt({isAiCfoOpen:t,setIsAiCfoOpen:d,mobileExploreReferrer:"Month-End Close Overview"}),v=s.useCallback((g,T,_=!1)=>{O(Ce({tenantId:T,period:{month:g.month,year:g.year},refreshViewInBackground:_}))},[]),V=s.useCallback(g=>{const T=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(g.month,g.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,T??null),O(Bn(u.tenantId,g))},[u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),i=m[u.tenantId],h=s.useCallback(()=>{const g=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(i.month,i.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,g??null),v(i,u.tenantId,!0)},[v,i,u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),w=Q(S.state?.pathnameStackToGoBack,S.pathname),A=s.useCallback(()=>{if(o.monthEndCloseChecks!=null&&i!=null){const g=o.monthEndCloseChecks.monthEndCloseCheckList.find(T=>T.progress<100);if(g!=null)return void E(`./${g.id}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}});E(`./month_end_insights/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,i]),{areTenantIdsInSync:x}=$t();return Jt({isDataReady:o.fetchState==="Completed"}),s.useEffect(()=>{i!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&x&&v(i,u.tenantId)},[v,i,o.fetchState,u.tenantId,x]),s.useEffect(()=>{i!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&x&&O(Fn(i))},[i,o.monthClosePerformanceTrendFetchStatus.fetchState,x]),s.useEffect(()=>{const g=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&h()},3e5);return()=>clearInterval(g)},[o.fetchState]),s.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const g=S.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,g??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),p.jsx(xo,{children:p.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:F,onMonthEndCheckClick:g=>{E(`./${g}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:V,handleReviewButtonClick:A,onBackClick:()=>{E("../../dashboard")},onReload:h,isAiCfoAccessEnabled:y,onAskAiCfoClick:I})})},xo=De.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-it_Rhm8-.js";import{a as d}from"./sentry-C-hGmJ4T.js";import{W as i,Y as l,_ as p,p as c}from"./index-Drj6C88E.js";import"./mui-B87RTrAV.js";import m from"./NotFoundScreen-DZbU-KCv.js";import{j as u,u as b}from"./core-BF8mCLAO.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="118adab5-fa9d-47c4-a924-6dd394fd860f",a._sentryDebugIdIdentifier="sentry-dbid-118adab5-fa9d-47c4-a924-6dd394fd860f")}catch{}})();const j=()=>{const a=u(),e=b(),t=d.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),r=d.useCallback(()=>{(()=>{const n=c(e.state?.pathnameStackToGoBack),f=n.poppedPathname??k();a(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(e.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:r}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{j as F};
1
+ import{j as s}from"./liveblocks-it_Rhm8-.js";import{a as d}from"./sentry-C-hGmJ4T.js";import{W as i,Y as l,_ as p,p as c}from"./index-NPabbksF.js";import"./mui-B87RTrAV.js";import m from"./NotFoundScreen-Cryu2QFy.js";import{j as u,u as b}from"./core-BF8mCLAO.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="118adab5-fa9d-47c4-a924-6dd394fd860f",a._sentryDebugIdIdentifier="sentry-dbid-118adab5-fa9d-47c4-a924-6dd394fd860f")}catch{}})();const j=()=>{const a=u(),e=b(),t=d.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),r=d.useCallback(()=>{(()=>{const n=c(e.state?.pathnameStackToGoBack),f=n.poppedPathname??k();a(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(e.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:r}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{j as F};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-it_Rhm8-.js";import{l as w,k as x,j,u as y,h as Y,q as ee,g as A,N as ae,n as te,o as p}from"./core-BF8mCLAO.js";import{It as S,Iu as k,Iv as N,yP as $,yB as L,Iw as C,Ix as ne,Iy as oe,yF as ie,eN as I,yM as se,yJ as le}from"./zeni-epic-state-Ds1G4QGX.js";import{K as g,o as d,Z as de,e as v,j as E,k as re,p as ce,m as me,n as F,s as pe,d as ue,J as he,q as xe,h as ge,r as be,v as fe,w as we,x as ye,y as Se,A as ke,X as ve}from"./index-Drj6C88E.js";import{n as c}from"./mui-B87RTrAV.js";import b from"./NotFoundScreen-DZbU-KCv.js";import{a as P}from"./sentry-C-hGmJ4T.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.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]="823ba5ab-c971-4fc2-84bd-a4e32b99d11d",e._sentryDebugIdIdentifier="sentry-dbid-823ba5ab-c971-4fc2-84bd-a4e32b99d11d")}catch{}})();const Ie=c.div`
1
+ import{j as a}from"./liveblocks-it_Rhm8-.js";import{l as w,k as x,j,u as y,h as Y,q as ee,g as A,N as ae,n as te,o as p}from"./core-BF8mCLAO.js";import{It as S,Iu as k,Iv as N,yP as $,yB as L,Iw as C,Ix as ne,Iy as oe,yF as ie,eN as I,yM as se,yJ as le}from"./zeni-epic-state-Ds1G4QGX.js";import{K as g,o as d,Z as de,e as v,j as E,k as re,p as ce,m as me,n as F,s as pe,d as ue,J as he,q as xe,h as ge,r as be,v as fe,w as we,x as ye,y as Se,A as ke,X as ve}from"./index-NPabbksF.js";import{n as c}from"./mui-B87RTrAV.js";import b from"./NotFoundScreen-Cryu2QFy.js";import{a as P}from"./sentry-C-hGmJ4T.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.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]="823ba5ab-c971-4fc2-84bd-a4e32b99d11d",e._sentryDebugIdIdentifier="sentry-dbid-823ba5ab-c971-4fc2-84bd-a4e32b99d11d")}catch{}})();const Ie=c.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-it_Rhm8-.js";import{a as g}from"./sentry-C-hGmJ4T.js";import{h as U,u as w,j as _,q as M,g as l,N as T}from"./core-BF8mCLAO.js";import{z as r,h as P,O as V,f as A,e as N,g as q,D as R,w as W,i as $}from"./index-Drj6C88E.js";import{eM as B,Id as G,Io as H,Ie as J,eN as K,fh as Q,Ik as X,fF as Y,cR as Z,Ip as ee,Iq as te}from"./zeni-epic-state-Ds1G4QGX.js";import{n as ne}from"./mui-B87RTrAV.js";import{u as se}from"./useDeviceId-CGZ6TLY7.js";import{f as ae}from"./analyticsHelper-BlP3gsal.js";import{t as ie}from"./getLocaleForTenant-BZ9xLliJ.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.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]="b63b7d5a-8b2c-4dea-a355-886e176d0c7b",t._sentryDebugIdIdentifier="sentry-dbid-b63b7d5a-8b2c-4dea-a355-886e176d0c7b")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=U(),a=w(),f=_(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),b=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,m)))},[n,p,t,i,m,s?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(b.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,a.state,t]);const F=g.useCallback(()=>{f("/signin/auth")},[f]),O=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),j=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:O,onVerifyOtp:j,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||m==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-it_Rhm8-.js";import{a as g}from"./sentry-C-hGmJ4T.js";import{h as U,u as w,j as _,q as M,g as l,N as T}from"./core-BF8mCLAO.js";import{z as r,h as P,O as V,f as A,e as N,g as q,D as R,w as W,i as $}from"./index-NPabbksF.js";import{eM as B,Id as G,Io as H,Ie as J,eN as K,fh as Q,Ik as X,fF as Y,cR as Z,Ip as ee,Iq as te}from"./zeni-epic-state-Ds1G4QGX.js";import{n as ne}from"./mui-B87RTrAV.js";import{u as se}from"./useDeviceId-CGZ6TLY7.js";import{f as ae}from"./analyticsHelper-DkI5fHpv.js";import{t as ie}from"./getLocaleForTenant-CdAyQ18u.js";import"./recharts-BBMAmq_A.js";import"./analytics-BSnG8C1z.js";import"./plaid-lXH1vlKo.js";import"./dnd-BwvUecBQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CJdx3HBv.js";import"./lexical-BHRXj1_E.js";import"./pdf-oE7nS36B.js";import"./utils-C4NhxqJn.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]="b63b7d5a-8b2c-4dea-a355-886e176d0c7b",t._sentryDebugIdIdentifier="sentry-dbid-b63b7d5a-8b2c-4dea-a355-886e176d0c7b")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=U(),a=w(),f=_(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),b=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,m)))},[n,p,t,i,m,s?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(b.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,a.state,t]);const F=g.useCallback(()=>{f("/signin/auth")},[f]),O=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),j=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:O,onVerifyOtp:j,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||m==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;