@zeniai/web-app-ui 5.0.77-dev → 5.0.77-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/assets/{AddressRoutes-Clm_yxMo.js → AddressRoutes-O04th73J.js} +1 -1
  2. package/dist/assets/{AddressScreen-ByYpZmgQ.js → AddressScreen-Bk_munT3.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-DbYSFoNw.js → AiCfoScreen-9dFOdDvS.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-CX2-tB9Z.js → BillPayApprovalRoutes-COiJeUFT.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-CFin72Sd.js → BillPayRoutes-DRXDrSZP.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-C-d6e6xJ.js → BusinessVerificationPageScreen-CnAB8eUQ.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-BqilxZnu.js → ChargeCardRoutes-C9NA04uL.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-Btm8q2XT.js → CompanyPassportScreen-BWjh-1tt.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-B3NEPge1.js → ConnectionAuthScreen-D6DaHf5c.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-BP98cwHW.js → CustomerOnboardingAuthScreen-3eEcB707.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-Cx10OoO6.js → CustomerOnboardingRoutes-l7rM0eut.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-Dr7E3H8N.js → DashboardRoutes-BR-AxyQo.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-BmA8DcRx.js → DefaultTenantHome-C74gAQVt.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-CzSUYZwn.js → DomesticWireDetailScreen-CWWX1EFM.js} +1 -1
  15. package/dist/assets/{DrawerScreen-AH0ysY6V.js → DrawerScreen-DzkaoOWL.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-DVGIBaLz.js → EntityDetailRoutes-B7e2LtGS.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-BhbZS8a1.js → ExpenseAutomationRoutes-But3rf3J.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-DPxCLrsp.js → FeaturePreviewScreen-B2O-98_e.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-BvqLZI0N.js → HubSpotOAuthCallbackScreen-DexCFc1l.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-jZeMo5Ui.js → MagicLinkRoutes-Chwo-qkP.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-PJSTdmbN.js → MagicLinkSignInScreen-DWsNyqtg.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-CNxBiA0K.js → MobileAppDrawer-B3x5wY10.js} +1 -1
  23. package/dist/assets/{NotFoundScreen-CsEhUGfR.js → NotFoundScreen-t1ueGvDG.js} +1 -1
  24. package/dist/assets/{NotificationRoutes-9IJgVYJ1.js → NotificationRoutes-CIdj2V-n.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-1ZY7Ls_k.js → OAuthConsentScreen-CP2RFaGU.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-8SC0GJZW.js → PandLWithForecastRoutes-BXYFz1ZW.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-DQ3Y767r.js → PeopleRoutes-MqrPexG5.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-BZb18QS3.js → PerformanceRoutes-B1RTm-Zq.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-BRrDd8wr.js → QBOConnectionScreen-CzbbjqA7.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-DWAGGjua.js → ReferralListScreen-DTQFACuG.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-DSgEFO1H.js → ReimbursementApprovalRoutes-Dclz8XkB.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CtZbBICM.js → ReimbursementApprovalRuleDetailScreen-Cf6fN3gm.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-Iavqnxfs.js → ReimbursementRoutes-Dd9IEYb-.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-CjoIF9EB.js → ReportsRoutes-B9O7T9pm.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-CTiffYxG.js → RewardsRoutes-DN2HacCh.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-zUtLUY3P.js → ScreenRoutes-BsLKoqEt.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-Dr2cLQZf.js → SettingsRoutes-B6i5o_xZ.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-BMUAJOjI.js → SetupPagesScreen-D9wDjvOC.js} +1 -1
  39. package/dist/assets/{SignInScreen-BO8V1s1B.js → SignInScreen-D68DdO0g.js} +1 -1
  40. package/dist/assets/{SignOutScreen-B1QfOGXO.js → SignOutScreen-CiC1xhyM.js} +1 -1
  41. package/dist/assets/{TaskListScreen-DdoFZv0I.js → TaskListScreen-BXp_P6Ec.js} +1 -1
  42. package/dist/assets/{TaskRoutes-DR1BBqXQ.js → TaskRoutes-Dne-2qND.js} +1 -1
  43. package/dist/assets/{TransactionDetailRoutes-DLkTkOiV.js → TransactionDetailRoutes-C1ih2pnm.js} +1 -1
  44. package/dist/assets/{TransactionDetailScreen--PMkud8g.js → TransactionDetailScreen-DRZw6o-C.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-quiJ_wNs.js → TransactionListRoutes-BOekcd9c.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-BVcC0j-i.js → TreasuryRoutes-BMXt9CZJ.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-DJYa05bm.js → VendorsRoutes-ZfxM-ykJ.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-CTaGbwbB.js → WiseConfirmationScreen-D5IG7vtp.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-CpYvVE1u.js → ZeniAccountRoutes-CpvkXgX6.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-C8feQjoH.js → ZeniAccountStatementScreen-C_K9i07r.js} +1 -1
  51. package/dist/assets/{analyticsHelper-DhD4YoYg.js → analyticsHelper-BunVJ4K_.js} +1 -1
  52. package/dist/assets/{getLocaleForTenant-CFQN8jbL.js → getLocaleForTenant-BVZe9vGW.js} +1 -1
  53. package/dist/assets/{index-CeZ7L-BQ.js → index-DojfCsv7.js} +5 -5
  54. package/dist/assets/{routePaths-vUmlDccC.js → routePaths-DoAvT9jx.js} +1 -1
  55. package/dist/assets/{useAskAiCfoHostNavButtonProps-D4_eEE1f.js → useAskAiCfoHostNavButtonProps-It-lF7wN.js} +1 -1
  56. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-b8cA6qxS.js → useFetchSuggestedQuestionsWhenReady-D9n2AKQx.js} +1 -1
  57. package/dist/assets/{useInitialThreadRequest-cRvS9PIT.js → useInitialThreadRequest-Dbj0dyeX.js} +1 -1
  58. package/dist/assets/{withTransactionSidePanel-BS7S2wn5.js → withTransactionSidePanel-DN0z2FuE.js} +1 -1
  59. package/dist/index.html +1 -1
  60. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-CfCKAQeM.js";import{A as i}from"./AddressScreen-ByYpZmgQ.js";import s from"./NotFoundScreen-CsEhUGfR.js";import"./sentry-131ydzJg.js";import{n as d,o as r}from"./core-uYqCzel8.js";import"./zeni-epic-state-BmAPZlsC.js";import"./recharts-BUFoogHS.js";import"./index-CeZ7L-BQ.js";import"./mui-CTbUXhla.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.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]="624154e3-3694-4a3c-b645-a66b8e12404c",t._sentryDebugIdIdentifier="sentry-dbid-624154e3-3694-4a3c-b645-a66b8e12404c")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
1
+ import{j as e}from"./liveblocks-CfCKAQeM.js";import{A as i}from"./AddressScreen-Bk_munT3.js";import s from"./NotFoundScreen-t1ueGvDG.js";import"./sentry-131ydzJg.js";import{n as d,o as r}from"./core-uYqCzel8.js";import"./zeni-epic-state-BmAPZlsC.js";import"./recharts-BUFoogHS.js";import"./index-DojfCsv7.js";import"./mui-CTbUXhla.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.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]="624154e3-3694-4a3c-b645-a66b8e12404c",t._sentryDebugIdIdentifier="sentry-dbid-624154e3-3694-4a3c-b645-a66b8e12404c")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-CfCKAQeM.js";import{a as h}from"./sentry-131ydzJg.js";import{j as T,h as _,u as j,l as E,g as $,k as B}from"./core-uYqCzel8.js";import{Z as K,m as M,z as D,c as L,x as R,A as z,d as C,f as S,k as F,h as b,p as N}from"./index-CeZ7L-BQ.js";import{J$ as k,gY as U,eQ as G,K0 as O,c2 as V,K1 as q,ki as H}from"./zeni-epic-state-BmAPZlsC.js";import{n as J}from"./mui-CTbUXhla.js";import Q from"./NotFoundScreen-CsEhUGfR.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]="590c23ad-8bc3-46aa-920f-04189908b03a",e._sentryDebugIdIdentifier="sentry-dbid-590c23ad-8bc3-46aa-920f-04189908b03a")}catch{}})();const Y=J.div`
1
+ import{j as d}from"./liveblocks-CfCKAQeM.js";import{a as h}from"./sentry-131ydzJg.js";import{j as T,h as _,u as j,l as E,g as $,k as B}from"./core-uYqCzel8.js";import{Z as K,m as M,z as D,c as L,x as R,A as z,d as C,f as S,k as F,h as b,p as N}from"./index-DojfCsv7.js";import{J$ as k,gY as U,eQ as G,K0 as O,c2 as V,K1 as q,ki as H}from"./zeni-epic-state-BmAPZlsC.js";import{n as J}from"./mui-CTbUXhla.js";import Q from"./NotFoundScreen-t1ueGvDG.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]="590c23ad-8bc3-46aa-920f-04189908b03a",e._sentryDebugIdIdentifier="sentry-dbid-590c23ad-8bc3-46aa-920f-04189908b03a")}catch{}})();const Y=J.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-CfCKAQeM.js";import{a as l}from"./sentry-131ydzJg.js";import{h as de,j as me,u as pe,g as N,l as he,k as fe}from"./core-uYqCzel8.js";import{T as Se,cJ as ge,z as Ce,Z as ke,cK as we,cL as be,cM as V,cN as Ie,cO as J,p as U,A as q,d as T,cP as z,cQ as Ee,X as Pe,f as Te,a3 as ye,cR as xe,Y as _e,q as ve,aY as Oe,cS as Ae}from"./index-CeZ7L-BQ.js";import{fG as Qe,f5 as K,eQ as Ue,hC as je,Qz as De,eP as Fe,hM as Be,hI as Le,fw as H,fq as Me,fj as Re,fn as W,fr as Ge,fs as $e,ft as Ne,fu as Ve,fv as qe}from"./zeni-epic-state-BmAPZlsC.js";import{D as ze,n as w,S as He,P as We}from"./mui-CTbUXhla.js";import{p as Ye}from"./pathToGoBack-Y7yporNq.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="96595ffa-6914-456e-9f72-582c59159120",s._sentryDebugIdIdentifier="sentry-dbid-96595ffa-6914-456e-9f72-582c59159120")}catch{}})();const X="chat-response-generated",Je=fe(function(s,r){const t=K(s),m=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose}},function(s,r){const{location:t,currentTenant:m,userId:c,navigate:S,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:u}=r;return{onEventReceived:(e,o)=>{if(e===X&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,p=$e(n.type),d=n.metadata.chat_session_id??null,{currentChatSession:a,currentQuestionAnswer:b,currentQuestionAnswerSummary:y}=J(C,d);p!=="answer"?T.trackAICFOChatResponseGenerated(p,b?.question.questionText??"",n.text,d,Ae(y,a),n.metadata.message_id??null):T.trackAICFOChatAnswerGenerated(n.text,b?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Ne(n.visualization?.type??"")??null,d,n.summarized_title,n.metadata.message_id??null),s(Ve({chatSessionId:n.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),s(qe({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:c}))}},onSubmit:(e,o,n,p)=>{e&&Oe(s,e,o,f,C,c,p,n)},updateCurrentInput:e=>{s(W(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Ge(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??Ye(1);S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),s(W(""))},togglePageView:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),u(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{f!=null&&s(Re());const e=ve(t.state?.pathnameStackToGoBack,t.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Me({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(ye(xe)),gt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Se(),t=de(),m=me(),c=pe(),[S,f]=l.useState(!1);l.useEffect(()=>{t(Qe())},[t]);const{customPageTitle:C}=ge(),u=N(i=>K(i)),e=Ce.getSignedInUser(),{session_id:o}=he(),n=ke(),p=Pe(n),d=N(i=>Ue(i)),a=u.uiState.currentChatSessionId,b=d.tenantEmailDomain,{handleUploadPromoClose:y,isUploadPromoVisible:Z}=we({isFileUploadEnabled:s,tenantEmailDomain:b}),x=be({currentTenant:d,currentChatSessionId:a,aiCfoView:u}),I=c.state,E=I?.aiCfoInitialQuestion,j=!!I?.aiCfoShouldSubmit;l.useEffect(()=>{const i=c.state;if(i?.[V]!==!0)return;f(!0);const g={...i};delete g[V],m(c,{replace:!0,state:g})},[c.pathname,c.search,c.state,m]);const[ee,_]=l.useState(null),[te,v]=l.useState(!1),D=l.useRef(!1);l.useEffect(()=>{D.current||E==null||E===""||(_(E),v(j),D.current=!0)},[E,j]);const ae=l.useCallback(()=>{_(null),v(!1)},[]),F=l.useMemo(()=>new URLSearchParams(c.search),[c.search]),B=F.get("ref")??I?.aiCfoRef,O=F.get("emailRefId")??I?.aiCfoEmailRefId,L=l.useRef(!1);l.useEffect(()=>{L.current||B!=="month-end-email"||O==null||a!=null||e==null||(t(je("controller",e.userId,O,"MONTH_END_EMAIL")),L.current=!0)},[B,O,a,t,e]);const P=u.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&a!=null&&(_(P),v(!0),t(De()))},[P,a,t]);const se=d.masterTOSInfo,k=se?.isMasterTOSAccepted??!1,{visitedSessions:M}=Ie(a),A=u.fetchState,Q=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,R=a!=null?u.fetchChatSessionHistoryByChatSessionId?.[a]?.fetchState??"Not-Started":"Not-Started",G=a==null||(u.uiState.chatHistoryNextPageToken[a]?.hasMore??!0),$=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:oe}=J($,a),ne=oe.length===0;l.useEffect(()=>{k||p||m("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[k,p,m,c.state]);const ie=l.useCallback(()=>{const i=U(c.state?.pathnameStackToGoBack),g=d.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...c.state,pathnameStackToGoBack:i.newStack}})},[d.tenantEmailDomain,c.state,m]);l.useEffect(()=>{a!=null&&o!==a&&m(`../ai-cfo/${a}`,{state:{...c.state}})},[a,o]),l.useEffect(()=>{o!=null&&a==null&&o!=="new_chat"&&o!=="explore"&&t(Fe({sessionId:o,agentId:"controller"}))},[]);const le=l.useMemo(()=>({events:M.map(i=>`private-encrypted-chat-${i}.${X}`),eventCallback:(i,g,ue)=>ue.onEventReceived(i,g)}),[M]);l.useEffect(()=>{A!=="In-Progress"&&Q&&t(Be())},[A,Q,t]),l.useEffect(()=>{a!=null&&R!=="In-Progress"&&G&&e!=null&&A==="Completed"&&!Q&&t(Le(a,e.userId))},[R,G,a,e,t]);const re=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const ce=a!=null&&u.responseStateByChatSessionId?.[a]?.answer?.fetchState==="In-Progress";return!k&&p?h.jsxs(Xe,{children:[h.jsx(q,{analytics:T,onLoad:re}),x.drawerElement,h.jsx(Ze,{children:h.jsx(Y,{children:h.jsx(z,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:ie,onCompleteClick:()=>{d.userRoleId!=null&&t(H(d.userRoleId))}})})})]}):h.jsxs(Ke,{children:[h.jsx(q,{analytics:T,onLoad:i=>i.trackPageLoaded(Te.Event.aiCFOPage)}),p&&x.drawerElement,h.jsx(Je,{...le,currentChatSessionId:a,allSessionsWithOrderedQuestionAnswers:$,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:o,location:c,isSubmitting:ce,isEmptyChatWithSession:ne,customPageTitle:C,currentTenant:d,emailLinkQuestion:ee??void 0,autoSubmitEmailLinkQuestion:te,onEmailLinkQuestionProcessed:ae,onMenuClick:p?x.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:Z,onUploadPromoClose:y}),h.jsx(ze,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:et,style:{width:p?"100%":`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(Y,{onClick:i=>i.stopPropagation(),children:h.jsx(z,{isTOSAccepted:k,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>f(!1),onCompleteClick:()=>{k||d.userRoleId==null||t(H(d.userRoleId)),f(!1)}})})})]})},Y=w(He)`
1
+ import{j as h}from"./liveblocks-CfCKAQeM.js";import{a as l}from"./sentry-131ydzJg.js";import{h as de,j as me,u as pe,g as N,l as he,k as fe}from"./core-uYqCzel8.js";import{T as Se,cJ as ge,z as Ce,Z as ke,cK as we,cL as be,cM as V,cN as Ie,cO as J,p as U,A as q,d as T,cP as z,cQ as Ee,X as Pe,f as Te,a3 as ye,cR as xe,Y as _e,q as ve,aY as Oe,cS as Ae}from"./index-DojfCsv7.js";import{fG as Qe,f5 as K,eQ as Ue,hC as je,Qz as De,eP as Fe,hM as Be,hI as Le,fw as H,fq as Me,fj as Re,fn as W,fr as Ge,fs as $e,ft as Ne,fu as Ve,fv as qe}from"./zeni-epic-state-BmAPZlsC.js";import{D as ze,n as w,S as He,P as We}from"./mui-CTbUXhla.js";import{p as Ye}from"./pathToGoBack-Y7yporNq.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="96595ffa-6914-456e-9f72-582c59159120",s._sentryDebugIdIdentifier="sentry-dbid-96595ffa-6914-456e-9f72-582c59159120")}catch{}})();const X="chat-response-generated",Je=fe(function(s,r){const t=K(s),m=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose}},function(s,r){const{location:t,currentTenant:m,userId:c,navigate:S,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:u}=r;return{onEventReceived:(e,o)=>{if(e===X&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,p=$e(n.type),d=n.metadata.chat_session_id??null,{currentChatSession:a,currentQuestionAnswer:b,currentQuestionAnswerSummary:y}=J(C,d);p!=="answer"?T.trackAICFOChatResponseGenerated(p,b?.question.questionText??"",n.text,d,Ae(y,a),n.metadata.message_id??null):T.trackAICFOChatAnswerGenerated(n.text,b?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Ne(n.visualization?.type??"")??null,d,n.summarized_title,n.metadata.message_id??null),s(Ve({chatSessionId:n.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),s(qe({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:c}))}},onSubmit:(e,o,n,p)=>{e&&Oe(s,e,o,f,C,c,p,n)},updateCurrentInput:e=>{s(W(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Ge(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??Ye(1);S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),s(W(""))},togglePageView:()=>{const e=U(t.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(o,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),u(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{f!=null&&s(Re());const e=ve(t.state?.pathnameStackToGoBack,t.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Me({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(ye(xe)),gt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Se(),t=de(),m=me(),c=pe(),[S,f]=l.useState(!1);l.useEffect(()=>{t(Qe())},[t]);const{customPageTitle:C}=ge(),u=N(i=>K(i)),e=Ce.getSignedInUser(),{session_id:o}=he(),n=ke(),p=Pe(n),d=N(i=>Ue(i)),a=u.uiState.currentChatSessionId,b=d.tenantEmailDomain,{handleUploadPromoClose:y,isUploadPromoVisible:Z}=we({isFileUploadEnabled:s,tenantEmailDomain:b}),x=be({currentTenant:d,currentChatSessionId:a,aiCfoView:u}),I=c.state,E=I?.aiCfoInitialQuestion,j=!!I?.aiCfoShouldSubmit;l.useEffect(()=>{const i=c.state;if(i?.[V]!==!0)return;f(!0);const g={...i};delete g[V],m(c,{replace:!0,state:g})},[c.pathname,c.search,c.state,m]);const[ee,_]=l.useState(null),[te,v]=l.useState(!1),D=l.useRef(!1);l.useEffect(()=>{D.current||E==null||E===""||(_(E),v(j),D.current=!0)},[E,j]);const ae=l.useCallback(()=>{_(null),v(!1)},[]),F=l.useMemo(()=>new URLSearchParams(c.search),[c.search]),B=F.get("ref")??I?.aiCfoRef,O=F.get("emailRefId")??I?.aiCfoEmailRefId,L=l.useRef(!1);l.useEffect(()=>{L.current||B!=="month-end-email"||O==null||a!=null||e==null||(t(je("controller",e.userId,O,"MONTH_END_EMAIL")),L.current=!0)},[B,O,a,t,e]);const P=u.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&a!=null&&(_(P),v(!0),t(De()))},[P,a,t]);const se=d.masterTOSInfo,k=se?.isMasterTOSAccepted??!1,{visitedSessions:M}=Ie(a),A=u.fetchState,Q=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,R=a!=null?u.fetchChatSessionHistoryByChatSessionId?.[a]?.fetchState??"Not-Started":"Not-Started",G=a==null||(u.uiState.chatHistoryNextPageToken[a]?.hasMore??!0),$=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:oe}=J($,a),ne=oe.length===0;l.useEffect(()=>{k||p||m("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[k,p,m,c.state]);const ie=l.useCallback(()=>{const i=U(c.state?.pathnameStackToGoBack),g=d.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...c.state,pathnameStackToGoBack:i.newStack}})},[d.tenantEmailDomain,c.state,m]);l.useEffect(()=>{a!=null&&o!==a&&m(`../ai-cfo/${a}`,{state:{...c.state}})},[a,o]),l.useEffect(()=>{o!=null&&a==null&&o!=="new_chat"&&o!=="explore"&&t(Fe({sessionId:o,agentId:"controller"}))},[]);const le=l.useMemo(()=>({events:M.map(i=>`private-encrypted-chat-${i}.${X}`),eventCallback:(i,g,ue)=>ue.onEventReceived(i,g)}),[M]);l.useEffect(()=>{A!=="In-Progress"&&Q&&t(Be())},[A,Q,t]),l.useEffect(()=>{a!=null&&R!=="In-Progress"&&G&&e!=null&&A==="Completed"&&!Q&&t(Le(a,e.userId))},[R,G,a,e,t]);const re=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const ce=a!=null&&u.responseStateByChatSessionId?.[a]?.answer?.fetchState==="In-Progress";return!k&&p?h.jsxs(Xe,{children:[h.jsx(q,{analytics:T,onLoad:re}),x.drawerElement,h.jsx(Ze,{children:h.jsx(Y,{children:h.jsx(z,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:ie,onCompleteClick:()=>{d.userRoleId!=null&&t(H(d.userRoleId))}})})})]}):h.jsxs(Ke,{children:[h.jsx(q,{analytics:T,onLoad:i=>i.trackPageLoaded(Te.Event.aiCFOPage)}),p&&x.drawerElement,h.jsx(Je,{...le,currentChatSessionId:a,allSessionsWithOrderedQuestionAnswers:$,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:o,location:c,isSubmitting:ce,isEmptyChatWithSession:ne,customPageTitle:C,currentTenant:d,emailLinkQuestion:ee??void 0,autoSubmitEmailLinkQuestion:te,onEmailLinkQuestionProcessed:ae,onMenuClick:p?x.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:Z,onUploadPromoClose:y}),h.jsx(ze,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:et,style:{width:p?"100%":`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(Y,{onClick:i=>i.stopPropagation(),children:h.jsx(z,{isTOSAccepted:k,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>f(!1),onCompleteClick:()=>{k||d.userRoleId==null||t(H(d.userRoleId)),f(!1)}})})})]})},Y=w(He)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-CfCKAQeM.js";import{a as y}from"./sentry-131ydzJg.js";import{j as U,u as B,h as j,g as f,N,k as T,l as O,n as $,o as h}from"./core-uYqCzel8.js";import{eQ as F,Ni as R,M_ as b,xM as x,xG as L,xK as I,xz as z,N0 as M,xC as W,xO as q,xN as E}from"./zeni-epic-state-BmAPZlsC.js";import{m as P,z as k,x as V,a3 as G,by as K,ac as _,bz as Q}from"./index-CeZ7L-BQ.js";import"./mui-CTbUXhla.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-CtZbBICM.js";import J from"./NotFoundScreen-CsEhUGfR.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]="853cd5e6-385e-47ed-8b6e-8b6bbdd64aa0",e._sentryDebugIdIdentifier="sentry-dbid-853cd5e6-385e-47ed-8b6e-8b6bbdd64aa0")}catch{}})();const w="bill-approval-rule-update",X=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(M(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(G(K)),Y=()=>{const e=U(),o=B(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>F(i)),r=f(i=>R(i)),g=f(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const v={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...v})},Z=T(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(v=>{const i=v.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=v.actors.selectedNonUsers.map(S=>{const C=!!H(S.value);return{type:C?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!C}}),m=i.concat(A);g.push({action:v.stepType.selectedOption,actors:m,operator:m.length>1?v.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(E(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(E(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{t("../")}}})(Q);function D(){const e=U(),o=j(),t=B(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=f(r=>b(r)),d=f(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs($,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),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-CfCKAQeM.js";import{a as y}from"./sentry-131ydzJg.js";import{j as U,u as B,h as j,g as f,N,k as T,l as O,n as $,o as h}from"./core-uYqCzel8.js";import{eQ as F,Ni as R,M_ as b,xM as x,xG as L,xK as I,xz as z,N0 as M,xC as W,xO as q,xN as E}from"./zeni-epic-state-BmAPZlsC.js";import{m as P,z as k,x as V,a3 as G,by as K,ac as _,bz as Q}from"./index-DojfCsv7.js";import"./mui-CTbUXhla.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-Cf6fN3gm.js";import J from"./NotFoundScreen-t1ueGvDG.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]="853cd5e6-385e-47ed-8b6e-8b6bbdd64aa0",e._sentryDebugIdIdentifier="sentry-dbid-853cd5e6-385e-47ed-8b6e-8b6bbdd64aa0")}catch{}})();const w="bill-approval-rule-update",X=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(M(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(G(K)),Y=()=>{const e=U(),o=B(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>F(i)),r=f(i=>R(i)),g=f(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const v={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...v})},Z=T(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(v=>{const i=v.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=v.actors.selectedNonUsers.map(S=>{const C=!!H(S.value);return{type:C?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!C}}),m=i.concat(A);g.push({action:v.stepType.selectedOption,actors:m,operator:m.length>1?v.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(E(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(E(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{t("../")}}})(Q);function D(){const e=U(),o=j(),t=B(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=f(r=>b(r)),d=f(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs($,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),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-CfCKAQeM.js";import{j as J,h as se,u as Y,l as ae,g as v,N as te,k as Q,i as na,n as ia,o as S}from"./core-uYqCzel8.js";import{eQ as Z,MA as Le,bv as It,Ht as oa,bo as wt,bF as pe,MB as xt,x4 as Bt,ye as $e,xD as la,bn as De,MC as sa,MD as ra,c2 as ca,ME as da,jC as Ct,MF as At,MG as Et,yP as _e,xj as Ce,MH as ua,wU as tt,MI as pa,B$ as ma,wY as ba,x2 as Dt,MJ as ke,MK as Ge,yf as Ne,ML as ha,MM as ga,yi as Oe,MN as ya,yv as Sa,MO as jt,x$ as at,y4 as fa,MP as ka,MQ as ue,MR as Tt,MS as Pt,MT as Ft,fK as va,xo as Me,cx as Rt,MU as Ia,gO as wa,MV as xa,MW as Ba,eW as Vt,eU as $t,MX as ze,MY as Ca,MZ as Aa,Kj as Ze,M_ as Ea,Kk as oe,Kl as He,M$ as Da,N0 as ja,N1 as Ta,y6 as nt,y3 as Pa,N2 as Fa,N3 as Ra,N4 as Va,xR as $a,N5 as Ma,N6 as Ua,N7 as La,cl as Mt,cN as Ut,jN as _a,bL as Ga,bq as Lt,bM as _t,wa as Na,N8 as Oa,BO as za,BU as Za,sJ as Ha,yg as Wa,yW as qa,j_ as fe,N9 as Ka,Na as Gt,ks as Ja,jU as Nt,kd as Ot,kc as it,bE as be,bK as Ya,Nb as Qa,Nc as ve,ix as Xa,Nd as ot,Ne as en,iB as tn,iW as an,z8 as nn,Nf as on,kl as ln,y_ as sn,Ng as lt,z2 as rn,z7 as cn,z4 as dn,yY as un,Nh as zt,xd as pn,Ni as mn,Nj as bn,fC as hn,fB as gn,fA as yn,k1 as Sn,kj as st,ku as fn,q9 as kn,ka as vn,z0 as In,iH as wn,kz as xn,Nk as Bn,iz as Cn,q0 as An,Nl as En,xX as Dn,bG as jn,bs as Tn,Jd as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-BmAPZlsC.js";import{m as me,z as V,c as Ie,y as le,S as y,aK as Ae,x as re,o as A,A as je,d as D,b5 as Mn,p as z,Y as We,q as E,Z as we,b6 as rt,b7 as ct,b8 as Un,ah as Ln,I as _n,aE as Gn,G as Zt,D as qe,J as Ke,b9 as Nn,aq as Ht,ba as On,U as zn,f as Wt,a3 as Zn,bb as Hn,bc as Wn,bd as qn,be as Kn,bf as Jn,bg as Yn,bh as Qn,bi as Xn,bj as ei,s as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a6 as li}from"./index-CeZ7L-BQ.js";import{n as U,S as si}from"./mui-CTbUXhla.js";import{A as dt}from"./AddressScreen-ByYpZmgQ.js";import{g as ie,a as Te,i as qt,V as Je,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-CzSUYZwn.js";import{a as f}from"./sentry-131ydzJg.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-D4_eEE1f.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-b8cA6qxS.js";import{u as Kt}from"./useInitialThreadRequest-cRvS9PIT.js";import Ee from"./NotFoundScreen-CsEhUGfR.js";import{D as ui}from"./DrawerScreen-AH0ysY6V.js";import{M as Jt}from"./MobileAppDrawer-CNxBiA0K.js";import{F as Yt}from"./FeaturePreviewScreen-DPxCLrsp.js";import{S as Pe}from"./SetupPagesScreen-BMUAJOjI.js";import{B as pi}from"./BillPayApprovalRoutes-CX2-tB9Z.js";import{FallBackRoute as mi}from"./ScreenRoutes-zUtLUY3P.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./analyticsHelper-DhD4YoYg.js";import"./routePaths-vUmlDccC.js";import"./BusinessVerificationPageScreen-C-d6e6xJ.js";import"./ReimbursementApprovalRuleDetailScreen-CtZbBICM.js";import"./getLocaleForTenant-CFQN8jbL.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]="ec7fd141-d48f-4552-9b67-90fd73358615",e._sentryDebugIdIdentifier="sentry-dbid-ec7fd141-d48f-4552-9b67-90fd73358615")}catch{}})();const bi=Q(function(e,t){const l=Le(e,t.billId),i=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Mn);function hi(){const e=J(),t=se(),l=Y(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(N=>Z(N)),s=v(N=>Le(N,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Qe({mobileExploreReferrer:"Bill Details"});Xe({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:L}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=L(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),M=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(N=>N.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",$,M,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,M,X,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:N=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(N)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:M,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Q(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ne(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Y(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,L]=f.useState(!1),[$,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,M=C.showAutofill;const K=v(F=>Le(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],M=!1);const X=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Ne(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?L(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(L(!0),t($e(!1,h,j,b,i)))),u&&!T&&(L(!0),t($e(!1,h,j,b,i)))},[B,T,u,i,t]);const N={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||M?null:a.jsx(pt,{children:a.jsx(Qt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[M&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:N,isEditPopup:!0}):null,o==="small"||M?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:M,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Nn();return a.jsx(Qt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-CfCKAQeM.js";import{j as J,h as se,u as Y,l as ae,g as v,N as te,k as Q,i as na,n as ia,o as S}from"./core-uYqCzel8.js";import{eQ as Z,MA as Le,bv as It,Ht as oa,bo as wt,bF as pe,MB as xt,x4 as Bt,ye as $e,xD as la,bn as De,MC as sa,MD as ra,c2 as ca,ME as da,jC as Ct,MF as At,MG as Et,yP as _e,xj as Ce,MH as ua,wU as tt,MI as pa,B$ as ma,wY as ba,x2 as Dt,MJ as ke,MK as Ge,yf as Ne,ML as ha,MM as ga,yi as Oe,MN as ya,yv as Sa,MO as jt,x$ as at,y4 as fa,MP as ka,MQ as ue,MR as Tt,MS as Pt,MT as Ft,fK as va,xo as Me,cx as Rt,MU as Ia,gO as wa,MV as xa,MW as Ba,eW as Vt,eU as $t,MX as ze,MY as Ca,MZ as Aa,Kj as Ze,M_ as Ea,Kk as oe,Kl as He,M$ as Da,N0 as ja,N1 as Ta,y6 as nt,y3 as Pa,N2 as Fa,N3 as Ra,N4 as Va,xR as $a,N5 as Ma,N6 as Ua,N7 as La,cl as Mt,cN as Ut,jN as _a,bL as Ga,bq as Lt,bM as _t,wa as Na,N8 as Oa,BO as za,BU as Za,sJ as Ha,yg as Wa,yW as qa,j_ as fe,N9 as Ka,Na as Gt,ks as Ja,jU as Nt,kd as Ot,kc as it,bE as be,bK as Ya,Nb as Qa,Nc as ve,ix as Xa,Nd as ot,Ne as en,iB as tn,iW as an,z8 as nn,Nf as on,kl as ln,y_ as sn,Ng as lt,z2 as rn,z7 as cn,z4 as dn,yY as un,Nh as zt,xd as pn,Ni as mn,Nj as bn,fC as hn,fB as gn,fA as yn,k1 as Sn,kj as st,ku as fn,q9 as kn,ka as vn,z0 as In,iH as wn,kz as xn,Nk as Bn,iz as Cn,q0 as An,Nl as En,xX as Dn,bG as jn,bs as Tn,Jd as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-BmAPZlsC.js";import{m as me,z as V,c as Ie,y as le,S as y,aK as Ae,x as re,o as A,A as je,d as D,b5 as Mn,p as z,Y as We,q as E,Z as we,b6 as rt,b7 as ct,b8 as Un,ah as Ln,I as _n,aE as Gn,G as Zt,D as qe,J as Ke,b9 as Nn,aq as Ht,ba as On,U as zn,f as Wt,a3 as Zn,bb as Hn,bc as Wn,bd as qn,be as Kn,bf as Jn,bg as Yn,bh as Qn,bi as Xn,bj as ei,s as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a6 as li}from"./index-DojfCsv7.js";import{n as U,S as si}from"./mui-CTbUXhla.js";import{A as dt}from"./AddressScreen-Bk_munT3.js";import{g as ie,a as Te,i as qt,V as Je,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-CWWX1EFM.js";import{a as f}from"./sentry-131ydzJg.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-It-lF7wN.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-D9n2AKQx.js";import{u as Kt}from"./useInitialThreadRequest-Dbj0dyeX.js";import Ee from"./NotFoundScreen-t1ueGvDG.js";import{D as ui}from"./DrawerScreen-DzkaoOWL.js";import{M as Jt}from"./MobileAppDrawer-B3x5wY10.js";import{F as Yt}from"./FeaturePreviewScreen-B2O-98_e.js";import{S as Pe}from"./SetupPagesScreen-D9wDjvOC.js";import{B as pi}from"./BillPayApprovalRoutes-COiJeUFT.js";import{FallBackRoute as mi}from"./ScreenRoutes-BsLKoqEt.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./analyticsHelper-BunVJ4K_.js";import"./routePaths-DoAvT9jx.js";import"./BusinessVerificationPageScreen-CnAB8eUQ.js";import"./ReimbursementApprovalRuleDetailScreen-Cf6fN3gm.js";import"./getLocaleForTenant-BVZe9vGW.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]="ec7fd141-d48f-4552-9b67-90fd73358615",e._sentryDebugIdIdentifier="sentry-dbid-ec7fd141-d48f-4552-9b67-90fd73358615")}catch{}})();const bi=Q(function(e,t){const l=Le(e,t.billId),i=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Mn);function hi(){const e=J(),t=se(),l=Y(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(N=>Z(N)),s=v(N=>Le(N,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Qe({mobileExploreReferrer:"Bill Details"});Xe({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:L}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=L(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),M=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(N=>N.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",$,M,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,M,X,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:N=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(N)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:M,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Q(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ne(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Y(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,L]=f.useState(!1),[$,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,M=C.showAutofill;const K=v(F=>Le(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],M=!1);const X=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Ne(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?L(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(L(!0),t($e(!1,h,j,b,i)))),u&&!T&&(L(!0),t($e(!1,h,j,b,i)))},[B,T,u,i,t]);const N={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||M?null:a.jsx(pt,{children:a.jsx(Qt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[M&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:N,isEditPopup:!0}):null,o==="small"||M?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:M,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Nn();return a.jsx(Qt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=U.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-CfCKAQeM.js";import{a as V}from"./sentry-131ydzJg.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-uYqCzel8.js";import{c as ce,y as ue,aK as de,z,A as pe,d as B,ac as F,f as E,bu as le,aq as me,q as R,ar as P}from"./index-CeZ7L-BQ.js";import{N6 as fe,eQ as q,s8 as ye,Hx as Se,xR as ge,Ay as Ie,D5 as he,DK as be,ED as De,Nt as Oe,Nu as Te,Nv as ke,Nw as Ce,Nx as Ve,K0 as Ne,Mv as we,Kc as Ae,ki as ve,fC as _e,fB as xe,fA as Fe,q9 as Ee,q0 as ze,pZ as Be,ka as Re,sh as Pe,sf as M,bE as L,st as U,cv as Me}from"./zeni-epic-state-BmAPZlsC.js";import{n as Le}from"./mui-CTbUXhla.js";import{c as j}from"./routePaths-vUmlDccC.js";import{M as Ue}from"./MobileAppDrawer-CNxBiA0K.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]="76e87a2e-eedb-4eef-948c-56662e3db6c7",e._sentryDebugIdIdentifier="sentry-dbid-76e87a2e-eedb-4eef-948c-56662e3db6c7")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-CfCKAQeM.js";import{a as V}from"./sentry-131ydzJg.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-uYqCzel8.js";import{c as ce,y as ue,aK as de,z,A as pe,d as B,ac as F,f as E,bu as le,aq as me,q as R,ar as P}from"./index-DojfCsv7.js";import{N6 as fe,eQ as q,s8 as ye,Hx as Se,xR as ge,Ay as Ie,D5 as he,DK as be,ED as De,Nt as Oe,Nu as Te,Nv as ke,Nw as Ce,Nx as Ve,K0 as Ne,Mv as we,Kc as Ae,ki as ve,fC as _e,fB as xe,fA as Fe,q9 as Ee,q0 as ze,pZ as Be,ka as Re,sh as Pe,sf as M,bE as L,st as U,cv as Me}from"./zeni-epic-state-BmAPZlsC.js";import{n as Le}from"./mui-CTbUXhla.js";import{c as j}from"./routePaths-DoAvT9jx.js";import{M as Ue}from"./MobileAppDrawer-B3x5wY10.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]="76e87a2e-eedb-4eef-948c-56662e3db6c7",e._sentryDebugIdIdentifier="sentry-dbid-76e87a2e-eedb-4eef-948c-56662e3db6c7")}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-CfCKAQeM.js";import{j as le,l as ia,h as ue,g as y,u as ge,k as pe,N as ga,q as ut,n as Wt,o as te}from"./core-uYqCzel8.js";import{eQ as ie,bs as Re,O_ as ka,eU as be,eV as ye,eW as Se,fR as Ge,cs as ze,O$ as Ye,P0 as Ma,tn as ba,jK as ya,P1 as Sa,gO as oa,zR as Je,zT as $a,zU as Ga,jA as mt,P2 as Ze,zF as Ct,P3 as qt,P4 as Qt,zI as Da,P5 as Xt,Nq as _a,rz as pt,zO as za,gZ as Jt,P6 as ht,P7 as Ke,bq as en,P8 as an,fC as Pa,fB as wa,Am as tn,fA as Ta,N6 as nn,P9 as ft,cl as gt,cN as rn,Np as da,AY as sn,Pa as tt,Ay as Fa,Pb as bt,AZ as on,NR as cn,A_ as dn,BU as ln,sJ as un,BO as mn,A7 as yt,A0 as Cn,Pc as pn,fT as hn,Ag as St,Ak as It,fS as fn,Pd as gn,AK as At,Pe as bn,Pf as yn,Pg as Sn,Ai as Et,A3 as kt,zL as Dt,Ac as _t,Aa as Pt,Ae as In,zS as nt,Ph as wt,Pi as va,Av as Ia,K5 as Tt,cO as Ya,Pj as An,Pk as En,Pl as kn,Pm as Dn,As as Na,AR as _n,AN as Pn,Ao as wn,AP as Tn,AF as Fn,AH as vn,Pn as Ft,AX as vt,Ht as xn,Po as Bn,Pp as Ln,Pq as Un,Pr as xt,Ps as Rn,Bi as On,Ax as Bt,Ar as ca,Aw as jn,Pt as Nn,Pu as Vn,zC as Hn,Pv as Lt,Pw as Ut,Px as Mn,zE as $n,zD as rt,Py as Gn,Pz as zn,PA as Yn,K1 as Zn,PB as Za,PC as Kn,wd as Rt,ki as Wn,gP as qn,Bn as Qn,PD as Ot,PE as Xn,Bo as Jn,PF as er,df as ar,th as tr,Bd as nr,B7 as Ue,bv as rr,bF as sr,cx as or,bG as cr,Jd as ir}from"./zeni-epic-state-BmAPZlsC.js";import{z as J,c as je,y as ce,S as Y,x as la,bY as xa,c7 as dr,p as ve,c8 as lr,c9 as ur,Z as ua,aK as Fe,q as fe,bf as Ka,ca as mr,G as ma,h as Ba,m as Wa,d as Q,D as qa,cb as Cr,an as Qa,br as Qe,cc as Va,cd as pr,A as Xa,a3 as hr,ce as fr,aq as jt,Y as Ha,U as Nt,f as Vt,cf as gr,cg as br,ch as yr,ci as Sr,cj as Ir,ck as Ar,o as Aa,cl as Er,cm as kr,cn as Ra,s as Dr,co as _r,cp as Pr,cq as wr,cr as Tr,cs as Fr,a6 as vr}from"./index-CeZ7L-BQ.js";import{n as _e,D as Ht,S as xr}from"./mui-CTbUXhla.js";import{a as i}from"./sentry-131ydzJg.js";import{g as Ce,a as Ca,b as Mt,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Ja,P as Lr,i as et,s as Xe,j as $t,k as Me,l as Gt,m as Ur,n as zt,p as Rr,S as st}from"./SetupPagesScreen-BMUAJOjI.js";import La from"./NotFoundScreen-CsEhUGfR.js";import{M as $e}from"./MobileAppDrawer-CNxBiA0K.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-D4_eEE1f.js";import{c as Zt}from"./useFetchSuggestedQuestionsWhenReady-b8cA6qxS.js";import{v as ot}from"./utils-BkkIzijx.js";import{t as Or}from"./AddressScreen-ByYpZmgQ.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./analyticsHelper-DhD4YoYg.js";import"./routePaths-vUmlDccC.js";import"./BusinessVerificationPageScreen-C-d6e6xJ.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]="62fad405-1fbe-4076-bd81-491144cdf5af",e._sentryDebugIdIdentifier="sentry-dbid-62fad405-1fbe-4076-bd81-491144cdf5af")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=J.getSignedInUser(),n=y(X=>ie(X)),C=je(),p=Re(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=u(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(R,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>Ge(X,n.companyId)),N=ze(v.controllers),{creditAccount:L,creditAccountRepayment:w}=y(X=>Ye(X)),V=y(X=>X.classListState.fetchState),m=!_&&d&&f,l=y(X=>Ma(X,t,m,d)),[P,T]=i.useState(!1),H=l.chargeCard,U=H?.cardCreatedByUser?.userId,K=y(X=>U!=null?ba(X.userRoleState,U):void 0),I=K?.accountingClassIDs[0],B=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,O=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=O?.accountingClassIDs[0],E=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),z=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&z&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,z,q]),i.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,m,!1)))},[P,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(z===!1||z&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,c);e(X)}},[l.fetchState,c,z]),i.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&f&&p&&a($a()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&f&&p&&a(Ga()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,f,p,V]);const G=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Oe(d,g,D,f),ae=Ca(d,f,p,L,w),ne=Mt(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:G,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ze(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ze(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=ge(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,R]=i.useState(!1),F=J.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>Qt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(Y.isDebitCardFeatureEnabled),w=Se(L,k),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),P=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&U&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Je(n,K,U)))},[o,g.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:z}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:z}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const B=J.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(O,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{R(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx($e,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(Gr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:B,navigate:r,currentTenant:k,location:C,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:()=>{W(!0)}}),e!=null?s.jsx(zr,{windowSize:t,children:e}):null]})},Gr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Jt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ke(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(Pa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),zr=_e.div`
1
+ import{j as s}from"./liveblocks-CfCKAQeM.js";import{j as le,l as ia,h as ue,g as y,u as ge,k as pe,N as ga,q as ut,n as Wt,o as te}from"./core-uYqCzel8.js";import{eQ as ie,bs as Re,O_ as ka,eU as be,eV as ye,eW as Se,fR as Ge,cs as ze,O$ as Ye,P0 as Ma,tn as ba,jK as ya,P1 as Sa,gO as oa,zR as Je,zT as $a,zU as Ga,jA as mt,P2 as Ze,zF as Ct,P3 as qt,P4 as Qt,zI as Da,P5 as Xt,Nq as _a,rz as pt,zO as za,gZ as Jt,P6 as ht,P7 as Ke,bq as en,P8 as an,fC as Pa,fB as wa,Am as tn,fA as Ta,N6 as nn,P9 as ft,cl as gt,cN as rn,Np as da,AY as sn,Pa as tt,Ay as Fa,Pb as bt,AZ as on,NR as cn,A_ as dn,BU as ln,sJ as un,BO as mn,A7 as yt,A0 as Cn,Pc as pn,fT as hn,Ag as St,Ak as It,fS as fn,Pd as gn,AK as At,Pe as bn,Pf as yn,Pg as Sn,Ai as Et,A3 as kt,zL as Dt,Ac as _t,Aa as Pt,Ae as In,zS as nt,Ph as wt,Pi as va,Av as Ia,K5 as Tt,cO as Ya,Pj as An,Pk as En,Pl as kn,Pm as Dn,As as Na,AR as _n,AN as Pn,Ao as wn,AP as Tn,AF as Fn,AH as vn,Pn as Ft,AX as vt,Ht as xn,Po as Bn,Pp as Ln,Pq as Un,Pr as xt,Ps as Rn,Bi as On,Ax as Bt,Ar as ca,Aw as jn,Pt as Nn,Pu as Vn,zC as Hn,Pv as Lt,Pw as Ut,Px as Mn,zE as $n,zD as rt,Py as Gn,Pz as zn,PA as Yn,K1 as Zn,PB as Za,PC as Kn,wd as Rt,ki as Wn,gP as qn,Bn as Qn,PD as Ot,PE as Xn,Bo as Jn,PF as er,df as ar,th as tr,Bd as nr,B7 as Ue,bv as rr,bF as sr,cx as or,bG as cr,Jd as ir}from"./zeni-epic-state-BmAPZlsC.js";import{z as J,c as je,y as ce,S as Y,x as la,bY as xa,c7 as dr,p as ve,c8 as lr,c9 as ur,Z as ua,aK as Fe,q as fe,bf as Ka,ca as mr,G as ma,h as Ba,m as Wa,d as Q,D as qa,cb as Cr,an as Qa,br as Qe,cc as Va,cd as pr,A as Xa,a3 as hr,ce as fr,aq as jt,Y as Ha,U as Nt,f as Vt,cf as gr,cg as br,ch as yr,ci as Sr,cj as Ir,ck as Ar,o as Aa,cl as Er,cm as kr,cn as Ra,s as Dr,co as _r,cp as Pr,cq as wr,cr as Tr,cs as Fr,a6 as vr}from"./index-DojfCsv7.js";import{n as _e,D as Ht,S as xr}from"./mui-CTbUXhla.js";import{a as i}from"./sentry-131ydzJg.js";import{g as Ce,a as Ca,b as Mt,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Ja,P as Lr,i as et,s as Xe,j as $t,k as Me,l as Gt,m as Ur,n as zt,p as Rr,S as st}from"./SetupPagesScreen-D9wDjvOC.js";import La from"./NotFoundScreen-t1ueGvDG.js";import{M as $e}from"./MobileAppDrawer-B3x5wY10.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-It-lF7wN.js";import{c as Zt}from"./useFetchSuggestedQuestionsWhenReady-D9n2AKQx.js";import{v as ot}from"./utils-BkkIzijx.js";import{t as Or}from"./AddressScreen-Bk_munT3.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./analyticsHelper-BunVJ4K_.js";import"./routePaths-DoAvT9jx.js";import"./BusinessVerificationPageScreen-CnAB8eUQ.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]="62fad405-1fbe-4076-bd81-491144cdf5af",e._sentryDebugIdIdentifier="sentry-dbid-62fad405-1fbe-4076-bd81-491144cdf5af")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=J.getSignedInUser(),n=y(X=>ie(X)),C=je(),p=Re(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=u(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(R,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>Ge(X,n.companyId)),N=ze(v.controllers),{creditAccount:L,creditAccountRepayment:w}=y(X=>Ye(X)),V=y(X=>X.classListState.fetchState),m=!_&&d&&f,l=y(X=>Ma(X,t,m,d)),[P,T]=i.useState(!1),H=l.chargeCard,U=H?.cardCreatedByUser?.userId,K=y(X=>U!=null?ba(X.userRoleState,U):void 0),I=K?.accountingClassIDs[0],B=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,O=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=O?.accountingClassIDs[0],E=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),z=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&z&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,z,q]),i.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Je(t,m,!1)))},[P,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(z===!1||z&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,c);e(X)}},[l.fetchState,c,z]),i.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&f&&p&&a($a()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&f&&p&&a(Ga()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,f,p,V]);const G=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Oe(d,g,D,f),ae=Ca(d,f,p,L,w),ne=Mt(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:G,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ze(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=ge(),r=J.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ze(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=ge(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,R]=i.useState(!1),F=J.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>Qt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(Y.isDebitCardFeatureEnabled),w=Se(L,k),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),P=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&U&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Je(n,K,U)))},[o,g.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:z}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=fe(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:z}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const B=J.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(O,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{R(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx($e,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(Gr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:B,navigate:r,currentTenant:k,location:C,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:()=>{W(!0)}}),e!=null?s.jsx(zr,{windowSize:t,children:e}):null]})},Gr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Jt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ke(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(Pa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),zr=_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-CfCKAQeM.js";import{a as g}from"./sentry-131ydzJg.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-uYqCzel8.js";import{z as N,b1 as F,A as P,d as V,f as A,ac as C,b2 as j,aq as L,ar as M,q as U}from"./index-CeZ7L-BQ.js";import{eQ as D,fE as B,s8 as R,fz as _,c2 as z,Mv as G,bn as q,q9 as Y,pZ as Z,ka as H,lG as S,Mw as Q,bE as $,cv as b,lO as J,lR as K}from"./zeni-epic-state-BmAPZlsC.js";import"./mui-CTbUXhla.js";import{c as W}from"./routePaths-vUmlDccC.js";import{M as X}from"./MobileAppDrawer-CNxBiA0K.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]="02124e3d-fd4d-45fc-b4cf-65f725857a7c",t._sentryDebugIdIdentifier="sentry-dbid-02124e3d-fd4d-45fc-b4cf-65f725857a7c")}catch{}})();const ee=E(function(t){const a=_(t),i=N.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:q(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(K())},onAddressClick:e=>{const n=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?b(u):void 0,meetingLink:y!=""&&y!=null?b(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(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]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(Q(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(H({files:e}))},onDeleteFile:e=>{t(Z(e))},onEditFileName:(e,n)=>{t(Y(e,n.split(".")[0]))}}})(j);function de(){const t=w(),a=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(R())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(A.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-CfCKAQeM.js";import{a as g}from"./sentry-131ydzJg.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-uYqCzel8.js";import{z as N,b1 as F,A as P,d as V,f as A,ac as C,b2 as j,aq as L,ar as M,q as U}from"./index-DojfCsv7.js";import{eQ as D,fE as B,s8 as R,fz as _,c2 as z,Mv as G,bn as q,q9 as Y,pZ as Z,ka as H,lG as S,Mw as Q,bE as $,cv as b,lO as J,lR as K}from"./zeni-epic-state-BmAPZlsC.js";import"./mui-CTbUXhla.js";import{c as W}from"./routePaths-DoAvT9jx.js";import{M as X}from"./MobileAppDrawer-B3x5wY10.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]="02124e3d-fd4d-45fc-b4cf-65f725857a7c",t._sentryDebugIdIdentifier="sentry-dbid-02124e3d-fd4d-45fc-b4cf-65f725857a7c")}catch{}})();const ee=E(function(t){const a=_(t),i=N.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:q(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(K())},onAddressClick:e=>{const n=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?b(u):void 0,meetingLink:y!=""&&y!=null?b(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:M(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(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]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(Q(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(H({files:e}))},onDeleteFile:e=>{t(Z(e))},onEditFileName:(e,n)=>{t(Y(e,n.split(".")[0]))}}})(j);function de(){const t=w(),a=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(R())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(A.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,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-CfCKAQeM.js";import{a}from"./sentry-131ydzJg.js";import{h as D,u as v,g as u,N as w}from"./core-uYqCzel8.js";import{J9 as A,eQ as O,fl as U,mS as _,fN as E,fk as j,eR as L,Jg as k}from"./zeni-epic-state-BmAPZlsC.js";import{u as F,z as p,L as g,D as $,o as H}from"./index-CeZ7L-BQ.js";import{n as R}from"./mui-CTbUXhla.js";import{t as z}from"./getLocaleForTenant-CFQN8jbL.js";import{g as Q,Q as J}from"./QBOConnectionScreen-BRrDd8wr.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./empty-CKinwWZY.js";import"./pdf-lib-CNgiyR2K.js";import"./index-DeBaxB_L.js";import"./url-BRm_J7V6.js";import"./index-CxWCBC6O.js";import"./decodeURIComponentSafe-DCnYf30M.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]="0a98b192-a0c4-4670-822f-b14995350685",t._sentryDebugIdIdentifier="sentry-dbid-0a98b192-a0c4-4670-822f-b14995350685")}catch{}})();const P=R.div`
1
+ import{j as C}from"./liveblocks-CfCKAQeM.js";import{a}from"./sentry-131ydzJg.js";import{h as D,u as v,g as u,N as w}from"./core-uYqCzel8.js";import{J9 as A,eQ as O,fl as U,mS as _,fN as E,fk as j,eR as L,Jg as k}from"./zeni-epic-state-BmAPZlsC.js";import{u as F,z as p,L as g,D as $,o as H}from"./index-DojfCsv7.js";import{n as R}from"./mui-CTbUXhla.js";import{t as z}from"./getLocaleForTenant-BVZe9vGW.js";import{g as Q,Q as J}from"./QBOConnectionScreen-CzbbjqA7.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./empty-CKinwWZY.js";import"./pdf-lib-CNgiyR2K.js";import"./index-DeBaxB_L.js";import"./url-BRm_J7V6.js";import"./index-CxWCBC6O.js";import"./decodeURIComponentSafe-DCnYf30M.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]="0a98b192-a0c4-4670-822f-b14995350685",t._sentryDebugIdIdentifier="sentry-dbid-0a98b192-a0c4-4670-822f-b14995350685")}catch{}})();const P=R.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-CfCKAQeM.js";import{z as a}from"./index-CeZ7L-BQ.js";import{g as n}from"./QBOConnectionScreen-BRrDd8wr.js";import"./sentry-131ydzJg.js";import{u as p,N as s}from"./core-uYqCzel8.js";import"./zeni-epic-state-BmAPZlsC.js";import"./recharts-BUFoogHS.js";import"./mui-CTbUXhla.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./empty-CKinwWZY.js";import"./pdf-lib-CNgiyR2K.js";import"./index-DeBaxB_L.js";import"./url-BRm_J7V6.js";import"./index-CxWCBC6O.js";import"./decodeURIComponentSafe-DCnYf30M.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="8d904e89-6b8e-4c86-980c-585a84d9d789",t._sentryDebugIdIdentifier="sentry-dbid-8d904e89-6b8e-4c86-980c-585a84d9d789")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
1
+ import{j as i}from"./liveblocks-CfCKAQeM.js";import{z as a}from"./index-DojfCsv7.js";import{g as n}from"./QBOConnectionScreen-CzbbjqA7.js";import"./sentry-131ydzJg.js";import{u as p,N as s}from"./core-uYqCzel8.js";import"./zeni-epic-state-BmAPZlsC.js";import"./recharts-BUFoogHS.js";import"./mui-CTbUXhla.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./empty-CKinwWZY.js";import"./pdf-lib-CNgiyR2K.js";import"./index-DeBaxB_L.js";import"./url-BRm_J7V6.js";import"./index-CxWCBC6O.js";import"./decodeURIComponentSafe-DCnYf30M.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="8d904e89-6b8e-4c86-980c-585a84d9d789",t._sentryDebugIdIdentifier="sentry-dbid-8d904e89-6b8e-4c86-980c-585a84d9d789")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-CfCKAQeM.js";import{t as Ke,A as Ce}from"./AddressScreen-ByYpZmgQ.js";import $e from"./NotFoundScreen-CsEhUGfR.js";import{a as g}from"./sentry-131ydzJg.js";import{j as se,u as oe,h as ie,l as re,g as D,N as E,k as ce,i as ze,n as Me,o as z}from"./core-uYqCzel8.js";import{s as de,c as le,z as B,y as ue,m as qe,S as _,q as V,A as W,d as N,x as je,f as X,am as Qe,Z as Ze,an as ke,h as te,ao as He,ap as Ie,o as We,aq as Je,ar as Ee,as as Xe}from"./index-CeZ7L-BQ.js";import{bn as Ye,eQ as ee,fd as et,eW as pe,eU as me,bv as tt,mQ as at,f9 as nt,bO as st,je as ae,jh as ve,JF as ot,bT as it,c2 as ge,sm as fe,s7 as rt,Ka as Y,sn as _e,Hx as ct,ki as Ue,Kb as Ve,Kc as dt,Kd as lt,Ke as ut,jc as pt,jf as mt,s9 as Be,sl as gt,bE as xe,cv as ft,sz as Te,q9 as ht,pZ as yt,ka as bt,fC as St,fB as Ct,fA as kt,Kf as It,s1 as Et,sA as xt,sD as Tt,sG as Ot,sM as At,cU as Pt}from"./zeni-epic-state-BmAPZlsC.js";import{n as he}from"./mui-CTbUXhla.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-BRrDd8wr.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./empty-CKinwWZY.js";import"./pdf-lib-CNgiyR2K.js";import"./index-DeBaxB_L.js";import"./url-BRm_J7V6.js";import"./index-CxWCBC6O.js";import"./decodeURIComponentSafe-DCnYf30M.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]="ba99d4c4-3f6b-4f7b-9d5a-2602d7ddcf32",t._sentryDebugIdIdentifier="sentry-dbid-ba99d4c4-3f6b-4f7b-9d5a-2602d7ddcf32")}catch{}})();const wt=ce(function(t,s){const o=[];s.isApAgingFeatureEnabled===!1&&o.push("accounts_payable_aging"),s.isArAgingFeatureEnabled===!1&&o.push("accounts_receivable_aging"),s.shouldFetchZeniAccountsPromoCard===!1&&o.push("zeni_accounts_promo_card"),s.shouldFetchRewardsPlanCard===!1&&o.push("rewards_card"),s.isExpenseAutomationEnabledForUser===!1&&o.push("expense_automation_card");const u=nt(t,o,s.signedInUser,s.isExpenseAutomationFeatureEnabledV2,s.isExpenseAutomationEnabledForUser,s.isTreasuryEnabled);return{dashboardFetchState:st(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,s){const{themeState:o,navigate:u,location:d}=s;return{onZeniLogoClick:()=>{o.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),jt=()=>{const t=se(),s=oe(),o=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&f,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),A=me(c),P=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&P.push("top_expenses"),$===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),q===!1&&P.push("reimbursement_card","reimbursement_promo_card"),k===!1&&P.push("zeni_accounts_promo_card"),h===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||A||(r(!0),o(at(i.userId,R,c.tenantId,!0,!1,P)))},[d,O,j,A,i,c.tenantId,o]),g.useEffect(()=>{(j||A)&&setTimeout(()=>{b(!0)},5e3)},[j,A]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(s.state?.pathnameStackToGoBack,s.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(E,{to:"../../cards",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:s,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-CfCKAQeM.js";import{t as Ke,A as Ce}from"./AddressScreen-Bk_munT3.js";import $e from"./NotFoundScreen-t1ueGvDG.js";import{a as g}from"./sentry-131ydzJg.js";import{j as se,u as oe,h as ie,l as re,g as D,N as E,k as ce,i as ze,n as Me,o as z}from"./core-uYqCzel8.js";import{s as de,c as le,z as B,y as ue,m as qe,S as _,q as V,A as W,d as N,x as je,f as X,am as Qe,Z as Ze,an as ke,h as te,ao as He,ap as Ie,o as We,aq as Je,ar as Ee,as as Xe}from"./index-DojfCsv7.js";import{bn as Ye,eQ as ee,fd as et,eW as pe,eU as me,bv as tt,mQ as at,f9 as nt,bO as st,je as ae,jh as ve,JF as ot,bT as it,c2 as ge,sm as fe,s7 as rt,Ka as Y,sn as _e,Hx as ct,ki as Ue,Kb as Ve,Kc as dt,Kd as lt,Ke as ut,jc as pt,jf as mt,s9 as Be,sl as gt,bE as xe,cv as ft,sz as Te,q9 as ht,pZ as yt,ka as bt,fC as St,fB as Ct,fA as kt,Kf as It,s1 as Et,sA as xt,sD as Tt,sG as Ot,sM as At,cU as Pt}from"./zeni-epic-state-BmAPZlsC.js";import{n as he}from"./mui-CTbUXhla.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-CzbbjqA7.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./empty-CKinwWZY.js";import"./pdf-lib-CNgiyR2K.js";import"./index-DeBaxB_L.js";import"./url-BRm_J7V6.js";import"./index-CxWCBC6O.js";import"./decodeURIComponentSafe-DCnYf30M.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]="ba99d4c4-3f6b-4f7b-9d5a-2602d7ddcf32",t._sentryDebugIdIdentifier="sentry-dbid-ba99d4c4-3f6b-4f7b-9d5a-2602d7ddcf32")}catch{}})();const wt=ce(function(t,s){const o=[];s.isApAgingFeatureEnabled===!1&&o.push("accounts_payable_aging"),s.isArAgingFeatureEnabled===!1&&o.push("accounts_receivable_aging"),s.shouldFetchZeniAccountsPromoCard===!1&&o.push("zeni_accounts_promo_card"),s.shouldFetchRewardsPlanCard===!1&&o.push("rewards_card"),s.isExpenseAutomationEnabledForUser===!1&&o.push("expense_automation_card");const u=nt(t,o,s.signedInUser,s.isExpenseAutomationFeatureEnabledV2,s.isExpenseAutomationEnabledForUser,s.isTreasuryEnabled);return{dashboardFetchState:st(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,s){const{themeState:o,navigate:u,location:d}=s;return{onZeniLogoClick:()=>{o.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Qe),jt=()=>{const t=se(),s=oe(),o=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&f,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),A=me(c),P=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&P.push("top_expenses"),$===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),q===!1&&P.push("reimbursement_card","reimbursement_promo_card"),k===!1&&P.push("zeni_accounts_promo_card"),h===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||A||(r(!0),o(at(i.userId,R,c.tenantId,!0,!1,P)))},[d,O,j,A,i,c.tenantId,o]),g.useEffect(()=>{(j||A)&&setTimeout(()=>{b(!0)},5e3)},[j,A]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(s.state?.pathnameStackToGoBack,s.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(E,{to:"../../cards",state:{...s.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:s,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-CfCKAQeM.js";import{l as z,g as S,u as q,h as N,j as Z,k as Q,s as Ka,n as st,o as w}from"./core-uYqCzel8.js";import{eQ as B,Kv as Ye,bE as Gt,bq as he,LI as qa,i2 as Za,LJ as wt,LK as Ha,i5 as rt,LL as je,LM as Qa,ia as Xa,LN as Dt,LO as Wa,ie as it,LP as Le,LQ as Ja,cl as lt,LR as en,LS as tn,KP as an,j8 as nn,LT as on,bn as Ie,LU as Nt,Kj as ae,bc as $t,jm as zt,m_ as Kt,j5 as qt,Kl as ne,Kk as H,f5 as sn,eN as rn,fn as cn,LV as ln,LW as dn,LX as Zt,LY as _e,uc as Ee,ud as Te,uA as fe,uu as oe,uh as xe,LZ as un,L_ as mn,L$ as pn,M0 as Ht,M1 as ke,M2 as hn,dE as Ve,qJ as Qt,M3 as fn,M4 as gn,M5 as bn,M6 as dt,JI as ut,jC as ge,uI as mt,qR as Cn,M7 as _n,ue as Ft,qM as me,qI as Xt,M8 as ie,M9 as kn,Ma as pt,JG as ht,sQ as Wt,Mb as Sn,Mc as yn,Md as An,Me as ft,t1 as vn,Mf as In,ug as Pt,sP as Jt,Mg as ce,Mh as En,bv as ea,uM as ta,Mi as Tn,Mj as xn,Mk as wn,Ml as gt,uH as Dn,Mm as Fn,uf as Ot,uL as aa,Mn as le,Mo as Pn,Mp as On,Mq as na,jr as oa,mX as sa,jw as ra,mV as ia,mU as ca,mT as la,sc as Mn,fd as Rn,cO as Bn,cP as jn,mQ as Ln,f9 as Un,n5 as Yn,DQ as Mt,Mr as Vn,Ms as Gn,Mt as Nn,Mu as $n,b5 as bt,f0 as zn,gM as Kn,fE as qn,m$ as Zn,i_ as Hn,mY as Qn,mW as Xn,eW as Wn,eU as Jn}from"./zeni-epic-state-BmAPZlsC.js";import{z as R,Y as X,q as D,d as I,D as K,aR as eo,A as we,aS as da,f as V,aT as to,c as De,aU as ua,y as Ge,S as j,m as ao,aV as no,aW as oo,T as ma,Z as so,a as pa,a1 as ro,aK as ha,aX as io,aY as co,X as lo,aZ as uo,a_ as mo,an as po,p as ho,U as fo,a$ as go,b0 as ye}from"./index-CeZ7L-BQ.js";import{n as Ct}from"./mui-CTbUXhla.js";import{a as C}from"./sentry-131ydzJg.js";import{w as fa}from"./withTransactionSidePanel-BS7S2wn5.js";import{b as ga,t as be,e as se,a as _t,v as bo}from"./routePaths-vUmlDccC.js";import{u as W}from"./useAskAiCfoHostNavButtonProps-D4_eEE1f.js";import{c as Fe,b as Co,u as _o}from"./useFetchSuggestedQuestionsWhenReady-b8cA6qxS.js";import ve from"./NotFoundScreen-CsEhUGfR.js";import{t as ba}from"./analyticsHelper-DhD4YoYg.js";import{C as ko}from"./CompanyPassportScreen-Btm8q2XT.js";import{F as So}from"./FeaturePreviewScreen-DPxCLrsp.js";import{R as yo}from"./ReferralListScreen-DWAGGjua.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./TransactionDetailScreen--PMkud8g.js";import"./decodeURIComponentSafe-DCnYf30M.js";import"./MobileAppDrawer-CNxBiA0K.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]="60d65aa9-78c0-4204-b8ce-3e83bdc56bc9",e._sentryDebugIdIdentifier="sentry-dbid-60d65aa9-78c0-4204-b8ce-3e83bdc56bc9")}catch{}})();const Ao=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(E=>E.tenantState.currentTenantId),d=S(E=>B(E)),{tenantEmailDomain:p}=z(),_=q(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=C.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${X}/agingDetailedReport`,timezone:Ye()}),[]),m=C.useMemo(()=>r!=null?Gt(r):he(),[r]),h=N(),f=Z(),k=S(E=>qa(E,m,o)),y=C.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),b=C.useCallback(()=>{f("../../",{relative:"path"})},[]),A=C.useCallback((E,$)=>{h(wt({sortKey:E,sortOrder:$}))},[]),T=C.useCallback(E=>{h(wt({downloadState:E}))},[]),L=C.useCallback(E=>{if(e)e(E.transactionId,E.transactionType);else if(p!=null){const $=ga({id:E.transactionId,type:E.transactionType},p);f($);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f($,{state:{pathnameStackToGoBack:de}})}},[p,e]),F=C.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return C.useEffect(()=>{y()},[]),C.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(eo,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:L,onReload:y,onBackClick:b,onColumnSortConfigChanged:A,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),vo=()=>{const e=N(),a=Z(),t=S(A=>Ha(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AP Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>B(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=C.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${X}/agingReport`,timezone:Ye()}),[]),g=t.apAgingUIState.selectedDate??he(),u=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(g))},[]);C.useEffect(()=>{u()},[]);const c=C.useCallback(()=>{a("../",{relative:"path"})},[]),m=C.useCallback(A=>{e(je({searchString:A}))},[]),h=C.useCallback((A,T)=>{e(je({sortKey:T,sortOrder:A}))},[]),f=C.useCallback(A=>{a(`./${A}/${g.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=C.useCallback(A=>{e(je({downloadState:A}))},[]),y=C.useCallback((A,T)=>{},[]),b=C.useCallback((A,T)=>{e(je({selectedDate:A,agingDateSelectionType:T})),e(rt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:I,onLoad:A=>A.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:b,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Io=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(F=>B(F)),{tenantEmailDomain:d}=z(),p=q(),_=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=C.useMemo(()=>({authParams:g,companyName:_,downloadEndPoint:`${X}/agingDetailedReport`,timezone:Ye()}),[]),c=C.useMemo(()=>r!=null?Gt(r):he(),[r]),m=N(),h=Z(),f=S(F=>Qa(F,c,o)),k=C.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Xa(o,c))},[c]),y=C.useCallback(()=>{h("../../",{relative:"path"})},[]),b=C.useCallback((F,E)=>{m(Dt({sortKey:F,sortOrder:E}))},[]),A=C.useCallback(F=>{m(Dt({downloadState:F}))},[]),T=C.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const E=ga({id:F.transactionId,type:F.transactionType},d);h(E);const $=D(p.state?.pathnameStackToGoBack,p.pathname);h(E,{state:{pathnameStackToGoBack:$}})}},[d,e]),L=C.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return C.useEffect(()=>{k()},[]),C.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),l.jsx(to,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:T,onReload:k,onBackClick:y,onColumnSortConfigChanged:b,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Eo=()=>{const e=N(),a=Z(),t=S(b=>Wa(b)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AR Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(b=>B(b)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=C.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${X}/agingReport`,timezone:Ye()}),[]),_=t.arAgingUIState.selectedDate??he(),g=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);C.useEffect(()=>{g()},[]);const u=C.useCallback(()=>{a("../",{relative:"path"})},[]),c=C.useCallback(b=>{e(Le({searchString:b}))},[]),m=C.useCallback((b,A)=>{e(Le({sortKey:A,sortOrder:b}))},[]),h=C.useCallback(b=>{a(`./${b}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=C.useCallback(b=>{e(Le({downloadState:b}))},[]),k=C.useCallback((b,A)=>{e(Le({selectedDate:b,agingDateSelectionType:A})),e(it(b))},[]),y=C.useCallback((b,A)=>{e(Ja({nodeId:b,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:I,onLoad:b=>b.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ca=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function _a(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=be(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const To=Q(function(e){const a=en(e).accountsInOrder.map((n,o)=>Ca(n,o)),t=tn(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},_a)(ua),xo=Q(function(e){const a=on(e).accountsInOrder.map((o,r)=>Ca(o,r)),t=R.getSignedInUser(),n=Ie(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},_a)(ua);function wo(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=De(),o=S(s=>B(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(To,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=De(),o=lt(n?.loggedInUserRoleMap),r=S(s=>B(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Fo=Ct.div`
1
+ import{j as l}from"./liveblocks-CfCKAQeM.js";import{l as z,g as S,u as q,h as N,j as Z,k as Q,s as Ka,n as st,o as w}from"./core-uYqCzel8.js";import{eQ as B,Kv as Ye,bE as Gt,bq as he,LI as qa,i2 as Za,LJ as wt,LK as Ha,i5 as rt,LL as je,LM as Qa,ia as Xa,LN as Dt,LO as Wa,ie as it,LP as Le,LQ as Ja,cl as lt,LR as en,LS as tn,KP as an,j8 as nn,LT as on,bn as Ie,LU as Nt,Kj as ae,bc as $t,jm as zt,m_ as Kt,j5 as qt,Kl as ne,Kk as H,f5 as sn,eN as rn,fn as cn,LV as ln,LW as dn,LX as Zt,LY as _e,uc as Ee,ud as Te,uA as fe,uu as oe,uh as xe,LZ as un,L_ as mn,L$ as pn,M0 as Ht,M1 as ke,M2 as hn,dE as Ve,qJ as Qt,M3 as fn,M4 as gn,M5 as bn,M6 as dt,JI as ut,jC as ge,uI as mt,qR as Cn,M7 as _n,ue as Ft,qM as me,qI as Xt,M8 as ie,M9 as kn,Ma as pt,JG as ht,sQ as Wt,Mb as Sn,Mc as yn,Md as An,Me as ft,t1 as vn,Mf as In,ug as Pt,sP as Jt,Mg as ce,Mh as En,bv as ea,uM as ta,Mi as Tn,Mj as xn,Mk as wn,Ml as gt,uH as Dn,Mm as Fn,uf as Ot,uL as aa,Mn as le,Mo as Pn,Mp as On,Mq as na,jr as oa,mX as sa,jw as ra,mV as ia,mU as ca,mT as la,sc as Mn,fd as Rn,cO as Bn,cP as jn,mQ as Ln,f9 as Un,n5 as Yn,DQ as Mt,Mr as Vn,Ms as Gn,Mt as Nn,Mu as $n,b5 as bt,f0 as zn,gM as Kn,fE as qn,m$ as Zn,i_ as Hn,mY as Qn,mW as Xn,eW as Wn,eU as Jn}from"./zeni-epic-state-BmAPZlsC.js";import{z as R,Y as X,q as D,d as I,D as K,aR as eo,A as we,aS as da,f as V,aT as to,c as De,aU as ua,y as Ge,S as j,m as ao,aV as no,aW as oo,T as ma,Z as so,a as pa,a1 as ro,aK as ha,aX as io,aY as co,X as lo,aZ as uo,a_ as mo,an as po,p as ho,U as fo,a$ as go,b0 as ye}from"./index-DojfCsv7.js";import{n as Ct}from"./mui-CTbUXhla.js";import{a as C}from"./sentry-131ydzJg.js";import{w as fa}from"./withTransactionSidePanel-DN0z2FuE.js";import{b as ga,t as be,e as se,a as _t,v as bo}from"./routePaths-DoAvT9jx.js";import{u as W}from"./useAskAiCfoHostNavButtonProps-It-lF7wN.js";import{c as Fe,b as Co,u as _o}from"./useFetchSuggestedQuestionsWhenReady-D9n2AKQx.js";import ve from"./NotFoundScreen-t1ueGvDG.js";import{t as ba}from"./analyticsHelper-BunVJ4K_.js";import{C as ko}from"./CompanyPassportScreen-BWjh-1tt.js";import{F as So}from"./FeaturePreviewScreen-B2O-98_e.js";import{R as yo}from"./ReferralListScreen-DTQFACuG.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./TransactionDetailScreen-DRZw6o-C.js";import"./decodeURIComponentSafe-DCnYf30M.js";import"./MobileAppDrawer-B3x5wY10.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]="60d65aa9-78c0-4204-b8ce-3e83bdc56bc9",e._sentryDebugIdIdentifier="sentry-dbid-60d65aa9-78c0-4204-b8ce-3e83bdc56bc9")}catch{}})();const Ao=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(E=>E.tenantState.currentTenantId),d=S(E=>B(E)),{tenantEmailDomain:p}=z(),_=q(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=C.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${X}/agingDetailedReport`,timezone:Ye()}),[]),m=C.useMemo(()=>r!=null?Gt(r):he(),[r]),h=N(),f=Z(),k=S(E=>qa(E,m,o)),y=C.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),b=C.useCallback(()=>{f("../../",{relative:"path"})},[]),A=C.useCallback((E,$)=>{h(wt({sortKey:E,sortOrder:$}))},[]),T=C.useCallback(E=>{h(wt({downloadState:E}))},[]),L=C.useCallback(E=>{if(e)e(E.transactionId,E.transactionType);else if(p!=null){const $=ga({id:E.transactionId,type:E.transactionType},p);f($);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f($,{state:{pathnameStackToGoBack:de}})}},[p,e]),F=C.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return C.useEffect(()=>{y()},[]),C.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(eo,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:L,onReload:y,onBackClick:b,onColumnSortConfigChanged:A,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),vo=()=>{const e=N(),a=Z(),t=S(A=>Ha(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AP Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>B(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=C.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${X}/agingReport`,timezone:Ye()}),[]),g=t.apAgingUIState.selectedDate??he(),u=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(g))},[]);C.useEffect(()=>{u()},[]);const c=C.useCallback(()=>{a("../",{relative:"path"})},[]),m=C.useCallback(A=>{e(je({searchString:A}))},[]),h=C.useCallback((A,T)=>{e(je({sortKey:T,sortOrder:A}))},[]),f=C.useCallback(A=>{a(`./${A}/${g.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=C.useCallback(A=>{e(je({downloadState:A}))},[]),y=C.useCallback((A,T)=>{},[]),b=C.useCallback((A,T)=>{e(je({selectedDate:A,agingDateSelectionType:T})),e(rt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:I,onLoad:A=>A.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:b,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Io=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(F=>B(F)),{tenantEmailDomain:d}=z(),p=q(),_=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=C.useMemo(()=>({authParams:g,companyName:_,downloadEndPoint:`${X}/agingDetailedReport`,timezone:Ye()}),[]),c=C.useMemo(()=>r!=null?Gt(r):he(),[r]),m=N(),h=Z(),f=S(F=>Qa(F,c,o)),k=C.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Xa(o,c))},[c]),y=C.useCallback(()=>{h("../../",{relative:"path"})},[]),b=C.useCallback((F,E)=>{m(Dt({sortKey:F,sortOrder:E}))},[]),A=C.useCallback(F=>{m(Dt({downloadState:F}))},[]),T=C.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const E=ga({id:F.transactionId,type:F.transactionType},d);h(E);const $=D(p.state?.pathnameStackToGoBack,p.pathname);h(E,{state:{pathnameStackToGoBack:$}})}},[d,e]),L=C.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return C.useEffect(()=>{k()},[]),C.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),l.jsx(to,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:T,onReload:k,onBackClick:y,onColumnSortConfigChanged:b,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Eo=()=>{const e=N(),a=Z(),t=S(b=>Wa(b)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AR Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(b=>B(b)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=C.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${X}/agingReport`,timezone:Ye()}),[]),_=t.arAgingUIState.selectedDate??he(),g=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);C.useEffect(()=>{g()},[]);const u=C.useCallback(()=>{a("../",{relative:"path"})},[]),c=C.useCallback(b=>{e(Le({searchString:b}))},[]),m=C.useCallback((b,A)=>{e(Le({sortKey:A,sortOrder:b}))},[]),h=C.useCallback(b=>{a(`./${b}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=C.useCallback(b=>{e(Le({downloadState:b}))},[]),k=C.useCallback((b,A)=>{e(Le({selectedDate:b,agingDateSelectionType:A})),e(it(b))},[]),y=C.useCallback((b,A)=>{e(Ja({nodeId:b,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:I,onLoad:b=>b.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ca=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function _a(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=be(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const To=Q(function(e){const a=en(e).accountsInOrder.map((n,o)=>Ca(n,o)),t=tn(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},_a)(ua),xo=Q(function(e){const a=on(e).accountsInOrder.map((o,r)=>Ca(o,r)),t=R.getSignedInUser(),n=Ie(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},_a)(ua);function wo(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=De(),o=S(s=>B(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(To,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=De(),o=lt(n?.loggedInUserRoleMap),r=S(s=>B(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Fo=Ct.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-CfCKAQeM.js";import{a as u}from"./sentry-131ydzJg.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-uYqCzel8.js";import{J9 as N,eQ as _,fl as U,Ja as L,mS as R,Jb as z}from"./zeni-epic-state-BmAPZlsC.js";import{u as O,z as f,L as T,t as I,D as $,b as j}from"./index-CeZ7L-BQ.js";import"./mui-CTbUXhla.js";import{t as P}from"./getLocaleForTenant-CFQN8jbL.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.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]="0690d749-15fd-46f1-9347-543338f7fa14",t._sentryDebugIdIdentifier="sentry-dbid-0690d749-15fd-46f1-9347-543338f7fa14")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=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=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const J=["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"],q={"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 J)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-CfCKAQeM.js";import{a as u}from"./sentry-131ydzJg.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-uYqCzel8.js";import{J9 as N,eQ as _,fl as U,Ja as L,mS as R,Jb as z}from"./zeni-epic-state-BmAPZlsC.js";import{u as O,z as f,L as T,t as I,D as $,b as j}from"./index-DojfCsv7.js";import"./mui-CTbUXhla.js";import{t as P}from"./getLocaleForTenant-BVZe9vGW.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.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]="0690d749-15fd-46f1-9347-543338f7fa14",t._sentryDebugIdIdentifier="sentry-dbid-0690d749-15fd-46f1-9347-543338f7fa14")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=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=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const J=["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"],q={"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 J)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-CfCKAQeM.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-uYqCzel8.js";import{Nc as k,Nj as q,fC as K,fB as M,fA as Q,iz as W,Kk as J,q0 as L,eQ as V,MK as D,ix as T,Nd as S,Nm as F,iv as G,iS as j}from"./zeni-epic-state-BmAPZlsC.js";import{bn as X,Z as N,y as R,z as U,m as Z,p,S as v,x as z,bo as Y,o as O,bp as ee,q as te}from"./index-CeZ7L-BQ.js";import{n as H}from"./mui-CTbUXhla.js";import"./sentry-131ydzJg.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]="6f010c9c-f9fb-4c23-94d1-f3357dc98752",e._sentryDebugIdIdentifier="sentry-dbid-6f010c9c-f9fb-4c23-94d1-f3357dc98752")}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(J("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
1
+ import{j as l}from"./liveblocks-CfCKAQeM.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-uYqCzel8.js";import{Nc as k,Nj as q,fC as K,fB as M,fA as Q,iz as W,Kk as J,q0 as L,eQ as V,MK as D,ix as T,Nd as S,Nm as F,iv as G,iS as j}from"./zeni-epic-state-BmAPZlsC.js";import{bn as X,Z as N,y as R,z as U,m as Z,p,S as v,x as z,bo as Y,o as O,bp as ee,q as te}from"./index-DojfCsv7.js";import{n as H}from"./mui-CTbUXhla.js";import"./sentry-131ydzJg.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]="6f010c9c-f9fb-4c23-94d1-f3357dc98752",e._sentryDebugIdIdentifier="sentry-dbid-6f010c9c-f9fb-4c23-94d1-f3357dc98752")}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(J("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-CfCKAQeM.js";import{Z as c,G as l,m as f}from"./index-CeZ7L-BQ.js";import{D as b}from"./mui-CTbUXhla.js";import"./sentry-131ydzJg.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]="b26b4ae4-0c9b-47d2-a9ac-ad4f0f5041c7",e._sentryDebugIdIdentifier="sentry-dbid-b26b4ae4-0c9b-47d2-a9ac-ad4f0f5041c7")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=c(),s=o?.valuePx(a)??p.drawerLeftMargin.valuePx(a),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{m as D};
1
+ import{j as i}from"./liveblocks-CfCKAQeM.js";import{Z as c,G as l,m as f}from"./index-DojfCsv7.js";import{D as b}from"./mui-CTbUXhla.js";import"./sentry-131ydzJg.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]="b26b4ae4-0c9b-47d2-a9ac-ad4f0f5041c7",e._sentryDebugIdIdentifier="sentry-dbid-b26b4ae4-0c9b-47d2-a9ac-ad4f0f5041c7")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=c(),s=o?.valuePx(a)??p.drawerLeftMargin.valuePx(a),d=f();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{m as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-CfCKAQeM.js";import{a as d}from"./sentry-131ydzJg.js";import{j as A,h as B,u as K,l as G,g as l,N as F,k as O,n as N,o as W}from"./core-uYqCzel8.js";import{Lr as _,eQ as H,KQ as L,kC as M,Hp as k,Lw as Q,Kj as R,jC as V,Hq as S,KV as Y,KW as $,Kl as z,Kk as J}from"./zeni-epic-state-BmAPZlsC.js";import{aO as U,d as X,p as Z,q as tt}from"./index-CeZ7L-BQ.js";import"./mui-CTbUXhla.js";import{d as b}from"./decodeURIComponentSafe-DCnYf30M.js";import{w as et}from"./withTransactionSidePanel-BS7S2wn5.js";import{e as at,b as nt}from"./routePaths-vUmlDccC.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./useAskAiCfoHostNavButtonProps-D4_eEE1f.js";import"./useFetchSuggestedQuestionsWhenReady-b8cA6qxS.js";import"./TransactionDetailScreen--PMkud8g.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]="44e034a2-e3b7-466a-8b38-2784ed16bdab",a._sentryDebugIdIdentifier="sentry-dbid-44e034a2-e3b7-466a-8b38-2784ed16bdab")}catch{}})();const ot=O(function(a,t){const e=t.entity,o=Q(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:R(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:V(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(z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Y()),a($()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=K(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:I,entityIdEncoded:j,entityNameEncoded:w}=G(),r=b(j??""),p=b(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),q=l(n=>H(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>L(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:q,tenantEmailDomain:I,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:C(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(N,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
1
+ import{j as s}from"./liveblocks-CfCKAQeM.js";import{a as d}from"./sentry-131ydzJg.js";import{j as A,h as B,u as K,l as G,g as l,N as F,k as O,n as N,o as W}from"./core-uYqCzel8.js";import{Lr as _,eQ as H,KQ as L,kC as M,Hp as k,Lw as Q,Kj as R,jC as V,Hq as S,KV as Y,KW as $,Kl as z,Kk as J}from"./zeni-epic-state-BmAPZlsC.js";import{aO as U,d as X,p as Z,q as tt}from"./index-DojfCsv7.js";import"./mui-CTbUXhla.js";import{d as b}from"./decodeURIComponentSafe-DCnYf30M.js";import{w as et}from"./withTransactionSidePanel-DN0z2FuE.js";import{e as at,b as nt}from"./routePaths-DoAvT9jx.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./useAskAiCfoHostNavButtonProps-It-lF7wN.js";import"./useFetchSuggestedQuestionsWhenReady-D9n2AKQx.js";import"./TransactionDetailScreen-DRZw6o-C.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]="44e034a2-e3b7-466a-8b38-2784ed16bdab",a._sentryDebugIdIdentifier="sentry-dbid-44e034a2-e3b7-466a-8b38-2784ed16bdab")}catch{}})();const ot=O(function(a,t){const e=t.entity,o=Q(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:R(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:V(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(z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(Y()),a($()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=K(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:I,entityIdEncoded:j,entityNameEncoded:w}=G(),r=b(j??""),p=b(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),q=l(n=>H(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>L(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:q,tenantEmailDomain:I,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:C(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(N,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-CfCKAQeM.js";import xn from"./NotFoundScreen-CsEhUGfR.js";import{a,b as Pt}from"./sentry-131ydzJg.js";import{n as Fe,S as Rn}from"./mui-CTbUXhla.js";import{h as ce,j as wt,u as Ge,g as U,k as Dn,l as rt,n as Un,o as Le}from"./core-uYqCzel8.js";import{eQ as Re,PL as Fn,n0 as Se,fg as Bn,qD as _n,ni as xt,nD as Rt,PM as Dt,nN as Mn,PN as Ut,nb as Vn,q9 as On,e$ as pe,PO as De,sJ as Ft,BU as Bt,PP as _t,PQ as jn,pQ as Qe,Ls as dt,Lu as Ln,jF as zn,Lv as $n,jM as qn,cW as Gn,tM as Ne,no as Mt,nS as Ue,PR as Qn,Kl as ut,Kk as Pe,PS as mt,k1 as Nn,PT as Yn,PU as Jn,PV as Kn,PW as Wn,nv as Hn,ng as ie,nV as we,PX as Zn,PY as Xn,PZ as ea,o0 as ta,jQ as na,jH as aa,P_ as oa,jP as ht,LC as sa,P$ as ca,Q0 as ia,pM as la,pr as ra,nT as ge,pq as ze,Q1 as da,Q2 as ua,lk as ma,bq as ha,lf as pt,l1 as pa,Q3 as ga,gO as gt,fS as Ca,lc as Sa,vF as fa,Q4 as Ia,or as ka,om as Ea,oq as va,ob as ya,Q5 as ba,f2 as Vt,nG as Aa,nr as Ta,fh as Ct,nX as Pa,Q6 as wa,nU as Ot,Q7 as xa,Q8 as Ra,Q9 as Da,Qa as Ua,Qb as St,pY as Fa,ph as Ba,Kj as _a,jO as Ma,Qc as Va,Gq as Oa,jN as ja,jC as La,f1 as za,oS as jt,p9 as $a,nR as ft,nW as qa,bE as Ga,l9 as Qa,l6 as Na,Qd as Ya,oa as It,p7 as kt,p5 as Ja,oX as Ka,oC as Wa,p8 as Ha,Qe as Za,Qf as Xa,oG as eo,Qg as to,ow as no,oF as ao,oD as oo,pc as so}from"./zeni-epic-state-BmAPZlsC.js";import{y as Lt,S as Ce,d as L,q as W,U as zt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,x as $t,cz as ro,an as $e,D as uo,cA as mo,Y as ho,cB as po,T as go,cC as Co,cD as So,s as fo,c as Io,aK as ko,b1 as Eo,G as vo,cE as yo}from"./index-CeZ7L-BQ.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-D4_eEE1f.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-b8cA6qxS.js";import{c as vt,C as bo}from"./TransactionDetailScreen--PMkud8g.js";import{w as Ao}from"./withTransactionSidePanel-BS7S2wn5.js";import{h as To,v as Po}from"./routePaths-vUmlDccC.js";import{g as qe}from"./accountMappingHelper-D6x0RpVY.js";import{D as wo}from"./DrawerScreen-AH0ysY6V.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./decodeURIComponentSafe-DCnYf30M.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]="1fcd27ef-ceb0-4731-a89e-e2f5b540fadb",t._sentryDebugIdIdentifier="sentry-dbid-1fcd27ef-ceb0-4731-a89e-e2f5b540fadb")}catch{}})();const xo=()=>{const t=ce(),i=wt(),A=Ge(),I=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,I.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,J=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:J}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(I.tenantId,d))},[I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[I.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,I.tenantId,!0)},[m,r,I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=W(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:f}=zt();return Gt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&f&&m(r,I.tenantId)},[m,r,o.fetchState,I.tenantId,f]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&f&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,f]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
1
+ import{j as C}from"./liveblocks-CfCKAQeM.js";import xn from"./NotFoundScreen-t1ueGvDG.js";import{a,b as Pt}from"./sentry-131ydzJg.js";import{n as Fe,S as Rn}from"./mui-CTbUXhla.js";import{h as ce,j as wt,u as Ge,g as U,k as Dn,l as rt,n as Un,o as Le}from"./core-uYqCzel8.js";import{eQ as Re,PL as Fn,n0 as Se,fg as Bn,qD as _n,ni as xt,nD as Rt,PM as Dt,nN as Mn,PN as Ut,nb as Vn,q9 as On,e$ as pe,PO as De,sJ as Ft,BU as Bt,PP as _t,PQ as jn,pQ as Qe,Ls as dt,Lu as Ln,jF as zn,Lv as $n,jM as qn,cW as Gn,tM as Ne,no as Mt,nS as Ue,PR as Qn,Kl as ut,Kk as Pe,PS as mt,k1 as Nn,PT as Yn,PU as Jn,PV as Kn,PW as Wn,nv as Hn,ng as ie,nV as we,PX as Zn,PY as Xn,PZ as ea,o0 as ta,jQ as na,jH as aa,P_ as oa,jP as ht,LC as sa,P$ as ca,Q0 as ia,pM as la,pr as ra,nT as ge,pq as ze,Q1 as da,Q2 as ua,lk as ma,bq as ha,lf as pt,l1 as pa,Q3 as ga,gO as gt,fS as Ca,lc as Sa,vF as fa,Q4 as Ia,or as ka,om as Ea,oq as va,ob as ya,Q5 as ba,f2 as Vt,nG as Aa,nr as Ta,fh as Ct,nX as Pa,Q6 as wa,nU as Ot,Q7 as xa,Q8 as Ra,Q9 as Da,Qa as Ua,Qb as St,pY as Fa,ph as Ba,Kj as _a,jO as Ma,Qc as Va,Gq as Oa,jN as ja,jC as La,f1 as za,oS as jt,p9 as $a,nR as ft,nW as qa,bE as Ga,l9 as Qa,l6 as Na,Qd as Ya,oa as It,p7 as kt,p5 as Ja,oX as Ka,oC as Wa,p8 as Ha,Qe as Za,Qf as Xa,oG as eo,Qg as to,ow as no,oF as ao,oD as oo,pc as so}from"./zeni-epic-state-BmAPZlsC.js";import{y as Lt,S as Ce,d as L,q as W,U as zt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,x as $t,cz as ro,an as $e,D as uo,cA as mo,Y as ho,cB as po,T as go,cC as Co,cD as So,s as fo,c as Io,aK as ko,b1 as Eo,G as vo,cE as yo}from"./index-DojfCsv7.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-It-lF7wN.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-D9n2AKQx.js";import{c as vt,C as bo}from"./TransactionDetailScreen-DRZw6o-C.js";import{w as Ao}from"./withTransactionSidePanel-DN0z2FuE.js";import{h as To,v as Po}from"./routePaths-DoAvT9jx.js";import{g as qe}from"./accountMappingHelper-D6x0RpVY.js";import{D as wo}from"./DrawerScreen-DzkaoOWL.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./decodeURIComponentSafe-DCnYf30M.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]="1fcd27ef-ceb0-4731-a89e-e2f5b540fadb",t._sentryDebugIdIdentifier="sentry-dbid-1fcd27ef-ceb0-4731-a89e-e2f5b540fadb")}catch{}})();const xo=()=>{const t=ce(),i=wt(),A=Ge(),I=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,I.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,J=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:J}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(I.tenantId,d))},[I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[I.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,I.tenantId,!0)},[m,r,I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=W(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:f}=zt();return Gt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&f&&m(r,I.tenantId)},[m,r,o.fetchState,I.tenantId,f]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&f&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,f]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-CfCKAQeM.js";import{a as r}from"./sentry-131ydzJg.js";import{_ as c,$ as l,a0 as p,p as m}from"./index-CeZ7L-BQ.js";import"./mui-CTbUXhla.js";import f from"./NotFoundScreen-CsEhUGfR.js";import{j as u,u as b}from"./core-uYqCzel8.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]="2e827b03-3332-44c2-8c4e-3d6d0e2a5436",e._sentryDebugIdIdentifier="sentry-dbid-2e827b03-3332-44c2-8c4e-3d6d0e2a5436")}catch{}})();const j=()=>{const e=u(),t=b(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(t.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=c(t.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:a,onGoBack:d}):s.jsx(f,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{j as F};
1
+ import{j as s}from"./liveblocks-CfCKAQeM.js";import{a as r}from"./sentry-131ydzJg.js";import{_ as c,$ as l,a0 as p,p as m}from"./index-DojfCsv7.js";import"./mui-CTbUXhla.js";import f from"./NotFoundScreen-t1ueGvDG.js";import{j as u,u as b}from"./core-uYqCzel8.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]="2e827b03-3332-44c2-8c4e-3d6d0e2a5436",e._sentryDebugIdIdentifier="sentry-dbid-2e827b03-3332-44c2-8c4e-3d6d0e2a5436")}catch{}})();const j=()=>{const e=u(),t=b(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(t.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=c(t.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:a,onGoBack:d}):s.jsx(f,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{j as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-131ydzJg.js";import{h as l,j as f,u as m}from"./core-uYqCzel8.js";import{gv as p,Jx as g,Jy as _}from"./zeni-epic-state-BmAPZlsC.js";import{u as b,L as h,z as y}from"./index-CeZ7L-BQ.js";import"./liveblocks-CfCKAQeM.js";import"./recharts-BUFoogHS.js";import"./mui-CTbUXhla.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="38346526-e167-43b6-a777-34fdf3173551",e._sentryDebugIdIdentifier="sentry-dbid-38346526-e167-43b6-a777-34fdf3173551")}catch{}})();function z(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:c}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{z as default};
1
+ import{a as r}from"./sentry-131ydzJg.js";import{h as l,j as f,u as m}from"./core-uYqCzel8.js";import{gv as p,Jx as g,Jy as _}from"./zeni-epic-state-BmAPZlsC.js";import{u as b,L as h,z as y}from"./index-DojfCsv7.js";import"./liveblocks-CfCKAQeM.js";import"./recharts-BUFoogHS.js";import"./mui-CTbUXhla.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="38346526-e167-43b6-a777-34fdf3173551",e._sentryDebugIdIdentifier="sentry-dbid-38346526-e167-43b6-a777-34fdf3173551")}catch{}})();function z(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:c}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),u=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&u!=null){const t=JSON.parse(u);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{z as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-CfCKAQeM.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as E,N as ae,n as ne,o as p}from"./core-uYqCzel8.js";import{Jq as k,Jr as v,Js as T,zv as z,zh as G,Jt as B,Ju as oe,Jv as se,zl as ie,eR as $,zs as le,zp as re}from"./zeni-epic-state-BmAPZlsC.js";import{Z as g,o as r,j as de,d as j,h as J,k as ce,p as me,n as pe,q as M,y as ue,S as he,r as xe,s as ge,m as fe,w as we,x as be,A as Se,B as ye,C as ke,E as ve,G as je,H as $e}from"./index-CeZ7L-BQ.js";import{n as m}from"./mui-CTbUXhla.js";import f from"./NotFoundScreen-CsEhUGfR.js";import{a as I}from"./sentry-131ydzJg.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.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]="a505e988-bc42-426b-8e37-2cb14433fdf0",e._sentryDebugIdIdentifier="sentry-dbid-a505e988-bc42-426b-8e37-2cb14433fdf0")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-CfCKAQeM.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as E,N as ae,n as ne,o as p}from"./core-uYqCzel8.js";import{Jq as k,Jr as v,Js as T,zv as z,zh as G,Jt as B,Ju as oe,Jv as se,zl as ie,eR as $,zs as le,zp as re}from"./zeni-epic-state-BmAPZlsC.js";import{Z as g,o as r,j as de,d as j,h as J,k as ce,p as me,n as pe,q as M,y as ue,S as he,r as xe,s as ge,m as fe,w as we,x as be,A as Se,B as ye,C as ke,E as ve,G as je,H as $e}from"./index-DojfCsv7.js";import{n as m}from"./mui-CTbUXhla.js";import f from"./NotFoundScreen-t1ueGvDG.js";import{a as I}from"./sentry-131ydzJg.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.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]="a505e988-bc42-426b-8e37-2cb14433fdf0",e._sentryDebugIdIdentifier="sentry-dbid-a505e988-bc42-426b-8e37-2cb14433fdf0")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;