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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/assets/{AddressRoutes-CfEBmv0d.js → AddressRoutes-D5m9Txpa.js} +1 -1
  2. package/dist/assets/{AddressScreen-Dic8fdZj.js → AddressScreen-9ZQKW4Vc.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-oHaKO3YZ.js → AiCfoScreen-HGbtKnxx.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes--JiwbSlw.js → BillPayApprovalRoutes-WO8R24uy.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-iu-y_0bY.js → BillPayRoutes-OfGi1DH5.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-BZ6pMYtD.js → BusinessVerificationPageScreen-Cwb0O2iw.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-B8BvvLNn.js → ChargeCardRoutes-rGxvQDtl.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-Crt0Wguw.js → CompanyPassportScreen-BLCufivU.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-CMvgcToC.js → ConnectionAuthScreen-DPjlQt6j.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-BWu3bg8J.js → CustomerOnboardingAuthScreen-BLnBp8eI.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-C-eOXGDS.js → CustomerOnboardingRoutes-DX7TTN0z.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-TSlOHhjs.js → DashboardRoutes-DsB2iHa0.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-C_6PZH2v.js → DefaultTenantHome-s96KbqYN.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-Dgz3xvTR.js → DomesticWireDetailScreen-masdKbKT.js} +1 -1
  15. package/dist/assets/{DrawerScreen-DA7W7_FJ.js → DrawerScreen-D7lcO0VJ.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-BC2rYBUq.js → EntityDetailRoutes-DWIHI0bf.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-BLnzE6sM.js → ExpenseAutomationRoutes-Df1ZmsUn.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-ZZAPjaff.js → FeaturePreviewScreen-D4qKJlp2.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-DOC4BX5c.js → HubSpotOAuthCallbackScreen-CLs0WVB9.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-DvIXgxg3.js → MagicLinkRoutes-CH7xneTX.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-Do3HpkUK.js → MagicLinkSignInScreen-Ij-bum6F.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-3z1V-CUc.js → MobileAppDrawer-Ccfg2tLY.js} +1 -1
  23. package/dist/assets/{NotFoundScreen-CcPbqGwL.js → NotFoundScreen-DdK7GyZ6.js} +1 -1
  24. package/dist/assets/{NotificationRoutes-Bo0zZ1Kt.js → NotificationRoutes-DVhgz2MT.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-Dbc4UpDH.js → OAuthConsentScreen-CdvqeO7v.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-CK7phZDt.js → PandLWithForecastRoutes-CSnkyLzm.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-B92Pa5DO.js → PeopleRoutes-DwTgxifH.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-zwUtk6Fa.js → PerformanceRoutes-BLUJTpzt.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-BVyeqZrM.js → QBOConnectionScreen-MmUXgGtM.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-Dos23hEe.js → ReferralListScreen-B2ACfYZr.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-DHAddbeN.js → ReimbursementApprovalRoutes-CT4lWRTd.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DBa6iD2W.js → ReimbursementApprovalRuleDetailScreen-CNt84ZGM.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-BmvzogVc.js → ReimbursementRoutes-BHzTaVBa.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-BxWR6xqe.js → ReportsRoutes-BDSCsmt2.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-DfxqaoUk.js → RewardsRoutes-YDsLsdCp.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-CJd27YIj.js → ScreenRoutes-r_yq8fzi.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-jK4Q3qxF.js → SettingsRoutes-B5I2T9gT.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-BqUpkFrc.js → SetupPagesScreen-CWz4vIj-.js} +1 -1
  39. package/dist/assets/{SignInScreen-DMKJW3-3.js → SignInScreen-Dp0TAL4V.js} +1 -1
  40. package/dist/assets/{SignOutScreen-DcxoE-cS.js → SignOutScreen-DeydCvA_.js} +1 -1
  41. package/dist/assets/{TaskListScreen-BKqqal1w.js → TaskListScreen-DgDHZCji.js} +1 -1
  42. package/dist/assets/{TaskRoutes-_u7Wmqyu.js → TaskRoutes-1dpFKupm.js} +1 -1
  43. package/dist/assets/{TransactionDetailRoutes-Cw9Uc-n0.js → TransactionDetailRoutes-BRCYDEe1.js} +1 -1
  44. package/dist/assets/{TransactionDetailScreen-DIVwpSfj.js → TransactionDetailScreen-Dz99_JkB.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-DdeRCYAU.js → TransactionListRoutes-C05fsgRv.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-Ch-gY5t9.js → TreasuryRoutes-DjyI2oxa.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-Bx7Q80V-.js → VendorsRoutes-Df4R1sQP.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-DRuEprOC.js → WiseConfirmationScreen-W0w1BuqD.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-OuhMj1ig.js → ZeniAccountRoutes-C8pdGbMJ.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-Brn3KW0y.js → ZeniAccountStatementScreen-DmJw_u4G.js} +1 -1
  51. package/dist/assets/{analyticsHelper-B0HqRRKS.js → analyticsHelper-CWJll2iT.js} +1 -1
  52. package/dist/assets/{getLocaleForTenant-BJg8tROe.js → getLocaleForTenant-D8IeK8ro.js} +1 -1
  53. package/dist/assets/{index-CsttCRun.js → index-CR1sBuly.js} +5 -5
  54. package/dist/assets/{routePaths-AncZCFgJ.js → routePaths-BoWQ8YXQ.js} +1 -1
  55. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BOZLDiKO.js → useAiCfoDashboardSuggestedQuestionsChips-Xp4UZg6R.js} +1 -1
  56. package/dist/assets/{useAskAiCfoHostNavButtonProps-B6D1gPTU.js → useAskAiCfoHostNavButtonProps-D2I_ptqP.js} +1 -1
  57. package/dist/assets/{useInitialThreadRequest-Ce_TAmYW.js → useInitialThreadRequest-oMQ4nobf.js} +1 -1
  58. package/dist/assets/{withTransactionSidePanel-C9nI8iAG.js → withTransactionSidePanel-C6lz4d-6.js} +1 -1
  59. package/dist/index.html +1 -1
  60. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-BEuWW_o5.js";import{A as d}from"./AddressScreen-Dic8fdZj.js";import i from"./NotFoundScreen-CcPbqGwL.js";import"./sentry-DsHW_1mX.js";import{o as s,p as r}from"./core-lbYY5woS.js";import"./zeni-epic-state-DsxPZxrE.js";import"./recharts-aApoEySM.js";import"./index-CsttCRun.js";import"./mui-hUAh7HgW.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
1
+ import{j as e}from"./liveblocks-BEuWW_o5.js";import{A as d}from"./AddressScreen-9ZQKW4Vc.js";import i from"./NotFoundScreen-DdK7GyZ6.js";import"./sentry-DsHW_1mX.js";import{o as s,p as r}from"./core-lbYY5woS.js";import"./zeni-epic-state-DsxPZxrE.js";import"./recharts-aApoEySM.js";import"./index-CR1sBuly.js";import"./mui-hUAh7HgW.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-BEuWW_o5.js";import{a as h}from"./sentry-DsHW_1mX.js";import{l as T,h as _,u as j,i as E,g as B,n as K}from"./core-lbYY5woS.js";import{K as M,m as $,z as D,I as L,B as R,R as z,c as C,e as S,M as F,h as b,p as N}from"./index-CsttCRun.js";import{K8 as I,g_ as U,eQ as G,K9 as O,c2 as V,Ka as q,kj as H}from"./zeni-epic-state-DsxPZxrE.js";import{n as Q}from"./mui-hUAh7HgW.js";import J from"./NotFoundScreen-CcPbqGwL.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]="ca8f8d8f-e0d4-4655-8993-9b7090462cdd",e._sentryDebugIdIdentifier="sentry-dbid-ca8f8d8f-e0d4-4655-8993-9b7090462cdd")}catch{}})();const W=Q.div`
1
+ import{j as r}from"./liveblocks-BEuWW_o5.js";import{a as h}from"./sentry-DsHW_1mX.js";import{l as T,h as _,u as j,i as E,g as B,n as K}from"./core-lbYY5woS.js";import{K as M,m as $,z as D,I as L,B as R,R as z,c as C,e as S,M as F,h as b,p as N}from"./index-CR1sBuly.js";import{K8 as I,g_ as U,eQ as G,K9 as O,c2 as V,Ka as q,kj as H}from"./zeni-epic-state-DsxPZxrE.js";import{n as Q}from"./mui-hUAh7HgW.js";import J from"./NotFoundScreen-DdK7GyZ6.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]="ca8f8d8f-e0d4-4655-8993-9b7090462cdd",e._sentryDebugIdIdentifier="sentry-dbid-ca8f8d8f-e0d4-4655-8993-9b7090462cdd")}catch{}})();const W=Q.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as f}from"./liveblocks-BEuWW_o5.js";import{a as i}from"./sentry-DsHW_1mX.js";import{h as ge,l as Ce,u as Ie,g as q,i as be,n as ke}from"./core-lbYY5woS.js";import{O as we,cO as Pe,z as xe,K as Ee,cP as Te,cQ as Qe,cR as z,cS as ve,cT as Y,p as D,R as W,c as E,cU as H,cV as ye,a0 as _e,e as Oe,a6 as Ue,cW as Ae,a1 as Le,n as De,b0 as Fe,cX as Be}from"./index-CsttCRun.js";import{fI as Re,f7 as Z,eQ as je,hE as Me,QL as Ge,eP as Ve,hO as $e,hK as Ne,fy as K,fs as qe,fl as ze,fp as X,ft as We,fu as He,fv as Ke,fw as Xe,fx as Je}from"./zeni-epic-state-DsxPZxrE.js";import{D as Ye,n as b,S as Ze,P as et}from"./mui-hUAh7HgW.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-BOZLDiKO.js";import{p as st}from"./pathToGoBack-BTgB24PY.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="69047a1d-aff0-4d18-9f1c-f552a2348bbf",o._sentryDebugIdIdentifier="sentry-dbid-69047a1d-aff0-4d18-9f1c-f552a2348bbf")}catch{}})();const ee="chat-response-generated",ot=ke(function(o,n){const t=Z(o),m=n.isSubmitting;return{showSampleQuestions:n.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:n.sessionFromUrl==="new_chat"||n.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Le}/tableDownload`,emailLinkQuestion:n.emailLinkQuestion,autoSubmitEmailLinkQuestion:n.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:n.onEmailLinkQuestionProcessed,routedInitialQuestionSource:n.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:n.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:n.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:n.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:n.isFileUploadEnabled,isUploadPromoVisible:n.isUploadPromoVisible,onUploadPromoClose:n.onUploadPromoClose}},function(o,n){const{location:t,currentTenant:m,userId:r,navigate:g,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:c}=n;return{onEventReceived:(e,l)=>{if(e===ee&&typeof l.text=="string"&&typeof l.metadata=="object"){const u=l,p=He(u.type),d=u.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:k,currentQuestionAnswerSummary:T}=Y(C,d);p!=="answer"?E.trackAICFOChatResponseGenerated(p,k?.question.questionText??"",u.text,d,Be(T,s),u.metadata.message_id??null):E.trackAICFOChatAnswerGenerated(u.text,k?.question.questionText??"",(u.follow_up_questions?.length??0)>0,!!u.assumptions,!!u.insights,u.visualization!=null,Ke(u.visualization?.type??"")??null,d,u.summarized_title,u.metadata.message_id??null),o(Xe({chatSessionId:u.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),o(Je({chatSessionId:u.metadata.chat_session_id,answerPayload:u,userId:r}))}},onSubmit:(e,l,u,p)=>{e&&Fe(o,e,l,S,C,r,p,u)},updateCurrentInput:e=>{o(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{o(We(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{g(-1)},onCloseClick:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??st(1);g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),o(X(""))},togglePageView:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),c(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{g(-1)},onNewChatClick:()=>{S!=null&&o(ze());const e=De(t.state?.pathnameStackToGoBack,t.pathname);g(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,l)=>{o(qe({questionAnswerId:e,isCollapsed:l}))},onMenuClick:n.onMenuClick}})(Ue(Ae)),Et=({isFileUploadEnabled:o})=>{const{setIsAiCfoOpen:n}=we(),t=ge(),m=Ce(),r=Ie(),[g,S]=i.useState(!1);i.useEffect(()=>{t(Re())},[t]);const{customPageTitle:C}=Pe(),c=q(a=>Z(a)),e=xe.getSignedInUser(),{session_id:l}=be(),u=Ee(),p=_e(u),d=q(a=>je(a)),s=c.uiState.currentChatSessionId,k=d.tenantEmailDomain,{handleUploadPromoClose:T,isUploadPromoVisible:te}=Te({isFileUploadEnabled:o,tenantEmailDomain:k}),Q=Qe({currentTenant:d,currentChatSessionId:s,aiCfoView:c}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=r.state,P=w?.aiCfoInitialQuestion,F=!!w?.aiCfoShouldSubmit;i.useEffect(()=>{const a=r.state;if(a?.[z]!==!0)return;S(!0);const h={...a};delete h[z],m(r,{replace:!0,state:h})},[r.pathname,r.search,r.state,m]);const[ae,v]=i.useState(null),[ne,y]=i.useState(!1),[ie,_]=i.useState(void 0),[re,O]=i.useState(void 0),B=i.useRef(!1);i.useEffect(()=>{if(!B.current&&P!=null&&P!==""){const a=r.state;v(P),y(F),_(a?.aiCfoInitialSubmissionSource!=null?a.aiCfoInitialSubmissionSource:void 0);const h=a?.aiCfoSuggestionIndex;O(typeof h=="number"?h:void 0),B.current=!0}},[P,F,r.state]);const le=i.useCallback(()=>{v(null),y(!1),_(void 0),O(void 0)},[]),R=i.useMemo(()=>new URLSearchParams(r.search),[r.search]),j=R.get("ref")??w?.aiCfoRef,U=R.get("emailRefId")??w?.aiCfoEmailRefId,M=i.useRef(!1);i.useEffect(()=>{M.current||j!=="month-end-email"||U==null||s!=null||e==null||(t(Me("controller",e.userId,U,"MONTH_END_EMAIL")),M.current=!0)},[j,U,s,t,e]);const x=c.uiState.lastContextMessage;i.useEffect(()=>{x!=null&&x!==""&&s!=null&&(v(x),y(!0),_(void 0),O(void 0),t(Ge()))},[x,s,t]);const ue=d.masterTOSInfo,I=ue?.isMasterTOSAccepted??!1,{visitedSessions:G}=ve(s),A=c.fetchState,L=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,V=s!=null?c.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",$=s==null||(c.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),N=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ce}=Y(N,s),de=ce.length===0;i.useEffect(()=>{I||p||m("../dashboard",{state:{...r.state,message:"open_ai_cfo_drawer"}})},[I,p,m,r.state]);const me=i.useCallback(()=>{const a=D(r.state?.pathnameStackToGoBack),h=d.tenantEmailDomain;m(a.poppedPathname??(h!=null?`/${h}/dashboard`:".."),{state:{...r.state,pathnameStackToGoBack:a.newStack}})},[d.tenantEmailDomain,r.state,m]);i.useEffect(()=>{s!=null&&l!==s&&m(`../ai-cfo/${s}`,{state:{...r.state}})},[s,l]),i.useEffect(()=>{l!=null&&s==null&&l!=="new_chat"&&l!=="explore"&&t(Ve({sessionId:l,agentId:"controller"}))},[]);const pe=i.useMemo(()=>({events:G.map(a=>`private-encrypted-chat-${a}.${ee}`),eventCallback:(a,h,Se)=>Se.onEventReceived(a,h)}),[G]);i.useEffect(()=>{A!=="In-Progress"&&L&&t($e())},[A,L,t]),i.useEffect(()=>{s!=null&&V!=="In-Progress"&&$&&e!=null&&A==="Completed"&&!L&&t(Ne(s,e.userId))},[V,$,s,e,t]);const fe=a=>a.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||l==null)throw Error("Can't access AI Controller page without signing in...");const he=s!=null&&c.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return!I&&p?f.jsxs(nt,{children:[f.jsx(W,{analytics:E,onLoad:fe}),Q.drawerElement,f.jsx(it,{children:f.jsx(J,{children:f.jsx(H,{isTOSAccepted:!1,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:me,onCompleteClick:()=>{d.userRoleId!=null&&t(K(d.userRoleId))}})})})]}):f.jsxs(at,{children:[f.jsx(W,{analytics:E,onLoad:a=>a.trackPageLoaded(Oe.Event.aiCFOPage)}),p&&Q.drawerElement,f.jsx(ot,{...pe,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>S(!0),userId:e.userId,setIsAiCfoOpen:n,navigate:m,sessionFromUrl:l,location:r,isSubmitting:he,isEmptyChatWithSession:de,customPageTitle:C,currentTenant:d,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:p?Q.open:void 0,isFileUploadEnabled:o,isUploadPromoVisible:te,onUploadPromoClose:T,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),f.jsx(Ye,{anchor:"right",open:g,transitionDuration:250,PaperProps:{component:rt,style:{width:p?"100%":`${ye}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:f.jsx(J,{onClick:a=>a.stopPropagation(),children:f.jsx(H,{isTOSAccepted:I,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>S(!1),onCompleteClick:()=>{I||d.userRoleId==null||t(K(d.userRoleId)),S(!1)}})})})]})},J=b(Ze)`
1
+ import{j as f}from"./liveblocks-BEuWW_o5.js";import{a as i}from"./sentry-DsHW_1mX.js";import{h as ge,l as Ce,u as Ie,g as q,i as be,n as ke}from"./core-lbYY5woS.js";import{O as we,cO as Pe,z as xe,K as Ee,cP as Te,cQ as Qe,cR as z,cS as ve,cT as Y,p as D,R as W,c as E,cU as H,cV as ye,a0 as _e,e as Oe,a6 as Ue,cW as Ae,a1 as Le,n as De,b0 as Fe,cX as Be}from"./index-CR1sBuly.js";import{fI as Re,f7 as Z,eQ as je,hE as Me,QL as Ge,eP as Ve,hO as $e,hK as Ne,fy as K,fs as qe,fl as ze,fp as X,ft as We,fu as He,fv as Ke,fw as Xe,fx as Je}from"./zeni-epic-state-DsxPZxrE.js";import{D as Ye,n as b,S as Ze,P as et}from"./mui-hUAh7HgW.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-Xp4UZg6R.js";import{p as st}from"./pathToGoBack-BTgB24PY.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="69047a1d-aff0-4d18-9f1c-f552a2348bbf",o._sentryDebugIdIdentifier="sentry-dbid-69047a1d-aff0-4d18-9f1c-f552a2348bbf")}catch{}})();const ee="chat-response-generated",ot=ke(function(o,n){const t=Z(o),m=n.isSubmitting;return{showSampleQuestions:n.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:m,isNewChatSession:n.sessionFromUrl==="new_chat"||n.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Le}/tableDownload`,emailLinkQuestion:n.emailLinkQuestion,autoSubmitEmailLinkQuestion:n.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:n.onEmailLinkQuestionProcessed,routedInitialQuestionSource:n.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:n.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:n.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:n.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:n.isFileUploadEnabled,isUploadPromoVisible:n.isUploadPromoVisible,onUploadPromoClose:n.onUploadPromoClose}},function(o,n){const{location:t,currentTenant:m,userId:r,navigate:g,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:c}=n;return{onEventReceived:(e,l)=>{if(e===ee&&typeof l.text=="string"&&typeof l.metadata=="object"){const u=l,p=He(u.type),d=u.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:k,currentQuestionAnswerSummary:T}=Y(C,d);p!=="answer"?E.trackAICFOChatResponseGenerated(p,k?.question.questionText??"",u.text,d,Be(T,s),u.metadata.message_id??null):E.trackAICFOChatAnswerGenerated(u.text,k?.question.questionText??"",(u.follow_up_questions?.length??0)>0,!!u.assumptions,!!u.insights,u.visualization!=null,Ke(u.visualization?.type??"")??null,d,u.summarized_title,u.metadata.message_id??null),o(Xe({chatSessionId:u.metadata.chat_session_id,responseType:p,fetchState:{fetchState:"Completed",error:void 0}})),o(Je({chatSessionId:u.metadata.chat_session_id,answerPayload:u,userId:r}))}},onSubmit:(e,l,u,p)=>{e&&Fe(o,e,l,S,C,r,p,u)},updateCurrentInput:e=>{o(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{o(We(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{g(-1)},onCloseClick:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??st(1);g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack}}),o(X(""))},togglePageView:()=>{const e=D(t.state?.pathnameStackToGoBack),l=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;g(l,{state:{...t.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),c(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{g(-1)},onNewChatClick:()=>{S!=null&&o(ze());const e=De(t.state?.pathnameStackToGoBack,t.pathname);g(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,l)=>{o(qe({questionAnswerId:e,isCollapsed:l}))},onMenuClick:n.onMenuClick}})(Ue(Ae)),Et=({isFileUploadEnabled:o})=>{const{setIsAiCfoOpen:n}=we(),t=ge(),m=Ce(),r=Ie(),[g,S]=i.useState(!1);i.useEffect(()=>{t(Re())},[t]);const{customPageTitle:C}=Pe(),c=q(a=>Z(a)),e=xe.getSignedInUser(),{session_id:l}=be(),u=Ee(),p=_e(u),d=q(a=>je(a)),s=c.uiState.currentChatSessionId,k=d.tenantEmailDomain,{handleUploadPromoClose:T,isUploadPromoVisible:te}=Te({isFileUploadEnabled:o,tenantEmailDomain:k}),Q=Qe({currentTenant:d,currentChatSessionId:s,aiCfoView:c}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=r.state,P=w?.aiCfoInitialQuestion,F=!!w?.aiCfoShouldSubmit;i.useEffect(()=>{const a=r.state;if(a?.[z]!==!0)return;S(!0);const h={...a};delete h[z],m(r,{replace:!0,state:h})},[r.pathname,r.search,r.state,m]);const[ae,v]=i.useState(null),[ne,y]=i.useState(!1),[ie,_]=i.useState(void 0),[re,O]=i.useState(void 0),B=i.useRef(!1);i.useEffect(()=>{if(!B.current&&P!=null&&P!==""){const a=r.state;v(P),y(F),_(a?.aiCfoInitialSubmissionSource!=null?a.aiCfoInitialSubmissionSource:void 0);const h=a?.aiCfoSuggestionIndex;O(typeof h=="number"?h:void 0),B.current=!0}},[P,F,r.state]);const le=i.useCallback(()=>{v(null),y(!1),_(void 0),O(void 0)},[]),R=i.useMemo(()=>new URLSearchParams(r.search),[r.search]),j=R.get("ref")??w?.aiCfoRef,U=R.get("emailRefId")??w?.aiCfoEmailRefId,M=i.useRef(!1);i.useEffect(()=>{M.current||j!=="month-end-email"||U==null||s!=null||e==null||(t(Me("controller",e.userId,U,"MONTH_END_EMAIL")),M.current=!0)},[j,U,s,t,e]);const x=c.uiState.lastContextMessage;i.useEffect(()=>{x!=null&&x!==""&&s!=null&&(v(x),y(!0),_(void 0),O(void 0),t(Ge()))},[x,s,t]);const ue=d.masterTOSInfo,I=ue?.isMasterTOSAccepted??!1,{visitedSessions:G}=ve(s),A=c.fetchState,L=c.uiState.chatSessionsNextPageToken.hasMore||!c.uiState.chatSessionsFirstPageFetched,V=s!=null?c.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",$=s==null||(c.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),N=c.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ce}=Y(N,s),de=ce.length===0;i.useEffect(()=>{I||p||m("../dashboard",{state:{...r.state,message:"open_ai_cfo_drawer"}})},[I,p,m,r.state]);const me=i.useCallback(()=>{const a=D(r.state?.pathnameStackToGoBack),h=d.tenantEmailDomain;m(a.poppedPathname??(h!=null?`/${h}/dashboard`:".."),{state:{...r.state,pathnameStackToGoBack:a.newStack}})},[d.tenantEmailDomain,r.state,m]);i.useEffect(()=>{s!=null&&l!==s&&m(`../ai-cfo/${s}`,{state:{...r.state}})},[s,l]),i.useEffect(()=>{l!=null&&s==null&&l!=="new_chat"&&l!=="explore"&&t(Ve({sessionId:l,agentId:"controller"}))},[]);const pe=i.useMemo(()=>({events:G.map(a=>`private-encrypted-chat-${a}.${ee}`),eventCallback:(a,h,Se)=>Se.onEventReceived(a,h)}),[G]);i.useEffect(()=>{A!=="In-Progress"&&L&&t($e())},[A,L,t]),i.useEffect(()=>{s!=null&&V!=="In-Progress"&&$&&e!=null&&A==="Completed"&&!L&&t(Ne(s,e.userId))},[V,$,s,e,t]);const fe=a=>a.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(e==null||l==null)throw Error("Can't access AI Controller page without signing in...");const he=s!=null&&c.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return!I&&p?f.jsxs(nt,{children:[f.jsx(W,{analytics:E,onLoad:fe}),Q.drawerElement,f.jsx(it,{children:f.jsx(J,{children:f.jsx(H,{isTOSAccepted:!1,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:me,onCompleteClick:()=>{d.userRoleId!=null&&t(K(d.userRoleId))}})})})]}):f.jsxs(at,{children:[f.jsx(W,{analytics:E,onLoad:a=>a.trackPageLoaded(Oe.Event.aiCFOPage)}),p&&Q.drawerElement,f.jsx(ot,{...pe,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>S(!0),userId:e.userId,setIsAiCfoOpen:n,navigate:m,sessionFromUrl:l,location:r,isSubmitting:he,isEmptyChatWithSession:de,customPageTitle:C,currentTenant:d,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:p?Q.open:void 0,isFileUploadEnabled:o,isUploadPromoVisible:te,onUploadPromoClose:T,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),f.jsx(Ye,{anchor:"right",open:g,transitionDuration:250,PaperProps:{component:rt,style:{width:p?"100%":`${ye}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:f.jsx(J,{onClick:a=>a.stopPropagation(),children:f.jsx(H,{isTOSAccepted:I,acceptMasterTOSState:c.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>S(!1),onCompleteClick:()=>{I||d.userRoleId==null||t(K(d.userRoleId)),S(!1)}})})})]})},J=b(Ze)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-BEuWW_o5.js";import{a as f}from"./sentry-DsHW_1mX.js";import{l as B,u as U,h as T,g as v,N,n as j,i as $,o as O,p as h}from"./core-lbYY5woS.js";import{eQ as L,Nr as R,N7 as b,xR as x,xL as F,xP as I,xE as W,N9 as q,xH as z,xT as H,xS as D}from"./zeni-epic-state-DsxPZxrE.js";import{m as P,z as k,B as V,a6 as Q,bD as G,af as _,bE as J}from"./index-CsttCRun.js";import"./mui-hUAh7HgW.js";import{i as K}from"./ReimbursementApprovalRuleDetailScreen-DBa6iD2W.js";import M from"./NotFoundScreen-CcPbqGwL.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]="a2107945-fc7d-49b8-85a1-35e50dd0b61f",e._sentryDebugIdIdentifier="sentry-dbid-a2107945-fc7d-49b8-85a1-35e50dd0b61f")}catch{}})();const w="bill-approval-rule-update",X=j(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(q(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(W(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(Q(G)),Y=()=>{const e=B(),o=U(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...y})},Z=j(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(S=>{const E=!!K(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:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(D(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(D(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(H())},onSaveRuleSuccess:()=>{t("../")}}})(J);function C(){const e=B(),o=T(),t=U(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(C,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(C,{})}),l.jsx(h,{path:"*",element:l.jsx(M,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-BEuWW_o5.js";import{a as f}from"./sentry-DsHW_1mX.js";import{l as B,u as U,h as T,g as v,N,n as j,i as $,o as O,p as h}from"./core-lbYY5woS.js";import{eQ as L,Nr as R,N7 as b,xR as x,xL as F,xP as I,xE as W,N9 as q,xH as z,xT as H,xS as D}from"./zeni-epic-state-DsxPZxrE.js";import{m as P,z as k,B as V,a6 as Q,bD as G,af as _,bE as J}from"./index-CR1sBuly.js";import"./mui-hUAh7HgW.js";import{i as K}from"./ReimbursementApprovalRuleDetailScreen-CNt84ZGM.js";import M from"./NotFoundScreen-DdK7GyZ6.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]="a2107945-fc7d-49b8-85a1-35e50dd0b61f",e._sentryDebugIdIdentifier="sentry-dbid-a2107945-fc7d-49b8-85a1-35e50dd0b61f")}catch{}})();const w="bill-approval-rule-update",X=j(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(q(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(W(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(Q(G)),Y=()=>{const e=B(),o=U(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,m)=>{i.endsWith(w)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...y})},Z=j(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(S=>{const E=!!K(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:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(D(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(D(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(H())},onSaveRuleSuccess:()=>{t("../")}}})(J);function C(){const e=B(),o=T(),t=U(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(C,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(C,{})}),l.jsx(h,{path:"*",element:l.jsx(M,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BEuWW_o5.js";import{l as Q,h as se,u as J,i as ae,g as v,N as te,n as X,k as na,o as ia,p as S}from"./core-lbYY5woS.js";import{eQ as Z,MJ as Ne,bv as It,HD as oa,bo as wt,bF as pe,MK as Ct,x9 as xt,yj as $e,xI as la,bn as De,ML as sa,MM as ra,c2 as ca,MN as da,jD as Bt,MO as At,MP as Et,yU as _e,xo as Be,MQ as ua,wZ as tt,MR as pa,C4 as ma,x1 as ba,x7 as Dt,MS as ke,MT as Me,yk as Ge,MU as ha,MV as ga,yn as Oe,MW as ya,yA as Sa,MX as jt,y4 as at,y9 as fa,MY as ka,MZ as ue,M_ as Tt,M$ as Pt,N0 as Ft,fM as va,xt as Le,cx as Rt,N1 as Ia,gQ as wa,N2 as Ca,N3 as xa,eY as Vt,eW as $t,N4 as ze,N5 as Ba,N6 as Aa,Ks as Ze,N7 as Ea,Kt as oe,Ku as He,N8 as Da,N9 as ja,Na as Ta,yb as nt,y8 as Pa,Nb as Fa,Nc as Ra,Nd as Va,xW as $a,Ne as La,Nf as Ua,Ng as Na,cl as Lt,cN as Ut,jO as _a,bL as Ma,bq as Nt,bM as _t,wf as Ga,Nh as Oa,BT as za,BZ as Za,sK as Ha,yl as Wa,y$ as qa,j$ as fe,Ni as Ka,Nj as Mt,kt as Qa,jV as Gt,ke as Ot,kd as it,bE as be,bK as Ja,Nk as Xa,Nl as ve,iy as Ya,Nm as ot,Nn as en,iC as tn,iX as an,zd as nn,No as on,km as ln,z3 as sn,Np as lt,z7 as rn,zc as cn,z9 as dn,z1 as un,Nq as zt,xi as pn,Nr as mn,Ns as bn,fE as hn,fD as gn,fC as yn,k2 as Sn,kk as st,kv as fn,qa as kn,kb as vn,z5 as In,iI as wn,kA as Cn,Nt as xn,iA as Bn,q1 as An,Nu as En,y0 as Dn,bG as jn,bs as Tn,Jn as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-DsxPZxrE.js";import{m as me,z as V,I as Ie,_ as We,C as le,j as y,aN as Ae,B as re,o as A,R as je,c as D,ba as Ln,p as z,a1 as qe,n as E,K as we,bb as rt,bc as ct,bd as Un,ak as Nn,y as _n,aH as Mn,w as Zt,D as Ke,Q as Qe,be as Gn,at as Ht,bf as On,V as zn,e as Wt,a6 as Zn,bg as Hn,bh as Wn,bi as qn,bj as Kn,bk as Qn,bl as Jn,bm as Xn,bn as Yn,bo as ei,s as ti,bp as ai,b5 as ni,bq as ii,br as oi,a9 as li}from"./index-CsttCRun.js";import{n as U,S as si}from"./mui-hUAh7HgW.js";import{A as dt}from"./AddressScreen-Dic8fdZj.js";import{g as ie,a as Te,i as qt,V as Je,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-Dgz3xvTR.js";import{a as f}from"./sentry-DsHW_1mX.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-B6D1gPTU.js";import{u as Kt}from"./useInitialThreadRequest-Ce_TAmYW.js";import Ee from"./NotFoundScreen-CcPbqGwL.js";import{D as ui}from"./DrawerScreen-DA7W7_FJ.js";import{M as Qt}from"./MobileAppDrawer-3z1V-CUc.js";import{F as Jt}from"./FeaturePreviewScreen-ZZAPjaff.js";import{S as Pe}from"./SetupPagesScreen-BqUpkFrc.js";import{B as pi}from"./BillPayApprovalRoutes--JiwbSlw.js";import{FallBackRoute as mi}from"./ScreenRoutes-CJd27YIj.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./analyticsHelper-B0HqRRKS.js";import"./routePaths-AncZCFgJ.js";import"./BusinessVerificationPageScreen-BZ6pMYtD.js";import"./ReimbursementApprovalRuleDetailScreen-DBa6iD2W.js";import"./getLocaleForTenant-BJg8tROe.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]="040711a9-1c8c-4ac6-b3d3-3b714d483e6c",e._sentryDebugIdIdentifier="sentry-dbid-040711a9-1c8c-4ac6-b3d3-3b714d483e6c")}catch{}})();const bi=X(function(e,t){const l=Ne(e,t.billId),i=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Bt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Ln);function hi(){const e=Q(),t=se(),l=J(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Ne(G,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,C]=f.useState(!1),[x,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:N}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=N(Ae.zeniAssistConfig),B=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&B===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,B,r]),f.useEffect(()=>{i!=null&&t(Ct(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(xt(i??"",$,L,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!0),t($e(!1,$,L,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:x,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=Q(),{billId:i}=ae(),c=J(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),C=v(F=>Z(F)),[x,_]=f.useState(!1),[T,N]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),B=v(F=>Me(F,m,g,i));let q=B.fetchState,W=B.file,L=B.showAutofill;const K=v(F=>Ne(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],L=!1);const Y=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?N(!1):!u&&x&&_(!1))},[i]),f.useEffect(()=>{x||i==null||u||(_(!0),t(xt(i,h,j,!1)),T||(N(!0),t($e(!1,h,j,b,i)))),u&&!T&&(N(!0),t($e(!1,h,j,b,i)))},[x,T,u,i,t]);const G={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(C.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,C.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Nn,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ci,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:G,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:L,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,B),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-BEuWW_o5.js";import{l as Q,h as se,u as J,i as ae,g as v,N as te,n as X,k as na,o as ia,p as S}from"./core-lbYY5woS.js";import{eQ as Z,MJ as Ne,bv as It,HD as oa,bo as wt,bF as pe,MK as Ct,x9 as xt,yj as $e,xI as la,bn as De,ML as sa,MM as ra,c2 as ca,MN as da,jD as Bt,MO as At,MP as Et,yU as _e,xo as Be,MQ as ua,wZ as tt,MR as pa,C4 as ma,x1 as ba,x7 as Dt,MS as ke,MT as Me,yk as Ge,MU as ha,MV as ga,yn as Oe,MW as ya,yA as Sa,MX as jt,y4 as at,y9 as fa,MY as ka,MZ as ue,M_ as Tt,M$ as Pt,N0 as Ft,fM as va,xt as Le,cx as Rt,N1 as Ia,gQ as wa,N2 as Ca,N3 as xa,eY as Vt,eW as $t,N4 as ze,N5 as Ba,N6 as Aa,Ks as Ze,N7 as Ea,Kt as oe,Ku as He,N8 as Da,N9 as ja,Na as Ta,yb as nt,y8 as Pa,Nb as Fa,Nc as Ra,Nd as Va,xW as $a,Ne as La,Nf as Ua,Ng as Na,cl as Lt,cN as Ut,jO as _a,bL as Ma,bq as Nt,bM as _t,wf as Ga,Nh as Oa,BT as za,BZ as Za,sK as Ha,yl as Wa,y$ as qa,j$ as fe,Ni as Ka,Nj as Mt,kt as Qa,jV as Gt,ke as Ot,kd as it,bE as be,bK as Ja,Nk as Xa,Nl as ve,iy as Ya,Nm as ot,Nn as en,iC as tn,iX as an,zd as nn,No as on,km as ln,z3 as sn,Np as lt,z7 as rn,zc as cn,z9 as dn,z1 as un,Nq as zt,xi as pn,Nr as mn,Ns as bn,fE as hn,fD as gn,fC as yn,k2 as Sn,kk as st,kv as fn,qa as kn,kb as vn,z5 as In,iI as wn,kA as Cn,Nt as xn,iA as Bn,q1 as An,Nu as En,y0 as Dn,bG as jn,bs as Tn,Jn as Pn,cP as Fn,cO as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-DsxPZxrE.js";import{m as me,z as V,I as Ie,_ as We,C as le,j as y,aN as Ae,B as re,o as A,R as je,c as D,ba as Ln,p as z,a1 as qe,n as E,K as we,bb as rt,bc as ct,bd as Un,ak as Nn,y as _n,aH as Mn,w as Zt,D as Ke,Q as Qe,be as Gn,at as Ht,bf as On,V as zn,e as Wt,a6 as Zn,bg as Hn,bh as Wn,bi as qn,bj as Kn,bk as Qn,bl as Jn,bm as Xn,bn as Yn,bo as ei,s as ti,bp as ai,b5 as ni,bq as ii,br as oi,a9 as li}from"./index-CR1sBuly.js";import{n as U,S as si}from"./mui-hUAh7HgW.js";import{A as dt}from"./AddressScreen-9ZQKW4Vc.js";import{g as ie,a as Te,i as qt,V as Je,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-masdKbKT.js";import{a as f}from"./sentry-DsHW_1mX.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-D2I_ptqP.js";import{u as Kt}from"./useInitialThreadRequest-oMQ4nobf.js";import Ee from"./NotFoundScreen-DdK7GyZ6.js";import{D as ui}from"./DrawerScreen-D7lcO0VJ.js";import{M as Qt}from"./MobileAppDrawer-Ccfg2tLY.js";import{F as Jt}from"./FeaturePreviewScreen-D4qKJlp2.js";import{S as Pe}from"./SetupPagesScreen-CWz4vIj-.js";import{B as pi}from"./BillPayApprovalRoutes-WO8R24uy.js";import{FallBackRoute as mi}from"./ScreenRoutes-r_yq8fzi.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./analyticsHelper-CWJll2iT.js";import"./routePaths-BoWQ8YXQ.js";import"./BusinessVerificationPageScreen-Cwb0O2iw.js";import"./ReimbursementApprovalRuleDetailScreen-CNt84ZGM.js";import"./getLocaleForTenant-D8IeK8ro.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]="040711a9-1c8c-4ac6-b3d3-3b714d483e6c",e._sentryDebugIdIdentifier="sentry-dbid-040711a9-1c8c-4ac6-b3d3-3b714d483e6c")}catch{}})();const bi=X(function(e,t){const l=Ne(e,t.billId),i=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Bt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Ln);function hi(){const e=Q(),t=se(),l=J(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Ne(G,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,C]=f.useState(!1),[x,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:N}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=N(Ae.zeniAssistConfig),B=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&B===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,B,r]),f.useEffect(()=>{i!=null&&t(Ct(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(xt(i??"",$,L,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!0),t($e(!1,$,L,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:x,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=V.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=Q(),{billId:i}=ae(),c=J(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),C=v(F=>Z(F)),[x,_]=f.useState(!1),[T,N]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),B=v(F=>Me(F,m,g,i));let q=B.fetchState,W=B.file,L=B.showAutofill;const K=v(F=>Ne(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],L=!1);const Y=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?N(!1):!u&&x&&_(!1))},[i]),f.useEffect(()=>{x||i==null||u||(_(!0),t(xt(i,h,j,!1)),T||(N(!0),t($e(!1,h,j,b,i)))),u&&!T&&(N(!0),t($e(!1,h,j,b,i)))},[x,T,u,i,t]);const G={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(C.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,C.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||K.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:Y}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Nn,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ci,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:G,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:L,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,B),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=U.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-BEuWW_o5.js";import{a as N}from"./sentry-DsHW_1mX.js";import{l as ae,u as ne,h as se,i as ie,g as C,N as oe,n as re}from"./core-lbYY5woS.js";import{I as ce,C as ue,aN as de,z,R as pe,c as B,af as E,e as x,bz as le,at as me,n as P,au as R}from"./index-CsttCRun.js";import{Nf as fe,eQ as G,s9 as ye,HH as Se,xW as ge,AD as Ie,Da as be,DP as he,EI as De,NC as Oe,ND as Te,NE as ke,NF as Ce,NG as Ne,K9 as Ve,ME as we,Kl as Ae,kj as _e,fE as Fe,fD as ve,fC as Ee,qa as xe,q1 as ze,p_ as Be,kb as Pe,si as Re,sg as M,bE as L,su as U,cv as Me}from"./zeni-epic-state-DsxPZxrE.js";import{n as Le}from"./mui-hUAh7HgW.js";import{d as j}from"./routePaths-AncZCFgJ.js";import{M as Ue}from"./MobileAppDrawer-3z1V-CUc.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]="0c23c475-1025-48b4-987c-1d659b1b27c0",e._sentryDebugIdIdentifier="sentry-dbid-0c23c475-1025-48b4-987c-1d659b1b27c0")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-BEuWW_o5.js";import{a as N}from"./sentry-DsHW_1mX.js";import{l as ae,u as ne,h as se,i as ie,g as C,N as oe,n as re}from"./core-lbYY5woS.js";import{I as ce,C as ue,aN as de,z,R as pe,c as B,af as E,e as x,bz as le,at as me,n as P,au as R}from"./index-CR1sBuly.js";import{Nf as fe,eQ as G,s9 as ye,HH as Se,xW as ge,AD as Ie,Da as be,DP as he,EI as De,NC as Oe,ND as Te,NE as ke,NF as Ce,NG as Ne,K9 as Ve,ME as we,Kl as Ae,kj as _e,fE as Fe,fD as ve,fC as Ee,qa as xe,q1 as ze,p_ as Be,kb as Pe,si as Re,sg as M,bE as L,su as U,cv as Me}from"./zeni-epic-state-DsxPZxrE.js";import{n as Le}from"./mui-hUAh7HgW.js";import{d as j}from"./routePaths-BoWQ8YXQ.js";import{M as Ue}from"./MobileAppDrawer-Ccfg2tLY.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]="0c23c475-1025-48b4-987c-1d659b1b27c0",e._sentryDebugIdIdentifier="sentry-dbid-0c23c475-1025-48b4-987c-1d659b1b27c0")}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-BEuWW_o5.js";import{l as le,i as ia,h as ue,g as y,u as fe,n as pe,N as fa,s as ut,o as Wt,p as te}from"./core-lbYY5woS.js";import{eQ as ie,bs as Re,Pa as ka,eW as be,eX as ye,eY as Se,fT as Ge,cs as ze,Pb as Ke,Pc as Ma,to as ba,jL as ya,Pd as Sa,gQ as oa,zW as Qe,zY as $a,zZ as Ga,jB as mt,Pe as Ye,zK as Ct,Pf as qt,Pg as Jt,zN as Da,Ph as Xt,Nz as _a,rA as pt,zT as za,g$ as Qt,Pi as ht,Pj as Ze,bq as en,Pk as an,fE as Pa,fD as wa,Ar as tn,fC as Ta,Nf as nn,Pl as gt,cl as ft,cN as rn,Ny as da,B1 as sn,Pm as tt,AD as Fa,Pn as bt,B2 as on,N_ as cn,B3 as dn,BZ as ln,sK as un,BT as mn,Ac as yt,A5 as Cn,Po as pn,fV as hn,Al as St,Ap as It,fU as gn,Pp as fn,AP as At,Pq as bn,Pr as yn,Ps as Sn,An as Et,A8 as kt,zQ as Dt,Ah as _t,Af as Pt,Aj as In,zX as nt,Pt as wt,Pu as va,AA as Ia,Ke as Tt,cO as Ka,Pv as An,Pw as En,Px as kn,Py as Dn,Ax as Na,AW as _n,AS as Pn,At as wn,AU as Tn,AK as Fn,AM as vn,Pz as Ft,B0 as vt,HD as xn,PA as Bn,PB as Ln,PC as Un,PD as xt,PE as Rn,Bn as On,AC as Bt,Aw as ca,AB as jn,PF as Nn,PG as Vn,zH as Hn,PH as Lt,PI as Ut,PJ as Mn,zJ as $n,zI as rt,PK as Gn,PL as zn,PM as Kn,Ka as Yn,PN as Ya,PO as Zn,wi as Rt,kj as Wn,gR as qn,Bs as Jn,PP as Ot,PQ as Xn,Bt as Qn,PR as er,df as ar,ti as tr,Bi as nr,Bc as Ue,bv as rr,bF as sr,cx as or,bG as cr,Jn as ir}from"./zeni-epic-state-DsxPZxrE.js";import{z as Q,I as je,C as ce,j as K,B as la,c1 as xa,cc as dr,p as ve,cd as lr,ce as ur,K as ua,aN as Fe,n as ge,bk as Za,cf as mr,w as ma,h as Ba,m as Wa,c as J,D as qa,cg as Cr,_ as jt,aq as Ja,bw as Je,ch as Va,ci as pr,R as Xa,a6 as hr,cj as gr,at as Nt,a1 as Ha,V as Vt,e as Ht,ck as fr,cl as br,cm as yr,cn as Sr,co as Ir,cp as Ar,o as Aa,cq as Er,cr as kr,cs as Ra,s as Dr,ct as _r,cu as Pr,cv as wr,cw as Tr,cx as Fr,a9 as vr}from"./index-CsttCRun.js";import{n as _e,D as Mt,S as xr}from"./mui-hUAh7HgW.js";import{a as i}from"./sentry-DsHW_1mX.js";import{g as Ce,a as Ca,b as $t,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Qa,P as Lr,i as et,s as Xe,j as Gt,k as Me,l as zt,m as Ur,n as Kt,p as Rr,S as st}from"./SetupPagesScreen-BqUpkFrc.js";import La from"./NotFoundScreen-CcPbqGwL.js";import{M as $e}from"./MobileAppDrawer-3z1V-CUc.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-B6D1gPTU.js";import{v as ot}from"./utils-AZPawxk4.js";import{t as Or}from"./AddressScreen-Dic8fdZj.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./analyticsHelper-B0HqRRKS.js";import"./routePaths-AncZCFgJ.js";import"./BusinessVerificationPageScreen-BZ6pMYtD.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]="1d74f4d3-6813-4ac3-8823-56addc7b8253",e._sentryDebugIdIdentifier="sentry-dbid-1d74f4d3-6813-4ac3-8823-56addc7b8253")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=Q.getSignedInUser(),n=y(X=>ie(X)),C=je(),p=Re(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(K.isChargeCardFeatureEnabled),g=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=u(K.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(R,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,f=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>Ge(X,n.companyId)),N=ze(v.controllers),{creditAccount:L,creditAccountRepayment:w}=y(X=>Ke(X)),V=y(X=>X.classListState.fetchState),m=!_&&d&&g,l=y(X=>Ma(X,t,m,d)),[P,T]=i.useState(!1),H=l.chargeCard,U=H?.cardCreatedByUser?.userId,Z=y(X=>U!=null?ba(X.userRoleState,U):void 0),I=Z?.accountingClassIDs[0],B=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,O=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=O?.accountingClassIDs[0],E=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),z=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&z&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,z,q]),i.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Qe(t,m,!1)))},[P,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(z===!1||z&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,c);e(X)}},[l.fetchState,c,z]),i.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&g&&p&&a($a()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&g&&p&&a(Ga()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,g,p,V]);const G=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Oe(d,f,D,g),ae=Ca(d,g,p,L,w),ne=$t(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:G,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:f,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:g,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:Z?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=fe(),r=Q.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ye(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=fe(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[g,R]=i.useState(!1),F=Q.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,f=y(E=>Jt(E,n)),d=f.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(K.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(K.isDebitCardFeatureEnabled),w=Se(L,k),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),P=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),Z=!l&&U&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&f.fetchState==="Not-Started"&&(c(!0),a(Qe(n,Z,U)))},[o,f.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(f.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=ge(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:z}})}else if(_&&f.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=ge(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:z}})}}},[f.fetchState,d?.type.code,_,f.isRefreshingViewInBackground]);const B=Q.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};i.useEffect(()=>{f.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(O,3e3),A(!0))},[f.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{R(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Kr,{children:[s.jsx($e,{isAppContentDrawerOpen:g,handleDrawerToggle:W}),s.jsx(Gr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Za(),chargeCardDetailState:f,signedInUserToken:B,navigate:r,currentTenant:k,location:C,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(zr,{windowSize:t,children:e}):null]})},Gr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Qt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ze(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(Pa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),zr=_e.div`
1
+ import{j as s}from"./liveblocks-BEuWW_o5.js";import{l as le,i as ia,h as ue,g as y,u as fe,n as pe,N as fa,s as ut,o as Wt,p as te}from"./core-lbYY5woS.js";import{eQ as ie,bs as Re,Pa as ka,eW as be,eX as ye,eY as Se,fT as Ge,cs as ze,Pb as Ke,Pc as Ma,to as ba,jL as ya,Pd as Sa,gQ as oa,zW as Qe,zY as $a,zZ as Ga,jB as mt,Pe as Ye,zK as Ct,Pf as qt,Pg as Jt,zN as Da,Ph as Xt,Nz as _a,rA as pt,zT as za,g$ as Qt,Pi as ht,Pj as Ze,bq as en,Pk as an,fE as Pa,fD as wa,Ar as tn,fC as Ta,Nf as nn,Pl as gt,cl as ft,cN as rn,Ny as da,B1 as sn,Pm as tt,AD as Fa,Pn as bt,B2 as on,N_ as cn,B3 as dn,BZ as ln,sK as un,BT as mn,Ac as yt,A5 as Cn,Po as pn,fV as hn,Al as St,Ap as It,fU as gn,Pp as fn,AP as At,Pq as bn,Pr as yn,Ps as Sn,An as Et,A8 as kt,zQ as Dt,Ah as _t,Af as Pt,Aj as In,zX as nt,Pt as wt,Pu as va,AA as Ia,Ke as Tt,cO as Ka,Pv as An,Pw as En,Px as kn,Py as Dn,Ax as Na,AW as _n,AS as Pn,At as wn,AU as Tn,AK as Fn,AM as vn,Pz as Ft,B0 as vt,HD as xn,PA as Bn,PB as Ln,PC as Un,PD as xt,PE as Rn,Bn as On,AC as Bt,Aw as ca,AB as jn,PF as Nn,PG as Vn,zH as Hn,PH as Lt,PI as Ut,PJ as Mn,zJ as $n,zI as rt,PK as Gn,PL as zn,PM as Kn,Ka as Yn,PN as Ya,PO as Zn,wi as Rt,kj as Wn,gR as qn,Bs as Jn,PP as Ot,PQ as Xn,Bt as Qn,PR as er,df as ar,ti as tr,Bi as nr,Bc as Ue,bv as rr,bF as sr,cx as or,bG as cr,Jn as ir}from"./zeni-epic-state-DsxPZxrE.js";import{z as Q,I as je,C as ce,j as K,B as la,c1 as xa,cc as dr,p as ve,cd as lr,ce as ur,K as ua,aN as Fe,n as ge,bk as Za,cf as mr,w as ma,h as Ba,m as Wa,c as J,D as qa,cg as Cr,_ as jt,aq as Ja,bw as Je,ch as Va,ci as pr,R as Xa,a6 as hr,cj as gr,at as Nt,a1 as Ha,V as Vt,e as Ht,ck as fr,cl as br,cm as yr,cn as Sr,co as Ir,cp as Ar,o as Aa,cq as Er,cr as kr,cs as Ra,s as Dr,ct as _r,cu as Pr,cv as wr,cw as Tr,cx as Fr,a9 as vr}from"./index-CR1sBuly.js";import{n as _e,D as Mt,S as xr}from"./mui-hUAh7HgW.js";import{a as i}from"./sentry-DsHW_1mX.js";import{g as Ce,a as Ca,b as $t,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Qa,P as Lr,i as et,s as Xe,j as Gt,k as Me,l as zt,m as Ur,n as Kt,p as Rr,S as st}from"./SetupPagesScreen-CWz4vIj-.js";import La from"./NotFoundScreen-DdK7GyZ6.js";import{M as $e}from"./MobileAppDrawer-Ccfg2tLY.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-D2I_ptqP.js";import{v as ot}from"./utils-AZPawxk4.js";import{t as Or}from"./AddressScreen-9ZQKW4Vc.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./analyticsHelper-CWJll2iT.js";import"./routePaths-BoWQ8YXQ.js";import"./BusinessVerificationPageScreen-Cwb0O2iw.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]="1d74f4d3-6813-4ac3-8823-56addc7b8253",e._sentryDebugIdIdentifier="sentry-dbid-1d74f4d3-6813-4ac3-8823-56addc7b8253")}catch{}})();function jr(){const e=le(),{cardId:t}=ia(),a=ue(),r=Q.getSignedInUser(),n=y(X=>ie(X)),C=je(),p=Re(C?.loggedInUserRoleMap),{useFeatureGate:u}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(X=>ka(X).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=u(K.isChargeCardFeatureEnabled),g=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:R}=u(K.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(R,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,f=Ie({isDebitCardFeatureEnabled:R,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:f,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(X=>Ge(X,n.companyId)),N=ze(v.controllers),{creditAccount:L,creditAccountRepayment:w}=y(X=>Ke(X)),V=y(X=>X.classListState.fetchState),m=!_&&d&&g,l=y(X=>Ma(X,t,m,d)),[P,T]=i.useState(!1),H=l.chargeCard,U=H?.cardCreatedByUser?.userId,Z=y(X=>U!=null?ba(X.userRoleState,U):void 0),I=Z?.accountingClassIDs[0],B=y(X=>I!=null?ya(X.classState,{classId:I,reportId:"class_list"}):void 0),j=H?.cardHolderUser?.userId,O=y(X=>j!=null?ba(X.userRoleState,j):void 0),W=O?.accountingClassIDs[0],E=y(X=>W!=null?ya(X.classState,{classId:W,reportId:"class_list"}):void 0),z=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&z&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,z,q]),i.useEffect(()=>{P||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Qe(t,m,!1)))},[P,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(z===!1||z&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const X=Ce(n.tenantEmailDomain,t,r,H,c);e(X)}},[l.fetchState,c,z]),i.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&g&&p&&a($a()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&g&&p&&a(Ga()),V!=="Completed"&&V!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,g,p,V]);const G=()=>{if(r!=null&&t!=null){a(Sa());const X=Ce(n.tenantEmailDomain,t,r);e(X)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Oe(d,f,D,g),ae=Ca(d,g,p,L,w),ne=$t(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(dr,{onGotItClick:G,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:f,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:g,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:V,creditAccountRepayment:w,cardIssuedByRoles:Z?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Vr(){const e=le(),t=ue(),a=fe(),r=Q.getSignedInUser(),n=y(o=>ie(o)),[C,p]=i.useState(!1),u=y(o=>Ye(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??Hr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{C||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(p(!0),t(Ct()))},[C,u,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return u.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:S}):u.cashbackSummary.cashbackEarned.amount===0&&u.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Nr,{onBackClick:S})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new ma(100,58)},$r=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ia(),C=fe(),{useDynamicConfig:p}=ce(),[u,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[g,R]=i.useState(!1),F=Q.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=p(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,f=y(E=>Jt(E,n)),d=f.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:N}=v(K.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=v(K.isDebitCardFeatureEnabled),w=Se(L,k),V=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),m=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),P=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Ae({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:N,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),Z=!l&&U&&m;i.useEffect(()=>{u===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&f.fetchState==="Not-Started"&&(c(!0),a(Qe(n,Z,U)))},[o,f.fetchState,u,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(f.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=ge(C.state?.pathnameStackToGoBack,C.pathname);r(E,{state:{pathnameStackToGoBack:z}})}else if(_&&f.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Xt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),z=ge(C.state?.pathnameStackToGoBack,C.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:z}})}}},[f.fetchState,d?.type.code,_,f.isRefreshingViewInBackground]);const B=Q.getZeniOtpTokenForCardHolder(n),j=y(E=>pt(E.userState,F.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};i.useEffect(()=>{f.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(O,3e3),A(!0))},[f.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{R(E)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Kr,{children:[s.jsx($e,{isAppContentDrawerOpen:g,handleDrawerToggle:W}),s.jsx(Gr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:F,isSandboxEnv:Za(),chargeCardDetailState:f,signedInUserToken:B,navigate:r,currentTenant:k,location:C,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(zr,{windowSize:t,children:e}):null]})},Gr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const C=Qt(e.addressState,a);if(C==null)throw Error("Can't access shippingAddress.");const p=ht(e,n),u=t.updateStatus,S=Ze(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||c,showMenuIcon:o,shippingAddress:C,vgsVaultId:Ba.cardVaultId,twoFAView:p,activationWaitStatus:u,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:C,chargeCardDetailState:p}=t,u=p.chargeCard?.cardProviderID,{tenantEmailDomain:S}=C;return{onGetOtp:o=>{u!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{u!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{u!=null&&e(Pa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&Q.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),zr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1mX.js";import{l as w,h as T,u as k,i as x,g as b,n as E}from"./core-lbYY5woS.js";import{z as C,b5 as F,R as P,c as V,e as A,af as O,b6 as L,at as M,au as j,n as U}from"./index-CsttCRun.js";import{eQ as D,fG as B,s9 as _,fB as R,c2 as G,ME as z,bn as H,qa as Y,p_ as q,kb as Q,lH as S,MF as Z,bE as $,cv as N,lP as J,lS as K}from"./zeni-epic-state-DsxPZxrE.js";import"./mui-hUAh7HgW.js";import{d as W}from"./routePaths-AncZCFgJ.js";import{M as X}from"./MobileAppDrawer-3z1V-CUc.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]="b15a7548-8d0d-4d09-bbfa-81ae55f70b7b",a._sentryDebugIdIdentifier="sentry-dbid-b15a7548-8d0d-4d09-bbfa-81ae55f70b7b")}catch{}})();const ee=E(function(a){const t=R(a),i=C.getSignedInUser(),l=D(a),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=G(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(a.companyConfigState),n=a.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${M.fileMicroServiceBaseUrl}`,isZeniUser:H(i)}},function(a,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{a(K())},onAddressClick:e=>{const n=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{a(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:j(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};a(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{a(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{a(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=>{a(Z(e))},onCompanyOfficerUpdated:e=>{a(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=>{a(Q({files:e}))},onDeleteFile:e=>{a(q(e))},onEditFileName:(e,n)=>{a(Y(e,n.split(".")[0]))}}})(L);function de(){const a=w(),t=T(),i=k(),{tenantEmailDomain:l}=x(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=b(s=>s.companyViewState.passportView.fetchState),o=b(s=>s.companyConfigState.fetchState),r=b(s=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,n,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>a("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(A.Event.companyPassport,O(i)?"Settings":"Company Passport")}),O(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:a,location:i,isLoading:y,currentTenant:r,isSettings:O(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1mX.js";import{l as w,h as T,u as k,i as x,g as b,n as E}from"./core-lbYY5woS.js";import{z as C,b5 as F,R as P,c as V,e as A,af as O,b6 as L,at as M,au as j,n as U}from"./index-CR1sBuly.js";import{eQ as D,fG as B,s9 as _,fB as R,c2 as G,ME as z,bn as H,qa as Y,p_ as q,kb as Q,lH as S,MF as Z,bE as $,cv as N,lP as J,lS as K}from"./zeni-epic-state-DsxPZxrE.js";import"./mui-hUAh7HgW.js";import{d as W}from"./routePaths-BoWQ8YXQ.js";import{M as X}from"./MobileAppDrawer-Ccfg2tLY.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]="b15a7548-8d0d-4d09-bbfa-81ae55f70b7b",a._sentryDebugIdIdentifier="sentry-dbid-b15a7548-8d0d-4d09-bbfa-81ae55f70b7b")}catch{}})();const ee=E(function(a){const t=R(a),i=C.getSignedInUser(),l=D(a),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=G(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(a.companyConfigState),n=a.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${M.fileMicroServiceBaseUrl}`,isZeniUser:H(i)}},function(a,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{a(K())},onAddressClick:e=>{const n=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{a(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:j(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?$(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};a(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{a(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{a(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=>{a(Z(e))},onCompanyOfficerUpdated:e=>{a(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=>{a(Q({files:e}))},onDeleteFile:e=>{a(q(e))},onEditFileName:(e,n)=>{a(Y(e,n.split(".")[0]))}}})(L);function de(){const a=w(),t=T(),i=k(),{tenantEmailDomain:l}=x(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=b(s=>s.companyViewState.passportView.fetchState),o=b(s=>s.companyConfigState.fetchState),r=b(s=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,n,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>a("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(A.Event.companyPassport,O(i)?"Settings":"Company Passport")}),O(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:a,location:i,isLoading:y,currentTenant:r,isSettings:O(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-BEuWW_o5.js";import{a}from"./sentry-DsHW_1mX.js";import{h as D,u as v,g as u,N as w}from"./core-lbYY5woS.js";import{Jj as A,eQ as O,fn as U,mT as j,fP as b,fm as _,eU as L,Jq as F}from"./zeni-epic-state-DsxPZxrE.js";import{u as $,z as p,L as g,D as k,o as H}from"./index-CsttCRun.js";import{n as P}from"./mui-hUAh7HgW.js";import{t as z}from"./getLocaleForTenant-BJg8tROe.js";import{g as Q,Q as J}from"./QBOConnectionScreen-BVyeqZrM.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./empty-DuvQh38L.js";import"./pdf-lib-CQ6bcQhi.js";import"./index-DBlyACY-.js";import"./url-CPbSl3Sf.js";import"./index-9bPjdOkz.js";import"./decodeURIComponentSafe-Bt7TpCfB.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]="83bb252d-3875-4dcb-bf63-e9090e6372a9",t._sentryDebugIdIdentifier="sentry-dbid-83bb252d-3875-4dcb-bf63-e9090e6372a9")}catch{}})();const R=P.div`
1
+ import{j as C}from"./liveblocks-BEuWW_o5.js";import{a}from"./sentry-DsHW_1mX.js";import{h as D,u as v,g as u,N as w}from"./core-lbYY5woS.js";import{Jj as A,eQ as O,fn as U,mT as j,fP as b,fm as _,eU as L,Jq as F}from"./zeni-epic-state-DsxPZxrE.js";import{u as $,z as p,L as g,D as k,o as H}from"./index-CR1sBuly.js";import{n as P}from"./mui-hUAh7HgW.js";import{t as z}from"./getLocaleForTenant-D8IeK8ro.js";import{g as Q,Q as J}from"./QBOConnectionScreen-MmUXgGtM.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./empty-DuvQh38L.js";import"./pdf-lib-CQ6bcQhi.js";import"./index-DBlyACY-.js";import"./url-CPbSl3Sf.js";import"./index-9bPjdOkz.js";import"./decodeURIComponentSafe-Bt7TpCfB.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]="83bb252d-3875-4dcb-bf63-e9090e6372a9",t._sentryDebugIdIdentifier="sentry-dbid-83bb252d-3875-4dcb-bf63-e9090e6372a9")}catch{}})();const R=P.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-BEuWW_o5.js";import{z as a}from"./index-CsttCRun.js";import{g as n}from"./QBOConnectionScreen-BVyeqZrM.js";import"./sentry-DsHW_1mX.js";import{u as p,N as s}from"./core-lbYY5woS.js";import"./zeni-epic-state-DsxPZxrE.js";import"./recharts-aApoEySM.js";import"./mui-hUAh7HgW.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./empty-DuvQh38L.js";import"./pdf-lib-CQ6bcQhi.js";import"./index-DBlyACY-.js";import"./url-CPbSl3Sf.js";import"./index-9bPjdOkz.js";import"./decodeURIComponentSafe-Bt7TpCfB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="8d904e89-6b8e-4c86-980c-585a84d9d789",t._sentryDebugIdIdentifier="sentry-dbid-8d904e89-6b8e-4c86-980c-585a84d9d789")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
1
+ import{j as i}from"./liveblocks-BEuWW_o5.js";import{z as a}from"./index-CR1sBuly.js";import{g as n}from"./QBOConnectionScreen-MmUXgGtM.js";import"./sentry-DsHW_1mX.js";import{u as p,N as s}from"./core-lbYY5woS.js";import"./zeni-epic-state-DsxPZxrE.js";import"./recharts-aApoEySM.js";import"./mui-hUAh7HgW.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./empty-DuvQh38L.js";import"./pdf-lib-CQ6bcQhi.js";import"./index-DBlyACY-.js";import"./url-CPbSl3Sf.js";import"./index-9bPjdOkz.js";import"./decodeURIComponentSafe-Bt7TpCfB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="8d904e89-6b8e-4c86-980c-585a84d9d789",t._sentryDebugIdIdentifier="sentry-dbid-8d904e89-6b8e-4c86-980c-585a84d9d789")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BEuWW_o5.js";import{t as Ke,A as Ce}from"./AddressScreen-Dic8fdZj.js";import $e from"./NotFoundScreen-CcPbqGwL.js";import{a as g}from"./sentry-DsHW_1mX.js";import{l as oe,u as se,h as ie,i as re,g as D,N as E,n as ce,k as ze,o as Me,p as z}from"./core-lbYY5woS.js";import{s as de,I as le,z as B,C as ue,m as qe,j as _,n as V,R as W,c as N,B as we,e as Y,ap as Qe,K as Ze,aq as ke,h as te,ar as He,as as Ie,o as We,at as Je,au as Ee,av as Ye}from"./index-CsttCRun.js";import{bn as Xe,eQ as ee,ff as et,eY as pe,eW as me,bv as tt,mR as at,fb as nt,bO as ot,jf as ae,ji as ve,JP as st,bT as it,c2 as ge,sn as fe,s8 as rt,Kj as X,so as _e,HH as ct,kj as Ue,Kk as Ve,Kl as dt,Km as lt,Kn as ut,jd as pt,jg as mt,sa as Be,sm as gt,bE as Te,cv as ft,sA as xe,qa as ht,p_ as yt,kb as bt,fE as St,fD as Ct,fC as kt,Ko as It,s2 as Et,sB as Tt,sE as xt,sH as Ot,sN as Pt,cU as At}from"./zeni-epic-state-DsxPZxrE.js";import{n as he}from"./mui-hUAh7HgW.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-BVyeqZrM.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./empty-DuvQh38L.js";import"./pdf-lib-CQ6bcQhi.js";import"./index-DBlyACY-.js";import"./url-CPbSl3Sf.js";import"./index-9bPjdOkz.js";import"./decodeURIComponentSafe-Bt7TpCfB.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]="1caa415b-772c-4da7-893b-4cfd0b0a3f7b",t._sentryDebugIdIdentifier="sentry-dbid-1caa415b-772c-4da7-893b-4cfd0b0a3f7b")}catch{}})();const jt=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"}})}}})(Qe),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),A=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&A.push("top_expenses"),$===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),k===!1&&A.push("zeni_accounts_promo_card"),h===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{b(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)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(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-BEuWW_o5.js";import{t as Ke,A as Ce}from"./AddressScreen-9ZQKW4Vc.js";import $e from"./NotFoundScreen-DdK7GyZ6.js";import{a as g}from"./sentry-DsHW_1mX.js";import{l as oe,u as se,h as ie,i as re,g as D,N as E,n as ce,k as ze,o as Me,p as z}from"./core-lbYY5woS.js";import{s as de,I as le,z as B,C as ue,m as qe,j as _,n as V,R as W,c as N,B as we,e as Y,ap as Qe,K as Ze,aq as ke,h as te,ar as He,as as Ie,o as We,at as Je,au as Ee,av as Ye}from"./index-CR1sBuly.js";import{bn as Xe,eQ as ee,ff as et,eY as pe,eW as me,bv as tt,mR as at,fb as nt,bO as ot,jf as ae,ji as ve,JP as st,bT as it,c2 as ge,sn as fe,s8 as rt,Kj as X,so as _e,HH as ct,kj as Ue,Kk as Ve,Kl as dt,Km as lt,Kn as ut,jd as pt,jg as mt,sa as Be,sm as gt,bE as Te,cv as ft,sA as xe,qa as ht,p_ as yt,kb as bt,fE as St,fD as Ct,fC as kt,Ko as It,s2 as Et,sB as Tt,sE as xt,sH as Ot,sN as Pt,cU as At}from"./zeni-epic-state-DsxPZxrE.js";import{n as he}from"./mui-hUAh7HgW.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-MmUXgGtM.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./empty-DuvQh38L.js";import"./pdf-lib-CQ6bcQhi.js";import"./index-DBlyACY-.js";import"./url-CPbSl3Sf.js";import"./index-9bPjdOkz.js";import"./decodeURIComponentSafe-Bt7TpCfB.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]="1caa415b-772c-4da7-893b-4cfd0b0a3f7b",t._sentryDebugIdIdentifier="sentry-dbid-1caa415b-772c-4da7-893b-4cfd0b0a3f7b")}catch{}})();const jt=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"}})}}})(Qe),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Xe(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),A=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&A.push("top_expenses"),$===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),k===!1&&A.push("zeni_accounts_promo_card"),h===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{b(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)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(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=he.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-BEuWW_o5.js";import{i as K,g as k,u as Q,h as z,l as H,n as J,j as ta,o as ut,p as F}from"./core-lbYY5woS.js";import{eQ as U,KE as Ze,bE as aa,bq as ve,LR as Sn,i3 as yn,LS as Yt,LT as An,i6 as mt,LU as ze,LV as vn,ib as En,LW as Gt,LX as In,ig as pt,LY as Ke,LZ as Tn,cl as gt,L_ as xn,L$ as Dn,KY as wn,j9 as Fn,M0 as On,bn as Re,M1 as na,Ks as re,bc as oa,jn as sa,m$ as ra,j6 as ia,Ku as ie,Kt as X,f7 as ca,eS as Pn,fp as ht,M2 as Mn,M3 as Rn,M4 as la,M5 as we,uh as Be,ui as je,uF as Ee,uz as ce,um as Le,M6 as Bn,M7 as jn,M8 as Ln,M9 as da,Ma as Fe,Mb as Un,dE as Qe,qK as ua,Mc as Yn,Md as Gn,Me as Vn,Mf as bt,JR as Ct,jD as Ie,uN as _t,qS as Nn,Mg as $n,uj as Vt,qN as ye,qJ as ma,Mh as pe,Mi as zn,Mj as kt,JQ as St,sR as pa,Mk as Kn,Ml as qn,Mm as Zn,Mn as yt,t2 as Qn,Mo as Hn,ul as Nt,sQ as ha,Mp as he,Mq as Wn,bv as fa,uR as ga,Mr as Xn,Ms as Jn,Mt as eo,Mu as At,uM as to,Mv as ao,uk as $t,uQ as ba,Mw as fe,Mx as no,My as oo,Mz as Ca,js as _a,mY as ka,jx as Sa,mW as ya,mV as Aa,mU as va,sd as so,ff as ro,cO as io,cP as co,mR as lo,fb as uo,n6 as mo,DV as zt,MA as po,MB as ho,MC as fo,MD as go,b5 as He,f2 as bo,gO as Co,fG as _o,n0 as ko,i$ as So,mZ as yo,mX as Ao,eY as vo,eW as Eo}from"./zeni-epic-state-DsxPZxrE.js";import{z as j,a1 as ee,n as D,c as T,D as q,aU as Io,_ as Ue,R as Ye,aV as Ea,e as N,aW as To,I as be,aX as Ia,C as Ce,j as M,m as xo,aY as Do,aZ as wo,O as Ta,K as xa,a as Da,Y as Fo,a_ as Oo,J as Po,aN as wa,a$ as Fa,b0 as Oa,a0 as Pa,b1 as Mo,b2 as Ro,aq as Bo,p as jo,V as Lo,b3 as Uo,b4 as ge}from"./index-CsttCRun.js";import{n as vt}from"./mui-hUAh7HgW.js";import{a as b}from"./sentry-DsHW_1mX.js";import{w as Ma}from"./withTransactionSidePanel-C9nI8iAG.js";import{c as Ra,t as Te,f as le,a as Et,v as Yo}from"./routePaths-AncZCFgJ.js";import{u as te}from"./useAskAiCfoHostNavButtonProps-B6D1gPTU.js";import Me from"./NotFoundScreen-CcPbqGwL.js";import{u as It}from"./useInitialThreadRequest-Ce_TAmYW.js";import{t as Ba}from"./analyticsHelper-B0HqRRKS.js";import{C as Go}from"./CompanyPassportScreen-Crt0Wguw.js";import{u as Vo}from"./useAiCfoDashboardSuggestedQuestionsChips-BOZLDiKO.js";import{F as No}from"./FeaturePreviewScreen-ZZAPjaff.js";import{R as $o}from"./ReferralListScreen-Dos23hEe.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./TransactionDetailScreen-DIVwpSfj.js";import"./decodeURIComponentSafe-Bt7TpCfB.js";import"./MobileAppDrawer-3z1V-CUc.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]="7f695011-1a23-4203-94ba-530fac8c2103",e._sentryDebugIdIdentifier="sentry-dbid-7f695011-1a23-4203-94ba-530fac8c2103")}catch{}})();const zo=Ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(A=>A.tenantState.currentTenantId),c=k(A=>U(A)),{tenantEmailDomain:m}=K(),g=Q(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ee}/agingDetailedReport`,timezone:Ze()}),[]),h=b.useMemo(()=>r!=null?aa(r):ve(),[r]),p=z(),f=H(),y=k(A=>Sn(A,h,o)),I=b.useCallback(()=>{o!=null&&y.fetchState!=="In-Progress"&&y.fetchState!=="Completed"&&p(yn(o,h))},[h]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),E=b.useCallback((A,L)=>{p(Yt({sortKey:A,sortOrder:L}))},[]),x=b.useCallback(A=>{p(Yt({downloadState:A}))},[]),R=b.useCallback(A=>{if(e)e(A.transactionId,A.transactionType);else if(m!=null){const L=Ra({id:A.transactionId,type:A.transactionType},m);f(L);const de=D(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:de}})}},[m,e]),S=b.useCallback(()=>{y.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),y.vendor.id,y.vendor.name)},[y.vendor,h]);return b.useEffect(()=>{I()},[]),b.useEffect(()=>{y.fetchState==="Completed"&&S()},[S,y.fetchState]),d.jsx(Io,{apAgingDetail:y,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:R,onReload:I,onBackClick:_,onColumnSortConfigChanged:E,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ko=()=>{const e=z(),a=H(),t=k(E=>An(E)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=te({mobileExploreReferrer:"AP Aging"});Ue({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=k(E=>E.tenantState.currentTenantId),i=k(E=>U(E)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ee}/agingReport`,timezone:Ze()}),[]),C=t.apAgingUIState.selectedDate??ve(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(mt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(E=>{e(ze({searchString:E}))},[]),p=b.useCallback((E,x)=>{e(ze({sortKey:x,sortOrder:E}))},[]),f=b.useCallback(E=>{a(`./${E}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),y=b.useCallback(E=>{e(ze({downloadState:E}))},[]),I=b.useCallback((E,x)=>{},[]),_=b.useCallback((E,x)=>{e(ze({selectedDate:E,agingDateSelectionType:x})),e(mt(E))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:E=>E.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Ea,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:y,onSelectedDateChanged:_,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},qo=Ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(S=>U(S)),{tenantEmailDomain:c}=K(),m=Q(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ee}/agingDetailedReport`,timezone:Ze()}),[]),l=b.useMemo(()=>r!=null?aa(r):ve(),[r]),h=z(),p=H(),f=k(S=>vn(S,l,o)),y=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(En(o,l))},[l]),I=b.useCallback(()=>{p("../../",{relative:"path"})},[]),_=b.useCallback((S,A)=>{h(Gt({sortKey:S,sortOrder:A}))},[]),E=b.useCallback(S=>{h(Gt({downloadState:S}))},[]),x=b.useCallback(S=>{if(e)e(S.transactionId,S.transactionType);else if(c!=null){const A=Ra({id:S.transactionId,type:S.transactionType},c);p(A);const L=D(m.state?.pathnameStackToGoBack,m.pathname);p(A,{state:{pathnameStackToGoBack:L}})}},[c,e]),R=b.useCallback(()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&R()},[f.fetchState,R]),d.jsx(To,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:x,onReload:y,onBackClick:I,onColumnSortConfigChanged:_,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Zo=()=>{const e=z(),a=H(),t=k(_=>In(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=te({mobileExploreReferrer:"AR Aging"});Ue({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=k(_=>U(_)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ee}/agingReport`,timezone:Ze()}),[]),g=t.arAgingUIState.selectedDate??ve(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(pt(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(_=>{e(Ke({searchString:_}))},[]),h=b.useCallback((_,E)=>{e(Ke({sortKey:E,sortOrder:_}))},[]),p=b.useCallback(_=>{a(`./${_}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(_=>{e(Ke({downloadState:_}))},[]),y=b.useCallback((_,E)=>{e(Ke({selectedDate:_,agingDateSelectionType:E})),e(pt(_))},[]),I=b.useCallback((_,E)=>{e(Tn({nodeId:_,isCollapsed:E}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:_=>_.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Ea,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:y,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ja=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function La(e,a){const t=wn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Te(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Fn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Qo=J(function(e){const a=xn(e).accountsInOrder.map((n,o)=>ja(n,o)),t=Dn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}},La)(Ia),Ho=J(function(e){const a=On(e).accountsInOrder.map((o,r)=>ja(o,r)),t=j.getSignedInUser(),n=Re(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}},La)(Ia);function Wo(){const e=H(),a=Q(),{tenantEmailDomain:t}=K(),n=be(),o=k(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=gt(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Me,{}):d.jsx(Qo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Xo(){const e=H(),a=Q(),{tenantEmailDomain:t}=K(),n=be(),o=gt(n?.loggedInUserRoleMap),r=k(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Me,{}):d.jsx(Ho,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Jo=vt.div`
1
+ import{j as d}from"./liveblocks-BEuWW_o5.js";import{i as K,g as k,u as Q,h as z,l as H,n as J,j as ta,o as ut,p as F}from"./core-lbYY5woS.js";import{eQ as U,KE as Ze,bE as aa,bq as ve,LR as Sn,i3 as yn,LS as Yt,LT as An,i6 as mt,LU as ze,LV as vn,ib as En,LW as Gt,LX as In,ig as pt,LY as Ke,LZ as Tn,cl as gt,L_ as xn,L$ as Dn,KY as wn,j9 as Fn,M0 as On,bn as Re,M1 as na,Ks as re,bc as oa,jn as sa,m$ as ra,j6 as ia,Ku as ie,Kt as X,f7 as ca,eS as Pn,fp as ht,M2 as Mn,M3 as Rn,M4 as la,M5 as we,uh as Be,ui as je,uF as Ee,uz as ce,um as Le,M6 as Bn,M7 as jn,M8 as Ln,M9 as da,Ma as Fe,Mb as Un,dE as Qe,qK as ua,Mc as Yn,Md as Gn,Me as Vn,Mf as bt,JR as Ct,jD as Ie,uN as _t,qS as Nn,Mg as $n,uj as Vt,qN as ye,qJ as ma,Mh as pe,Mi as zn,Mj as kt,JQ as St,sR as pa,Mk as Kn,Ml as qn,Mm as Zn,Mn as yt,t2 as Qn,Mo as Hn,ul as Nt,sQ as ha,Mp as he,Mq as Wn,bv as fa,uR as ga,Mr as Xn,Ms as Jn,Mt as eo,Mu as At,uM as to,Mv as ao,uk as $t,uQ as ba,Mw as fe,Mx as no,My as oo,Mz as Ca,js as _a,mY as ka,jx as Sa,mW as ya,mV as Aa,mU as va,sd as so,ff as ro,cO as io,cP as co,mR as lo,fb as uo,n6 as mo,DV as zt,MA as po,MB as ho,MC as fo,MD as go,b5 as He,f2 as bo,gO as Co,fG as _o,n0 as ko,i$ as So,mZ as yo,mX as Ao,eY as vo,eW as Eo}from"./zeni-epic-state-DsxPZxrE.js";import{z as j,a1 as ee,n as D,c as T,D as q,aU as Io,_ as Ue,R as Ye,aV as Ea,e as N,aW as To,I as be,aX as Ia,C as Ce,j as M,m as xo,aY as Do,aZ as wo,O as Ta,K as xa,a as Da,Y as Fo,a_ as Oo,J as Po,aN as wa,a$ as Fa,b0 as Oa,a0 as Pa,b1 as Mo,b2 as Ro,aq as Bo,p as jo,V as Lo,b3 as Uo,b4 as ge}from"./index-CR1sBuly.js";import{n as vt}from"./mui-hUAh7HgW.js";import{a as b}from"./sentry-DsHW_1mX.js";import{w as Ma}from"./withTransactionSidePanel-C6lz4d-6.js";import{c as Ra,t as Te,f as le,a as Et,v as Yo}from"./routePaths-BoWQ8YXQ.js";import{u as te}from"./useAskAiCfoHostNavButtonProps-D2I_ptqP.js";import Me from"./NotFoundScreen-DdK7GyZ6.js";import{u as It}from"./useInitialThreadRequest-oMQ4nobf.js";import{t as Ba}from"./analyticsHelper-CWJll2iT.js";import{C as Go}from"./CompanyPassportScreen-BLCufivU.js";import{u as Vo}from"./useAiCfoDashboardSuggestedQuestionsChips-Xp4UZg6R.js";import{F as No}from"./FeaturePreviewScreen-D4qKJlp2.js";import{R as $o}from"./ReferralListScreen-B2ACfYZr.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./TransactionDetailScreen-Dz99_JkB.js";import"./decodeURIComponentSafe-Bt7TpCfB.js";import"./MobileAppDrawer-Ccfg2tLY.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]="7f695011-1a23-4203-94ba-530fac8c2103",e._sentryDebugIdIdentifier="sentry-dbid-7f695011-1a23-4203-94ba-530fac8c2103")}catch{}})();const zo=Ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(A=>A.tenantState.currentTenantId),c=k(A=>U(A)),{tenantEmailDomain:m}=K(),g=Q(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ee}/agingDetailedReport`,timezone:Ze()}),[]),h=b.useMemo(()=>r!=null?aa(r):ve(),[r]),p=z(),f=H(),y=k(A=>Sn(A,h,o)),I=b.useCallback(()=>{o!=null&&y.fetchState!=="In-Progress"&&y.fetchState!=="Completed"&&p(yn(o,h))},[h]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),E=b.useCallback((A,L)=>{p(Yt({sortKey:A,sortOrder:L}))},[]),x=b.useCallback(A=>{p(Yt({downloadState:A}))},[]),R=b.useCallback(A=>{if(e)e(A.transactionId,A.transactionType);else if(m!=null){const L=Ra({id:A.transactionId,type:A.transactionType},m);f(L);const de=D(g.state?.pathnameStackToGoBack,g.pathname);f(L,{state:{pathnameStackToGoBack:de}})}},[m,e]),S=b.useCallback(()=>{y.vendor!=null&&T.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),y.vendor.id,y.vendor.name)},[y.vendor,h]);return b.useEffect(()=>{I()},[]),b.useEffect(()=>{y.fetchState==="Completed"&&S()},[S,y.fetchState]),d.jsx(Io,{apAgingDetail:y,downloadParams:l,reportDate:h,analytics:T,onTransactionClick:R,onReload:I,onBackClick:_,onColumnSortConfigChanged:E,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ko=()=>{const e=z(),a=H(),t=k(E=>An(E)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=te({mobileExploreReferrer:"AP Aging"});Ue({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=k(E=>E.tenantState.currentTenantId),i=k(E=>U(E)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ee}/agingReport`,timezone:Ze()}),[]),C=t.apAgingUIState.selectedDate??ve(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(mt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(E=>{e(ze({searchString:E}))},[]),p=b.useCallback((E,x)=>{e(ze({sortKey:x,sortOrder:E}))},[]),f=b.useCallback(E=>{a(`./${E}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),y=b.useCallback(E=>{e(ze({downloadState:E}))},[]),I=b.useCallback((E,x)=>{},[]),_=b.useCallback((E,x)=>{e(ze({selectedDate:E,agingDateSelectionType:x})),e(mt(E))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:E=>E.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Ea,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:T,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:y,onSelectedDateChanged:_,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},qo=Ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(S=>U(S)),{tenantEmailDomain:c}=K(),m=Q(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ee}/agingDetailedReport`,timezone:Ze()}),[]),l=b.useMemo(()=>r!=null?aa(r):ve(),[r]),h=z(),p=H(),f=k(S=>vn(S,l,o)),y=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(En(o,l))},[l]),I=b.useCallback(()=>{p("../../",{relative:"path"})},[]),_=b.useCallback((S,A)=>{h(Gt({sortKey:S,sortOrder:A}))},[]),E=b.useCallback(S=>{h(Gt({downloadState:S}))},[]),x=b.useCallback(S=>{if(e)e(S.transactionId,S.transactionType);else if(c!=null){const A=Ra({id:S.transactionId,type:S.transactionType},c);p(A);const L=D(m.state?.pathnameStackToGoBack,m.pathname);p(A,{state:{pathnameStackToGoBack:L}})}},[c,e]),R=b.useCallback(()=>{f.customer!=null&&T.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&R()},[f.fetchState,R]),d.jsx(To,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:T,onTransactionClick:x,onReload:y,onBackClick:I,onColumnSortConfigChanged:_,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Zo=()=>{const e=z(),a=H(),t=k(_=>In(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=te({mobileExploreReferrer:"AR Aging"});Ue({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=k(_=>U(_)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ee}/agingReport`,timezone:Ze()}),[]),g=t.arAgingUIState.selectedDate??ve(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(pt(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(_=>{e(Ke({searchString:_}))},[]),h=b.useCallback((_,E)=>{e(Ke({sortKey:E,sortOrder:_}))},[]),p=b.useCallback(_=>{a(`./${_}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(_=>{e(Ke({downloadState:_}))},[]),y=b.useCallback((_,E)=>{e(Ke({selectedDate:_,agingDateSelectionType:E})),e(pt(_))},[]),I=b.useCallback((_,E)=>{e(Tn({nodeId:_,isCollapsed:E}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:_=>_.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Ea,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:y,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ja=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function La(e,a){const t=wn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Te(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Fn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?T.trackZeniAccountsCashBalancePromoClicked("Move Money"):(T.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else T.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Qo=J(function(e){const a=xn(e).accountsInOrder.map((n,o)=>ja(n,o)),t=Dn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:T}},La)(Ia),Ho=J(function(e){const a=On(e).accountsInOrder.map((o,r)=>ja(o,r)),t=j.getSignedInUser(),n=Re(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}},La)(Ia);function Wo(){const e=H(),a=Q(),{tenantEmailDomain:t}=K(),n=be(),o=k(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=gt(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Me,{}):d.jsx(Qo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Xo(){const e=H(),a=Q(),{tenantEmailDomain:t}=K(),n=be(),o=gt(n?.loggedInUserRoleMap),r=k(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Me,{}):d.jsx(Ho,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Jo=vt.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-BEuWW_o5.js";import{a as u}from"./sentry-DsHW_1mX.js";import{h as y,g as p,n as w,u as A,N as k}from"./core-lbYY5woS.js";import{Jj as N,eQ as _,fn as U,Jk as L,mT as R,Jl as z}from"./zeni-epic-state-DsxPZxrE.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-CsttCRun.js";import"./mui-hUAh7HgW.js";import{t as P}from"./getLocaleForTenant-BJg8tROe.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.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]="1da5db94-1e11-4dcb-b3e5-f9b9df39bc48",t._sentryDebugIdIdentifier="sentry-dbid-1da5db94-1e11-4dcb-b3e5-f9b9df39bc48")}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(),b=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=b.get("question")?.replace(/^["']|["']$/g,"")??null,e=b.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,b);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),b=u.useRef(null),m=p(e=>N(e)),n=p(e=>e.tenantState.fetchState),i=p(e=>e.tenantState.error),a=p(e=>e.tenantState.activeTenantFetchState.fetchState),c=p(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;b.current!==e&&(b.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const J=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of J)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-BEuWW_o5.js";import{a as u}from"./sentry-DsHW_1mX.js";import{h as y,g as p,n as w,u as A,N as k}from"./core-lbYY5woS.js";import{Jj as N,eQ as _,fn as U,Jk as L,mT as R,Jl as z}from"./zeni-epic-state-DsxPZxrE.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-CR1sBuly.js";import"./mui-hUAh7HgW.js";import{t as P}from"./getLocaleForTenant-D8IeK8ro.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.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]="1da5db94-1e11-4dcb-b3e5-f9b9df39bc48",t._sentryDebugIdIdentifier="sentry-dbid-1da5db94-1e11-4dcb-b3e5-f9b9df39bc48")}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(),b=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=b.get("question")?.replace(/^["']|["']$/g,"")??null,e=b.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,b);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),b=u.useRef(null),m=p(e=>N(e)),n=p(e=>e.tenantState.fetchState),i=p(e=>e.tenantState.error),a=p(e=>e.tenantState.activeTenantFetchState.fetchState),c=p(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;b.current!==e&&(b.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const J=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of J)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BEuWW_o5.js";import{l as w,u as C,g as h,n as A,i as B}from"./core-lbYY5woS.js";import{Nl as k,Ns as K,fE as q,fD as M,fC as Q,iA as W,Kt as J,q1 as L,eQ as V,MT as D,iy as T,Nm as v,Nv as F,iw as G,iT as N}from"./zeni-epic-state-DsxPZxrE.js";import{bs as X,K as j,C as R,z as U,m as O,p,j as S,B as Z,bt as Y,o as z,bu as ee,n as te}from"./index-CsttCRun.js";import{n as H}from"./mui-hUAh7HgW.js";import"./sentry-DsHW_1mX.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]="dbe5ca74-656c-4955-913f-3a016b83dfbb",e._sentryDebugIdIdentifier="sentry-dbid-dbe5ca74-656c-4955-913f-3a016b83dfbb")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(J("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(K(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
1
+ import{j as l}from"./liveblocks-BEuWW_o5.js";import{l as w,u as C,g as h,n as A,i as B}from"./core-lbYY5woS.js";import{Nl as k,Ns as K,fE as q,fD as M,fC as Q,iA as W,Kt as J,q1 as L,eQ as V,MT as D,iy as T,Nm as v,Nv as F,iw as G,iT as N}from"./zeni-epic-state-DsxPZxrE.js";import{bs as X,K as j,C as R,z as U,m as O,p,j as S,B as Z,bt as Y,o as z,bu as ee,n as te}from"./index-CR1sBuly.js";import{n as H}from"./mui-hUAh7HgW.js";import"./sentry-DsHW_1mX.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]="dbe5ca74-656c-4955-913f-3a016b83dfbb",e._sentryDebugIdIdentifier="sentry-dbid-dbe5ca74-656c-4955-913f-3a016b83dfbb")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(J("common")),n!=null&&e(L(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(K(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-BEuWW_o5.js";import{K as l,w as f,m as c}from"./index-CsttCRun.js";import{D as p}from"./mui-hUAh7HgW.js";import"./sentry-DsHW_1mX.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]="f52e2d2c-9a6b-4671-9467-14f9341190b0",e._sentryDebugIdIdentifier="sentry-dbid-f52e2d2c-9a6b-4671-9467-14f9341190b0")}catch{}})();const b={drawerLeftMargin:new f(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=l(),a=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
1
+ import{j as i}from"./liveblocks-BEuWW_o5.js";import{K as l,w as f,m as c}from"./index-CR1sBuly.js";import{D as p}from"./mui-hUAh7HgW.js";import"./sentry-DsHW_1mX.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]="f52e2d2c-9a6b-4671-9467-14f9341190b0",e._sentryDebugIdIdentifier="sentry-dbid-f52e2d2c-9a6b-4671-9467-14f9341190b0")}catch{}})();const b={drawerLeftMargin:new f(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=l(),a=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BEuWW_o5.js";import{a as d}from"./sentry-DsHW_1mX.js";import{l as B,h as G,u as F,i as K,g as l,N as q,n as L,o as N,p as _}from"./core-lbYY5woS.js";import{LA as z,eQ as O,KZ as R,kD as H,Hz as b,LF as M,Ks as W,jD as Y,HA as S,L2 as $,L3 as Q,Ku as V,Kt as Z}from"./zeni-epic-state-DsxPZxrE.js";import{aR as J,c as U,p as X,n as tt}from"./index-CsttCRun.js";import"./mui-hUAh7HgW.js";import{d as k}from"./decodeURIComponentSafe-Bt7TpCfB.js";import{w as et}from"./withTransactionSidePanel-C9nI8iAG.js";import{f as at,c as nt}from"./routePaths-AncZCFgJ.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./useAskAiCfoHostNavButtonProps-B6D1gPTU.js";import"./TransactionDetailScreen-DIVwpSfj.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]="be5d4eaf-19e4-4124-9ec0-69bf89660af4",a._sentryDebugIdIdentifier="sentry-dbid-be5d4eaf-19e4-4124-9ec0-69bf89660af4")}catch{}})();const ot=L(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:Y(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(V({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Z("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=X(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(J),it=et(function({entityType:a,...t}){const e=B(),o=G(),c=F(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:j}=K(),r=k(x??""),p=k(j??""),f=rt(r,p),v=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),w=l(n=>O(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(H(i)))},[m,f,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,A=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(b(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:w,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:I(v.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
1
+ import{j as s}from"./liveblocks-BEuWW_o5.js";import{a as d}from"./sentry-DsHW_1mX.js";import{l as B,h as G,u as F,i as K,g as l,N as q,n as L,o as N,p as _}from"./core-lbYY5woS.js";import{LA as z,eQ as O,KZ as R,kD as H,Hz as b,LF as M,Ks as W,jD as Y,HA as S,L2 as $,L3 as Q,Ku as V,Kt as Z}from"./zeni-epic-state-DsxPZxrE.js";import{aR as J,c as U,p as X,n as tt}from"./index-CR1sBuly.js";import"./mui-hUAh7HgW.js";import{d as k}from"./decodeURIComponentSafe-Bt7TpCfB.js";import{w as et}from"./withTransactionSidePanel-C6lz4d-6.js";import{f as at,c as nt}from"./routePaths-BoWQ8YXQ.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./useAskAiCfoHostNavButtonProps-D2I_ptqP.js";import"./TransactionDetailScreen-Dz99_JkB.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]="be5d4eaf-19e4-4124-9ec0-69bf89660af4",a._sentryDebugIdIdentifier="sentry-dbid-be5d4eaf-19e4-4124-9ec0-69bf89660af4")}catch{}})();const ot=L(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:Y(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(V({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Z("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=X(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(J),it=et(function({entityType:a,...t}){const e=B(),o=G(),c=F(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:j}=K(),r=k(x??""),p=k(j??""),f=rt(r,p),v=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),w=l(n=>O(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(H(i)))},[m,f,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,A=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(b(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:w,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:I(v.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-BEuWW_o5.js";import xn from"./NotFoundScreen-CcPbqGwL.js";import{a,b as Pt}from"./sentry-DsHW_1mX.js";import{n as Fe,S as Rn}from"./mui-hUAh7HgW.js";import{h as ce,l as wt,u as Ge,g as U,n as Dn,i as rt,o as Un,p as Le}from"./core-lbYY5woS.js";import{eQ as Re,PX as Fn,n1 as Se,fi as Bn,qE as _n,nj as xt,nE as Rt,PY as Dt,nO as Vn,PZ as Ut,nc as On,qa as Mn,f1 as pe,P_ as De,sK as Ft,BZ as Bt,P$ as _t,Q0 as jn,pR as qe,LB as dt,LD as Ln,jG as zn,LE as Qn,jN as $n,cW as Gn,tR as Ne,np as Vt,nT as Ue,Q1 as qn,Ku as ut,Kt as Pe,Q2 as mt,k2 as Nn,Q3 as Yn,Q4 as Jn,Q5 as Kn,Q6 as Hn,nw as Zn,nh as ie,nW as we,Q7 as Wn,Q8 as Xn,Q9 as ea,o1 as ta,jR as na,jI as aa,Qa as oa,jQ as ht,LL as sa,Qb as ca,Qc as ia,pN as la,ps as ra,nU as ge,pr as ze,Qd as da,Qe as ua,ll as ma,bq as ha,lg as pt,l2 as pa,Qf as ga,gQ as gt,fU as Ca,ld as Sa,vK as Ia,Qg as fa,os as ka,on as Ea,or as va,oc as ya,Qh as ba,f4 as Ot,nH as Aa,ns as Ta,fj as Ct,nY as Pa,Qi as wa,nV as Mt,Qj as xa,Qk as Ra,Ql as Da,Qm as Ua,Qn as St,pZ as Fa,pi as Ba,Ks as _a,jP as Va,Qo as Oa,Gv as Ma,jO as ja,jD as La,f3 as za,oT as jt,pa as Qa,nS as It,nX as $a,bE as Ga,la as qa,l7 as Na,Qp as Ya,ob as ft,p8 as kt,p6 as Ja,oY as Ka,oD as Ha,p9 as Za,Qq as Wa,Qr as Xa,oH as eo,Qs as to,ox as no,oG as ao,oE as oo,pd as so}from"./zeni-epic-state-DsxPZxrE.js";import{C as Lt,j as Ce,c as L,n as H,V as zt,_ as Qt,cB as co,z as Be,cC as io,at as xe,cD as lo,aT as Et,B as $t,cE as ro,aq as Qe,D as uo,cF as mo,a1 as ho,cG as po,O as go,cH as Co,cI as So,s as Io,I as fo,aN as ko,b5 as Eo,w as vo,cJ as yo}from"./index-CsttCRun.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-B6D1gPTU.js";import{c as vt,C as bo}from"./TransactionDetailScreen-DIVwpSfj.js";import{w as Ao}from"./withTransactionSidePanel-C9nI8iAG.js";import{h as To,v as Po}from"./routePaths-AncZCFgJ.js";import{g as $e}from"./accountMappingHelper-DZZWkdNS.js";import{D as wo}from"./DrawerScreen-DA7W7_FJ.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./decodeURIComponentSafe-Bt7TpCfB.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]="3b21dbe4-3bb2-4e7e-9ecf-ed4e74d5dfa3",t._sentryDebugIdIdentifier="sentry-dbid-3b21dbe4-3bb2-4e7e-9ecf-ed4e74d5dfa3")}catch{}})();const xo=()=>{const t=ce(),i=wt(),A=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,J=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:J}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
1
+ import{j as C}from"./liveblocks-BEuWW_o5.js";import xn from"./NotFoundScreen-DdK7GyZ6.js";import{a,b as Pt}from"./sentry-DsHW_1mX.js";import{n as Fe,S as Rn}from"./mui-hUAh7HgW.js";import{h as ce,l as wt,u as Ge,g as U,n as Dn,i as rt,o as Un,p as Le}from"./core-lbYY5woS.js";import{eQ as Re,PX as Fn,n1 as Se,fi as Bn,qE as _n,nj as xt,nE as Rt,PY as Dt,nO as Vn,PZ as Ut,nc as On,qa as Mn,f1 as pe,P_ as De,sK as Ft,BZ as Bt,P$ as _t,Q0 as jn,pR as qe,LB as dt,LD as Ln,jG as zn,LE as Qn,jN as $n,cW as Gn,tR as Ne,np as Vt,nT as Ue,Q1 as qn,Ku as ut,Kt as Pe,Q2 as mt,k2 as Nn,Q3 as Yn,Q4 as Jn,Q5 as Kn,Q6 as Hn,nw as Zn,nh as ie,nW as we,Q7 as Wn,Q8 as Xn,Q9 as ea,o1 as ta,jR as na,jI as aa,Qa as oa,jQ as ht,LL as sa,Qb as ca,Qc as ia,pN as la,ps as ra,nU as ge,pr as ze,Qd as da,Qe as ua,ll as ma,bq as ha,lg as pt,l2 as pa,Qf as ga,gQ as gt,fU as Ca,ld as Sa,vK as Ia,Qg as fa,os as ka,on as Ea,or as va,oc as ya,Qh as ba,f4 as Ot,nH as Aa,ns as Ta,fj as Ct,nY as Pa,Qi as wa,nV as Mt,Qj as xa,Qk as Ra,Ql as Da,Qm as Ua,Qn as St,pZ as Fa,pi as Ba,Ks as _a,jP as Va,Qo as Oa,Gv as Ma,jO as ja,jD as La,f3 as za,oT as jt,pa as Qa,nS as It,nX as $a,bE as Ga,la as qa,l7 as Na,Qp as Ya,ob as ft,p8 as kt,p6 as Ja,oY as Ka,oD as Ha,p9 as Za,Qq as Wa,Qr as Xa,oH as eo,Qs as to,ox as no,oG as ao,oE as oo,pd as so}from"./zeni-epic-state-DsxPZxrE.js";import{C as Lt,j as Ce,c as L,n as H,V as zt,_ as Qt,cB as co,z as Be,cC as io,at as xe,cD as lo,aT as Et,B as $t,cE as ro,aq as Qe,D as uo,cF as mo,a1 as ho,cG as po,O as go,cH as Co,cI as So,s as Io,I as fo,aN as ko,b5 as Eo,w as vo,cJ as yo}from"./index-CR1sBuly.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-D2I_ptqP.js";import{c as vt,C as bo}from"./TransactionDetailScreen-Dz99_JkB.js";import{w as Ao}from"./withTransactionSidePanel-C6lz4d-6.js";import{h as To,v as Po}from"./routePaths-BoWQ8YXQ.js";import{g as $e}from"./accountMappingHelper-DZZWkdNS.js";import{D as wo}from"./DrawerScreen-D7lcO0VJ.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./decodeURIComponentSafe-Bt7TpCfB.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]="3b21dbe4-3bb2-4e7e-9ecf-ed4e74d5dfa3",t._sentryDebugIdIdentifier="sentry-dbid-3b21dbe4-3bb2-4e7e-9ecf-ed4e74d5dfa3")}catch{}})();const xo=()=>{const t=ce(),i=wt(),A=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,J=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:J}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BEuWW_o5.js";import{a as r}from"./sentry-DsHW_1mX.js";import{a2 as i,a3 as l,a4 as p,p as b}from"./index-CsttCRun.js";import"./mui-hUAh7HgW.js";import m from"./NotFoundScreen-CcPbqGwL.js";import{l as c,u}from"./core-lbYY5woS.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]="962e43b2-96f5-4d4d-bf4b-69fb382a754a",e._sentryDebugIdIdentifier="sentry-dbid-962e43b2-96f5-4d4d-bf4b-69fb382a754a")}catch{}})();const _=()=>{const e=c(),a=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=b(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
1
+ import{j as s}from"./liveblocks-BEuWW_o5.js";import{a as r}from"./sentry-DsHW_1mX.js";import{a2 as i,a3 as l,a4 as p,p as b}from"./index-CR1sBuly.js";import"./mui-hUAh7HgW.js";import m from"./NotFoundScreen-DdK7GyZ6.js";import{l as c,u}from"./core-lbYY5woS.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]="962e43b2-96f5-4d4d-bf4b-69fb382a754a",e._sentryDebugIdIdentifier="sentry-dbid-962e43b2-96f5-4d4d-bf4b-69fb382a754a")}catch{}})();const _=()=>{const e=c(),a=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=b(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-DsHW_1mX.js";import{h as l,l as f,u as m}from"./core-lbYY5woS.js";import{gx as p,JH as g,JI as _}from"./zeni-epic-state-DsxPZxrE.js";import{u as b,L as h,z as y}from"./index-CsttCRun.js";import"./liveblocks-BEuWW_o5.js";import"./recharts-aApoEySM.js";import"./mui-hUAh7HgW.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c79c3850-dde0-4ee5-927c-1b14a6cf997f",e._sentryDebugIdIdentifier="sentry-dbid-c79c3850-dde0-4ee5-927c-1b14a6cf997f")}catch{}})();function C(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
1
+ import{a as r}from"./sentry-DsHW_1mX.js";import{h as l,l as f,u as m}from"./core-lbYY5woS.js";import{gx as p,JH as g,JI as _}from"./zeni-epic-state-DsxPZxrE.js";import{u as b,L as h,z as y}from"./index-CR1sBuly.js";import"./liveblocks-BEuWW_o5.js";import"./recharts-aApoEySM.js";import"./mui-hUAh7HgW.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c79c3850-dde0-4ee5-927c-1b14a6cf997f",e._sentryDebugIdIdentifier="sentry-dbid-c79c3850-dde0-4ee5-927c-1b14a6cf997f")}catch{}})();function C(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-BEuWW_o5.js";import{i as S,n as f,l as C,u as y,h as ee,s as te,g as E,N as ae,o as ne,p}from"./core-lbYY5woS.js";import{JA as k,JB as v,JC as T,zA as B,zm as G,JD as D,JE as oe,JF as ie,zq as se,eU as $,zx as le,zu as re}from"./zeni-epic-state-DsxPZxrE.js";import{K as x,o as r,i as de,c as j,h as J,M as ce,p as me,k as pe,n as M,C as ue,j as he,r as fe,s as xe,m as ge,v as be,B as we,R as Se,T as ye,S as ke,U as ve,w as je,x as $e}from"./index-CsttCRun.js";import{n as m}from"./mui-hUAh7HgW.js";import g from"./NotFoundScreen-CcPbqGwL.js";import{a as I}from"./sentry-DsHW_1mX.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.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]="6f23f1bb-bff3-4985-961d-764ba4af2ff1",e._sentryDebugIdIdentifier="sentry-dbid-6f23f1bb-bff3-4985-961d-764ba4af2ff1")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-BEuWW_o5.js";import{i as S,n as f,l as C,u as y,h as ee,s as te,g as E,N as ae,o as ne,p}from"./core-lbYY5woS.js";import{JA as k,JB as v,JC as T,zA as B,zm as G,JD as D,JE as oe,JF as ie,zq as se,eU as $,zx as le,zu as re}from"./zeni-epic-state-DsxPZxrE.js";import{K as x,o as r,i as de,c as j,h as J,M as ce,p as me,k as pe,n as M,C as ue,j as he,r as fe,s as xe,m as ge,v as be,B as we,R as Se,T as ye,S as ke,U as ve,w as je,x as $e}from"./index-CR1sBuly.js";import{n as m}from"./mui-hUAh7HgW.js";import g from"./NotFoundScreen-DdK7GyZ6.js";import{a as I}from"./sentry-DsHW_1mX.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.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]="6f23f1bb-bff3-4985-961d-764ba4af2ff1",e._sentryDebugIdIdentifier="sentry-dbid-6f23f1bb-bff3-4985-961d-764ba4af2ff1")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;