@zeniai/web-app-ui 5.0.57-dev → 5.0.57-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 (100) hide show
  1. package/dist/assets/AddressRoutes-Bag7m6qW.js +1 -0
  2. package/dist/assets/{AddressScreen-C6IvqCLW.js → AddressScreen-Ca2p0J93.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-CzXeITwY.js → AiCfoScreen-Cln5kFvq.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-CiWD3mPm.js → BillPayApprovalRoutes-BkiWlWG1.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DYqCDQKr.js → BillPayRoutes-BUnKFudo.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-CPbmBL7J.js → BusinessVerificationPageScreen-CETF7Xs2.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-CAQ18GHz.js → ChargeCardRoutes-DyrY3AOh.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-7bEBCgDZ.js → CompanyPassportScreen-CEn8Hq_N.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-Drw16O1C.js → ConnectionAuthScreen-DIDoz4Y4.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-sEtdhf6t.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-CsQUOi23.js → CustomerOnboardingRoutes-C6aBtTbj.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-FjJ49qIi.js → DashboardRoutes-ibMx9tJv.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-BxEBIEMW.js → DefaultTenantHome-DrSW3qnP.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-YdN2GJI3.js → DomesticWireDetailScreen-DqS4Tcvr.js} +1 -1
  15. package/dist/assets/{DrawerScreen-D376zeqM.js → DrawerScreen-CZjhB4M8.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-BhxpLYjU.js → EntityDetailRoutes-uteOKaRW.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-DMIgQeGn.js → ExpenseAutomationRoutes-vN-ZEfGB.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-BBBv1uMR.js → FeaturePreviewScreen-Bb7LAhIT.js} +1 -1
  19. package/dist/assets/{MagicLinkRoutes-DYFaWJEB.js → MagicLinkRoutes-CrxYhL_N.js} +1 -1
  20. package/dist/assets/{MagicLinkSignInScreen-BYKmWE-B.js → MagicLinkSignInScreen-DMujXaBO.js} +1 -1
  21. package/dist/assets/{MobileAppDrawer-BqatZNBg.js → MobileAppDrawer-CsFu1SGJ.js} +1 -1
  22. package/dist/assets/NotFoundScreen-DYeXrX7_.js +1 -0
  23. package/dist/assets/{NotificationRoutes-BhWmeNUp.js → NotificationRoutes-KbJh7WKb.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-D2gaV3KQ.js → PandLWithForecastRoutes-DXlZi8qW.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-C49twcDs.js → PeopleRoutes-Dfo2HPQ8.js} +1 -1
  26. package/dist/assets/{PerformanceRoutes-8TzRyboc.js → PerformanceRoutes-CtfzaZEr.js} +1 -1
  27. package/dist/assets/{Preview-v6ufh9Up.js → Preview-DPJ5uAOV.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-Cnhg87ad.js → QBOConnectionScreen-ZbQqcTvr.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-Czxg_tCU.js → ReferralListScreen-CJVut1-a.js} +1 -1
  30. package/dist/assets/{ReimbursementApprovalRoutes-CSGZqgWn.js → ReimbursementApprovalRoutes-DbWpAe_W.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DQiQsDBw.js → ReimbursementApprovalRuleDetailScreen-B4Iu7nC0.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-pEKPc1LV.js → ReimbursementRoutes-DE6qZeFt.js} +1 -1
  33. package/dist/assets/{ReportsRoutes-IJfcYi5_.js → ReportsRoutes-D-5WE4O3.js} +1 -1
  34. package/dist/assets/{RewardsRoutes-DAxVBnQa.js → RewardsRoutes-Bse1jH88.js} +1 -1
  35. package/dist/assets/{ScreenRoutes-CyuhXplX.js → ScreenRoutes-DAtAgM93.js} +2 -2
  36. package/dist/assets/{SettingsRoutes-BG6iE30t.js → SettingsRoutes-DiqY7ZzG.js} +1 -1
  37. package/dist/assets/{SetupPagesScreen-8DP-INVh.js → SetupPagesScreen-5gu402_s.js} +1 -1
  38. package/dist/assets/{SignInScreen-CJfDbzv1.js → SignInScreen-Bv_CmdB4.js} +1 -1
  39. package/dist/assets/{SignOutScreen-B8SOTK5f.js → SignOutScreen-Bg5nBSS2.js} +1 -1
  40. package/dist/assets/{TaskListScreen-DYKkvt2-.js → TaskListScreen-CeAHUBwa.js} +1 -1
  41. package/dist/assets/{TaskRoutes-D26BUK4U.js → TaskRoutes-XLr0JwdP.js} +1 -1
  42. package/dist/assets/TransactionDetailRoutes-W70apOcQ.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-B3KLkUFa.js → TransactionDetailScreen-DwslT8ci.js} +1 -1
  44. package/dist/assets/{TransactionListRoutes-DG9rPkBC.js → TransactionListRoutes-CPz2tIys.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-ZGFkV4TM.js → TreasuryRoutes-CLsQ2k2B.js} +1 -1
  46. package/dist/assets/{VendorsRoutes-B8LMPpiX.js → VendorsRoutes-DBHqiibW.js} +1 -1
  47. package/dist/assets/{WiseConfirmationScreen-btVOEfVh.js → WiseConfirmationScreen-CUSz1saI.js} +1 -1
  48. package/dist/assets/{ZeniAccountRoutes-CPNfHI8n.js → ZeniAccountRoutes-D7qmRpeW.js} +1 -1
  49. package/dist/assets/{ZeniAccountStatementScreen-B4A5SVx8.js → ZeniAccountStatementScreen-YO51ZD4a.js} +1 -1
  50. package/dist/assets/{accountMappingHelper-C1yTeNF1.js → accountMappingHelper-DXLz-vZu.js} +1 -1
  51. package/dist/assets/{analytics-xb_2pDDq.js → analytics-C7fHeQaW.js} +1 -1
  52. package/dist/assets/{analyticsHelper-CNwzWBf_.js → analyticsHelper-BI0zNJMo.js} +1 -1
  53. package/dist/assets/{core-DGD8k-EU.js → core-BojUR2ky.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-DKUmHyeo.js → decodeURIComponentSafe-Cj7RmfYA.js} +1 -1
  55. package/dist/assets/{dnd-s5MAPZ_4.js → dnd-CxlDz5d0.js} +1 -1
  56. package/dist/assets/{empty-Dt0wGXhX.js → empty-BfK9KfwA.js} +1 -1
  57. package/dist/assets/{empty-C-OX54ey.js → empty-U91QAR9K.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-19CW_zr_.js → emptyVideoElement-CycntGaA.js} +1 -1
  59. package/dist/assets/{epic-BWgHIe0E.js → epic-C89Urkp1.js} +1 -1
  60. package/dist/assets/{getLocaleForTenant-BrCCfdIO.js → getLocaleForTenant-DXctzPv_.js} +1 -1
  61. package/dist/assets/{index-vWYcYgGc.js → index-BFSmByg_.js} +1 -1
  62. package/dist/assets/{index-CTLIpLfK.js → index-Bl7KFfTZ.js} +1 -1
  63. package/dist/assets/{index-BIyxkQfN.js → index-C30E8A69.js} +2 -2
  64. package/dist/assets/{index-BD5JP2X1.js → index-CJekYpNM.js} +1 -1
  65. package/dist/assets/{index-BE1Y8qVe.js → index-DlIWyK0U.js} +1 -1
  66. package/dist/assets/{index-CNT4WvUT.js → index-Dw0sYJvv.js} +7 -7
  67. package/dist/assets/{index-DFm7CUCx.js → index-LcueFkuq.js} +1 -1
  68. package/dist/assets/{lexical-D9fe9vQ7.js → lexical-BsuE2Lsd.js} +1 -1
  69. package/dist/assets/{liveblocks-Cxvop2w5.js → liveblocks-BJogRArg.js} +1 -1
  70. package/dist/assets/{lottie-rysS_6yg.js → lottie-Cn4ueTxI.js} +1 -1
  71. package/dist/assets/{mui-Cdh_ZgIg.js → mui-Bg09VkiQ.js} +1 -1
  72. package/dist/assets/{pathToGoBack-79-68hCi.js → pathToGoBack-DkMRBkCy.js} +1 -1
  73. package/dist/assets/{pdf-lib-o7tH0fyZ.js → pdf-lib-CayRdH4_.js} +1 -1
  74. package/dist/assets/{pdf-B7Btpc50.js → pdf-unrI9041.js} +3 -3
  75. package/dist/assets/{plaid-BVGCfCA1.js → plaid-DLEkn0-3.js} +1 -1
  76. package/dist/assets/{pusher-yXRrAcLQ.js → pusher-0TzEhQ4N.js} +1 -1
  77. package/dist/assets/{react-C5Y1Z7Ny.js → react-DE-H5XLs.js} +1 -1
  78. package/dist/assets/{react-D_nAXUQt.js → react-DqIU-sTG.js} +1 -1
  79. package/dist/assets/{react-DbAaKnkZ.js → react-DrHghgwg.js} +1 -1
  80. package/dist/assets/{react-CniPiXF0.js → react-DroQkqxO.js} +1 -1
  81. package/dist/assets/{react-Bu0vc7Mq.js → react-OJ3jwYUc.js} +1 -1
  82. package/dist/assets/{react-DXDp-y6T.js → react-PyBVK2LU.js} +1 -1
  83. package/dist/assets/{recharts-oolJNF1J.js → recharts-CYOGURoz.js} +1 -1
  84. package/dist/assets/{routePaths-CKa13qEa.js → routePaths-DriCJPaW.js} +1 -1
  85. package/dist/assets/{sentry-Bel9R1P0.js → sentry-WdXgkw90.js} +1 -1
  86. package/dist/assets/{url-CXvkkYyM.js → url-BxFmO3XK.js} +1 -1
  87. package/dist/assets/{url-CKAhPnIv.js → url-DF46HIMu.js} +1 -1
  88. package/dist/assets/{useAskAiCfoHostNavButtonProps-CwXdaO7x.js → useAskAiCfoHostNavButtonProps-C3l35BIu.js} +1 -1
  89. package/dist/assets/{useDeviceId-C-LBnIzp.js → useDeviceId-CYsEMtI-.js} +1 -1
  90. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-7gmq8HnL.js → useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js} +1 -1
  91. package/dist/assets/{useInitialThreadRequest-KZIIx-jA.js → useInitialThreadRequest-DBmAMV6A.js} +1 -1
  92. package/dist/assets/{utils-y7cfvjBg.js → utils-CJNmQJBz.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-Bmv6ar-S.js → withTransactionSidePanel-DUWL7sXt.js} +1 -1
  94. package/dist/assets/{zeni-epic-state-CjARY91O.js → zeni-epic-state-BJsXImBw.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +1 -1
  97. package/dist/assets/AddressRoutes-C1bL1yEL.js +0 -1
  98. package/dist/assets/CustomerOnboardingAuthScreen-DbhhpyIu.js +0 -1
  99. package/dist/assets/NotFoundScreen-BrmwEoGP.js +0 -1
  100. package/dist/assets/TransactionDetailRoutes-BZNOCcmc.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-BJogRArg.js";import{A as d}from"./AddressScreen-Ca2p0J93.js";import i from"./NotFoundScreen-DYeXrX7_.js";import"./sentry-WdXgkw90.js";import{n as s,o as r}from"./core-BojUR2ky.js";import"./zeni-epic-state-BJsXImBw.js";import"./recharts-CYOGURoz.js";import"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-Cxvop2w5.js";import{a as m}from"./sentry-Bel9R1P0.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-DGD8k-EU.js";import{q as $,h as D,z as L,j as K,B as N,A as R,d as C,f as S,r as z,k as h,v as F}from"./index-CNT4WvUT.js";import{I$ as k,gM as U,eN as q,J0 as G,c0 as J,J1 as O,k6 as V}from"./zeni-epic-state-CjARY91O.js";import{n as H}from"./mui-Cdh_ZgIg.js";import Q from"./NotFoundScreen-BrmwEoGP.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]="da1e90b1-1775-4b2b-9cae-1bc6783b2713",e._sentryDebugIdIdentifier="sentry-dbid-da1e90b1-1775-4b2b-9cae-1bc6783b2713")}catch{}})();const W=H.div`
1
+ import{j as d}from"./liveblocks-BJogRArg.js";import{a as m}from"./sentry-WdXgkw90.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-BojUR2ky.js";import{q as $,h as D,z as L,j as K,B as N,A as R,d as C,f as S,r as z,k as h,v as F}from"./index-Dw0sYJvv.js";import{I$ as k,gM as U,eN as q,J0 as G,c0 as J,J1 as O,k6 as V}from"./zeni-epic-state-BJsXImBw.js";import{n as H}from"./mui-Bg09VkiQ.js";import Q from"./NotFoundScreen-DYeXrX7_.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]="da1e90b1-1775-4b2b-9cae-1bc6783b2713",e._sentryDebugIdIdentifier="sentry-dbid-da1e90b1-1775-4b2b-9cae-1bc6783b2713")}catch{}})();const W=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-Cxvop2w5.js";import{a as r}from"./sentry-Bel9R1P0.js";import{h as oe,j as ne,u as ie,g as j,l as re,k as le}from"./core-DGD8k-EU.js";import{J as ce,cG as ue,z as de,q as me,cH as pe,cI as fe,cJ as he,cK as $,A as Se,d as v,N as q,cL as ge,cM as Ce,f as ke,a1 as we,cN as be,O as Ie,x as Pe,v as G,aY as Ee,cO as Te}from"./index-CNT4WvUT.js";import{fD as ye,f2 as H,eN as _e,hq as xe,Px as ve,eM as Ue,hA as Ae,hw as Oe,ft as Qe,fn as De,fg as Fe,fk as V,fo as Me,fp as Le,fq as Be,fr as Ne,fs as Re}from"./zeni-epic-state-CjARY91O.js";import{D as je,n as U,P as qe,S as Ge}from"./mui-Cdh_ZgIg.js";import{p as Ve}from"./pathToGoBack-79-68hCi.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="e4705dd8-cf52-4628-9fcf-6a61f4d46400",s._sentryDebugIdIdentifier="sentry-dbid-e4705dd8-cf52-4628-9fcf-6a61f4d46400")}catch{}})();const W="chat-response-generated",$e=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:P}=$(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(P,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Ne({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Re({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Ee(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(V(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Me(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ve(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(V(""))},togglePageView:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Pe(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(we(be)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=j(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=j(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:P}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,k=C?.aiCfoInitialQuestion,O=!!C?.aiCfoShouldSubmit,[z,E]=r.useState(null),[J,T]=r.useState(!1),Q=r.useRef(!1);r.useEffect(()=>{Q.current||k==null||k===""||(E(k),T(O),Q.current=!0)},[k,O]);const Y=r.useCallback(()=>{E(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,M=r.useRef(!1);r.useEffect(()=>{M.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),M.current=!0)},[F,y,t,a,e]);const w=l.uiState.lastContextMessage;r.useEffect(()=>{w!=null&&w!==""&&t!=null&&(E(w),T(!0),a(ve()))},[w,t,a]);const K=c.masterTOSInfo,b=K?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",N=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),R=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=$(R,t),X=Z.length===0;r.useEffect(()=>{b||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[b]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&N&&e!=null&&_==="Completed"&&!x&&a(Oe(t,e.userId))},[B,N,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(ke.Event.aiCFOPage)}),q(n)&&A.drawerElement,h.jsx($e,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:R,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:X,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:J,onEmailLinkQuestionProcessed:Y,onMenuClick:q(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:P,onUploadPromoClose:g}),h.jsx(je,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:b,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{b||c.userRoleId==null||a(Qe(c.userRoleId)),f(!1)}})})})]})},He=U(Ge)`
1
+ import{j as h}from"./liveblocks-BJogRArg.js";import{a as r}from"./sentry-WdXgkw90.js";import{h as oe,j as ne,u as ie,g as j,l as re,k as le}from"./core-BojUR2ky.js";import{J as ce,cG as ue,z as de,q as me,cH as pe,cI as fe,cJ as he,cK as $,A as Se,d as v,N as q,cL as ge,cM as Ce,f as ke,a1 as we,cN as be,O as Ie,x as Pe,v as G,aY as Ee,cO as Te}from"./index-Dw0sYJvv.js";import{fD as ye,f2 as H,eN as _e,hq as xe,Px as ve,eM as Ue,hA as Ae,hw as Oe,ft as Qe,fn as De,fg as Fe,fk as V,fo as Me,fp as Le,fq as Be,fr as Ne,fs as Re}from"./zeni-epic-state-BJsXImBw.js";import{D as je,n as U,P as qe,S as Ge}from"./mui-Bg09VkiQ.js";import{p as Ve}from"./pathToGoBack-DkMRBkCy.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="e4705dd8-cf52-4628-9fcf-6a61f4d46400",s._sentryDebugIdIdentifier="sentry-dbid-e4705dd8-cf52-4628-9fcf-6a61f4d46400")}catch{}})();const W="chat-response-generated",$e=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:P}=$(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(P,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Ne({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Re({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Ee(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(V(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Me(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ve(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(V(""))},togglePageView:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Pe(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(we(be)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=j(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=j(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:P}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,k=C?.aiCfoInitialQuestion,O=!!C?.aiCfoShouldSubmit,[z,E]=r.useState(null),[J,T]=r.useState(!1),Q=r.useRef(!1);r.useEffect(()=>{Q.current||k==null||k===""||(E(k),T(O),Q.current=!0)},[k,O]);const Y=r.useCallback(()=>{E(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,M=r.useRef(!1);r.useEffect(()=>{M.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),M.current=!0)},[F,y,t,a,e]);const w=l.uiState.lastContextMessage;r.useEffect(()=>{w!=null&&w!==""&&t!=null&&(E(w),T(!0),a(ve()))},[w,t,a]);const K=c.masterTOSInfo,b=K?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",N=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),R=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=$(R,t),X=Z.length===0;r.useEffect(()=>{b||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[b]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&N&&e!=null&&_==="Completed"&&!x&&a(Oe(t,e.userId))},[B,N,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(ke.Event.aiCFOPage)}),q(n)&&A.drawerElement,h.jsx($e,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:R,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:X,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:J,onEmailLinkQuestionProcessed:Y,onMenuClick:q(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:P,onUploadPromoClose:g}),h.jsx(je,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:b,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{b||c.userRoleId==null||a(Qe(c.userRoleId)),f(!1)}})})})]})},He=U(Ge)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-Cxvop2w5.js";import{a as y}from"./sentry-Bel9R1P0.js";import{j as B,u as U,h as j,g as f,N as $,k as T,l as N,n as O,o as b}from"./core-DGD8k-EU.js";import{eN as L,Mi as A,L_ as h,x8 as w,x2 as F,x6 as x,wX as z,M0 as M,w_ as W,xa as q,x9 as C}from"./zeni-epic-state-CjARY91O.js";import{h as P,z as k,B as _,a1 as X,by as G,ab as V,bz as H}from"./index-CNT4WvUT.js";import"./mui-Cdh_ZgIg.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-DQiQsDBw.js";import K from"./NotFoundScreen-BrmwEoGP.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]="1652140b-cd3b-4b71-94a3-d1be6dd93611",e._sentryDebugIdIdentifier="sentry-dbid-1652140b-cd3b-4b71-94a3-d1be6dd93611")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(M(!1))},onBackClick:()=>{V(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(X(G)),Y=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>L(i)),r=f(i=>A(i)),g=f(i=>h(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const v={events:c.companyId!=null?[`private-${c.companyId}.${I}`]:[],eventCallback:(i,R,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(_,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...v})},Z=T(function(e,o){const t=h(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=V(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(v=>{const i=v.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=v.actors.selectedNonUsers.map(S=>{const E=!!J(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(R);g.push({action:v.stepType.selectedOption,actors:m,operator:m.length>1?v.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=N(),a=k.getSignedInUser(),u=P(),s=f(r=>h(r)),d=f(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(_,{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(b,{path:"/",element:l.jsx(Y,{})}),l.jsx(b,{path:"/new",element:l.jsx(D,{})}),l.jsx(b,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(b,{path:"*",element:l.jsx(K,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-BJogRArg.js";import{a as y}from"./sentry-WdXgkw90.js";import{j as B,u as U,h as j,g as f,N as $,k as T,l as N,n as O,o as b}from"./core-BojUR2ky.js";import{eN as L,Mi as A,L_ as h,x8 as w,x2 as F,x6 as x,wX as z,M0 as M,w_ as W,xa as q,x9 as C}from"./zeni-epic-state-BJsXImBw.js";import{h as P,z as k,B as _,a1 as X,by as G,ab as V,bz as H}from"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-B4Iu7nC0.js";import K from"./NotFoundScreen-DYeXrX7_.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]="1652140b-cd3b-4b71-94a3-d1be6dd93611",e._sentryDebugIdIdentifier="sentry-dbid-1652140b-cd3b-4b71-94a3-d1be6dd93611")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(M(!1))},onBackClick:()=>{V(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(X(G)),Y=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>L(i)),r=f(i=>A(i)),g=f(i=>h(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const v={events:c.companyId!=null?[`private-${c.companyId}.${I}`]:[],eventCallback:(i,R,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(_,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...v})},Z=T(function(e,o){const t=h(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=V(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(v=>{const i=v.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=v.actors.selectedNonUsers.map(S=>{const E=!!J(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(R);g.push({action:v.stepType.selectedOption,actors:m,operator:m.length>1?v.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=N(),a=k.getSignedInUser(),u=P(),s=f(r=>h(r)),d=f(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(_,{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(b,{path:"/",element:l.jsx(Y,{})}),l.jsx(b,{path:"/new",element:l.jsx(D,{})}),l.jsx(b,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(b,{path:"*",element:l.jsx(K,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-Cxvop2w5.js";import{j as K,h as re,u as Q,l as te,g as I,N as ee,k as X,i as la,n as sa,o as S}from"./core-DGD8k-EU.js";import{eN as Z,LA as Ge,bv as At,GD as ra,bo as xt,bD as pe,LB as Bt,ws as Et,xC as Ue,w$ as ca,bn as je,LC as da,LD as ua,c0 as pa,LE as ma,jq as Dt,LF as jt,LG as Tt,yb as Oe,wH as Be,LH as ba,wg as it,LI as ha,Bn as ga,wk as ya,wq as Pt,LJ as ke,LK as Ne,xD as ze,LL as Sa,LM as fa,xG as Ze,LN as ka,xT as Ia,LO as Ft,xn as ot,xs as va,LP as wa,LQ as ue,LR as Rt,LS as Lt,LT as Vt,fH as Ca,wM as Me,cv as $t,LU as Aa,gC as xa,LV as Ba,LW as Ea,eT as Ut,eR as Mt,LX as He,LY as Da,LZ as ja,Jj as We,L_ as Ta,Jk as ie,Jl as qe,L$ as Pa,M0 as Fa,M1 as Ra,xu as lt,xr as La,M2 as Va,M3 as $a,M4 as Ua,xd as Ma,M5 as _a,M6 as Ga,M7 as Oa,cj as _t,cL as Gt,jB as Na,bJ as za,bq as Ot,bK as Nt,vy as Za,M8 as Ha,Ba as Wa,Bg as qa,s5 as Ja,xE as Ka,yi as Qa,jO as fe,M9 as Xa,Ma as zt,kg as Ya,jI as Zt,k1 as Ht,k0 as st,bC as be,bI as en,Mb as tn,Mc as Ie,ik as an,Md as rt,Me as nn,ip as on,iK as ln,yw as sn,Mf as rn,k9 as cn,ym as dn,Mg as ct,yq as un,yv as pn,ys as mn,yk as bn,Mh as Wt,wB as hn,Mi as gn,Mj as yn,fz as Sn,fy as fn,fx as kn,jR as In,k7 as dt,ki as vn,pE as wn,j_ as Cn,yo as An,iv as xn,kn as Bn,Mk as En,im as Dn,pv as jn,Ml as Tn,xj as Pn,bE as Fn,bs as Rn,Ik as Ln,cN as Vn,cM as $n,cu as Un,cA as Mn}from"./zeni-epic-state-CjARY91O.js";import{h as me,z as L,j as ve,J as Je,a as oe,p as y,aJ as Ee,B as ce,o as E,A as Te,d as j,b5 as _n,v as z,O as Ke,x as D,q as we,b6 as ut,b7 as pt,b8 as Gn,ag as On,E as Nn,aD as zn,C as qt,D as Qe,F as Xe,b9 as Zn,ap as Jt,ba as Hn,K as Wn,f as Kt,a1 as qn,bb as Jn,bc as Kn,bd as Qn,be as Xn,bf as Yn,bg as ei,bh as ti,bi as ai,bj as ni,$ as ii,bk as oi,b1 as li,bl as si,bm as ri,a5 as ci}from"./index-CNT4WvUT.js";import{n as V,S as di}from"./mui-Cdh_ZgIg.js";import{A as mt}from"./AddressScreen-C6IvqCLW.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-YdN2GJI3.js";import{a as f}from"./sentry-Bel9R1P0.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-CwXdaO7x.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-7gmq8HnL.js";import{u as Xt}from"./useInitialThreadRequest-KZIIx-jA.js";import De from"./NotFoundScreen-BrmwEoGP.js";import{D as bi}from"./DrawerScreen-D376zeqM.js";import{M as Yt}from"./MobileAppDrawer-BqatZNBg.js";import{F as ea}from"./FeaturePreviewScreen-BBBv1uMR.js";import{S as Re}from"./SetupPagesScreen-8DP-INVh.js";import{B as hi}from"./BillPayApprovalRoutes-CiWD3mPm.js";import{FallBackRoute as gi}from"./ScreenRoutes-CyuhXplX.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.js";import"./analyticsHelper-CNwzWBf_.js";import"./routePaths-CKa13qEa.js";import"./BusinessVerificationPageScreen-CPbmBL7J.js";import"./ReimbursementApprovalRuleDetailScreen-DQiQsDBw.js";import"./getLocaleForTenant-BrCCfdIO.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]="6262281e-a3e4-458c-9886-8f07c62f4ef7",e._sentryDebugIdIdentifier="sentry-dbid-6262281e-a3e4-458c-9886-8f07c62f4ef7")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=I(w=>Z(w)),s=I(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,k]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Ia({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(ka({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),k=I(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=I(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=I(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&M?_(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),u&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(k.tenantEmailDomain);t(ke({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,k.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(ki,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:Ii(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function ki(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function Ii(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-BJogRArg.js";import{j as K,h as re,u as Q,l as te,g as I,N as ee,k as X,i as la,n as sa,o as S}from"./core-BojUR2ky.js";import{eN as Z,LA as Ge,bv as At,GD as ra,bo as xt,bD as pe,LB as Bt,ws as Et,xC as Ue,w$ as ca,bn as je,LC as da,LD as ua,c0 as pa,LE as ma,jq as Dt,LF as jt,LG as Tt,yb as Oe,wH as Be,LH as ba,wg as it,LI as ha,Bn as ga,wk as ya,wq as Pt,LJ as ke,LK as Ne,xD as ze,LL as Sa,LM as fa,xG as Ze,LN as ka,xT as Ia,LO as Ft,xn as ot,xs as va,LP as wa,LQ as ue,LR as Rt,LS as Lt,LT as Vt,fH as Ca,wM as Me,cv as $t,LU as Aa,gC as xa,LV as Ba,LW as Ea,eT as Ut,eR as Mt,LX as He,LY as Da,LZ as ja,Jj as We,L_ as Ta,Jk as ie,Jl as qe,L$ as Pa,M0 as Fa,M1 as Ra,xu as lt,xr as La,M2 as Va,M3 as $a,M4 as Ua,xd as Ma,M5 as _a,M6 as Ga,M7 as Oa,cj as _t,cL as Gt,jB as Na,bJ as za,bq as Ot,bK as Nt,vy as Za,M8 as Ha,Ba as Wa,Bg as qa,s5 as Ja,xE as Ka,yi as Qa,jO as fe,M9 as Xa,Ma as zt,kg as Ya,jI as Zt,k1 as Ht,k0 as st,bC as be,bI as en,Mb as tn,Mc as Ie,ik as an,Md as rt,Me as nn,ip as on,iK as ln,yw as sn,Mf as rn,k9 as cn,ym as dn,Mg as ct,yq as un,yv as pn,ys as mn,yk as bn,Mh as Wt,wB as hn,Mi as gn,Mj as yn,fz as Sn,fy as fn,fx as kn,jR as In,k7 as dt,ki as vn,pE as wn,j_ as Cn,yo as An,iv as xn,kn as Bn,Mk as En,im as Dn,pv as jn,Ml as Tn,xj as Pn,bE as Fn,bs as Rn,Ik as Ln,cN as Vn,cM as $n,cu as Un,cA as Mn}from"./zeni-epic-state-BJsXImBw.js";import{h as me,z as L,j as ve,J as Je,a as oe,p as y,aJ as Ee,B as ce,o as E,A as Te,d as j,b5 as _n,v as z,O as Ke,x as D,q as we,b6 as ut,b7 as pt,b8 as Gn,ag as On,E as Nn,aD as zn,C as qt,D as Qe,F as Xe,b9 as Zn,ap as Jt,ba as Hn,K as Wn,f as Kt,a1 as qn,bb as Jn,bc as Kn,bd as Qn,be as Xn,bf as Yn,bg as ei,bh as ti,bi as ai,bj as ni,$ as ii,bk as oi,b1 as li,bl as si,bm as ri,a5 as ci}from"./index-Dw0sYJvv.js";import{n as V,S as di}from"./mui-Bg09VkiQ.js";import{A as mt}from"./AddressScreen-Ca2p0J93.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-DqS4Tcvr.js";import{a as f}from"./sentry-WdXgkw90.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import{u as Xt}from"./useInitialThreadRequest-DBmAMV6A.js";import De from"./NotFoundScreen-DYeXrX7_.js";import{D as bi}from"./DrawerScreen-CZjhB4M8.js";import{M as Yt}from"./MobileAppDrawer-CsFu1SGJ.js";import{F as ea}from"./FeaturePreviewScreen-Bb7LAhIT.js";import{S as Re}from"./SetupPagesScreen-5gu402_s.js";import{B as hi}from"./BillPayApprovalRoutes-BkiWlWG1.js";import{FallBackRoute as gi}from"./ScreenRoutes-DAtAgM93.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./analyticsHelper-BI0zNJMo.js";import"./routePaths-DriCJPaW.js";import"./BusinessVerificationPageScreen-CETF7Xs2.js";import"./ReimbursementApprovalRuleDetailScreen-B4Iu7nC0.js";import"./getLocaleForTenant-DXctzPv_.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]="6262281e-a3e4-458c-9886-8f07c62f4ef7",e._sentryDebugIdIdentifier="sentry-dbid-6262281e-a3e4-458c-9886-8f07c62f4ef7")}catch{}})();const yi=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=I(w=>Z(w)),s=I(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,k]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Ia({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(ka({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),k=I(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=I(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=I(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&M?_(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),u&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(k.tenantEmailDomain);t(ke({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,k.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(ki,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:Ii(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function ki(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function Ii(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function vi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-Cxvop2w5.js";import{a as V}from"./sentry-Bel9R1P0.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-DGD8k-EU.js";import{j as ce,a as ue,aJ as de,z as E,A as pe,d as M,ab as F,f as z,bu as le,ap as me,x as B,aq as R}from"./index-CNT4WvUT.js";import{M6 as fe,eN as G,rw as ye,GH as Se,xd as ge,zW as Ie,Ct as be,D6 as he,D$ as De,Mt as Oe,Mu as Te,Mv as ke,Mw as Ce,Mx as Ve,J0 as we,Lv as Ae,Jc as Ne,k6 as _e,fz as ve,fy as xe,fx as Fe,pE as ze,pv as Ee,ps as Me,j_ as Be,rF as Re,rD as P,bC as L,rR as j,ct as Pe}from"./zeni-epic-state-CjARY91O.js";import{n as Le}from"./mui-Cdh_ZgIg.js";import{c as U}from"./routePaths-CKa13qEa.js";import{M as je}from"./MobileAppDrawer-BqatZNBg.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]="4b06b6d1-655d-4608-85ff-aec8bc9083b9",e._sentryDebugIdIdentifier="sentry-dbid-4b06b6d1-655d-4608-85ff-aec8bc9083b9")}catch{}})();const Ue=Le.div`
1
+ import{j as k}from"./liveblocks-BJogRArg.js";import{a as V}from"./sentry-WdXgkw90.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-BojUR2ky.js";import{j as ce,a as ue,aJ as de,z as E,A as pe,d as M,ab as F,f as z,bu as le,ap as me,x as B,aq as R}from"./index-Dw0sYJvv.js";import{M6 as fe,eN as G,rw as ye,GH as Se,xd as ge,zW as Ie,Ct as be,D6 as he,D$ as De,Mt as Oe,Mu as Te,Mv as ke,Mw as Ce,Mx as Ve,J0 as we,Lv as Ae,Jc as Ne,k6 as _e,fz as ve,fy as xe,fx as Fe,pE as ze,pv as Ee,ps as Me,j_ as Be,rF as Re,rD as P,bC as L,rR as j,ct as Pe}from"./zeni-epic-state-BJsXImBw.js";import{n as Le}from"./mui-Bg09VkiQ.js";import{c as U}from"./routePaths-DriCJPaW.js";import{M as je}from"./MobileAppDrawer-CsFu1SGJ.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]="4b06b6d1-655d-4608-85ff-aec8bc9083b9",e._sentryDebugIdIdentifier="sentry-dbid-4b06b6d1-655d-4608-85ff-aec8bc9083b9")}catch{}})();const Ue=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-Cxvop2w5.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Qt,o as te}from"./core-DGD8k-EU.js";import{eN as ie,bs as Be,NZ as _a,eR as Se,eS as Ie,eT as Ae,fO as Me,cq as ze,N_ as $e,N$ as $a,sL as Sa,jy as Ia,O0 as Aa,gC as ca,zd as aa,zf as Ga,zg as Ya,jo as Ct,O1 as Ge,z1 as pt,O2 as Jt,O3 as Xt,z4 as wa,O4 as en,Mq as Pa,qX as ht,za as Za,gN as an,O5 as ft,O6 as Ye,bq as tn,O7 as nn,fz as Ta,fy as Fa,zK as rn,fx as va,M6 as sn,O8 as gt,cj as bt,cL as on,Mp as ua,Ak as cn,O9 as rt,zW as Oa,Oa as yt,Al as dn,MQ as ln,Am as un,Bg as mn,s5 as Cn,Ba as pn,zv as St,zo as hn,Ob as fn,fQ as gn,zE as It,zI as At,fP as bn,Oc as yn,A6 as Et,Od as Sn,Oe as In,Of as An,zG as kt,zr as Dt,z7 as _t,zA as wt,zy as Pt,zC as En,ze as st,Og as Tt,Oh as xa,zT as Ea,J5 as Ft,cM as Ka,Oi as kn,Oj as Dn,Ok as _n,Ol as wn,zQ as Ha,Ad as Pn,A9 as Tn,zM as Fn,Ab as vn,A1 as On,A3 as xn,Om as vt,Aj as Ot,GD as Bn,On as Ln,Oo as Un,Op as Rn,Oq as xt,Or as jn,AG as Nn,zV as Bt,zP as da,zU as Vn,Os as Hn,Ot as Mn,y_ as zn,Ou as Lt,Ov as Ut,Ow as $n,z0 as Gn,y$ as ot,Ox as Yn,Oy as Zn,Oz as Kn,J1 as Wn,OA as Wa,OB as qn,vB as Rt,k6 as Qn,gD as Jn,AL as Xn,OC as jt,OD as er,AM as ar,OE as tr,dc as nr,sF as rr,AB as sr,Av as xe,bv as or,bD as ir,cv as cr,bE as dr,Ik as lr}from"./zeni-epic-state-CjARY91O.js";import{z as X,j as Ue,a as oe,p as Z,B as Ze,bY as Ba,c7 as ur,v as ve,c8 as mr,c9 as Cr,q as ma,aJ as Fe,x as be,bf as qa,ca as pr,C as Ca,k as La,h as Qa,d as Q,D as Ja,cb as hr,J as Nt,am as Xa,br as Xe,cc as Ma,cd as fr,A as et,a1 as gr,ce as br,ap as Vt,O as za,K as Ht,f as Mt,cf as yr,cg as Sr,ch as Ir,ci as Ar,cj as Er,o as ka,ck as kr,cl as Dr,cm as ja,$ as _r,cn as wr,co as Pr,cp as Tr,cq as Fr,a5 as vr}from"./index-CNT4WvUT.js";import{n as _e,D as zt,S as Or}from"./mui-Cdh_ZgIg.js";import{a as c}from"./sentry-Bel9R1P0.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Re,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Ur,S as it}from"./SetupPagesScreen-8DP-INVh.js";import Ua from"./NotFoundScreen-BrmwEoGP.js";import{M as ha}from"./MobileAppDrawer-BqatZNBg.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-CwXdaO7x.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-7gmq8HnL.js";import{v as ct}from"./utils-y7cfvjBg.js";import{t as Rr}from"./AddressScreen-C6IvqCLW.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./analyticsHelper-CNwzWBf_.js";import"./routePaths-CKa13qEa.js";import"./BusinessVerificationPageScreen-CPbmBL7J.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]="159ff20a-265a-493f-a21e-ab9fdfb4361d",e._sentryDebugIdIdentifier="sentry-dbid-159ff20a-265a-493f-a21e-ab9fdfb4361d")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=X.getSignedInUser(),n=S(G=>ie(G)),u=Ue(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),R=d.chargeCard,M=R?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=R?.cardHolderUser?.userId,U=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=U?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",K=R?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||i===!1&&I===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,R,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:U?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Jt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=X.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ua,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=X.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Xt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),R=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:R}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=X.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),U=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(U,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Re(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
1
+ import{j as s}from"./liveblocks-BJogRArg.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Qt,o as te}from"./core-BojUR2ky.js";import{eN as ie,bs as Be,NZ as _a,eR as Se,eS as Ie,eT as Ae,fO as Me,cq as ze,N_ as $e,N$ as $a,sL as Sa,jy as Ia,O0 as Aa,gC as ca,zd as aa,zf as Ga,zg as Ya,jo as Ct,O1 as Ge,z1 as pt,O2 as Jt,O3 as Xt,z4 as wa,O4 as en,Mq as Pa,qX as ht,za as Za,gN as an,O5 as ft,O6 as Ye,bq as tn,O7 as nn,fz as Ta,fy as Fa,zK as rn,fx as va,M6 as sn,O8 as gt,cj as bt,cL as on,Mp as ua,Ak as cn,O9 as rt,zW as Oa,Oa as yt,Al as dn,MQ as ln,Am as un,Bg as mn,s5 as Cn,Ba as pn,zv as St,zo as hn,Ob as fn,fQ as gn,zE as It,zI as At,fP as bn,Oc as yn,A6 as Et,Od as Sn,Oe as In,Of as An,zG as kt,zr as Dt,z7 as _t,zA as wt,zy as Pt,zC as En,ze as st,Og as Tt,Oh as xa,zT as Ea,J5 as Ft,cM as Ka,Oi as kn,Oj as Dn,Ok as _n,Ol as wn,zQ as Ha,Ad as Pn,A9 as Tn,zM as Fn,Ab as vn,A1 as On,A3 as xn,Om as vt,Aj as Ot,GD as Bn,On as Ln,Oo as Un,Op as Rn,Oq as xt,Or as jn,AG as Nn,zV as Bt,zP as da,zU as Vn,Os as Hn,Ot as Mn,y_ as zn,Ou as Lt,Ov as Ut,Ow as $n,z0 as Gn,y$ as ot,Ox as Yn,Oy as Zn,Oz as Kn,J1 as Wn,OA as Wa,OB as qn,vB as Rt,k6 as Qn,gD as Jn,AL as Xn,OC as jt,OD as er,AM as ar,OE as tr,dc as nr,sF as rr,AB as sr,Av as xe,bv as or,bD as ir,cv as cr,bE as dr,Ik as lr}from"./zeni-epic-state-BJsXImBw.js";import{z as X,j as Ue,a as oe,p as Z,B as Ze,bY as Ba,c7 as ur,v as ve,c8 as mr,c9 as Cr,q as ma,aJ as Fe,x as be,bf as qa,ca as pr,C as Ca,k as La,h as Qa,d as Q,D as Ja,cb as hr,J as Nt,am as Xa,br as Xe,cc as Ma,cd as fr,A as et,a1 as gr,ce as br,ap as Vt,O as za,K as Ht,f as Mt,cf as yr,cg as Sr,ch as Ir,ci as Ar,cj as Er,o as ka,ck as kr,cl as Dr,cm as ja,$ as _r,cn as wr,co as Pr,cp as Tr,cq as Fr,a5 as vr}from"./index-Dw0sYJvv.js";import{n as _e,D as zt,S as Or}from"./mui-Bg09VkiQ.js";import{a as c}from"./sentry-WdXgkw90.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Re,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Ur,S as it}from"./SetupPagesScreen-5gu402_s.js";import Ua from"./NotFoundScreen-DYeXrX7_.js";import{M as ha}from"./MobileAppDrawer-CsFu1SGJ.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import{v as ct}from"./utils-CJNmQJBz.js";import{t as Rr}from"./AddressScreen-Ca2p0J93.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./analyticsHelper-BI0zNJMo.js";import"./routePaths-DriCJPaW.js";import"./BusinessVerificationPageScreen-CETF7Xs2.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]="159ff20a-265a-493f-a21e-ab9fdfb4361d",e._sentryDebugIdIdentifier="sentry-dbid-159ff20a-265a-493f-a21e-ab9fdfb4361d")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=X.getSignedInUser(),n=S(G=>ie(G)),u=Ue(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),R=d.chargeCard,M=R?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=R?.cardHolderUser?.userId,U=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=U?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=R?.type.code==="business_physical_credit_card"||R?.type.code==="business_physical_debit_card",K=R?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&R?.status?.code!=="active"||R?.cardHolderUserId!==r.userId||i===!1&&I===!1||R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,R,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=R?.type.code==="business_physical_debit_card"||R?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:R?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:U?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Jt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=X.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ua,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=X.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Xt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),R=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:R}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=X.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),U=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(U,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Re(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-Cxvop2w5.js";import{a as g}from"./sentry-Bel9R1P0.js";import{j as v,h as x,u as k,l as T,g as b,k as E}from"./core-DGD8k-EU.js";import{z as N,b1 as F,A as P,d as L,f as V,ab as O,b2 as j,ap as A,aq as U,x as B}from"./index-CNT4WvUT.js";import{eN as D,fB as _,rw as M,fw as R,c0 as z,Lv as G,bn as Y,pE as q,ps as H,j_ as Z,lu as S,Lw as $,bC as J,ct as C,lC as K,lF as Q}from"./zeni-epic-state-CjARY91O.js";import"./mui-Cdh_ZgIg.js";import{c as W}from"./routePaths-CKa13qEa.js";import{M as X}from"./MobileAppDrawer-BqatZNBg.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="66058ba6-1fe6-48c8-8ff3-8bca9b67bcd5",t._sentryDebugIdIdentifier="sentry-dbid-66058ba6-1fe6-48c8-8ff3-8bca9b67bcd5")}catch{}})();const ee=E(function(t){const a=R(t),i=N.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const n=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({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,w={companyInfo:{...n,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(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?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:w}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t($(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(Z({files:e}))},onDeleteFile:e=>{t(H(e))},onEditFileName:(e,n)=>{t(q(e,n.split(".")[0]))}}})(j);function de(){const t=v(),a=x(),i=k(),{tenantEmailDomain:l}=T(),[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??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(_(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(M())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,O(i)?"Settings":"Company Passport")}),O(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:O(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-BJogRArg.js";import{a as g}from"./sentry-WdXgkw90.js";import{j as v,h as x,u as k,l as T,g as b,k as E}from"./core-BojUR2ky.js";import{z as N,b1 as F,A as P,d as L,f as V,ab as O,b2 as j,ap as A,aq as U,x as B}from"./index-Dw0sYJvv.js";import{eN as D,fB as _,rw as M,fw as R,c0 as z,Lv as G,bn as Y,pE as q,ps as H,j_ as Z,lu as S,Lw as $,bC as J,ct as C,lC as K,lF as Q}from"./zeni-epic-state-BJsXImBw.js";import"./mui-Bg09VkiQ.js";import{c as W}from"./routePaths-DriCJPaW.js";import{M as X}from"./MobileAppDrawer-CsFu1SGJ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="66058ba6-1fe6-48c8-8ff3-8bca9b67bcd5",t._sentryDebugIdIdentifier="sentry-dbid-66058ba6-1fe6-48c8-8ff3-8bca9b67bcd5")}catch{}})();const ee=E(function(t){const a=R(t),i=N.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const n=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({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,w={companyInfo:{...n,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(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?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:w}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t($(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(Z({files:e}))},onDeleteFile:e=>{t(H(e))},onEditFileName:(e,n)=>{t(q(e,n.split(".")[0]))}}})(j);function de(){const t=v(),a=x(),i=k(),{tenantEmailDomain:l}=T(),[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??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(_(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(M())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,O(i)?"Settings":"Company Passport")}),O(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,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-Cxvop2w5.js";import{a}from"./sentry-Bel9R1P0.js";import{h as D,u as v,g as m,N as w}from"./core-DGD8k-EU.js";import{Ig as O,eN as A,fi as _,ml as U,fK as E,fh as j,eO as L,In as F}from"./zeni-epic-state-CjARY91O.js";import{u as $,z as u,L as g,D as k,o as H}from"./index-CNT4WvUT.js";import{n as z}from"./mui-Cdh_ZgIg.js";import{t as R}from"./getLocaleForTenant-BrCCfdIO.js";import{g as P,Q as G}from"./QBOConnectionScreen-Cnhg87ad.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.js";import"./empty-C-OX54ey.js";import"./pdf-lib-o7tH0fyZ.js";import"./index-vWYcYgGc.js";import"./url-CXvkkYyM.js";import"./index-CTLIpLfK.js";import"./decodeURIComponentSafe-DKUmHyeo.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]="f8f6cb81-5e78-403d-a489-46afc299ebc0",t._sentryDebugIdIdentifier="sentry-dbid-f8f6cb81-5e78-403d-a489-46afc299ebc0")}catch{}})();const K=z.div`
1
+ import{j as C}from"./liveblocks-BJogRArg.js";import{a}from"./sentry-WdXgkw90.js";import{h as D,u as v,g as m,N as w}from"./core-BojUR2ky.js";import{Ig as O,eN as A,fi as _,ml as U,fK as E,fh as j,eO as L,In as F}from"./zeni-epic-state-BJsXImBw.js";import{u as $,z as u,L as g,D as k,o as H}from"./index-Dw0sYJvv.js";import{n as z}from"./mui-Bg09VkiQ.js";import{t as R}from"./getLocaleForTenant-DXctzPv_.js";import{g as P,Q as G}from"./QBOConnectionScreen-ZbQqcTvr.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./empty-U91QAR9K.js";import"./pdf-lib-CayRdH4_.js";import"./index-BFSmByg_.js";import"./url-BxFmO3XK.js";import"./index-Bl7KFfTZ.js";import"./decodeURIComponentSafe-Cj7RmfYA.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]="f8f6cb81-5e78-403d-a489-46afc299ebc0",t._sentryDebugIdIdentifier="sentry-dbid-f8f6cb81-5e78-403d-a489-46afc299ebc0")}catch{}})();const K=z.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -0,0 +1 @@
1
+ import{j as d}from"./liveblocks-BJogRArg.js";import{z as n}from"./index-Dw0sYJvv.js";import{g as p}from"./QBOConnectionScreen-ZbQqcTvr.js";import"./sentry-WdXgkw90.js";import{u as a,N as i}from"./core-BojUR2ky.js";import"./zeni-epic-state-BJsXImBw.js";import"./recharts-CYOGURoz.js";import"./mui-Bg09VkiQ.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./empty-U91QAR9K.js";import"./pdf-lib-CayRdH4_.js";import"./index-BFSmByg_.js";import"./url-BxFmO3XK.js";import"./index-Bl7KFfTZ.js";import"./decodeURIComponentSafe-Cj7RmfYA.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-Cxvop2w5.js";import{t as $e,A as Ce}from"./AddressScreen-C6IvqCLW.js";import ze from"./NotFoundScreen-BrmwEoGP.js";import{a as g}from"./sentry-Bel9R1P0.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as qe,o as M}from"./core-DGD8k-EU.js";import{$ as de,j as le,z as B,a as ue,h as Je,p as _,x as V,A as H,d as N,B as we,f as X,al as Ke,q as Qe,am as Ie,k as te,an as Ze,ao as ke,o as He,ap as We,aq as xe,ar as Xe}from"./index-CNT4WvUT.js";import{bn as Ye,eN as ee,fa as et,eT as pe,eR as me,bv as tt,mj as at,f6 as nt,bM as ot,j2 as ae,j5 as ve,I_ as st,bR as it,c0 as ge,rK as fe,rv as rt,Ja as Y,rL as _e,GH as ct,k6 as Ue,Jb as Ve,Jc as dt,Jd as lt,Je as ut,j0 as pt,j3 as mt,rx as Be,rJ as gt,bC as Ee,ct as ft,rX as Te,pE as ht,ps as yt,j_ as St,fz as bt,fy as Ct,fx as It,Jf as kt,rp as xt,rY as Et,r$ as Tt,s2 as Ot,s8 as Pt,cS as At}from"./zeni-epic-state-CjARY91O.js";import{n as he}from"./mui-Cdh_ZgIg.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-Cnhg87ad.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.js";import"./empty-C-OX54ey.js";import"./pdf-lib-o7tH0fyZ.js";import"./index-vWYcYgGc.js";import"./url-CXvkkYyM.js";import"./index-CTLIpLfK.js";import"./decodeURIComponentSafe-DKUmHyeo.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]="957c367a-53d9-4b4f-8a4e-a34cdc3f24eb",t._sentryDebugIdIdentifier="sentry-dbid-957c367a-53d9-4b4f-8a4e-a34cdc3f24eb")}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"}})}}})(Ke),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),k=Je(),{isFeatureEnabled:E}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),A=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!q,J=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),J===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!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(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(x,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Q=>Q.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-BJogRArg.js";import{t as $e,A as Ce}from"./AddressScreen-Ca2p0J93.js";import ze from"./NotFoundScreen-DYeXrX7_.js";import{a as g}from"./sentry-WdXgkw90.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as qe,o as M}from"./core-BojUR2ky.js";import{$ as de,j as le,z as B,a as ue,h as Je,p as _,x as V,A as H,d as N,B as we,f as X,al as Ke,q as Qe,am as Ie,k as te,an as Ze,ao as ke,o as He,ap as We,aq as xe,ar as Xe}from"./index-Dw0sYJvv.js";import{bn as Ye,eN as ee,fa as et,eT as pe,eR as me,bv as tt,mj as at,f6 as nt,bM as ot,j2 as ae,j5 as ve,I_ as st,bR as it,c0 as ge,rK as fe,rv as rt,Ja as Y,rL as _e,GH as ct,k6 as Ue,Jb as Ve,Jc as dt,Jd as lt,Je as ut,j0 as pt,j3 as mt,rx as Be,rJ as gt,bC as Ee,ct as ft,rX as Te,pE as ht,ps as yt,j_ as St,fz as bt,fy as Ct,fx as It,Jf as kt,rp as xt,rY as Et,r$ as Tt,s2 as Ot,s8 as Pt,cS as At}from"./zeni-epic-state-BJsXImBw.js";import{n as he}from"./mui-Bg09VkiQ.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-ZbQqcTvr.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./empty-U91QAR9K.js";import"./pdf-lib-CayRdH4_.js";import"./index-BFSmByg_.js";import"./url-BxFmO3XK.js";import"./index-Bl7KFfTZ.js";import"./decodeURIComponentSafe-Cj7RmfYA.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]="957c367a-53d9-4b4f-8a4e-a34cdc3f24eb",t._sentryDebugIdIdentifier="sentry-dbid-957c367a-53d9-4b4f-8a4e-a34cdc3f24eb")}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"}})}}})(Ke),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),k=Je(),{isFeatureEnabled:E}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),A=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!q,J=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),J===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!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(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(x,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Q=>Q.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=he.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-Cxvop2w5.js";import{l as K,g as k,u as z,h as G,j as q,k as H,s as $a,n as nt,o as D}from"./core-DGD8k-EU.js";import{eN as L,Jv as Me,bC as Yt,bq as de,KI as za,hS as qa,KJ as wt,KK as Za,hV as ot,KL as Re,KM as Ha,h_ as Ja,KN as xt,KO as Qa,i2 as st,KP as je,KQ as Xa,cj as it,KR as Wa,KS as en,JP as tn,iY as an,KT as nn,bn as ye,KU as Vt,Jj as W,bc as Nt,ja as Gt,mt as Kt,iV as $t,Jl as ee,Jk as Z,f2 as on,fk as sn,KV as rn,KW as cn,KX as zt,KY as ge,tA as ve,tB as Ie,tY as ue,tS as te,tF as Ae,KZ as ln,K_ as dn,K$ as un,L0 as qt,L1 as be,L2 as mn,dB as Ue,qc as Zt,L3 as pn,L4 as hn,L5 as fn,L6 as ct,IH as lt,jq as me,u4 as dt,qk as gn,L7 as bn,tC as Dt,qf as ce,qb as Ht,L8 as oe,L9 as Cn,La as ut,IF as mt,sc as Jt,Lb as _n,Lc as kn,Ld as Sn,Le as pt,sp as yn,Lf as vn,tE as Ot,sb as Qt,Lg as se,Lh as In,bv as Xt,u8 as Wt,Li as An,Lj as En,Lk as Tn,Ll as ht,u3 as wn,Lm as xn,tD as Ft,u7 as ea,Ln as re,Lo as Dn,Lp as On,Lq as ta,jf as aa,mq as na,jk as oa,mo as sa,mn as ra,mm as ia,rA as Fn,fa as Pn,cM as Bn,cN as Rn,mj as jn,f6 as Ln,mA as Mn,Lr as Un,Dc as Yn,Ls as Vn,Lt as Nn,Lu as Gn,b5 as ft,eZ as Kn,gA as $n,fB as zn,mu as qn,iO as Zn,mr as Hn,mp as Jn,eT as Qn,eR as Xn}from"./zeni-epic-state-CjARY91O.js";import{z as j,O as J,x as O,d as A,D as $,aQ as Wn,J as Ee,A as Te,aR as ca,f as V,aS as eo,j as we,aT as la,a as Ye,p as M,h as to,aU as ao,aV as no,q as oo,c as da,_ as so,aW as ro,aJ as ua,aX as io,aY as co,N as lo,aZ as xe,a_ as uo,am as mo,v as po,K as ho,a$ as fo,b0 as _e}from"./index-CNT4WvUT.js";import{n as gt}from"./mui-Cdh_ZgIg.js";import{a as _}from"./sentry-Bel9R1P0.js";import{w as ma}from"./withTransactionSidePanel-Bmv6ar-S.js";import{b as pa,t as pe,e as ae,a as bt,v as go}from"./routePaths-CKa13qEa.js";import{u as Ve}from"./useAskAiCfoHostNavButtonProps-CwXdaO7x.js";import{c as De,b as bo}from"./useFetchSuggestedQuestionsWhenReady-7gmq8HnL.js";import Se from"./NotFoundScreen-BrmwEoGP.js";import{t as ha}from"./analyticsHelper-CNwzWBf_.js";import{C as Co}from"./CompanyPassportScreen-7bEBCgDZ.js";import{F as _o}from"./FeaturePreviewScreen-BBBv1uMR.js";import{R as ko}from"./ReferralListScreen-Czxg_tCU.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.js";import"./TransactionDetailScreen-B3KLkUFa.js";import"./decodeURIComponentSafe-DKUmHyeo.js";import"./MobileAppDrawer-BqatZNBg.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]="d774842e-15f3-4fb1-bff2-54658f78ee5c",e._sentryDebugIdIdentifier="sentry-dbid-d774842e-15f3-4fb1-bff2-54658f78ee5c")}catch{}})();const So=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(T=>T.tenantState.currentTenantId),u=k(T=>L(T)),{tenantEmailDomain:f}=K(),g=z(),b=u?.companyName??"",p={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=_.useMemo(()=>({authParams:p,companyName:b,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=_.useMemo(()=>r!=null?Yt(r):de(),[r]),C=G(),d=q(),h=k(T=>za(T,m,o)),S=_.useCallback(()=>{o!=null&&h.fetchState!=="In-Progress"&&h.fetchState!=="Completed"&&C(qa(o,m))},[m]),y=_.useCallback(()=>{d("../../",{relative:"path"})},[]),F=_.useCallback((T,B)=>{C(wt({sortKey:T,sortOrder:B}))},[]),E=_.useCallback(T=>{C(wt({downloadState:T}))},[]),v=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(f!=null){const B=pa({id:T.transactionId,type:T.transactionType},f);d(B);const he=O(g.state?.pathnameStackToGoBack,g.pathname);d(B,{state:{pathnameStackToGoBack:he}})}},[f,e]),w=_.useCallback(()=>{h.vendor!=null&&A.trackApAgingDetail("AP Aging",m.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),h.vendor.id,h.vendor.name)},[h.vendor,m]);return _.useEffect(()=>{S()},[]),_.useEffect(()=>{h.fetchState==="Completed"&&w()},[w,h.fetchState]),l.jsx(Wn,{apAgingDetail:h,downloadParams:c,reportDate:m,analytics:A,onTransactionClick:v,onReload:S,onBackClick:y,onColumnSortConfigChanged:F,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),yo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=G(),n=q(),o=k(v=>Za(v)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(v=>v.tenantState.currentTenantId),f=k(v=>L(v)),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),c=o.apAgingUIState.selectedDate??de(),m=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(ot(c))},[]);_.useEffect(()=>{m()},[]);const C=_.useCallback(()=>{n("../",{relative:"path"})},[]),d=_.useCallback(v=>{t(Re({searchString:v}))},[]),h=_.useCallback((v,w)=>{t(Re({sortKey:w,sortOrder:v}))},[]),S=_.useCallback(v=>{n(`./${v}/${c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[c]),y=_.useCallback(v=>{t(Re({downloadState:v}))},[]),F=_.useCallback((v,w)=>{},[]),E=_.useCallback((v,w)=>{t(Re({selectedDate:v,agingDateSelectionType:w})),t(ot(v))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:v=>v.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:p,analytics:A,onReloadReport:m,onBackClick:C,onSearchTextChange:d,onSortOrderChange:h,onEntityNameClick:S,updateDownloadStateHandler:y,onSelectedDateChanged:E,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(w=>L(w)),{tenantEmailDomain:u}=K(),f=z(),g=i.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=_.useMemo(()=>r!=null?Yt(r):de(),[r]),m=G(),C=q(),d=k(w=>Ha(w,c,o)),h=_.useCallback(()=>{o!=null&&d.fetchState!=="In-Progress"&&d.fetchState!=="Completed"&&m(Ja(o,c))},[c]),S=_.useCallback(()=>{C("../../",{relative:"path"})},[]),y=_.useCallback((w,T)=>{m(xt({sortKey:w,sortOrder:T}))},[]),F=_.useCallback(w=>{m(xt({downloadState:w}))},[]),E=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(u!=null){const T=pa({id:w.transactionId,type:w.transactionType},u);C(T);const B=O(f.state?.pathnameStackToGoBack,f.pathname);C(T,{state:{pathnameStackToGoBack:B}})}},[u,e]),v=_.useCallback(()=>{d.customer!=null&&A.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),d.customer.id,d.customer.name)},[d.customer,c]);return _.useEffect(()=>{h()},[]),_.useEffect(()=>{d.fetchState==="Completed"&&v()},[d.fetchState,v]),l.jsx(eo,{arAgingDetail:d,downloadParams:p,reportDate:c,analytics:A,onTransactionClick:E,onReload:h,onBackClick:S,onColumnSortConfigChanged:y,updateDownloadStateHandler:F,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=G(),n=q(),o=k(E=>Qa(E)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(E=>L(E)),f=u.companyName,g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:g,companyName:f,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),p=o.arAgingUIState.selectedDate??de(),c=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(st(p))},[]);_.useEffect(()=>{c()},[]);const m=_.useCallback(()=>{n("../",{relative:"path"})},[]),C=_.useCallback(E=>{t(je({searchString:E}))},[]),d=_.useCallback((E,v)=>{t(je({sortKey:v,sortOrder:E}))},[]),h=_.useCallback(E=>{n(`./${E}/${p.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[p]),S=_.useCallback(E=>{t(je({downloadState:E}))},[]),y=_.useCallback((E,v)=>{t(je({selectedDate:E,agingDateSelectionType:v})),t(st(E))},[]),F=_.useCallback((E,v)=>{t(Xa({nodeId:E,isCollapsed:v}))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:E=>E.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:A,onReloadReport:c,onBackClick:m,onSearchTextChange:C,onSortOrderChange:d,onEntityNameClick:h,updateDownloadStateHandler:S,onSelectedDateChanged:y,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?A.trackZeniAccountsCashBalancePromoClicked("Move Money"):(A.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else A.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Ao=H(function(e){const a=Wa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:A}},ga)(la),Eo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=j.getSignedInUser(),n=ye(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:A}},ga)(la);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=it(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Ao,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=it(n?.loggedInUserRoleMap),r=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const xo=gt.div`
1
+ import{j as l}from"./liveblocks-BJogRArg.js";import{l as K,g as k,u as z,h as G,j as q,k as H,s as $a,n as nt,o as D}from"./core-BojUR2ky.js";import{eN as L,Jv as Me,bC as Yt,bq as de,KI as za,hS as qa,KJ as wt,KK as Za,hV as ot,KL as Re,KM as Ha,h_ as Ja,KN as xt,KO as Qa,i2 as st,KP as je,KQ as Xa,cj as it,KR as Wa,KS as en,JP as tn,iY as an,KT as nn,bn as ye,KU as Vt,Jj as W,bc as Nt,ja as Gt,mt as Kt,iV as $t,Jl as ee,Jk as Z,f2 as on,fk as sn,KV as rn,KW as cn,KX as zt,KY as ge,tA as ve,tB as Ie,tY as ue,tS as te,tF as Ae,KZ as ln,K_ as dn,K$ as un,L0 as qt,L1 as be,L2 as mn,dB as Ue,qc as Zt,L3 as pn,L4 as hn,L5 as fn,L6 as ct,IH as lt,jq as me,u4 as dt,qk as gn,L7 as bn,tC as Dt,qf as ce,qb as Ht,L8 as oe,L9 as Cn,La as ut,IF as mt,sc as Jt,Lb as _n,Lc as kn,Ld as Sn,Le as pt,sp as yn,Lf as vn,tE as Ot,sb as Qt,Lg as se,Lh as In,bv as Xt,u8 as Wt,Li as An,Lj as En,Lk as Tn,Ll as ht,u3 as wn,Lm as xn,tD as Ft,u7 as ea,Ln as re,Lo as Dn,Lp as On,Lq as ta,jf as aa,mq as na,jk as oa,mo as sa,mn as ra,mm as ia,rA as Fn,fa as Pn,cM as Bn,cN as Rn,mj as jn,f6 as Ln,mA as Mn,Lr as Un,Dc as Yn,Ls as Vn,Lt as Nn,Lu as Gn,b5 as ft,eZ as Kn,gA as $n,fB as zn,mu as qn,iO as Zn,mr as Hn,mp as Jn,eT as Qn,eR as Xn}from"./zeni-epic-state-BJsXImBw.js";import{z as j,O as J,x as O,d as A,D as $,aQ as Wn,J as Ee,A as Te,aR as ca,f as V,aS as eo,j as we,aT as la,a as Ye,p as M,h as to,aU as ao,aV as no,q as oo,c as da,_ as so,aW as ro,aJ as ua,aX as io,aY as co,N as lo,aZ as xe,a_ as uo,am as mo,v as po,K as ho,a$ as fo,b0 as _e}from"./index-Dw0sYJvv.js";import{n as gt}from"./mui-Bg09VkiQ.js";import{a as _}from"./sentry-WdXgkw90.js";import{w as ma}from"./withTransactionSidePanel-DUWL7sXt.js";import{b as pa,t as pe,e as ae,a as bt,v as go}from"./routePaths-DriCJPaW.js";import{u as Ve}from"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import{c as De,b as bo}from"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import Se from"./NotFoundScreen-DYeXrX7_.js";import{t as ha}from"./analyticsHelper-BI0zNJMo.js";import{C as Co}from"./CompanyPassportScreen-CEn8Hq_N.js";import{F as _o}from"./FeaturePreviewScreen-Bb7LAhIT.js";import{R as ko}from"./ReferralListScreen-CJVut1-a.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./TransactionDetailScreen-DwslT8ci.js";import"./decodeURIComponentSafe-Cj7RmfYA.js";import"./MobileAppDrawer-CsFu1SGJ.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]="d774842e-15f3-4fb1-bff2-54658f78ee5c",e._sentryDebugIdIdentifier="sentry-dbid-d774842e-15f3-4fb1-bff2-54658f78ee5c")}catch{}})();const So=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(T=>T.tenantState.currentTenantId),u=k(T=>L(T)),{tenantEmailDomain:f}=K(),g=z(),b=u?.companyName??"",p={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=_.useMemo(()=>({authParams:p,companyName:b,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=_.useMemo(()=>r!=null?Yt(r):de(),[r]),C=G(),d=q(),h=k(T=>za(T,m,o)),S=_.useCallback(()=>{o!=null&&h.fetchState!=="In-Progress"&&h.fetchState!=="Completed"&&C(qa(o,m))},[m]),y=_.useCallback(()=>{d("../../",{relative:"path"})},[]),F=_.useCallback((T,B)=>{C(wt({sortKey:T,sortOrder:B}))},[]),E=_.useCallback(T=>{C(wt({downloadState:T}))},[]),v=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(f!=null){const B=pa({id:T.transactionId,type:T.transactionType},f);d(B);const he=O(g.state?.pathnameStackToGoBack,g.pathname);d(B,{state:{pathnameStackToGoBack:he}})}},[f,e]),w=_.useCallback(()=>{h.vendor!=null&&A.trackApAgingDetail("AP Aging",m.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),h.vendor.id,h.vendor.name)},[h.vendor,m]);return _.useEffect(()=>{S()},[]),_.useEffect(()=>{h.fetchState==="Completed"&&w()},[w,h.fetchState]),l.jsx(Wn,{apAgingDetail:h,downloadParams:c,reportDate:m,analytics:A,onTransactionClick:v,onReload:S,onBackClick:y,onColumnSortConfigChanged:F,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),yo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=G(),n=q(),o=k(v=>Za(v)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(v=>v.tenantState.currentTenantId),f=k(v=>L(v)),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),c=o.apAgingUIState.selectedDate??de(),m=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(ot(c))},[]);_.useEffect(()=>{m()},[]);const C=_.useCallback(()=>{n("../",{relative:"path"})},[]),d=_.useCallback(v=>{t(Re({searchString:v}))},[]),h=_.useCallback((v,w)=>{t(Re({sortKey:w,sortOrder:v}))},[]),S=_.useCallback(v=>{n(`./${v}/${c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[c]),y=_.useCallback(v=>{t(Re({downloadState:v}))},[]),F=_.useCallback((v,w)=>{},[]),E=_.useCallback((v,w)=>{t(Re({selectedDate:v,agingDateSelectionType:w})),t(ot(v))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:v=>v.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:p,analytics:A,onReloadReport:m,onBackClick:C,onSearchTextChange:d,onSortOrderChange:h,onEntityNameClick:S,updateDownloadStateHandler:y,onSelectedDateChanged:E,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(w=>L(w)),{tenantEmailDomain:u}=K(),f=z(),g=i.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=_.useMemo(()=>r!=null?Yt(r):de(),[r]),m=G(),C=q(),d=k(w=>Ha(w,c,o)),h=_.useCallback(()=>{o!=null&&d.fetchState!=="In-Progress"&&d.fetchState!=="Completed"&&m(Ja(o,c))},[c]),S=_.useCallback(()=>{C("../../",{relative:"path"})},[]),y=_.useCallback((w,T)=>{m(xt({sortKey:w,sortOrder:T}))},[]),F=_.useCallback(w=>{m(xt({downloadState:w}))},[]),E=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(u!=null){const T=pa({id:w.transactionId,type:w.transactionType},u);C(T);const B=O(f.state?.pathnameStackToGoBack,f.pathname);C(T,{state:{pathnameStackToGoBack:B}})}},[u,e]),v=_.useCallback(()=>{d.customer!=null&&A.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),d.customer.id,d.customer.name)},[d.customer,c]);return _.useEffect(()=>{h()},[]),_.useEffect(()=>{d.fetchState==="Completed"&&v()},[d.fetchState,v]),l.jsx(eo,{arAgingDetail:d,downloadParams:p,reportDate:c,analytics:A,onTransactionClick:E,onReload:h,onBackClick:S,onColumnSortConfigChanged:y,updateDownloadStateHandler:F,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=G(),n=q(),o=k(E=>Qa(E)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(E=>L(E)),f=u.companyName,g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:g,companyName:f,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),p=o.arAgingUIState.selectedDate??de(),c=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(st(p))},[]);_.useEffect(()=>{c()},[]);const m=_.useCallback(()=>{n("../",{relative:"path"})},[]),C=_.useCallback(E=>{t(je({searchString:E}))},[]),d=_.useCallback((E,v)=>{t(je({sortKey:v,sortOrder:E}))},[]),h=_.useCallback(E=>{n(`./${E}/${p.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[p]),S=_.useCallback(E=>{t(je({downloadState:E}))},[]),y=_.useCallback((E,v)=>{t(je({selectedDate:E,agingDateSelectionType:v})),t(st(E))},[]),F=_.useCallback((E,v)=>{t(Xa({nodeId:E,isCollapsed:v}))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:E=>E.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:A,onReloadReport:c,onBackClick:m,onSearchTextChange:C,onSortOrderChange:d,onEntityNameClick:h,updateDownloadStateHandler:S,onSelectedDateChanged:y,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?A.trackZeniAccountsCashBalancePromoClicked("Move Money"):(A.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else A.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Ao=H(function(e){const a=Wa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:A}},ga)(la),Eo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=j.getSignedInUser(),n=ye(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:A}},ga)(la);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=it(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Ao,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=it(n?.loggedInUserRoleMap),r=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const xo=gt.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-Cxvop2w5.js";import{a as u}from"./sentry-Bel9R1P0.js";import{h as y,g as b,k as w,u as A,N}from"./core-DGD8k-EU.js";import{Ig as k,eN as _,fi as U,Ih as L,ml as R,Ii as z}from"./zeni-epic-state-CjARY91O.js";import{u as O,z as f,L as T,t as S,D as $,b as j}from"./index-CNT4WvUT.js";import"./mui-Cdh_ZgIg.js";import{t as P}from"./getLocaleForTenant-BrCCfdIO.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.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]="25aa12d1-2af3-4507-9532-9acbfc7286e2",t._sentryDebugIdIdentifier="sentry-dbid-25aa12d1-2af3-4507-9532-9acbfc7286e2")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,I=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>k(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-BJogRArg.js";import{a as u}from"./sentry-WdXgkw90.js";import{h as y,g as b,k as w,u as A,N}from"./core-BojUR2ky.js";import{Ig as k,eN as _,fi as U,Ih as L,ml as R,Ii as z}from"./zeni-epic-state-BJsXImBw.js";import{u as O,z as f,L as T,t as S,D as $,b as j}from"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import{t as P}from"./getLocaleForTenant-DXctzPv_.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.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]="25aa12d1-2af3-4507-9532-9acbfc7286e2",t._sentryDebugIdIdentifier="sentry-dbid-25aa12d1-2af3-4507-9532-9acbfc7286e2")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,I=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>k(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-Cxvop2w5.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-DGD8k-EU.js";import{Mc as k,Mj as _,fz as q,fy as J,fx as K,im as L,Jk as W,pv as Q,eN as V,LK as D,ik as T,Md as v,Mm as F,ii as G,iG as j}from"./zeni-epic-state-CjARY91O.js";import{bn as X,q as N,a as R,z as U,h as z,v as p,p as S,B as M,bo as Y,o as O,bp as ee,x as te}from"./index-CNT4WvUT.js";import{n as Z}from"./mui-Cdh_ZgIg.js";import"./sentry-Bel9R1P0.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]="2813b1ce-dae5-47b0-945c-617f53a5d220",e._sentryDebugIdIdentifier="sentry-dbid-2813b1ce-dae5-47b0-945c-617f53a5d220")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(L(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(W("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(K(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Z.div`
1
+ import{j as l}from"./liveblocks-BJogRArg.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-BojUR2ky.js";import{Mc as k,Mj as _,fz as q,fy as J,fx as K,im as L,Jk as W,pv as Q,eN as V,LK as D,ik as T,Md as v,Mm as F,ii as G,iG as j}from"./zeni-epic-state-BJsXImBw.js";import{bn as X,q as N,a as R,z as U,h as z,v as p,p as S,B as M,bo as Y,o as O,bp as ee,x as te}from"./index-Dw0sYJvv.js";import{n as Z}from"./mui-Bg09VkiQ.js";import"./sentry-WdXgkw90.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]="2813b1ce-dae5-47b0-945c-617f53a5d220",e._sentryDebugIdIdentifier="sentry-dbid-2813b1ce-dae5-47b0-945c-617f53a5d220")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(L(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(W("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(K(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Z.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-Cxvop2w5.js";import{q as c,C as l,h as f}from"./index-CNT4WvUT.js";import{D as p}from"./mui-Cdh_ZgIg.js";import"./sentry-Bel9R1P0.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]="4c16b3f2-8281-4a9e-9fd4-8a0c1cec6b29",e._sentryDebugIdIdentifier="sentry-dbid-4c16b3f2-8281-4a9e-9fd4-8a0c1cec6b29")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=c(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
1
+ import{j as i}from"./liveblocks-BJogRArg.js";import{q as c,C as l,h as f}from"./index-Dw0sYJvv.js";import{D as p}from"./mui-Bg09VkiQ.js";import"./sentry-WdXgkw90.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]="4c16b3f2-8281-4a9e-9fd4-8a0c1cec6b29",e._sentryDebugIdIdentifier="sentry-dbid-4c16b3f2-8281-4a9e-9fd4-8a0c1cec6b29")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=c(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-Cxvop2w5.js";import{a as d}from"./sentry-Bel9R1P0.js";import{j as A,h as B,u as J,l as q,g as l,N,k as F,n as W,o as _}from"./core-DGD8k-EU.js";import{Kr as z,eN as O,JQ as K,kq as M,Gz as b,Kw as R,Jj as V,jq as Y,GA as S,JV as $,JW as Q,Jl as H,Jk as L}from"./zeni-epic-state-CjARY91O.js";import{aN as U,d as X,v as Z,x as tt}from"./index-CNT4WvUT.js";import"./mui-Cdh_ZgIg.js";import{d as k}from"./decodeURIComponentSafe-DKUmHyeo.js";import{w as et}from"./withTransactionSidePanel-Bmv6ar-S.js";import{e as at,b as nt}from"./routePaths-CKa13qEa.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.js";import"./useAskAiCfoHostNavButtonProps-CwXdaO7x.js";import"./useFetchSuggestedQuestionsWhenReady-7gmq8HnL.js";import"./TransactionDetailScreen-B3KLkUFa.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]="114b5874-7081-46ef-b053-923aa25fa95d",a._sentryDebugIdIdentifier="sentry-dbid-114b5874-7081-46ef-b053-923aa25fa95d")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=R(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:V(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:Y(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=q(),r=k(j??""),p=k(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=l(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>K(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(b(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(N,{to:I(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(W,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
1
+ import{j as s}from"./liveblocks-BJogRArg.js";import{a as d}from"./sentry-WdXgkw90.js";import{j as A,h as B,u as J,l as q,g as l,N,k as F,n as W,o as _}from"./core-BojUR2ky.js";import{Kr as z,eN as O,JQ as K,kq as M,Gz as b,Kw as R,Jj as V,jq as Y,GA as S,JV as $,JW as Q,Jl as H,Jk as L}from"./zeni-epic-state-BJsXImBw.js";import{aN as U,d as X,v as Z,x as tt}from"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import{d as k}from"./decodeURIComponentSafe-Cj7RmfYA.js";import{w as et}from"./withTransactionSidePanel-DUWL7sXt.js";import{e as at,b as nt}from"./routePaths-DriCJPaW.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import"./TransactionDetailScreen-DwslT8ci.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]="114b5874-7081-46ef-b053-923aa25fa95d",a._sentryDebugIdIdentifier="sentry-dbid-114b5874-7081-46ef-b053-923aa25fa95d")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=R(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:V(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:Y(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=q(),r=k(j??""),p=k(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=l(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>K(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(b(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(N,{to:I(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(W,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
@@ -1,4 +1,4 @@
1
- import{j as p}from"./liveblocks-Cxvop2w5.js";import xn from"./NotFoundScreen-BrmwEoGP.js";import{a as s,b as Pt}from"./sentry-Bel9R1P0.js";import{n as De,S as Rn}from"./mui-Cdh_ZgIg.js";import{h as se,j as wt,u as qe,g as F,k as Dn,l as rt,n as On,o as je}from"./core-DGD8k-EU.js";import{eN as we,OK as Un,mv as Ce,fd as Fn,q6 as Bn,mN as xt,n6 as Rt,OL as Dt,ng as _n,OM as Ot,mG as Vn,pE as Mn,eY as he,ON as xe,s5 as Ut,Bg as Ft,OO as Bt,OP as jn,pj as Ge,Ks as dt,Ku as zn,jt as Ln,Kv as $n,jA as qn,cU as Gn,t8 as Je,jq as Jn,mT as _t,nl as Re,OQ as Nn,Jl as ut,Jk as Ae,OR as mt,jR as Yn,OS as Kn,OT as Wn,OU as Zn,OV as Hn,m_ as Qn,mL as ce,no as Te,OW as Xn,OX as ea,OY as ta,nv as na,jE as aa,jv as oa,OZ as sa,jD as ht,KC as ca,O_ as ia,O$ as la,pf as ra,oW as da,nm as pe,oV as ze,P0 as ua,P1 as ma,l8 as ha,bq as pa,l3 as pt,kR as ga,P2 as Ca,gC as gt,fP as Sa,l0 as Ia,v1 as fa,P3 as ka,nW as Ea,nR as va,nV as ya,nG as ba,P4 as Aa,e$ as Vt,n9 as Ta,mW as Pa,fe as Ct,nq as wa,P5 as xa,nn as Mt,P6 as Ra,P7 as Da,P8 as Oa,P9 as Ua,Pa as St,pr as Fa,oM as Ba,Jj as _a,jC as Va,Pb as Ma,FA as ja,jB as za,e_ as La,ol as jt,oE as $a,nk as It,np as qa,bC as Ga,kZ as Ja,kW as Na,Pc as Ya,nF as ft,oC as kt,oA as Ka,oq as Wa,o5 as Za,oD as Ha,Pd as Qa,Pe as Xa,o9 as eo,Pf as to,n$ as no,o8 as ao,o6 as oo,oH as so}from"./zeni-epic-state-CjARY91O.js";import{J as zt,a as Lt,p as ge,d as L,x as H,K as $t,cu as co,z as Oe,cv as io,ap as Pe,cw as lo,aP as Et,B as qt,cx as ro,am as Le,D as uo,cy as mo,O as ho,cz as po,cA as go,cB as Co,$ as So,j as Io,aJ as fo,b1 as ko,C as Eo,cC as vo}from"./index-CNT4WvUT.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-CwXdaO7x.js";import{c as Jt}from"./useFetchSuggestedQuestionsWhenReady-7gmq8HnL.js";import{c as vt,C as yo}from"./TransactionDetailScreen-B3KLkUFa.js";import{w as bo}from"./withTransactionSidePanel-Bmv6ar-S.js";import{h as Ao,v as To}from"./routePaths-CKa13qEa.js";import{g as $e}from"./accountMappingHelper-C1yTeNF1.js";import{D as Po}from"./DrawerScreen-D376zeqM.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.js";import"./decodeURIComponentSafe-DKUmHyeo.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="15b47f60-5b09-4345-a70c-ed05c6ce78cc",t._sentryDebugIdIdentifier="sentry-dbid-15b47f60-5b09-4345-a70c-ed05c6ce78cc")}catch{}})();const wo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:d}=zt(),O=se(),E=wt(),S=qe(),u=F(g=>we(g)),{useFeatureGate:c}=Lt(),{isFeatureEnabled:B}=c(ge.isRealtimeInsightsFeatureEnabled),m=F(g=>g.expenseAutomationViewState.selectedPeriodByTenantId),o=F(g=>Un(g,u.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:f}=Gt({isAiCfoOpen:t,setIsAiCfoOpen:d,mobileExploreReferrer:"Month-End Close Overview"}),y=s.useCallback((g,T,_=!1)=>{O(Ce({tenantId:T,period:{month:g.month,year:g.year},refreshViewInBackground:_}))},[]),V=s.useCallback(g=>{const T=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(g.month,g.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,T??null),O(Fn(u.tenantId,g))},[u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),i=m[u.tenantId],h=s.useCallback(()=>{const g=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(i.month,i.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,g??null),y(i,u.tenantId,!0)},[y,i,u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),w=H(S.state?.pathnameStackToGoBack,S.pathname),A=s.useCallback(()=>{if(o.monthEndCloseChecks!=null&&i!=null){const g=o.monthEndCloseChecks.monthEndCloseCheckList.find(T=>T.progress<100);if(g!=null)return void E(`./${g.id}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}});E(`./month_end_insights/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,i]),{areTenantIdsInSync:x}=$t();return Jt({isDataReady:o.fetchState==="Completed"}),s.useEffect(()=>{i!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&x&&y(i,u.tenantId)},[y,i,o.fetchState,u.tenantId,x]),s.useEffect(()=>{i!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&x&&O(Bn(i))},[i,o.monthClosePerformanceTrendFetchStatus.fetchState,x]),s.useEffect(()=>{const g=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&h()},3e5);return()=>clearInterval(g)},[o.fetchState]),s.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const g=S.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,g??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),p.jsx(xo,{children:p.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:B,onMonthEndCheckClick:g=>{E(`./${g}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:V,handleReviewButtonClick:A,onBackClick:()=>{E("../../dashboard")},onReload:h,isAiCfoAccessEnabled:v,onAskAiCfoClick:f})})},xo=De.div`
1
+ import{j as p}from"./liveblocks-BJogRArg.js";import xn from"./NotFoundScreen-DYeXrX7_.js";import{a as s,b as Pt}from"./sentry-WdXgkw90.js";import{n as De,S as Rn}from"./mui-Bg09VkiQ.js";import{h as se,j as wt,u as qe,g as F,k as Dn,l as rt,n as On,o as je}from"./core-BojUR2ky.js";import{eN as we,OK as Un,mv as Ce,fd as Fn,q6 as Bn,mN as xt,n6 as Rt,OL as Dt,ng as _n,OM as Ot,mG as Vn,pE as Mn,eY as he,ON as xe,s5 as Ut,Bg as Ft,OO as Bt,OP as jn,pj as Ge,Ks as dt,Ku as zn,jt as Ln,Kv as $n,jA as qn,cU as Gn,t8 as Je,jq as Jn,mT as _t,nl as Re,OQ as Nn,Jl as ut,Jk as Ae,OR as mt,jR as Yn,OS as Kn,OT as Wn,OU as Zn,OV as Hn,m_ as Qn,mL as ce,no as Te,OW as Xn,OX as ea,OY as ta,nv as na,jE as aa,jv as oa,OZ as sa,jD as ht,KC as ca,O_ as ia,O$ as la,pf as ra,oW as da,nm as pe,oV as ze,P0 as ua,P1 as ma,l8 as ha,bq as pa,l3 as pt,kR as ga,P2 as Ca,gC as gt,fP as Sa,l0 as Ia,v1 as fa,P3 as ka,nW as Ea,nR as va,nV as ya,nG as ba,P4 as Aa,e$ as Vt,n9 as Ta,mW as Pa,fe as Ct,nq as wa,P5 as xa,nn as Mt,P6 as Ra,P7 as Da,P8 as Oa,P9 as Ua,Pa as St,pr as Fa,oM as Ba,Jj as _a,jC as Va,Pb as Ma,FA as ja,jB as za,e_ as La,ol as jt,oE as $a,nk as It,np as qa,bC as Ga,kZ as Ja,kW as Na,Pc as Ya,nF as ft,oC as kt,oA as Ka,oq as Wa,o5 as Za,oD as Ha,Pd as Qa,Pe as Xa,o9 as eo,Pf as to,n$ as no,o8 as ao,o6 as oo,oH as so}from"./zeni-epic-state-BJsXImBw.js";import{J as zt,a as Lt,p as ge,d as L,x as H,K as $t,cu as co,z as Oe,cv as io,ap as Pe,cw as lo,aP as Et,B as qt,cx as ro,am as Le,D as uo,cy as mo,O as ho,cz as po,cA as go,cB as Co,$ as So,j as Io,aJ as fo,b1 as ko,C as Eo,cC as vo}from"./index-Dw0sYJvv.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import{c as Jt}from"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import{c as vt,C as yo}from"./TransactionDetailScreen-DwslT8ci.js";import{w as bo}from"./withTransactionSidePanel-DUWL7sXt.js";import{h as Ao,v as To}from"./routePaths-DriCJPaW.js";import{g as $e}from"./accountMappingHelper-DXLz-vZu.js";import{D as Po}from"./DrawerScreen-CZjhB4M8.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./decodeURIComponentSafe-Cj7RmfYA.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="15b47f60-5b09-4345-a70c-ed05c6ce78cc",t._sentryDebugIdIdentifier="sentry-dbid-15b47f60-5b09-4345-a70c-ed05c6ce78cc")}catch{}})();const wo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:d}=zt(),O=se(),E=wt(),S=qe(),u=F(g=>we(g)),{useFeatureGate:c}=Lt(),{isFeatureEnabled:B}=c(ge.isRealtimeInsightsFeatureEnabled),m=F(g=>g.expenseAutomationViewState.selectedPeriodByTenantId),o=F(g=>Un(g,u.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:f}=Gt({isAiCfoOpen:t,setIsAiCfoOpen:d,mobileExploreReferrer:"Month-End Close Overview"}),y=s.useCallback((g,T,_=!1)=>{O(Ce({tenantId:T,period:{month:g.month,year:g.year},refreshViewInBackground:_}))},[]),V=s.useCallback(g=>{const T=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(g.month,g.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,T??null),O(Fn(u.tenantId,g))},[u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),i=m[u.tenantId],h=s.useCallback(()=>{const g=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(i.month,i.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,g??null),y(i,u.tenantId,!0)},[y,i,u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),w=H(S.state?.pathnameStackToGoBack,S.pathname),A=s.useCallback(()=>{if(o.monthEndCloseChecks!=null&&i!=null){const g=o.monthEndCloseChecks.monthEndCloseCheckList.find(T=>T.progress<100);if(g!=null)return void E(`./${g.id}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}});E(`./month_end_insights/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,i]),{areTenantIdsInSync:x}=$t();return Jt({isDataReady:o.fetchState==="Completed"}),s.useEffect(()=>{i!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&x&&y(i,u.tenantId)},[y,i,o.fetchState,u.tenantId,x]),s.useEffect(()=>{i!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&x&&O(Bn(i))},[i,o.monthClosePerformanceTrendFetchStatus.fetchState,x]),s.useEffect(()=>{const g=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&h()},3e5);return()=>clearInterval(g)},[o.fetchState]),s.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const g=S.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,g??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),p.jsx(xo,{children:p.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:B,onMonthEndCheckClick:g=>{E(`./${g}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:V,handleReviewButtonClick:A,onBackClick:()=>{E("../../dashboard")},onReload:h,isAiCfoAccessEnabled:v,onAskAiCfoClick:f})})},xo=De.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-Cxvop2w5.js";import{a as r}from"./sentry-Bel9R1P0.js";import{V as f,W as c,Z as l,v as p}from"./index-CNT4WvUT.js";import"./mui-Cdh_ZgIg.js";import m from"./NotFoundScreen-BrmwEoGP.js";import{j as u,u as b}from"./core-DGD8k-EU.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]="96d5797f-734e-4ad4-b5fc-3c3d6908652b",e._sentryDebugIdIdentifier="sentry-dbid-96d5797f-734e-4ad4-b5fc-3c3d6908652b")}catch{}})();const D=()=>{const e=u(),t=b(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=p(t.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(t.pathname);return o!=null?s.jsx(c,{menuItem:l(o),onDemoClick:a,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{D as F};
1
+ import{j as s}from"./liveblocks-BJogRArg.js";import{a as r}from"./sentry-WdXgkw90.js";import{V as f,W as c,Z as l,v as p}from"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import m from"./NotFoundScreen-DYeXrX7_.js";import{j as u,u as b}from"./core-BojUR2ky.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]="96d5797f-734e-4ad4-b5fc-3c3d6908652b",e._sentryDebugIdIdentifier="sentry-dbid-96d5797f-734e-4ad4-b5fc-3c3d6908652b")}catch{}})();const D=()=>{const e=u(),t=b(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=p(t.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(t.pathname);return o!=null?s.jsx(c,{menuItem:l(o),onDemoClick:a,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{D as F};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-Cxvop2w5.js";import{l as b,k as x,j,u as y,h as Z,q as ee,g as D,N as te,n as ae,o as p}from"./core-DGD8k-EU.js";import{Ix as S,Iy as k,Iz as N,yT as $,yF as L,IA as C,IB as ne,IC as oe,yJ as ie,eO as v,yQ as se,yN as le}from"./zeni-epic-state-CjARY91O.js";import{q as g,o as r,n as re,d as I,k as E,r as de,v as ce,w as me,x as F,a as pe,p as ue,y as he,$ as xe,h as ge,B as fe,A as we,I as be,S as ye,X as Se,C as ke,T as Ie}from"./index-CNT4WvUT.js";import{n as c}from"./mui-Cdh_ZgIg.js";import f from"./NotFoundScreen-BrmwEoGP.js";import{a as P}from"./sentry-Bel9R1P0.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.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]="5030d99b-1030-46cd-949a-0c889b190876",e._sentryDebugIdIdentifier="sentry-dbid-5030d99b-1030-46cd-949a-0c889b190876")}catch{}})();const ve=c.div`
1
+ import{j as t}from"./liveblocks-BJogRArg.js";import{l as b,k as x,j,u as y,h as Z,q as ee,g as D,N as te,n as ae,o as p}from"./core-BojUR2ky.js";import{Ix as S,Iy as k,Iz as N,yT as $,yF as L,IA as C,IB as ne,IC as oe,yJ as ie,eO as v,yQ as se,yN as le}from"./zeni-epic-state-BJsXImBw.js";import{q as g,o as r,n as re,d as I,k as E,r as de,v as ce,w as me,x as F,a as pe,p as ue,y as he,$ as xe,h as ge,B as fe,A as we,I as be,S as ye,X as Se,C as ke,T as Ie}from"./index-Dw0sYJvv.js";import{n as c}from"./mui-Bg09VkiQ.js";import f from"./NotFoundScreen-DYeXrX7_.js";import{a as P}from"./sentry-WdXgkw90.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.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]="5030d99b-1030-46cd-949a-0c889b190876",e._sentryDebugIdIdentifier="sentry-dbid-5030d99b-1030-46cd-949a-0c889b190876")}catch{}})();const ve=c.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-Cxvop2w5.js";import{a as f}from"./sentry-Bel9R1P0.js";import{h as O,u as _,j as w,q as M,g as l,N as T}from"./core-DGD8k-EU.js";import{z as r,h as P,D as V,e as A,d as N,f as q,m as G,I as R,i as W}from"./index-CNT4WvUT.js";import{eN as $,Ii as B,Is as H,Ij as J,eO as K,fh as Q,Io as X,fG as Y,cS as Z,It as ee,Iu as te}from"./zeni-epic-state-CjARY91O.js";import{n as ne}from"./mui-Cdh_ZgIg.js";import{u as se}from"./useDeviceId-C-LBnIzp.js";import{f as ae}from"./analyticsHelper-CNwzWBf_.js";import{t as ie}from"./getLocaleForTenant-BrCCfdIO.js";import"./recharts-oolJNF1J.js";import"./analytics-xb_2pDDq.js";import"./plaid-BVGCfCA1.js";import"./dnd-s5MAPZ_4.js";import"./stripe-DMRn4zHo.js";import"./lottie-rysS_6yg.js";import"./lexical-D9fe9vQ7.js";import"./pdf-B7Btpc50.js";import"./utils-y7cfvjBg.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="6ba40242-f98b-4d08-8dd9-6b44afc96181",t._sentryDebugIdIdentifier="sentry-dbid-6ba40242-f98b-4d08-8dd9-6b44afc96181")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=O(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>$(e)),b=l(e=>B(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(b.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,a.state,t]);const j=f.useCallback(()=>{m("/signin/auth")},[m]),U=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(G,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:U,onVerifyOtp:F,onCancelVerifyDevice:j});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-BJogRArg.js";import{a as f}from"./sentry-WdXgkw90.js";import{h as O,u as _,j as w,q as M,g as l,N as T}from"./core-BojUR2ky.js";import{z as r,h as P,D as V,e as A,d as N,f as q,m as G,I as R,i as W}from"./index-Dw0sYJvv.js";import{eN as $,Ii as B,Is as H,Ij as J,eO as K,fh as Q,Io as X,fG as Y,cS as Z,It as ee,Iu as te}from"./zeni-epic-state-BJsXImBw.js";import{n as ne}from"./mui-Bg09VkiQ.js";import{u as se}from"./useDeviceId-CYsEMtI-.js";import{f as ae}from"./analyticsHelper-BI0zNJMo.js";import{t as ie}from"./getLocaleForTenant-DXctzPv_.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="6ba40242-f98b-4d08-8dd9-6b44afc96181",t._sentryDebugIdIdentifier="sentry-dbid-6ba40242-f98b-4d08-8dd9-6b44afc96181")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=O(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>$(e)),b=l(e=>B(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(b.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,a.state,t]);const j=f.useCallback(()=>{m("/signin/auth")},[m]),U=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(G,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:U,onVerifyOtp:F,onCancelVerifyDevice:j});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;