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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/assets/{AddressRoutes-x8EoHTgO.js → AddressRoutes-C-vBt6EU.js} +1 -1
  2. package/dist/assets/{AddressScreen-BIexwSUC.js → AddressScreen-CPMiTr10.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-DN022lRy.js → AiCfoScreen-DwMo_gfa.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-D6a6fZAk.js → BillPayApprovalRoutes-ySvc-HDi.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-CdXbo9_x.js → BillPayRoutes-DkrY7gaQ.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-CavwhxgK.js → BusinessVerificationPageScreen-BGcxJWGX.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-Xfw8idFo.js → ChargeCardRoutes-DaqjbIqY.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-BFYWdwCR.js → CompanyPassportScreen-CqQQjG13.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-OGsoNPk1.js → ConnectionAuthScreen-CqaNGgTe.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-BlUS8xnK.js → CustomerOnboardingAuthScreen-CkivMRyQ.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-CdcqOy3h.js → CustomerOnboardingRoutes-Dh4dQcQm.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-DBu1dqFJ.js → DashboardRoutes-BunWcwzn.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-vkfDVx8a.js → DefaultTenantHome-CLljzZmF.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BsWJ2Su_.js → DomesticWireDetailScreen-8rq_3RAs.js} +1 -1
  15. package/dist/assets/{DrawerScreen-Bw1QfkLT.js → DrawerScreen-BVjSAkhK.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-DDZlauU7.js → EntityDetailRoutes-j6bkntim.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-CbzZZ1fQ.js → ExpenseAutomationRoutes-DxjGeljs.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-Bnq4uovL.js → FeaturePreviewScreen-DIglws95.js} +1 -1
  19. package/dist/assets/{MagicLinkRoutes-CeL7GNJn.js → MagicLinkRoutes-Bw9TLno3.js} +1 -1
  20. package/dist/assets/{MagicLinkSignInScreen-f8Uc14m0.js → MagicLinkSignInScreen-Q7iovr3K.js} +1 -1
  21. package/dist/assets/{MobileAppDrawer-NY5CZpkD.js → MobileAppDrawer-BXRnd_IS.js} +1 -1
  22. package/dist/assets/{NotFoundScreen-DNbVpibd.js → NotFoundScreen-Cucx3MKM.js} +1 -1
  23. package/dist/assets/{NotificationRoutes-BRjGOURk.js → NotificationRoutes-CcriqAcW.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-oBHUYnSn.js → PandLWithForecastRoutes-C7JhOn8C.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-0DuSRKi7.js → PeopleRoutes-CCgmsoyU.js} +1 -1
  26. package/dist/assets/{PerformanceRoutes-BPySqreL.js → PerformanceRoutes-Bm2LvHqj.js} +1 -1
  27. package/dist/assets/{QBOConnectionScreen-WktucsBE.js → QBOConnectionScreen-DKcB3eb7.js} +1 -1
  28. package/dist/assets/{ReferralListScreen-CAsh5C9i.js → ReferralListScreen-DQ3JeDsI.js} +1 -1
  29. package/dist/assets/{ReimbursementApprovalRoutes-BAvS3MWN.js → ReimbursementApprovalRoutes-B828Jrb7.js} +1 -1
  30. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-ZZIaexmv.js → ReimbursementApprovalRuleDetailScreen-BUgMzKjx.js} +1 -1
  31. package/dist/assets/{ReimbursementRoutes-yVlm9pPF.js → ReimbursementRoutes-BOAJyHPC.js} +1 -1
  32. package/dist/assets/{ReportsRoutes-Dlw2t-eT.js → ReportsRoutes-DoUbSXR8.js} +1 -1
  33. package/dist/assets/{RewardsRoutes-BP5Nzhwq.js → RewardsRoutes-sLDhHIWk.js} +1 -1
  34. package/dist/assets/{ScreenRoutes-B_PRMI91.js → ScreenRoutes-CEap4F7c.js} +2 -2
  35. package/dist/assets/{SettingsRoutes-BKRiya-R.js → SettingsRoutes-B-1uwG1f.js} +1 -1
  36. package/dist/assets/{SetupPagesScreen-BlvsgM9d.js → SetupPagesScreen-DmAnODHL.js} +1 -1
  37. package/dist/assets/{SignInScreen-BYWJfkJz.js → SignInScreen-DLEv3grW.js} +1 -1
  38. package/dist/assets/{SignOutScreen-BDOb5I1P.js → SignOutScreen-BWGRzL_W.js} +1 -1
  39. package/dist/assets/{TaskListScreen-7rCdkI4n.js → TaskListScreen-BwJ_RgJo.js} +1 -1
  40. package/dist/assets/{TaskRoutes-GSceRjWV.js → TaskRoutes-BFOwSoKs.js} +1 -1
  41. package/dist/assets/{TransactionDetailRoutes-BJJ7P6dg.js → TransactionDetailRoutes-BpsESo30.js} +1 -1
  42. package/dist/assets/{TransactionDetailScreen-BRy8OBJd.js → TransactionDetailScreen-D1icJoqW.js} +1 -1
  43. package/dist/assets/{TransactionListRoutes-CvETOFD-.js → TransactionListRoutes-BKVCWX3q.js} +1 -1
  44. package/dist/assets/{TreasuryRoutes-Cd4RbTnr.js → TreasuryRoutes-D-L0eSlp.js} +1 -1
  45. package/dist/assets/{VendorsRoutes-BOMpA3qx.js → VendorsRoutes-Dhf9--mz.js} +1 -1
  46. package/dist/assets/{WiseConfirmationScreen-CfxOf9br.js → WiseConfirmationScreen-CoVxJsRG.js} +1 -1
  47. package/dist/assets/{ZeniAccountRoutes-CTYhth7C.js → ZeniAccountRoutes-Dq6KZarp.js} +1 -1
  48. package/dist/assets/{ZeniAccountStatementScreen-B0vovcSx.js → ZeniAccountStatementScreen-DzrkGkJa.js} +1 -1
  49. package/dist/assets/{analyticsHelper-1lOvj-za.js → analyticsHelper-DWU-XMyN.js} +1 -1
  50. package/dist/assets/{getLocaleForTenant-Czitv1AW.js → getLocaleForTenant-CjYI5PP8.js} +1 -1
  51. package/dist/assets/{index-BxZQbqZa.js → index-B30ioXEx.js} +5 -5
  52. package/dist/assets/{routePaths-DKtGe48K.js → routePaths-C_5Vo_Nm.js} +1 -1
  53. package/dist/assets/{useAskAiCfoHostNavButtonProps-DxvBbMZO.js → useAskAiCfoHostNavButtonProps-DOA3k3qr.js} +1 -1
  54. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js → useFetchSuggestedQuestionsWhenReady-CThB0klC.js} +1 -1
  55. package/dist/assets/{useInitialThreadRequest-F8zTMPR1.js → useInitialThreadRequest-jV5iOQ5Z.js} +1 -1
  56. package/dist/assets/{withTransactionSidePanel-DJ3JMAJu.js → withTransactionSidePanel-C4Otz1Im.js} +1 -1
  57. package/dist/index.html +1 -1
  58. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-585gCzRC.js";import{A as d}from"./AddressScreen-BIexwSUC.js";import i from"./NotFoundScreen-DNbVpibd.js";import"./sentry-CznkHhej.js";import{n as s,o as r}from"./core-BM9YDzPX.js";import"./zeni-epic-state-1oMHKKZA.js";import"./recharts-Bk8sahKA.js";import"./index-BxZQbqZa.js";import"./mui-Dh_OiBGq.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
1
+ import{j as e}from"./liveblocks-585gCzRC.js";import{A as d}from"./AddressScreen-CPMiTr10.js";import i from"./NotFoundScreen-Cucx3MKM.js";import"./sentry-CznkHhej.js";import{n as s,o as r}from"./core-BM9YDzPX.js";import"./zeni-epic-state-1oMHKKZA.js";import"./recharts-Bk8sahKA.js";import"./index-B30ioXEx.js";import"./mui-Dh_OiBGq.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-585gCzRC.js";import{a as h}from"./sentry-CznkHhej.js";import{j as P,h as _,u as j,l as E,g as $,k as B}from"./core-BM9YDzPX.js";import{K as M,h as D,z as K,S as L,B as R,y as z,e as I,g as m,r as F,m as b,s as N}from"./index-BxZQbqZa.js";import{IZ as C,gI as U,eM as G,I_ as O,b$ as V,I$ as q,k2 as H}from"./zeni-epic-state-1oMHKKZA.js";import{n as Z}from"./mui-Dh_OiBGq.js";import J from"./NotFoundScreen-DNbVpibd.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]="8b67434c-5390-4bc5-8a66-a6c059945868",e._sentryDebugIdIdentifier="sentry-dbid-8b67434c-5390-4bc5-8a66-a6c059945868")}catch{}})();const Q=Z.div`
1
+ import{j as d}from"./liveblocks-585gCzRC.js";import{a as h}from"./sentry-CznkHhej.js";import{j as P,h as _,u as j,l as E,g as $,k as B}from"./core-BM9YDzPX.js";import{K as M,h as D,z as K,S as L,B as R,y as z,e as I,g as m,r as F,m as b,s as N}from"./index-B30ioXEx.js";import{IZ as C,gI as U,eM as G,I_ as O,b$ as V,I$ as q,k2 as H}from"./zeni-epic-state-1oMHKKZA.js";import{n as Z}from"./mui-Dh_OiBGq.js";import J from"./NotFoundScreen-Cucx3MKM.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]="8b67434c-5390-4bc5-8a66-a6c059945868",e._sentryDebugIdIdentifier="sentry-dbid-8b67434c-5390-4bc5-8a66-a6c059945868")}catch{}})();const Q=Z.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-585gCzRC.js";import{a as r}from"./sentry-CznkHhej.js";import{h as oe,j as ne,u as ie,g as G,l as re,k as le}from"./core-BM9YDzPX.js";import{J as ce,cB as ue,z as de,K as me,cC as pe,cD as fe,cE as he,cF as q,y as Se,e as v,Q as V,cG as ge,cH as Ce,g as be,a1 as ke,cI as we,T as Ie,x as Ee,s as $,cJ as Pe,cK as Te}from"./index-BxZQbqZa.js";import{fE as ye,f3 as H,eM as _e,hm as xe,Pv as ve,eL as Ue,hw as Qe,hs as Ae,fu as Oe,fo as De,fh as Fe,fl as N,fp as Be,fq as Le,fr as Me,fs as Re,ft as je}from"./zeni-epic-state-1oMHKKZA.js";import{D as Ge,n as U,P as Ve,S as $e}from"./mui-Dh_OiBGq.js";import{p as Ne}from"./pathToGoBack-B-VHmIUu.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="b3e2bf2e-c86b-4096-9fb4-85820ffd6c33",s._sentryDebugIdIdentifier="sentry-dbid-b3e2bf2e-c86b-4096-9fb4-85820ffd6c33")}catch{}})();const W="chat-response-generated",qe=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:E}=q(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(E,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Me(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(je({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Pe(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(N(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Be(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ne(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(N(""))},togglePageView:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Ee(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=G(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=G(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),Q=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,A=!!C?.aiCfoShouldSubmit,[z,P]=r.useState(null),[J,T]=r.useState(!1),O=r.useRef(!1);r.useEffect(()=>{O.current||b==null||b===""||(P(b),T(A),O.current=!0)},[b,A]);const K=r.useCallback(()=>{P(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,B=r.useRef(!1);r.useEffect(()=>{B.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),B.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(P(k),T(!0),a(ve()))},[k,t,a]);const Y=c.masterTOSInfo,w=Y?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,M=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),j=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=q(j,t),X=Z.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Qe())},[_,x,a]),r.useEffect(()=>{t!=null&&M!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Ae(t,e.userId))},[M,R,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),V(n)&&Q.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:j,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:X,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:J,onEmailLinkQuestionProcessed:K,onMenuClick:V(n)?Q.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,onUploadPromoClose:g}),h.jsx(Ge,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Oe(c.userRoleId)),f(!1)}})})})]})},He=U($e)`
1
+ import{j as h}from"./liveblocks-585gCzRC.js";import{a as r}from"./sentry-CznkHhej.js";import{h as oe,j as ne,u as ie,g as G,l as re,k as le}from"./core-BM9YDzPX.js";import{J as ce,cB as ue,z as de,K as me,cC as pe,cD as fe,cE as he,cF as q,y as Se,e as v,Q as V,cG as ge,cH as Ce,g as be,a1 as ke,cI as we,T as Ie,x as Ee,s as $,cJ as Pe,cK as Te}from"./index-B30ioXEx.js";import{fE as ye,f3 as H,eM as _e,hm as xe,Pv as ve,eL as Ue,hw as Qe,hs as Ae,fu as Oe,fo as De,fh as Fe,fl as N,fp as Be,fq as Le,fr as Me,fs as Re,ft as je}from"./zeni-epic-state-1oMHKKZA.js";import{D as Ge,n as U,P as Ve,S as $e}from"./mui-Dh_OiBGq.js";import{p as Ne}from"./pathToGoBack-B-VHmIUu.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="b3e2bf2e-c86b-4096-9fb4-85820ffd6c33",s._sentryDebugIdIdentifier="sentry-dbid-b3e2bf2e-c86b-4096-9fb4-85820ffd6c33")}catch{}})();const W="chat-response-generated",qe=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:E}=q(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(E,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Me(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(je({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Pe(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(N(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Be(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ne(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(N(""))},togglePageView:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Ee(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=G(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=G(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),Q=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,A=!!C?.aiCfoShouldSubmit,[z,P]=r.useState(null),[J,T]=r.useState(!1),O=r.useRef(!1);r.useEffect(()=>{O.current||b==null||b===""||(P(b),T(A),O.current=!0)},[b,A]);const K=r.useCallback(()=>{P(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,B=r.useRef(!1);r.useEffect(()=>{B.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),B.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(P(k),T(!0),a(ve()))},[k,t,a]);const Y=c.masterTOSInfo,w=Y?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,M=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),j=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=q(j,t),X=Z.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Qe())},[_,x,a]),r.useEffect(()=>{t!=null&&M!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Ae(t,e.userId))},[M,R,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),V(n)&&Q.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:j,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:X,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:J,onEmailLinkQuestionProcessed:K,onMenuClick:V(n)?Q.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,onUploadPromoClose:g}),h.jsx(Ge,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Oe(c.userRoleId)),f(!1)}})})})]})},He=U($e)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-585gCzRC.js";import{a as y}from"./sentry-CznkHhej.js";import{j as U,u as B,h as j,g as v,N as $,k as T,l as L,n as O,o as h}from"./core-BM9YDzPX.js";import{eM as N,Mg as R,LY as b,x5 as w,w$ as F,x3 as I,wU as M,L_ as W,wX as q,x7 as z,x6 as C}from"./zeni-epic-state-1oMHKKZA.js";import{h as P,z as k,B as V,a1 as X,bu as Y,aa as _,bv as G}from"./index-BxZQbqZa.js";import"./mui-Dh_OiBGq.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-ZZIaexmv.js";import J from"./NotFoundScreen-DNbVpibd.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]="cee623a8-b41d-40b8-aae7-939f5ada85dd",e._sentryDebugIdIdentifier="sentry-dbid-cee623a8-b41d-40b8-aae7-939f5ada85dd")}catch{}})();const x="bill-approval-rule-update",K=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(x)&&e(W(!1))},onBackClick:()=>{_(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(M(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(X(Y)),Q=()=>{const e=U(),o=B(),a=j(),[p,t]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(F(!0)))},[p,n,a]),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),a(I())),e("./new"))},[u,r,a]);const f={events:c.companyId!=null?[`private-${c.companyId}.${x}`]:[],eventCallback:(i,A,m)=>{i.endsWith(x)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const a=b(e),p=a.billPaySetupApproverViewUpdateData?.type??"approval_create",t=p==="approval_create"&&a.allApprovalRules.length!==0;let u=a.allApprovalRules.length===0;return o.approvalRuleId&&(u=a.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:a,hideUpperBoundField:t,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:a,approvalUpdateDataView:p,approverViewData:t,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(S=>{const E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{a("../")}}})(G);function D(){const e=U(),o=j(),a=B(),{approvalRuleId:p}=L(),t=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(q(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),t==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:a})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Q,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-585gCzRC.js";import{a as y}from"./sentry-CznkHhej.js";import{j as U,u as B,h as j,g as v,N as $,k as T,l as L,n as O,o as h}from"./core-BM9YDzPX.js";import{eM as N,Mg as R,LY as b,x5 as w,w$ as F,x3 as I,wU as M,L_ as W,wX as q,x7 as z,x6 as C}from"./zeni-epic-state-1oMHKKZA.js";import{h as P,z as k,B as V,a1 as X,bu as Y,aa as _,bv as G}from"./index-B30ioXEx.js";import"./mui-Dh_OiBGq.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-BUgMzKjx.js";import J from"./NotFoundScreen-Cucx3MKM.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]="cee623a8-b41d-40b8-aae7-939f5ada85dd",e._sentryDebugIdIdentifier="sentry-dbid-cee623a8-b41d-40b8-aae7-939f5ada85dd")}catch{}})();const x="bill-approval-rule-update",K=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(x)&&e(W(!1))},onBackClick:()=>{_(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(M(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(X(Y)),Q=()=>{const e=U(),o=B(),a=j(),[p,t]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(F(!0)))},[p,n,a]),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),a(I())),e("./new"))},[u,r,a]);const f={events:c.companyId!=null?[`private-${c.companyId}.${x}`]:[],eventCallback:(i,A,m)=>{i.endsWith(x)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const a=b(e),p=a.billPaySetupApproverViewUpdateData?.type??"approval_create",t=p==="approval_create"&&a.allApprovalRules.length!==0;let u=a.allApprovalRules.length===0;return o.approvalRuleId&&(u=a.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:a,hideUpperBoundField:t,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:a,approvalUpdateDataView:p,approverViewData:t,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(S=>{const E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{a("../")}}})(G);function D(){const e=U(),o=j(),a=B(),{approvalRuleId:p}=L(),t=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(q(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),t==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:a})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Q,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-585gCzRC.js";import{j as K,h as re,u as Q,l as te,g as k,N as ee,k as Y,i as la,n as sa,o as S}from"./core-BM9YDzPX.js";import{eM as Z,Ly as Ge,bu as At,GA as ra,bn as xt,bC as ue,Lz as Bt,wp as Et,xz as Ue,wY as ca,bm as je,LA as da,LB as pa,b$ as ua,LC as ma,jm as Dt,LD as jt,LE as Tt,y8 as Oe,wE as Be,LF as ba,wd as it,LG as ha,Bk as ga,wh as ya,wn as Pt,LH as Ie,LI as Ne,xA as ze,LJ as Sa,LK as fa,xD as Ze,LL as Ia,xQ as ka,LM as Ft,xk as ot,xp as va,LN as wa,LO as pe,LP as Rt,LQ as Lt,LR as Vt,fG as Ca,wJ as Me,ct as $t,LS as Aa,gy as xa,LT as Ba,LU as Ea,eT as Ut,eR as Mt,LV as He,LW as Da,LX as ja,Jh as We,LY as Ta,Ji as ie,Jj as qe,LZ as Pa,L_ as Fa,L$ as Ra,xr as lt,xo as La,M0 as Va,M1 as $a,M2 as Ua,xa as Ma,M3 as _a,M4 as Ga,M5 as Oa,cN as _t,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vv as Za,M6 as Ha,B7 as Wa,Bd as qa,s2 as Ja,xB as Ka,yf as Qa,jK as fe,M7 as Ya,M8 as zt,kc as Xa,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M9 as tn,Ma as ke,ig as an,Mb as rt,Mc as nn,ik as on,iG as ln,yt as sn,Md as rn,k5 as cn,yj as dn,Me as ct,yn as pn,ys as un,yp as mn,yh as bn,Mf as Wt,wy as hn,Mg as gn,Mh as yn,fA as Sn,fz as fn,fy as In,jN as kn,k3 as dt,ke as vn,pB as wn,jW as Cn,yl as An,ir as xn,kj as Bn,Mi as En,ii as Dn,ps as jn,Mj as Tn,xg as Pn,bD as Fn,br as Rn,Ig as Ln,cL as Vn,cK as $n,cs as Un,cy as Mn}from"./zeni-epic-state-1oMHKKZA.js";import{h as me,z as L,S as ve,J as Je,i as oe,c as y,aI as Ee,B as ce,o as E,y as Te,e as j,b1 as _n,s as z,T as Ke,x as D,K as we,b2 as pt,b3 as ut,b4 as Gn,af as On,G as Nn,aC as zn,F as qt,D as Qe,H as Ye,b5 as Zn,ao as Jt,b6 as Hn,N as Wn,g as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,Z as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-BxZQbqZa.js";import{n as V,S as di}from"./mui-Dh_OiBGq.js";import{A as mt}from"./AddressScreen-BIexwSUC.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-BsWJ2Su_.js";import{a as f}from"./sentry-CznkHhej.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-DxvBbMZO.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js";import{u as Yt}from"./useInitialThreadRequest-F8zTMPR1.js";import De from"./NotFoundScreen-DNbVpibd.js";import{D as bi}from"./DrawerScreen-Bw1QfkLT.js";import{M as Xt}from"./MobileAppDrawer-NY5CZpkD.js";import{F as ea}from"./FeaturePreviewScreen-Bnq4uovL.js";import{S as Re}from"./SetupPagesScreen-BlvsgM9d.js";import{B as hi}from"./BillPayApprovalRoutes-D6a6fZAk.js";import{FallBackRoute as gi}from"./ScreenRoutes-B_PRMI91.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./analyticsHelper-1lOvj-za.js";import"./routePaths-DKtGe48K.js";import"./BusinessVerificationPageScreen-CavwhxgK.js";import"./ReimbursementApprovalRuleDetailScreen-ZZIaexmv.js";import"./getLocaleForTenant-Czitv1AW.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]="6f86fe54-cd92-43e1-a725-3cd81cf65ec3",e._sentryDebugIdIdentifier="sentry-dbid-6f86fe54-cd92-43e1-a725-3cd81cf65ec3")}catch{}})();const yi=Y(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),p=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&M?_(!1):!p&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||p||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),p&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(p,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-585gCzRC.js";import{j as K,h as re,u as Q,l as te,g as k,N as ee,k as Y,i as la,n as sa,o as S}from"./core-BM9YDzPX.js";import{eM as Z,Ly as Ge,bu as At,GA as ra,bn as xt,bC as ue,Lz as Bt,wp as Et,xz as Ue,wY as ca,bm as je,LA as da,LB as pa,b$ as ua,LC as ma,jm as Dt,LD as jt,LE as Tt,y8 as Oe,wE as Be,LF as ba,wd as it,LG as ha,Bk as ga,wh as ya,wn as Pt,LH as Ie,LI as Ne,xA as ze,LJ as Sa,LK as fa,xD as Ze,LL as Ia,xQ as ka,LM as Ft,xk as ot,xp as va,LN as wa,LO as pe,LP as Rt,LQ as Lt,LR as Vt,fG as Ca,wJ as Me,ct as $t,LS as Aa,gy as xa,LT as Ba,LU as Ea,eT as Ut,eR as Mt,LV as He,LW as Da,LX as ja,Jh as We,LY as Ta,Ji as ie,Jj as qe,LZ as Pa,L_ as Fa,L$ as Ra,xr as lt,xo as La,M0 as Va,M1 as $a,M2 as Ua,xa as Ma,M3 as _a,M4 as Ga,M5 as Oa,cN as _t,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vv as Za,M6 as Ha,B7 as Wa,Bd as qa,s2 as Ja,xB as Ka,yf as Qa,jK as fe,M7 as Ya,M8 as zt,kc as Xa,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M9 as tn,Ma as ke,ig as an,Mb as rt,Mc as nn,ik as on,iG as ln,yt as sn,Md as rn,k5 as cn,yj as dn,Me as ct,yn as pn,ys as un,yp as mn,yh as bn,Mf as Wt,wy as hn,Mg as gn,Mh as yn,fA as Sn,fz as fn,fy as In,jN as kn,k3 as dt,ke as vn,pB as wn,jW as Cn,yl as An,ir as xn,kj as Bn,Mi as En,ii as Dn,ps as jn,Mj as Tn,xg as Pn,bD as Fn,br as Rn,Ig as Ln,cL as Vn,cK as $n,cs as Un,cy as Mn}from"./zeni-epic-state-1oMHKKZA.js";import{h as me,z as L,S as ve,J as Je,i as oe,c as y,aI as Ee,B as ce,o as E,y as Te,e as j,b1 as _n,s as z,T as Ke,x as D,K as we,b2 as pt,b3 as ut,b4 as Gn,af as On,G as Nn,aC as zn,F as qt,D as Qe,H as Ye,b5 as Zn,ao as Jt,b6 as Hn,N as Wn,g as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,Z as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-B30ioXEx.js";import{n as V,S as di}from"./mui-Dh_OiBGq.js";import{A as mt}from"./AddressScreen-CPMiTr10.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-8rq_3RAs.js";import{a as f}from"./sentry-CznkHhej.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-DOA3k3qr.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-CThB0klC.js";import{u as Yt}from"./useInitialThreadRequest-jV5iOQ5Z.js";import De from"./NotFoundScreen-Cucx3MKM.js";import{D as bi}from"./DrawerScreen-BVjSAkhK.js";import{M as Xt}from"./MobileAppDrawer-BXRnd_IS.js";import{F as ea}from"./FeaturePreviewScreen-DIglws95.js";import{S as Re}from"./SetupPagesScreen-DmAnODHL.js";import{B as hi}from"./BillPayApprovalRoutes-ySvc-HDi.js";import{FallBackRoute as gi}from"./ScreenRoutes-CEap4F7c.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./analyticsHelper-DWU-XMyN.js";import"./routePaths-C_5Vo_Nm.js";import"./BusinessVerificationPageScreen-BGcxJWGX.js";import"./ReimbursementApprovalRuleDetailScreen-BUgMzKjx.js";import"./getLocaleForTenant-CjYI5PP8.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]="6f86fe54-cd92-43e1-a725-3cd81cf65ec3",e._sentryDebugIdIdentifier="sentry-dbid-6f86fe54-cd92-43e1-a725-3cd81cf65ec3")}catch{}})();const yi=Y(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),p=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&M?_(!1):!p&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||p||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),p&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(p,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function vi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-585gCzRC.js";import{a as V}from"./sentry-CznkHhej.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-BM9YDzPX.js";import{S as ce,i as ue,aI as de,z,y as pe,e as B,aa as x,g as M,bq as le,ao as me,x as E,ap as P}from"./index-BxZQbqZa.js";import{M4 as fe,eM as G,rt as ye,GE as Se,xa as ge,zT as Ie,Cq as he,D3 as be,DY as De,Mr as Oe,Ms as Te,Mt as ke,Mu as Ce,Mv as Ve,I_ as we,Lt as Ae,Ja as Ne,k2 as _e,fA as ve,fz as Fe,fy as xe,pB as Me,ps as ze,pp as Be,jW as Ee,rC as Pe,rA as R,bB as L,rO as U,cr as Re}from"./zeni-epic-state-1oMHKKZA.js";import{n as Le}from"./mui-Dh_OiBGq.js";import{c as j}from"./routePaths-DKtGe48K.js";import{M as Ue}from"./MobileAppDrawer-NY5CZpkD.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]="62c5ae8d-9606-404b-a91e-5caa8d85a21b",e._sentryDebugIdIdentifier="sentry-dbid-62c5ae8d-9606-404b-a91e-5caa8d85a21b")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-585gCzRC.js";import{a as V}from"./sentry-CznkHhej.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-BM9YDzPX.js";import{S as ce,i as ue,aI as de,z,y as pe,e as B,aa as x,g as M,bq as le,ao as me,x as E,ap as P}from"./index-B30ioXEx.js";import{M4 as fe,eM as G,rt as ye,GE as Se,xa as ge,zT as Ie,Cq as he,D3 as be,DY as De,Mr as Oe,Ms as Te,Mt as ke,Mu as Ce,Mv as Ve,I_ as we,Lt as Ae,Ja as Ne,k2 as _e,fA as ve,fz as Fe,fy as xe,pB as Me,ps as ze,pp as Be,jW as Ee,rC as Pe,rA as R,bB as L,rO as U,cr as Re}from"./zeni-epic-state-1oMHKKZA.js";import{n as Le}from"./mui-Dh_OiBGq.js";import{c as j}from"./routePaths-C_5Vo_Nm.js";import{M as Ue}from"./MobileAppDrawer-BXRnd_IS.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]="62c5ae8d-9606-404b-a91e-5caa8d85a21b",e._sentryDebugIdIdentifier="sentry-dbid-62c5ae8d-9606-404b-a91e-5caa8d85a21b")}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-585gCzRC.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Jt,o as te}from"./core-BM9YDzPX.js";import{eM as ie,br as Be,NX as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NY as $e,NZ as $a,sI as Sa,ju as Ia,N_ as Aa,gy as ca,za as aa,zc as Ga,zd as Za,jk as Ct,N$ as Ge,y_ as pt,O0 as Xt,O1 as Qt,z1 as wa,O2 as en,Mo as Pa,qU as ht,z7 as Ya,gJ as an,O3 as ft,O4 as Ze,bp as tn,O5 as nn,fA as Ta,fz as Fa,zH as rn,fy as va,M4 as sn,O6 as gt,cN as bt,cJ as on,Mn as ua,Ah as cn,O7 as rt,zT as Oa,O8 as yt,Ai as dn,MO as ln,Aj as un,Bd as mn,s2 as Cn,B7 as pn,zs as St,zl as hn,O9 as fn,fM as gn,zB as It,zF as At,fL as bn,Oa as yn,A3 as Et,Ob as Sn,Oc as In,Od as An,zD as kt,zo as Dt,z4 as _t,zx as wt,zv as Pt,zz as En,zb as st,Oe as Tt,Of as xa,zQ as Ea,J3 as Ft,cK as Ka,Og as kn,Oh as Dn,Oi as _n,Oj as wn,zN as Ha,Aa as Pn,A6 as Tn,zJ as Fn,A8 as vn,z_ as On,A0 as xn,Ok as vt,Ag as Ot,GA as Bn,Ol as Ln,Om as Un,On as Rn,Oo as xt,Op as jn,AD as Nn,zS as Bt,zM as da,zR as Vn,Oq as Hn,Or as Mn,yX as zn,Os as Lt,Ot as Ut,Ou as $n,yZ as Gn,yY as ot,Ov as Zn,Ow as Yn,Ox as Kn,I$ as Wn,Oy as Wa,Oz as qn,vy as Rt,k2 as Jn,gz as Xn,AI as Qn,OA as jt,OB as er,AJ as ar,OC as tr,db as nr,sC as rr,Ay as sr,As as xe,bu as or,bC as ir,ct as cr,bD as dr,Ig as lr}from"./zeni-epic-state-1oMHKKZA.js";import{z as Q,S as Ue,i as oe,c as Y,B as Ye,bU as Ba,c3 as ur,s as ve,c4 as mr,c5 as Cr,K as ma,aI as Fe,x as be,bb as qa,c6 as pr,F as Ca,m as La,h as Ja,e as J,D as Xa,c7 as hr,J as Nt,al as Qa,bn as Qe,c8 as Ma,c9 as fr,y as et,a1 as gr,ca as br,ao as Vt,T as za,N as Ht,g as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as ja,Z as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-BxZQbqZa.js";import{n as _e,D as zt,S as Or}from"./mui-Dh_OiBGq.js";import{a as c}from"./sentry-CznkHhej.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Re,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Zt,m as Lr,n as Yt,p as Ur,S as it}from"./SetupPagesScreen-BlvsgM9d.js";import Ua from"./NotFoundScreen-DNbVpibd.js";import{M as ha}from"./MobileAppDrawer-NY5CZpkD.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-DxvBbMZO.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js";import{v as ct}from"./utils-Boc0JP6O.js";import{t as Rr}from"./AddressScreen-BIexwSUC.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./analyticsHelper-1lOvj-za.js";import"./routePaths-DKtGe48K.js";import"./BusinessVerificationPageScreen-CavwhxgK.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]="44845644-da6a-4490-b5a9-fd187631804a",e._sentryDebugIdIdentifier="sentry-dbid-44845644-da6a-4490-b5a9-fd187631804a")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=Q.getSignedInUser(),n=S(G=>ie(G)),u=Ue(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Y.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),R=d.chargeCard,M=R?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=R?.cardHolderUser?.userId,U=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Z=U?.accountingClassIDs[0],E=S(G=>Z!=null?Ia(G.classState,{classId:Z,reportId:"class_list"}):void 0),q=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",K=R?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||i===!1&&I===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,R,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Za()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ye,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:U?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=Q.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ua,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=Q.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Qt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Y.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),R=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:R}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=Q.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),U=()=>{l?.status?.code!=="active"&&a(Ya(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(U,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Z=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ye,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Z}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Z(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ze(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Re(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
1
+ import{j as s}from"./liveblocks-585gCzRC.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Jt,o as te}from"./core-BM9YDzPX.js";import{eM as ie,br as Be,NX as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NY as $e,NZ as $a,sI as Sa,ju as Ia,N_ as Aa,gy as ca,za as aa,zc as Ga,zd as Za,jk as Ct,N$ as Ge,y_ as pt,O0 as Xt,O1 as Qt,z1 as wa,O2 as en,Mo as Pa,qU as ht,z7 as Ya,gJ as an,O3 as ft,O4 as Ze,bp as tn,O5 as nn,fA as Ta,fz as Fa,zH as rn,fy as va,M4 as sn,O6 as gt,cN as bt,cJ as on,Mn as ua,Ah as cn,O7 as rt,zT as Oa,O8 as yt,Ai as dn,MO as ln,Aj as un,Bd as mn,s2 as Cn,B7 as pn,zs as St,zl as hn,O9 as fn,fM as gn,zB as It,zF as At,fL as bn,Oa as yn,A3 as Et,Ob as Sn,Oc as In,Od as An,zD as kt,zo as Dt,z4 as _t,zx as wt,zv as Pt,zz as En,zb as st,Oe as Tt,Of as xa,zQ as Ea,J3 as Ft,cK as Ka,Og as kn,Oh as Dn,Oi as _n,Oj as wn,zN as Ha,Aa as Pn,A6 as Tn,zJ as Fn,A8 as vn,z_ as On,A0 as xn,Ok as vt,Ag as Ot,GA as Bn,Ol as Ln,Om as Un,On as Rn,Oo as xt,Op as jn,AD as Nn,zS as Bt,zM as da,zR as Vn,Oq as Hn,Or as Mn,yX as zn,Os as Lt,Ot as Ut,Ou as $n,yZ as Gn,yY as ot,Ov as Zn,Ow as Yn,Ox as Kn,I$ as Wn,Oy as Wa,Oz as qn,vy as Rt,k2 as Jn,gz as Xn,AI as Qn,OA as jt,OB as er,AJ as ar,OC as tr,db as nr,sC as rr,Ay as sr,As as xe,bu as or,bC as ir,ct as cr,bD as dr,Ig as lr}from"./zeni-epic-state-1oMHKKZA.js";import{z as Q,S as Ue,i as oe,c as Y,B as Ye,bU as Ba,c3 as ur,s as ve,c4 as mr,c5 as Cr,K as ma,aI as Fe,x as be,bb as qa,c6 as pr,F as Ca,m as La,h as Ja,e as J,D as Xa,c7 as hr,J as Nt,al as Qa,bn as Qe,c8 as Ma,c9 as fr,y as et,a1 as gr,ca as br,ao as Vt,T as za,N as Ht,g as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as ja,Z as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-B30ioXEx.js";import{n as _e,D as zt,S as Or}from"./mui-Dh_OiBGq.js";import{a as c}from"./sentry-CznkHhej.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Re,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Zt,m as Lr,n as Yt,p as Ur,S as it}from"./SetupPagesScreen-DmAnODHL.js";import Ua from"./NotFoundScreen-Cucx3MKM.js";import{M as ha}from"./MobileAppDrawer-BXRnd_IS.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-DOA3k3qr.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-CThB0klC.js";import{v as ct}from"./utils-Boc0JP6O.js";import{t as Rr}from"./AddressScreen-CPMiTr10.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./analyticsHelper-DWU-XMyN.js";import"./routePaths-C_5Vo_Nm.js";import"./BusinessVerificationPageScreen-BGcxJWGX.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]="44845644-da6a-4490-b5a9-fd187631804a",e._sentryDebugIdIdentifier="sentry-dbid-44845644-da6a-4490-b5a9-fd187631804a")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=Q.getSignedInUser(),n=S(G=>ie(G)),u=Ue(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Y.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),R=d.chargeCard,M=R?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=R?.cardHolderUser?.userId,U=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Z=U?.accountingClassIDs[0],E=S(G=>Z!=null?Ia(G.classState,{classId:Z,reportId:"class_list"}):void 0),q=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",K=R?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||i===!1&&I===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,R,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Za()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ye,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:U?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=Q.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ua,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=Q.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Qt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Y.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),R=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:R}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=Q.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),U=()=>{l?.status?.code!=="active"&&a(Ya(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(U,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Z=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ye,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Z}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Z(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ze(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Re(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-585gCzRC.js";import{a as g}from"./sentry-CznkHhej.js";import{j as w,h as x,u as k,l as T,g as O,k as E}from"./core-BM9YDzPX.js";import{z as b,aZ as F,y as P,e as L,g as V,aa as N,a_ as j,ao as A,ap as B,x as U}from"./index-BxZQbqZa.js";import{eM as D,fC as M,rt as _,fx as R,b$ as z,Lt as G,bm as Y,pB as Z,pp as $,jW as q,lq as S,Lu as H,bB as W,cr as C,ly as J,lB as K}from"./zeni-epic-state-1oMHKKZA.js";import"./mui-Dh_OiBGq.js";import{c as Q}from"./routePaths-DKtGe48K.js";import{M as X}from"./MobileAppDrawer-NY5CZpkD.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="84b56ffc-8226-43fe-a8ba-fd9fad533ef5",t._sentryDebugIdIdentifier="sentry-dbid-84b56ffc-8226-43fe-a8ba-fd9fad533ef5")}catch{}})();const ee=E(function(t){const n=R(t),i=b.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},m=z(l?.userRole??[])&&n.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),a=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:n.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:n,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:m,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,n){const{companyId:i,currentTenant:l,navigate:c,location:p}=n,{tenantEmailDomain:m}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{t(K())},onAddressClick:e=>{const a=Q(m,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.subIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:B(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?W(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};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(H(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(q({files:e}))},onDeleteFile:e=>{t($(e))},onEditFileName:(e,a)=>{t(Z(e,a.split(".")[0]))}}})(j);function de(){const t=w(),n=x(),i=k(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[m,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??b.getSignedInUserTenant(l)?.companyId;if(b.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),n(M(d)))},[c,a,d,n]),g.useEffect(()=>{o==="Not-Started"&&n(_())},[o,n]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?f.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):f.jsxs(f.Fragment,{children:[f.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,N(i)?"Settings":"Company Passport")}),N(i)?f.jsx(X,{isAppContentDrawerOpen:m,handleDrawerToggle:u}):null,f.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:N(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as f}from"./liveblocks-585gCzRC.js";import{a as g}from"./sentry-CznkHhej.js";import{j as w,h as x,u as k,l as T,g as O,k as E}from"./core-BM9YDzPX.js";import{z as b,aZ as F,y as P,e as L,g as V,aa as N,a_ as j,ao as A,ap as B,x as U}from"./index-B30ioXEx.js";import{eM as D,fC as M,rt as _,fx as R,b$ as z,Lt as G,bm as Y,pB as Z,pp as $,jW as q,lq as S,Lu as H,bB as W,cr as C,ly as J,lB as K}from"./zeni-epic-state-1oMHKKZA.js";import"./mui-Dh_OiBGq.js";import{c as Q}from"./routePaths-C_5Vo_Nm.js";import{M as X}from"./MobileAppDrawer-BXRnd_IS.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="84b56ffc-8226-43fe-a8ba-fd9fad533ef5",t._sentryDebugIdIdentifier="sentry-dbid-84b56ffc-8226-43fe-a8ba-fd9fad533ef5")}catch{}})();const ee=E(function(t){const n=R(t),i=b.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},m=z(l?.userRole??[])&&n.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),a=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:n.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:n,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:m,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,n){const{companyId:i,currentTenant:l,navigate:c,location:p}=n,{tenantEmailDomain:m}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{t(K())},onAddressClick:e=>{const a=Q(m,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.subIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:B(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?W(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};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(H(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(q({files:e}))},onDeleteFile:e=>{t($(e))},onEditFileName:(e,a)=>{t(Z(e,a.split(".")[0]))}}})(j);function de(){const t=w(),n=x(),i=k(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[m,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??b.getSignedInUserTenant(l)?.companyId;if(b.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),n(M(d)))},[c,a,d,n]),g.useEffect(()=>{o==="Not-Started"&&n(_())},[o,n]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?f.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):f.jsxs(f.Fragment,{children:[f.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,N(i)?"Settings":"Company Passport")}),N(i)?f.jsx(X,{isAppContentDrawerOpen:m,handleDrawerToggle:u}):null,f.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:N(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-585gCzRC.js";import{a}from"./sentry-CznkHhej.js";import{h as D,u as v,g as m,N as w}from"./core-BM9YDzPX.js";import{Ic as A,eM as O,fj as _,mh as j,fJ as h,fi as U,eN as L,Ik as k}from"./zeni-epic-state-1oMHKKZA.js";import{u as F,z as u,L as b,D as $,o as H}from"./index-BxZQbqZa.js";import{n as z}from"./mui-Dh_OiBGq.js";import{t as R}from"./getLocaleForTenant-Czitv1AW.js";import{g as P,Q as G}from"./QBOConnectionScreen-WktucsBE.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./empty-CNAYaS5M.js";import"./pdf-lib-mwEs-5am.js";import"./index-DpQl7e8K.js";import"./url-Bqap2__X.js";import"./index-DvjNZZRv.js";import"./decodeURIComponentSafe-a784xZQy.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]="36d396b0-c6aa-48c6-bcba-a1bc747bebe9",t._sentryDebugIdIdentifier="sentry-dbid-36d396b0-c6aa-48c6-bcba-a1bc747bebe9")}catch{}})();const J=z.div`
1
+ import{j as C}from"./liveblocks-585gCzRC.js";import{a}from"./sentry-CznkHhej.js";import{h as D,u as v,g as m,N as w}from"./core-BM9YDzPX.js";import{Ic as A,eM as O,fj as _,mh as j,fJ as h,fi as U,eN as L,Ik as k}from"./zeni-epic-state-1oMHKKZA.js";import{u as F,z as u,L as b,D as $,o as H}from"./index-B30ioXEx.js";import{n as z}from"./mui-Dh_OiBGq.js";import{t as R}from"./getLocaleForTenant-CjYI5PP8.js";import{g as P,Q as G}from"./QBOConnectionScreen-DKcB3eb7.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./empty-CNAYaS5M.js";import"./pdf-lib-mwEs-5am.js";import"./index-DpQl7e8K.js";import"./url-Bqap2__X.js";import"./index-DvjNZZRv.js";import"./decodeURIComponentSafe-a784xZQy.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]="36d396b0-c6aa-48c6-bcba-a1bc747bebe9",t._sentryDebugIdIdentifier="sentry-dbid-36d396b0-c6aa-48c6-bcba-a1bc747bebe9")}catch{}})();const J=z.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -1 +1 @@
1
- import{j as d}from"./liveblocks-585gCzRC.js";import{z as n}from"./index-BxZQbqZa.js";import{g as p}from"./QBOConnectionScreen-WktucsBE.js";import"./sentry-CznkHhej.js";import{u as a,N as i}from"./core-BM9YDzPX.js";import"./zeni-epic-state-1oMHKKZA.js";import"./recharts-Bk8sahKA.js";import"./mui-Dh_OiBGq.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./empty-CNAYaS5M.js";import"./pdf-lib-mwEs-5am.js";import"./index-DpQl7e8K.js";import"./url-Bqap2__X.js";import"./index-DvjNZZRv.js";import"./decodeURIComponentSafe-a784xZQy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
1
+ import{j as d}from"./liveblocks-585gCzRC.js";import{z as n}from"./index-B30ioXEx.js";import{g as p}from"./QBOConnectionScreen-DKcB3eb7.js";import"./sentry-CznkHhej.js";import{u as a,N as i}from"./core-BM9YDzPX.js";import"./zeni-epic-state-1oMHKKZA.js";import"./recharts-Bk8sahKA.js";import"./mui-Dh_OiBGq.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./empty-CNAYaS5M.js";import"./pdf-lib-mwEs-5am.js";import"./index-DpQl7e8K.js";import"./url-Bqap2__X.js";import"./index-DvjNZZRv.js";import"./decodeURIComponentSafe-a784xZQy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-585gCzRC.js";import{t as $e,A as Ce}from"./AddressScreen-BIexwSUC.js";import ze from"./NotFoundScreen-DNbVpibd.js";import{a as g}from"./sentry-CznkHhej.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Me,n as Qe,o as M}from"./core-BM9YDzPX.js";import{Z as de,S as le,z as B,i as ue,h as qe,c as _,x as V,y as Y,e as N,B as je,g as W,ak as Ke,K as Je,al as Ie,m as te,am as Ze,an as ke,o as Ye,ao as He,ap as Ee,aq as We}from"./index-BxZQbqZa.js";import{bm as Xe,eM as ee,fb as et,eT as pe,eR as me,bu as tt,mf as at,f7 as nt,bL as ot,i_ as ae,j1 as ve,IY as st,bQ as it,b$ as ge,rH as he,rs as rt,J8 as X,rI as _e,GE as ct,k2 as Ue,J9 as Ve,Ja as dt,Jb as lt,Jc as ut,iY as pt,i$ as mt,ru as Be,rG as gt,bB as xe,cr as ht,rU as Te,pB as ft,pp as yt,jW as St,fA as bt,fz as Ct,fy as It,Jd as kt,rm as Et,rV as xt,rY as Tt,r$ as Ot,s5 as Pt,cR as At}from"./zeni-epic-state-1oMHKKZA.js";import{n as fe}from"./mui-Dh_OiBGq.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-WktucsBE.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./empty-CNAYaS5M.js";import"./pdf-lib-mwEs-5am.js";import"./index-DpQl7e8K.js";import"./url-Bqap2__X.js";import"./index-DvjNZZRv.js";import"./decodeURIComponentSafe-a784xZQy.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]="aad8c591-7200-4a5a-9f7c-7341df3be737",t._sentryDebugIdIdentifier="sentry-dbid-aad8c591-7200-4a5a-9f7c-7341df3be737")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),P=me(c),A=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{S(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(Y,{analytics:N,onLoad:l=>(J=>J.trackPageLoaded(W.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-585gCzRC.js";import{t as $e,A as Ce}from"./AddressScreen-CPMiTr10.js";import ze from"./NotFoundScreen-Cucx3MKM.js";import{a as g}from"./sentry-CznkHhej.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Me,n as Qe,o as M}from"./core-BM9YDzPX.js";import{Z as de,S as le,z as B,i as ue,h as qe,c as _,x as V,y as Y,e as N,B as je,g as W,ak as Ke,K as Je,al as Ie,m as te,am as Ze,an as ke,o as Ye,ao as He,ap as Ee,aq as We}from"./index-B30ioXEx.js";import{bm as Xe,eM as ee,fb as et,eT as pe,eR as me,bu as tt,mf as at,f7 as nt,bL as ot,i_ as ae,j1 as ve,IY as st,bQ as it,b$ as ge,rH as he,rs as rt,J8 as X,rI as _e,GE as ct,k2 as Ue,J9 as Ve,Ja as dt,Jb as lt,Jc as ut,iY as pt,i$ as mt,ru as Be,rG as gt,bB as xe,cr as ht,rU as Te,pB as ft,pp as yt,jW as St,fA as bt,fz as Ct,fy as It,Jd as kt,rm as Et,rV as xt,rY as Tt,r$ as Ot,s5 as Pt,cR as At}from"./zeni-epic-state-1oMHKKZA.js";import{n as fe}from"./mui-Dh_OiBGq.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-DKcB3eb7.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./empty-CNAYaS5M.js";import"./pdf-lib-mwEs-5am.js";import"./index-DpQl7e8K.js";import"./url-Bqap2__X.js";import"./index-DvjNZZRv.js";import"./decodeURIComponentSafe-a784xZQy.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]="aad8c591-7200-4a5a-9f7c-7341df3be737",t._sentryDebugIdIdentifier="sentry-dbid-aad8c591-7200-4a5a-9f7c-7341df3be737")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),P=me(c),A=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{S(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(Y,{analytics:N,onLoad:l=>(J=>J.trackPageLoaded(W.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as i}from"./liveblocks-585gCzRC.js";import{l as G,g as k,u as $,h as K,j as q,k as Z,n as We,o as D}from"./core-BM9YDzPX.js";import{eM as j,Jt as Fe,bB as Ut,bp as de,KG as Ka,hO as Na,KH as Tt,KI as Ga,hR as Qe,KJ as we,KK as za,hW as $a,KL as wt,KM as qa,h_ as et,KN as xe,KO as Za,cN as at,KP as Ha,KQ as Ja,JN as Xa,iU as Wa,KR as Qa,bm as _e,KS as Yt,Jh as Q,bc as Vt,j6 as Kt,mp as Nt,iR as Gt,Jj as ee,Ji as z,KT as en,KU as tn,KV as zt,KW as pe,tx as ke,ty as ye,tV as ue,tP as te,tC as Se,KX as an,KY as nn,KZ as on,K_ as $t,K$ as he,L0 as sn,dF as Oe,q9 as qt,L1 as rn,L2 as cn,L3 as ln,L4 as nt,IE as ot,jm as st,u1 as rt,qh as dn,L5 as un,tz as xt,qc as ie,q8 as Zt,L6 as oe,L7 as mn,L8 as ct,ID as it,s9 as Ht,L9 as pn,La as hn,Lb as fn,Lc as lt,sm as gn,Ld as bn,tB as Dt,s8 as Jt,Le as se,Lf as Cn,bu as Xt,u5 as Wt,Lg as _n,Lh as kn,Li as yn,Lj as dt,u0 as Sn,Lk as vn,tA as Ft,u4 as Qt,Ll as re,Lm as In,Ln as An,Lo as ea,jb as ta,mm as aa,jg as na,mk as oa,mj as sa,mi as ra,rx as En,fb as Tn,cK as wn,cL as xn,mf as Dn,f7 as Fn,mv as On,Lp as Pn,D9 as Bn,Lq as Rn,Lr as jn,Ls as Ln,b5 as ut,eZ as Mn,gw as Un,fC as Yn,mq as Vn,iK as Kn,mn as Nn,ml as Gn,eT as zn,eR as $n}from"./zeni-epic-state-1oMHKKZA.js";import{z as B,T as H,x as F,e as S,D as N,aP as qn,J as Pe,y as ve,aQ as ca,g as Y,aR as Zn,S as Ie,aS as ia,i as mt,c as L,h as Hn,aT as Jn,aU as Xn,aV as Ae,aW as Wn,a as Qn,al as eo,aI as to,s as ao,N as no,aX as oo,aY as ge}from"./index-BxZQbqZa.js";import{n as pt}from"./mui-Dh_OiBGq.js";import{a as _}from"./sentry-CznkHhej.js";import{w as la}from"./withTransactionSidePanel-DJ3JMAJu.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-DKtGe48K.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-DxvBbMZO.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js";import Ce from"./NotFoundScreen-DNbVpibd.js";import{t as ua}from"./analyticsHelper-1lOvj-za.js";import{C as ro}from"./CompanyPassportScreen-BFYWdwCR.js";import{F as co}from"./FeaturePreviewScreen-Bnq4uovL.js";import{R as io}from"./ReferralListScreen-CAsh5C9i.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./TransactionDetailScreen-BRy8OBJd.js";import"./decodeURIComponentSafe-a784xZQy.js";import"./MobileAppDrawer-NY5CZpkD.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]="3fcc6552-f879-4983-a49d-31b00cadd612",e._sentryDebugIdIdentifier="sentry-dbid-3fcc6552-f879-4983-a49d-31b00cadd612")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(T=>T.tenantState.currentTenantId),u=k(T=>j(T)),{tenantEmailDomain:m}=G(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=K(),g=q(),f=k(T=>Ka(T,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Na(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((T,J)=>{p(Tt({sortKey:T,sortOrder:J}))},[]),A=_.useCallback(T=>{p(Tt({downloadState:T}))},[]),I=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(m!=null){const J=da({id:T.transactionId,type:T.transactionType},m);g(J);const Le=F(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Le}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(qn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(I=>Ga(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(we({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(we({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(we({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(we({selectedDate:I,agingDateSelectionType:x})),t(Qe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:E,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=G(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=K(),p=q(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),E=_.useCallback((x,T)=>{d(wt({sortKey:x,sortOrder:T}))},[]),R=_.useCallback(x=>{d(wt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const T=da({id:x.transactionId,type:x.transactionType},u);p(T);const J=F(m.state?.pathnameStackToGoBack,m.pathname);p(T,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(Zn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:E,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(A=>qa(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),E=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(Za({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:E,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Xa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Wa(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=Z(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:N.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=Z(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:N.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
1
+ import{j as i}from"./liveblocks-585gCzRC.js";import{l as G,g as k,u as $,h as K,j as q,k as Z,n as We,o as D}from"./core-BM9YDzPX.js";import{eM as j,Jt as Fe,bB as Ut,bp as de,KG as Ka,hO as Na,KH as Tt,KI as Ga,hR as Qe,KJ as we,KK as za,hW as $a,KL as wt,KM as qa,h_ as et,KN as xe,KO as Za,cN as at,KP as Ha,KQ as Ja,JN as Xa,iU as Wa,KR as Qa,bm as _e,KS as Yt,Jh as Q,bc as Vt,j6 as Kt,mp as Nt,iR as Gt,Jj as ee,Ji as z,KT as en,KU as tn,KV as zt,KW as pe,tx as ke,ty as ye,tV as ue,tP as te,tC as Se,KX as an,KY as nn,KZ as on,K_ as $t,K$ as he,L0 as sn,dF as Oe,q9 as qt,L1 as rn,L2 as cn,L3 as ln,L4 as nt,IE as ot,jm as st,u1 as rt,qh as dn,L5 as un,tz as xt,qc as ie,q8 as Zt,L6 as oe,L7 as mn,L8 as ct,ID as it,s9 as Ht,L9 as pn,La as hn,Lb as fn,Lc as lt,sm as gn,Ld as bn,tB as Dt,s8 as Jt,Le as se,Lf as Cn,bu as Xt,u5 as Wt,Lg as _n,Lh as kn,Li as yn,Lj as dt,u0 as Sn,Lk as vn,tA as Ft,u4 as Qt,Ll as re,Lm as In,Ln as An,Lo as ea,jb as ta,mm as aa,jg as na,mk as oa,mj as sa,mi as ra,rx as En,fb as Tn,cK as wn,cL as xn,mf as Dn,f7 as Fn,mv as On,Lp as Pn,D9 as Bn,Lq as Rn,Lr as jn,Ls as Ln,b5 as ut,eZ as Mn,gw as Un,fC as Yn,mq as Vn,iK as Kn,mn as Nn,ml as Gn,eT as zn,eR as $n}from"./zeni-epic-state-1oMHKKZA.js";import{z as B,T as H,x as F,e as S,D as N,aP as qn,J as Pe,y as ve,aQ as ca,g as Y,aR as Zn,S as Ie,aS as ia,i as mt,c as L,h as Hn,aT as Jn,aU as Xn,aV as Ae,aW as Wn,a as Qn,al as eo,aI as to,s as ao,N as no,aX as oo,aY as ge}from"./index-B30ioXEx.js";import{n as pt}from"./mui-Dh_OiBGq.js";import{a as _}from"./sentry-CznkHhej.js";import{w as la}from"./withTransactionSidePanel-C4Otz1Im.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-C_5Vo_Nm.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-DOA3k3qr.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-CThB0klC.js";import Ce from"./NotFoundScreen-Cucx3MKM.js";import{t as ua}from"./analyticsHelper-DWU-XMyN.js";import{C as ro}from"./CompanyPassportScreen-CqQQjG13.js";import{F as co}from"./FeaturePreviewScreen-DIglws95.js";import{R as io}from"./ReferralListScreen-DQ3JeDsI.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./TransactionDetailScreen-D1icJoqW.js";import"./decodeURIComponentSafe-a784xZQy.js";import"./MobileAppDrawer-BXRnd_IS.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]="3fcc6552-f879-4983-a49d-31b00cadd612",e._sentryDebugIdIdentifier="sentry-dbid-3fcc6552-f879-4983-a49d-31b00cadd612")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(T=>T.tenantState.currentTenantId),u=k(T=>j(T)),{tenantEmailDomain:m}=G(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=K(),g=q(),f=k(T=>Ka(T,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Na(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((T,J)=>{p(Tt({sortKey:T,sortOrder:J}))},[]),A=_.useCallback(T=>{p(Tt({downloadState:T}))},[]),I=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(m!=null){const J=da({id:T.transactionId,type:T.transactionType},m);g(J);const Le=F(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Le}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(qn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(I=>Ga(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(we({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(we({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(we({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(we({selectedDate:I,agingDateSelectionType:x})),t(Qe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:E,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=G(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=K(),p=q(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),E=_.useCallback((x,T)=>{d(wt({sortKey:x,sortOrder:T}))},[]),R=_.useCallback(x=>{d(wt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const T=da({id:x.transactionId,type:x.transactionType},u);p(T);const J=F(m.state?.pathnameStackToGoBack,m.pathname);p(T,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(Zn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:E,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=K(),n=q(),o=k(A=>qa(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),E=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(Za({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:E,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Xa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Wa(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=Z(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:N.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=Z(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:N.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-585gCzRC.js";import{a as u}from"./sentry-CznkHhej.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-BM9YDzPX.js";import{Ic as N,eM as _,fj as U,Id as L,mh as R,Ie as z}from"./zeni-epic-state-1oMHKKZA.js";import{u as j,z as f,L as T,t as S,D as O,b as $}from"./index-BxZQbqZa.js";import"./mui-Dh_OiBGq.js";import{t as P}from"./getLocaleForTenant-Czitv1AW.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.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]="6edb8790-83dc-44ea-9d73-f957931ec959",t._sentryDebugIdIdentifier="sentry-dbid-6edb8790-83dc-44ea-9d73-f957931ec959")}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,I=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),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&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-585gCzRC.js";import{a as u}from"./sentry-CznkHhej.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-BM9YDzPX.js";import{Ic as N,eM as _,fj as U,Id as L,mh as R,Ie as z}from"./zeni-epic-state-1oMHKKZA.js";import{u as j,z as f,L as T,t as S,D as O,b as $}from"./index-B30ioXEx.js";import"./mui-Dh_OiBGq.js";import{t as P}from"./getLocaleForTenant-CjYI5PP8.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.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]="6edb8790-83dc-44ea-9d73-f957931ec959",t._sentryDebugIdIdentifier="sentry-dbid-6edb8790-83dc-44ea-9d73-f957931ec959")}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,I=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),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&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-585gCzRC.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-BM9YDzPX.js";import{Ma as k,Mh as _,fA as J,fz as K,fy as L,ii as W,Ji as q,ps as Q,eM as V,LI as D,ig as T,Mb as S,Mk as F,id as G,iC as j}from"./zeni-epic-state-1oMHKKZA.js";import{bj as X,K as R,i as N,z as U,h as M,s as p,c as v,B as z,bk as Y,o as O,bl as ee,x as te}from"./index-BxZQbqZa.js";import{n as Z}from"./mui-Dh_OiBGq.js";import"./sentry-CznkHhej.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]="67d9da56-c69e-43b3-977b-524aedb8b939",e._sentryDebugIdIdentifier="sentry-dbid-67d9da56-c69e-43b3-977b-524aedb8b939")}catch{}})();const ae=A(null,function(e,t){return{onSaveVendor:a=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),a!=null&&e(Q(a))},onGetOtp:a=>{e(L(a,"BillPayVendor"))},onResendOtp:a=>{e(K(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(J(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(_(a,n,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=Z.div`
1
+ import{j as l}from"./liveblocks-585gCzRC.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-BM9YDzPX.js";import{Ma as k,Mh as _,fA as J,fz as K,fy as L,ii as W,Ji as q,ps as Q,eM as V,LI as D,ig as T,Mb as S,Mk as F,id as G,iC as j}from"./zeni-epic-state-1oMHKKZA.js";import{bj as X,K as R,i as N,z as U,h as M,s as p,c as v,B as z,bk as Y,o as O,bl as ee,x as te}from"./index-B30ioXEx.js";import{n as Z}from"./mui-Dh_OiBGq.js";import"./sentry-CznkHhej.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]="67d9da56-c69e-43b3-977b-524aedb8b939",e._sentryDebugIdIdentifier="sentry-dbid-67d9da56-c69e-43b3-977b-524aedb8b939")}catch{}})();const ae=A(null,function(e,t){return{onSaveVendor:a=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),a!=null&&e(Q(a))},onGetOtp:a=>{e(L(a,"BillPayVendor"))},onResendOtp:a=>{e(K(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(J(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(_(a,n,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=Z.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as d}from"./liveblocks-585gCzRC.js";import{K as l,F as c,h as f}from"./index-BxZQbqZa.js";import{D as p}from"./mui-Dh_OiBGq.js";import"./sentry-CznkHhej.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]="63e12542-e79f-4200-b974-34ccb9515454",e._sentryDebugIdIdentifier="sentry-dbid-63e12542-e79f-4200-b974-34ccb9515454")}catch{}})();const b={drawerLeftMargin:new c(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=l(),a=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),i=f();return d.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{h as D};
1
+ import{j as d}from"./liveblocks-585gCzRC.js";import{K as l,F as c,h as f}from"./index-B30ioXEx.js";import{D as p}from"./mui-Dh_OiBGq.js";import"./sentry-CznkHhej.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]="63e12542-e79f-4200-b974-34ccb9515454",e._sentryDebugIdIdentifier="sentry-dbid-63e12542-e79f-4200-b974-34ccb9515454")}catch{}})();const b={drawerLeftMargin:new c(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=l(),a=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),i=f();return d.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-585gCzRC.js";import{a as d}from"./sentry-CznkHhej.js";import{j as A,h as B,u as J,l as q,g as l,N as F,k as M,n as O,o as N}from"./core-BM9YDzPX.js";import{Kp as _,eM as K,JO as R,km as W,Gw as I,Ku as Y,Jh as $,jm as z,Gx as S,JT as U,JU as V,Jj as H,Ji as L}from"./zeni-epic-state-1oMHKKZA.js";import{aM as Q,e as X,s as Z,x as tt}from"./index-BxZQbqZa.js";import"./mui-Dh_OiBGq.js";import{d as k}from"./decodeURIComponentSafe-a784xZQy.js";import{w as et}from"./withTransactionSidePanel-DJ3JMAJu.js";import{e as at,b as nt}from"./routePaths-DKtGe48K.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./useAskAiCfoHostNavButtonProps-DxvBbMZO.js";import"./useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js";import"./TransactionDetailScreen-BRy8OBJd.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]="769ca459-8f26-4ff7-8502-a071ce4de568",a._sentryDebugIdIdentifier="sentry-dbid-769ca459-8f26-4ff7-8502-a071ce4de568")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(U()),a(V()),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(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:b,entityIdEncoded:x,entityNameEncoded:j}=q(),r=k(x??""),p=k(j??""),f=rt(r,p),w=[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")),G=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(W(i)))},[m,f,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:b,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:C(w.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 jt({entityType:a}){return s.jsx(O,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
1
+ import{j as s}from"./liveblocks-585gCzRC.js";import{a as d}from"./sentry-CznkHhej.js";import{j as A,h as B,u as J,l as q,g as l,N as F,k as M,n as O,o as N}from"./core-BM9YDzPX.js";import{Kp as _,eM as K,JO as R,km as W,Gw as I,Ku as Y,Jh as $,jm as z,Gx as S,JT as U,JU as V,Jj as H,Ji as L}from"./zeni-epic-state-1oMHKKZA.js";import{aM as Q,e as X,s as Z,x as tt}from"./index-B30ioXEx.js";import"./mui-Dh_OiBGq.js";import{d as k}from"./decodeURIComponentSafe-a784xZQy.js";import{w as et}from"./withTransactionSidePanel-C4Otz1Im.js";import{e as at,b as nt}from"./routePaths-C_5Vo_Nm.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./useAskAiCfoHostNavButtonProps-DOA3k3qr.js";import"./useFetchSuggestedQuestionsWhenReady-CThB0klC.js";import"./TransactionDetailScreen-D1icJoqW.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]="769ca459-8f26-4ff7-8502-a071ce4de568",a._sentryDebugIdIdentifier="sentry-dbid-769ca459-8f26-4ff7-8502-a071ce4de568")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(U()),a(V()),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(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:b,entityIdEncoded:x,entityNameEncoded:j}=q(),r=k(x??""),p=k(j??""),f=rt(r,p),w=[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")),G=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(W(i)))},[m,f,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:b,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:C(w.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 jt({entityType:a}){return s.jsx(O,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-585gCzRC.js";import un from"./NotFoundScreen-DNbVpibd.js";import{a as l}from"./sentry-CznkHhej.js";import{n as Te,D as St,S as ze}from"./mui-Dh_OiBGq.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Be}from"./core-BM9YDzPX.js";import{eM as $e,OI as pn,f0 as me,fe as gn,q3 as Cn,OJ as je,mI as ft,mO as kt,OK as Et,nb as Sn,OL as yt,mB as In,pB as fn,OM as kn,jy as En,ON as yn,Fx as vn,eY as Me,pg as vt,Kq as at,Ks as bn,jp as Tn,Kt as An,jw as Pn,cT as wn,t5 as Le,Jh as xn,jx as Rn,e_ as Dn,mP as bt,ng as be,ob as Tt,oK as Un,e$ as At,nf as ot,mG as ae,ni as Pt,nk as Bn,bB as Fn,kV as On,kS as _n,nj as Ee,nh as ue,OO as Vn,nA as st,Bd as wt,OP as xt,s2 as Rt,oG as jn,jm as Mn,OQ as Ln,Jj as ct,Ji as ke,OR as it,jN as zn,OS as $n,OT as Gn,OU as qn,OV as Jn,mY as Yn,OW as Nn,OX as Kn,OY as Zn,nq as Hn,jA as Qn,jr as Wn,OZ as Xn,jz as lt,KA as ea,O_ as ta,O$ as na,pc as aa,oT as oa,oS as Fe,P0 as sa,P1 as ca,l4 as ia,bp as la,k$ as rt,kN as ra,P2 as da,gy as dt,fL as ua,kY as ma,u_ as ha,P3 as pa,nR as ga,nM as Ca,nQ as Sa,nB as Ia,P4 as fa,n4 as ka,mV as Ea,ff as ut,nl as ya,P5 as va,P6 as ba,P7 as Ta,P8 as Aa,P9 as Pa,Pa as mt,po as wa,oB as xa,ok as ht,ot as Ra,og as Da,oH as Ua,ol as Ba,Pb as Fa,Pc as Oa,n_ as _a,Pd as Va,nY as ja,nZ as Ma,nW as La,ov as za}from"./zeni-epic-state-1oMHKKZA.js";import{J as Dt,i as Ut,c as ye,e as M,x as H,N as Bt,cq as $a,h as Ft,z as Ae,cr as Ga,ao as ve,cs as qa,B as Ot,ct as Ja,cu as Ya,al as Oe,Z as Na,S as Ka,aI as Za,cv as Ha,aZ as Qa,F as Wa,D as Xa,cw as eo,T as to,cx as no}from"./index-BxZQbqZa.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-DxvBbMZO.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-DCbrlg3X.js";import{c as pt,C as ao}from"./TransactionDetailScreen-BRy8OBJd.js";import{w as oo}from"./withTransactionSidePanel-DJ3JMAJu.js";import{h as so,v as co}from"./routePaths-DKtGe48K.js";import{g as _e}from"./accountMappingHelper-KEN2wBMB.js";import{D as io}from"./DrawerScreen-Bw1QfkLT.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./decodeURIComponentSafe-a784xZQy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="a7ed2312-011e-4d9e-ad7a-91fb7c6137d4",t._sentryDebugIdIdentifier="sentry-dbid-a7ed2312-011e-4d9e-ad7a-91fb7c6137d4")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),w=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:x}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,U=!1)=>{w(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:U}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),w(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=H(y.state?.pathnameStackToGoBack,y.pathname),N=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Bt();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&w(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:x,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:N,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})})},ro=Te.div`
1
+ import{j as u}from"./liveblocks-585gCzRC.js";import un from"./NotFoundScreen-Cucx3MKM.js";import{a as l}from"./sentry-CznkHhej.js";import{n as Te,D as St,S as ze}from"./mui-Dh_OiBGq.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Be}from"./core-BM9YDzPX.js";import{eM as $e,OI as pn,f0 as me,fe as gn,q3 as Cn,OJ as je,mI as ft,mO as kt,OK as Et,nb as Sn,OL as yt,mB as In,pB as fn,OM as kn,jy as En,ON as yn,Fx as vn,eY as Me,pg as vt,Kq as at,Ks as bn,jp as Tn,Kt as An,jw as Pn,cT as wn,t5 as Le,Jh as xn,jx as Rn,e_ as Dn,mP as bt,ng as be,ob as Tt,oK as Un,e$ as At,nf as ot,mG as ae,ni as Pt,nk as Bn,bB as Fn,kV as On,kS as _n,nj as Ee,nh as ue,OO as Vn,nA as st,Bd as wt,OP as xt,s2 as Rt,oG as jn,jm as Mn,OQ as Ln,Jj as ct,Ji as ke,OR as it,jN as zn,OS as $n,OT as Gn,OU as qn,OV as Jn,mY as Yn,OW as Nn,OX as Kn,OY as Zn,nq as Hn,jA as Qn,jr as Wn,OZ as Xn,jz as lt,KA as ea,O_ as ta,O$ as na,pc as aa,oT as oa,oS as Fe,P0 as sa,P1 as ca,l4 as ia,bp as la,k$ as rt,kN as ra,P2 as da,gy as dt,fL as ua,kY as ma,u_ as ha,P3 as pa,nR as ga,nM as Ca,nQ as Sa,nB as Ia,P4 as fa,n4 as ka,mV as Ea,ff as ut,nl as ya,P5 as va,P6 as ba,P7 as Ta,P8 as Aa,P9 as Pa,Pa as mt,po as wa,oB as xa,ok as ht,ot as Ra,og as Da,oH as Ua,ol as Ba,Pb as Fa,Pc as Oa,n_ as _a,Pd as Va,nY as ja,nZ as Ma,nW as La,ov as za}from"./zeni-epic-state-1oMHKKZA.js";import{J as Dt,i as Ut,c as ye,e as M,x as H,N as Bt,cq as $a,h as Ft,z as Ae,cr as Ga,ao as ve,cs as qa,B as Ot,ct as Ja,cu as Ya,al as Oe,Z as Na,S as Ka,aI as Za,cv as Ha,aZ as Qa,F as Wa,D as Xa,cw as eo,T as to,cx as no}from"./index-B30ioXEx.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-DOA3k3qr.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-CThB0klC.js";import{c as pt,C as ao}from"./TransactionDetailScreen-D1icJoqW.js";import{w as oo}from"./withTransactionSidePanel-C4Otz1Im.js";import{h as so,v as co}from"./routePaths-C_5Vo_Nm.js";import{g as _e}from"./accountMappingHelper-KEN2wBMB.js";import{D as io}from"./DrawerScreen-BVjSAkhK.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.js";import"./decodeURIComponentSafe-a784xZQy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="a7ed2312-011e-4d9e-ad7a-91fb7c6137d4",t._sentryDebugIdIdentifier="sentry-dbid-a7ed2312-011e-4d9e-ad7a-91fb7c6137d4")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),w=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:x}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,U=!1)=>{w(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:U}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),w(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=H(y.state?.pathnameStackToGoBack,y.pathname),N=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Bt();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&w(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:x,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:N,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})})},ro=Te.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-585gCzRC.js";import{a as d}from"./sentry-CznkHhej.js";import{X as c,$ as l,Y as p,s as f}from"./index-BxZQbqZa.js";import"./mui-Dh_OiBGq.js";import m from"./NotFoundScreen-DNbVpibd.js";import{j as u,u as b}from"./core-BM9YDzPX.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="dd7c473a-a4d4-49cd-947d-ba847deafae6",a._sentryDebugIdIdentifier="sentry-dbid-dd7c473a-a4d4-49cd-947d-ba847deafae6")}catch{}})();const D=()=>{const a=u(),e=b(),t=d.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),r=d.useCallback(()=>{(()=>{const n=f(e.state?.pathnameStackToGoBack),i=n.poppedPathname??k();a(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=c(e.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:r}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{D as F};
1
+ import{j as s}from"./liveblocks-585gCzRC.js";import{a as d}from"./sentry-CznkHhej.js";import{X as c,$ as l,Y as p,s as f}from"./index-B30ioXEx.js";import"./mui-Dh_OiBGq.js";import m from"./NotFoundScreen-Cucx3MKM.js";import{j as u,u as b}from"./core-BM9YDzPX.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="dd7c473a-a4d4-49cd-947d-ba847deafae6",a._sentryDebugIdIdentifier="sentry-dbid-dd7c473a-a4d4-49cd-947d-ba847deafae6")}catch{}})();const D=()=>{const a=u(),e=b(),t=d.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),r=d.useCallback(()=>{(()=>{const n=f(e.state?.pathnameStackToGoBack),i=n.poppedPathname??k();a(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=c(e.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:r}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{D as F};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-585gCzRC.js";import{l as w,k as x,j,u as y,h as Y,q as ee,g as A,N as ae,n as te,o as p}from"./core-BM9YDzPX.js";import{Iu as S,Iv as k,Iw as N,yQ as $,yC as L,Ix as C,Iy as ne,Iz as oe,yG as ie,eN as I,yN as se,yK as le}from"./zeni-epic-state-1oMHKKZA.js";import{K as g,o as r,E as re,e as v,m as E,r as de,s as ce,v as me,x as F,i as pe,c as ue,R as he,Z as xe,h as ge,B as fe,y as be,p as we,A as ye,C as Se,F as ke,M as ve}from"./index-BxZQbqZa.js";import{n as c}from"./mui-Dh_OiBGq.js";import f from"./NotFoundScreen-DNbVpibd.js";import{a as P}from"./sentry-CznkHhej.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.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]="0a86ff8a-03ad-4a90-9556-4b7b35e6116b",e._sentryDebugIdIdentifier="sentry-dbid-0a86ff8a-03ad-4a90-9556-4b7b35e6116b")}catch{}})();const Ie=c.div`
1
+ import{j as a}from"./liveblocks-585gCzRC.js";import{l as w,k as x,j,u as y,h as Y,q as ee,g as A,N as ae,n as te,o as p}from"./core-BM9YDzPX.js";import{Iu as S,Iv as k,Iw as N,yQ as $,yC as L,Ix as C,Iy as ne,Iz as oe,yG as ie,eN as I,yN as se,yK as le}from"./zeni-epic-state-1oMHKKZA.js";import{K as g,o as r,E as re,e as v,m as E,r as de,s as ce,v as me,x as F,i as pe,c as ue,R as he,Z as xe,h as ge,B as fe,y as be,p as we,A as ye,C as Se,F as ke,M as ve}from"./index-B30ioXEx.js";import{n as c}from"./mui-Dh_OiBGq.js";import f from"./NotFoundScreen-Cucx3MKM.js";import{a as P}from"./sentry-CznkHhej.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.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]="0a86ff8a-03ad-4a90-9556-4b7b35e6116b",e._sentryDebugIdIdentifier="sentry-dbid-0a86ff8a-03ad-4a90-9556-4b7b35e6116b")}catch{}})();const Ie=c.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-585gCzRC.js";import{a as f}from"./sentry-CznkHhej.js";import{h as U,u as w,j as _,q as M,g as l,N as T}from"./core-BM9YDzPX.js";import{z as r,h as P,D as V,f as A,e as N,g as q,w as R,p as W,k as $}from"./index-BxZQbqZa.js";import{eM as B,Ie as G,Ip as H,If as J,eN as K,fi as Q,Il as X,fF as Y,cR as Z,Iq as ee,Ir as te}from"./zeni-epic-state-1oMHKKZA.js";import{n as ne}from"./mui-Dh_OiBGq.js";import{u as se}from"./useDeviceId-D_MFUrrA.js";import{f as ae}from"./analyticsHelper-1lOvj-za.js";import{t as ie}from"./getLocaleForTenant-Czitv1AW.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.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]="90f36598-8e52-474b-a89e-9829a8dbf6dd",t._sentryDebugIdIdentifier="sentry-dbid-90f36598-8e52-474b-a89e-9829a8dbf6dd")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=U(),a=w(),m=_(),[b]=M(),n=b.get("token"),p=b.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),k=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,k,v,a.state,t]);const F=f.useCallback(()=>{m("/signin/auth")},[m]),j=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:O,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-585gCzRC.js";import{a as f}from"./sentry-CznkHhej.js";import{h as U,u as w,j as _,q as M,g as l,N as T}from"./core-BM9YDzPX.js";import{z as r,h as P,D as V,f as A,e as N,g as q,w as R,p as W,k as $}from"./index-B30ioXEx.js";import{eM as B,Ie as G,Ip as H,If as J,eN as K,fi as Q,Il as X,fF as Y,cR as Z,Iq as ee,Ir as te}from"./zeni-epic-state-1oMHKKZA.js";import{n as ne}from"./mui-Dh_OiBGq.js";import{u as se}from"./useDeviceId-D_MFUrrA.js";import{f as ae}from"./analyticsHelper-DWU-XMyN.js";import{t as ie}from"./getLocaleForTenant-CjYI5PP8.js";import"./recharts-Bk8sahKA.js";import"./analytics-CqLahF_v.js";import"./plaid-B3TMtaAn.js";import"./dnd-DLVMxaGF.js";import"./stripe-DMRn4zHo.js";import"./lottie-piZcDgIc.js";import"./lexical-CFqhubpO.js";import"./pdf-C7LOTluM.js";import"./utils-Boc0JP6O.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]="90f36598-8e52-474b-a89e-9829a8dbf6dd",t._sentryDebugIdIdentifier="sentry-dbid-90f36598-8e52-474b-a89e-9829a8dbf6dd")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=U(),a=w(),m=_(),[b]=M(),n=b.get("token"),p=b.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),k=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,k,v,a.state,t]);const F=f.useCallback(()=>{m("/signin/auth")},[m]),j=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:O,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;