@zeniai/web-app-ui 5.1.51-qa → 5.1.52-dev

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 (122) hide show
  1. package/dist/assets/AddressRoutes-Cg2gXbOf.js +1 -0
  2. package/dist/assets/{AddressScreen-DHENiPsE.js → AddressScreen-BBCv44qS.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-BDeqJ8PX.js → AiCfoScreen-Da9zCyWe.js} +5 -5
  4. package/dist/assets/{BillPayApprovalRoutes-re8xxMBE.js → BillPayApprovalRoutes-TnPLWObs.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BKu8tYXF.js → BillPayRoutes-gRXPgRX3.js} +8 -8
  6. package/dist/assets/{BusinessVerificationPageScreen-7ydI8UR9.js → BusinessVerificationPageScreen-DWx2BUK6.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-QyowC-mN.js → CardsAiCfoScreen-BCU45aIH.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-BbZEL-b5.js → ChargeCardRoutes-SrcIcjEg.js} +10 -10
  9. package/dist/assets/{CompanyPassportScreen-AZhDXSZE.js → CompanyPassportScreen-C2ZjBTtu.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-DDij7-L5.js → ConnectionAuthScreen-DQGgk8VQ.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-DndbS7zx.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-COHKYeEq.js → CustomerOnboardingRoutes-BiJk8RGO.js} +4 -4
  13. package/dist/assets/{DashboardRoutes-B1cE2wJc.js → DashboardRoutes-C2R9sFOt.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-DivCz85L.js → DefaultTenantHome-Cs1fEcl7.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-D2sqfin3.js +18 -0
  16. package/dist/assets/DrawerScreen-BXWf7y4o.js +1 -0
  17. package/dist/assets/EntityDetailRoutes--LkTS4Lg.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-pmgLYKV-.js → ExpenseAutomationRoutes-DN1VLKxs.js} +3 -3
  19. package/dist/assets/FeaturePreviewScreen-C_7xKfC9.js +1 -0
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-BrjX8V0E.js → HubSpotOAuthCallbackScreen-BtgwDGFv.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-Dn4g326h.js → MagicLinkRoutes-w9Xo_7JQ.js} +9 -9
  22. package/dist/assets/MagicLinkSignInScreen-_FORqdKk.js +12 -0
  23. package/dist/assets/{MobileAppDrawer-CjoW3Rax.js → MobileAppDrawer-B2Mj3GDG.js} +1 -1
  24. package/dist/assets/NotFoundScreen-DpHt-tQH.js +1 -0
  25. package/dist/assets/{NotificationRoutes-DE-Z8DSv.js → NotificationRoutes-Bd-2Em1h.js} +1 -1
  26. package/dist/assets/OAuthConsentScreen-DunOek_C.js +1 -0
  27. package/dist/assets/{PandLWithForecastRoutes-C3Yczwgv.js → PandLWithForecastRoutes-BnZrz52M.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-ZidIbEdd.js → PeopleRoutes-tR11OG4C.js} +3 -3
  29. package/dist/assets/PerformanceRoutes-tqcqZlMe.js +1 -0
  30. package/dist/assets/{Preview-OiplHjn8.js → Preview-BBgrn4cd.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-B8QVReQm.js → QBOConnectionScreen-CWE_gavn.js} +1 -1
  32. package/dist/assets/{ReferralListScreen-Cnd7u4T9.js → ReferralListScreen-B51q6tuc.js} +2 -2
  33. package/dist/assets/ReimbursementApprovalRoutes-CX0ljo0U.js +1 -0
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BgYFphfr.js → ReimbursementApprovalRuleDetailScreen-BY8AWRBv.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-BeD0lwna.js → ReimbursementRoutes-BNT5fCZV.js} +5 -5
  36. package/dist/assets/{ReportsRoutes-CPI-jy1F.js → ReportsRoutes-BkcfE81W.js} +1 -1
  37. package/dist/assets/RewardsRoutes-Bp0jvJUz.js +1 -0
  38. package/dist/assets/{ScreenRoutes-B24ySlpK.js → ScreenRoutes-DzWi1qtt.js} +2 -2
  39. package/dist/assets/SettingsRoutes-C45RXj_4.js +57 -0
  40. package/dist/assets/{SetupPagesScreen-DtddTp_T.js → SetupPagesScreen-CnApuu2-.js} +5 -5
  41. package/dist/assets/SignInScreen-D4fYBdSr.js +1 -0
  42. package/dist/assets/{SignOutScreen-Djs9TXWR.js → SignOutScreen-scofbvIC.js} +1 -1
  43. package/dist/assets/{TaskListScreen-DMgU1v4z.js → TaskListScreen-5M_H_3yt.js} +2 -2
  44. package/dist/assets/{TaskRoutes-Cmtr7KFm.js → TaskRoutes-Bc8V0KLM.js} +2 -2
  45. package/dist/assets/{TransactionDetailRoutes-CjrDVjtT.js → TransactionDetailRoutes-lhjQfiA2.js} +1 -1
  46. package/dist/assets/TransactionDetailScreen-advW0sri.js +5 -0
  47. package/dist/assets/{TransactionListRoutes-uZihQK3F.js → TransactionListRoutes-BTVDW0ac.js} +1 -1
  48. package/dist/assets/{TreasuryRoutes-ZtY_hGM6.js → TreasuryRoutes-BlM-Juxy.js} +6 -6
  49. package/dist/assets/{VendorsRoutes-DcUkIEvd.js → VendorsRoutes-Db2Ed2Fz.js} +1 -1
  50. package/dist/assets/WiseConfirmationScreen-8khqAoaZ.js +12 -0
  51. package/dist/assets/{ZeniAccountRoutes-Cbm2k-08.js → ZeniAccountRoutes-68W3Grg4.js} +11 -11
  52. package/dist/assets/ZeniAccountStatementScreen-CCwshkYl.js +9 -0
  53. package/dist/assets/{accountMappingHelper-DDqSB3xQ.js → accountMappingHelper-DoYWzqd9.js} +1 -1
  54. package/dist/assets/{analytics-DoyQ8ezf.js → analytics-DVTbnjlr.js} +1 -1
  55. package/dist/assets/{analyticsHelper-CvGdvadP.js → analyticsHelper-7imjYGd-.js} +1 -1
  56. package/dist/assets/{core-CQnSJ9vO.js → core-k_c8SCBE.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-BprI0TcI.js → decodeURIComponentSafe-ClSfwHJC.js} +1 -1
  58. package/dist/assets/{dnd-DoHm848q.js → dnd-CKEs-Nbe.js} +1 -1
  59. package/dist/assets/{empty-BZMPWXIo.js → empty-CaaFsHZq.js} +1 -1
  60. package/dist/assets/{empty-DjW_4H8B.js → empty-rBU__xZH.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-CD9clJu_.js → emptyVideoElement-BiPjnR5F.js} +1 -1
  62. package/dist/assets/{epic-2G17lmbK.js → epic-BY3t4hzo.js} +2 -2
  63. package/dist/assets/getLocaleForTenant-BWdefIGu.js +1 -0
  64. package/dist/assets/{index-BtlQ6O6E.js → index-B0M_M2si.js} +1 -1
  65. package/dist/assets/{index-CF7DasjB.js → index-C9JBC9EP.js} +1 -1
  66. package/dist/assets/{index-Ci7GqulV.js → index-CAPOi0Fj.js} +1 -1
  67. package/dist/assets/{index-C6MtcitK.js → index-CBl-jehm.js} +1 -1
  68. package/dist/assets/{index-W83PhAZh.js → index-Cm2LZphQ.js} +12999 -13025
  69. package/dist/assets/{index-B6GtF9yZ.js → index-CrxfuqRy.js} +2 -2
  70. package/dist/assets/{index-DgHQU_66.js → index-D7n4W-6R.js} +1 -1
  71. package/dist/assets/{index-KsPtT3xm.js → index-_Ds-L3qG.js} +1 -1
  72. package/dist/assets/{lexical-WXHH1XHj.js → lexical-k-PQZXkn.js} +1 -1
  73. package/dist/assets/{liveblocks-DvKPzrwo.js → liveblocks-D3ESVZyk.js} +1 -1
  74. package/dist/assets/{lottie-DNsrs-P3.js → lottie-BYni7Ovk.js} +1 -1
  75. package/dist/assets/{mui-sKCdI-e6.js → mui-UJrLjp1k.js} +1 -1
  76. package/dist/assets/{pathToGoBack-DDBtlyQ4.js → pathToGoBack-D0Z5Ycmy.js} +1 -1
  77. package/dist/assets/{pdf-iXI4qQyj.js → pdf-CaeTpLUv.js} +4 -4
  78. package/dist/assets/{pdf-lib-C9eLuUx2.js → pdf-lib-Cgly_u4z.js} +1 -1
  79. package/dist/assets/{plaid-BOu_8LCE.js → plaid-B1j5PXHV.js} +1 -1
  80. package/dist/assets/{pusher-BxMucY8d.js → pusher-IzmLENf0.js} +1 -1
  81. package/dist/assets/{react-BfWAIeRe.js → react-BPazXlgj.js} +1 -1
  82. package/dist/assets/{react-Bfv7BUzV.js → react-BhDdWL-M.js} +1 -1
  83. package/dist/assets/{react-CHbhfie6.js → react-Cbn9UGi3.js} +1 -1
  84. package/dist/assets/{react-DW2tK8z_.js → react-D9CNJCXY.js} +1 -1
  85. package/dist/assets/{react-BY08R1tD.js → react-RV2byy3l.js} +1 -1
  86. package/dist/assets/{react-DVBLaOmV.js → react-iNsCZPRe.js} +1 -1
  87. package/dist/assets/{recharts-Cv5d-Vxs.js → recharts-Q-kkTNuO.js} +1 -1
  88. package/dist/assets/{routePaths-stnXzrYV.js → routePaths-d7Ok-gzv.js} +1 -1
  89. package/dist/assets/{sentry-Be8twC83.js → sentry-B_92GPgU.js} +1 -1
  90. package/dist/assets/{url-CuDHWvgT.js → url-CGw_V4gG.js} +1 -1
  91. package/dist/assets/{url-AlENSCVt.js → url-DLQKrj-e.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CKfyn0VP.js → useAiCfoDashboardSuggestedQuestionsChips-D_8fZhjX.js} +1 -1
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-j-YNVdB5.js +1 -0
  94. package/dist/assets/useCashManagementBanner-Dq8PXuUm.js +1 -0
  95. package/dist/assets/{useDeviceId-KC-rY1dP.js → useDeviceId-BE1s-3Wf.js} +1 -1
  96. package/dist/assets/{useInitialThreadRequest-BDAn-AM4.js → useInitialThreadRequest-DoCqWgSy.js} +1 -1
  97. package/dist/assets/{utils-BcJ2NV01.js → utils-Mjhh9T8E.js} +1 -1
  98. package/dist/assets/withTransactionSidePanel-AeDcEPW-.js +21 -0
  99. package/dist/assets/{zeni-epic-state-DKeO4Z0C.js → zeni-epic-state-C3zBO1No.js} +4 -4
  100. package/dist/index.html +1 -1
  101. package/package.json +3 -3
  102. package/dist/assets/AddressRoutes-gPXkxz7s.js +0 -1
  103. package/dist/assets/CustomerOnboardingAuthScreen-DO3NyaR6.js +0 -1
  104. package/dist/assets/DomesticWireDetailScreen-Bx2DINVR.js +0 -18
  105. package/dist/assets/DrawerScreen-BtLrlXnn.js +0 -1
  106. package/dist/assets/EntityDetailRoutes-CTo7No6n.js +0 -1
  107. package/dist/assets/FeaturePreviewScreen-9NvuDbvP.js +0 -1
  108. package/dist/assets/MagicLinkSignInScreen-CTkVv0M2.js +0 -12
  109. package/dist/assets/NotFoundScreen-FcrdBNP0.js +0 -1
  110. package/dist/assets/OAuthConsentScreen-Swpq9wju.js +0 -1
  111. package/dist/assets/PerformanceRoutes-VzYGFOXy.js +0 -1
  112. package/dist/assets/ReimbursementApprovalRoutes-DOhkjING.js +0 -1
  113. package/dist/assets/RewardsRoutes-Vdol6ACr.js +0 -1
  114. package/dist/assets/SettingsRoutes-D7qVKl5_.js +0 -57
  115. package/dist/assets/SignInScreen-u3NwSgsj.js +0 -1
  116. package/dist/assets/TransactionDetailScreen-ABqf1zzA.js +0 -5
  117. package/dist/assets/WiseConfirmationScreen-DYcjQlfc.js +0 -12
  118. package/dist/assets/ZeniAccountStatementScreen-Ciuw5n7i.js +0 -9
  119. package/dist/assets/getLocaleForTenant-CAvD8CfA.js +0 -1
  120. package/dist/assets/useAskAiCfoHostNavButtonProps-DAlpTVgV.js +0 -1
  121. package/dist/assets/useCashManagementBanner-D8slgHwh.js +0 -1
  122. package/dist/assets/withTransactionSidePanel-B9fglQqM.js +0 -21
@@ -1,4 +1,4 @@
1
- import{j as b}from"./liveblocks-DvKPzrwo.js";import{a as i}from"./sentry-Be8twC83.js";import{n as W}from"./utils-BcJ2NV01.js";import{u as Ie,h as we,g as Ee,j as T,i as ke,n as ve}from"./core-CQnSJ9vO.js";import{X as Ae,H as Te,x as z,z as Fe,d9 as Oe,db as Ue,b5 as ee,w as _e,c as V,dc as G,dj as xe,D as Qe,e as De,a7 as Le,df as $e,a2 as Ve,dk as je,b1 as Re,di as He}from"./index-W83PhAZh.js";import{gk as Me,g5 as Ne,g6 as X,g7 as qe,fQ as te,g8 as Be,g9 as We,eV as se,eW as ze,ga as Ge,f0 as Xe,iF as Ye,iB as Je,eX as Y,fJ as Ke,fK as Ze,fL as et,fM as tt,fN as st,fO as at,fP as ot,fR as nt,fS as it,fT as J,bE as K,fU as rt,fV as lt,fW as dt,fX as ct,fY as ut,fZ as mt,fC as ft,fG as Z,f_ as pt,f$ as Ct,g0 as ht,g1 as St,g2 as gt,g3 as bt,g4 as Pt}from"./zeni-epic-state-DKeO4Z0C.js";import{D as yt,n as R,P as It,S as wt}from"./mui-sKCdI-e6.js";import{d as Et}from"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.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]="ecc3bac9-f169-4f2d-8bf4-789308bb1165",e._sentryDebugIdIdentifier="sentry-dbid-ecc3bac9-f169-4f2d-8bf4-789308bb1165")}catch{}})();const kt=e=>Pt(e,!1),vt=e=>bt(e.name,!1),ae="chat-response-generated",oe="cards/ask",ne="card_policy_hero";function j(e){return`/${e}/cards`}function ie(e){return`/${e}/cards/policy`}const At=ve(function(e,r){const s=se(e),C=r.isSubmitting,c=e.cardPolicyState,m=Ke(c),d=Ze(c),h=et(c);return{showSampleQuestions:r.sessionFromUrl==="new_chat"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:C,isNewChatSession:r.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${Ve}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,allUsers:r.allUsers,cardPolicyCategorySearchOptions:m.map(kt),cardPolicyVendorSearchOptions:d.map(vt),cardPolicyIsVendorSearchLoading:h==="In-Progress",cardPolicyDocumentUploadState:ot(c),cardPolicyUploadedFileName:at(c),cardPolicyFormDraft:st(e.createCardPolicyState),cardsCreationFormDraft:tt(e)}},function(e,r){const{location:s,currentTenant:C,userId:c,navigate:m,currentChatSessionId:d,allSessionsWithOrderedQuestionAnswers:h,isAiCardCreationEnabled:E,isCardPolicyEnabled:P,cardPolicyPageContext:k}=r,f=C.tenantEmailDomain,O=s.state?.referrer,u=O===ne?ie(f):j(f);return{onEventReceived:(a,l)=>{if(a===ae&&typeof l.text=="string"&&typeof l.metadata=="object"){const t=l,n=Ct(t.type),p=t.metadata.chat_session_id??null,{currentChatSession:U,currentQuestionAnswer:v,currentQuestionAnswerSummary:y}=ee(h,p);n!=="answer"?V.trackAICFOChatResponseGenerated(n,v?.question.questionText??"",t.text,p,He(y,U),t.metadata.message_id??null):V.trackAICFOChatAnswerGenerated(t.text,v?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,ht(t.visualization?.type??"")??null,p,t.summarized_title,t.metadata.message_id??null),e(St({chatSessionId:t.metadata.chat_session_id,responseType:n,fetchState:{fetchState:"Completed",error:void 0}})),e(gt({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(a,l,t,n)=>{a&&Re(e,a,l,d,h,c,n,t,k)},updateCurrentInput:a=>{e(Z(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{e(pt(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(u,{state:{...s.state}}),e(Z(""))},togglePageView:()=>{m(u,{state:{...s.state}}),r.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{d!=null&&e(ft()),m(function(a){return`/${a}/${oe}`}(f),{state:{...s.state}})},onToggleCotCollapsed:(a,l)=>{e(mt({questionAnswerId:a,isCollapsed:l}))},onCardsCreationFormChange:E?a=>{e(ut(a))}:void 0,onCardsCreationFormSubmit:E?(a,l)=>{const t=lt(a);t.length!==0&&(e(dt(t)),e(ct({sourceChatSessionId:d??void 0})),d!=null&&e(J({chatSessionId:d,id:W(),kind:"creating_cards",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(j(f),{state:{...s.state}}))}:void 0,onCardPolicyFormChange:P?a=>{e(rt(a))}:void 0,onCardPolicyFormSubmit:P?(a,l)=>{const t=je({values:a});e(it({templates:[t],sourceChatSessionId:d})),d!=null&&e(J({chatSessionId:d,id:W(),kind:"creating_policy",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(`/${f}/cards/policy`,{state:{...s.state}})}:void 0,onCardPolicyUploadDocument:P?(a,l,t)=>{a.length!==0&&e(nt(a,l,t))}:void 0,onCardPolicyRemoveDocument:P?()=>{e(te())}:void 0}})(Le($e)),{spendManagement:{chargeCard:{cardsAiCfoHero:re,cardPolicyAiCfoHero:le}}}=Qe.getLocalizedStrings(),F=re.pageTitle,Tt=le.pageTitle,Ft=re.chatHeaderSubtitle,Ot=le.chatHeaderSubtitle,Xt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:r}=Ae(),s=Ie(),C=we(),c=Ee(),[m,d]=i.useState(!1),{useFeatureGate:h}=Te(),{isFeatureEnabled:E}=h(z.isAiCardCreationEnabled),{isFeatureEnabled:P}=h(z.isCardPolicyEnabled);i.useEffect(()=>{s(Me())},[s]),i.useEffect(()=>(s(Ne()),s(X()),s(qe("cardHolderCandidate",!1)),()=>{s(te())}),[s]);const k=T(o=>Be(o).fetchState);i.useEffect(()=>{k==="Not-Started"&&s(We(!1,!1,!1))},[k,s]);const f=i.useMemo(()=>Et(o=>{s(X(o))},250),[s]);i.useEffect(()=>()=>{f.cancel()},[f]);const O=i.useCallback(o=>{f(o)},[f]),u=T(o=>se(o)),a=Fe.getSignedInUser(),{session_id:l}=ke(),t=T(o=>ze(o)),n=u.uiState.currentChatSessionId,p=t.tenantEmailDomain,{handleUploadPromoClose:U,isUploadPromoVisible:v}=Oe({isFileUploadEnabled:e,tenantEmailDomain:p}),y=c.state,S=y?.aiCfoInitialQuestion??null,_=!!y?.aiCfoShouldSubmit,I=y?.referrer===ne,de=I?"card_policy":void 0,ce=i.useMemo(()=>({title:I?Tt:F,subtitle:I?Ot:Ft}),[I]),[ue,x]=i.useState(null),[me,Q]=i.useState(!1),D=i.useRef(!1);i.useEffect(()=>{D.current||S==null||S===""||(x(S),Q(_),D.current=!0)},[S,_]);const fe=i.useCallback(()=>{x(null),Q(!1)},[]),pe=t.masterTOSInfo,g=pe?.isMasterTOSAccepted??!1,A=i.useRef(null);i.useEffect(()=>{if(g&&A.current!=null){const{question:o,shouldSubmit:w}=A.current;A.current=null,x(o),Q(w),D.current=!1}},[g]);const{visitedSessions:H}=Ue(n),L=u.fetchState,$=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,M=n!=null?u.fetchChatSessionHistoryByChatSessionId?.[n]?.fetchState??"Not-Started":"Not-Started",N=n==null||(u.uiState.chatHistoryNextPageToken[n]?.hasMore??!0),q=u.allSessionsWithOrderedQuestionAnswers,B=T(o=>Ge(o.userState,o.userRoleState,o.userListViewState,"cardHolderCandidate")).users,Ce=i.useMemo(()=>B.map(o=>o.user).filter(o=>o!=null),[B]),{currentSessionQuestionAnswers:he}=ee(q,n),Se=he.length===0;i.useEffect(()=>{n!=null&&l!==n&&C(function(o,w){return`/${o}/${oe}/${w}`}(p,n),{state:{...c.state},replace:!0})},[n,l,p,C,c.state]),i.useEffect(()=>{l!=null&&n==null&&l!=="new_chat"&&s(Xe({sessionId:l,agentId:"controller"}))},[]);const ge=i.useMemo(()=>({events:H.map(o=>`private-encrypted-chat-${o}.${ae}`),eventCallback:(o,w,ye)=>ye.onEventReceived(o,w)}),[H]);if(i.useEffect(()=>{L!=="In-Progress"&&$&&s(Ye())},[L,$,s]),i.useEffect(()=>{n!=null&&M!=="In-Progress"&&N&&a!=null&&L==="Completed"&&!$&&s(Je(n,a.userId))},[M,N,n,a,s]),a==null)throw Error("Can't access Cards AI CFO page without signing in...");const be=l??"new_chat",Pe=n!=null&&u.responseStateByChatSessionId?.[n]?.answer?.fetchState==="In-Progress";return b.jsxs(_t,{children:[b.jsx(_e,{analytics:V,onLoad:o=>o.trackPageLoaded(De.Event.aiCFOPage)}),g?b.jsx(At,{...ge,currentChatSessionId:n,allSessionsWithOrderedQuestionAnswers:q,allUsers:Ce,isAiCardCreationEnabled:E,isCardPolicyEnabled:P,openOnboardingPage:()=>d(!0),userId:a.userId,setIsAiCfoOpen:r,navigate:C,sessionFromUrl:be,location:c,isSubmitting:Pe,isEmptyChatWithSession:Se,customPageTitle:F,chatHeader:ce,currentTenant:t,emailLinkQuestion:ue??void 0,autoSubmitEmailLinkQuestion:me,onEmailLinkQuestionProcessed:fe,isFileUploadEnabled:e,isUploadPromoVisible:v,onUploadPromoClose:U,onCardPolicyVendorSearchTextChange:O,cardPolicyPageContext:de}):b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:F,onCloseClick:()=>{C(I?ie(p):j(p),{state:{...c.state}})},onCompleteClick:()=>{g||t.userRoleId==null||(S!=null&&S!==""&&(A.current={question:S,shouldSubmit:_}),s(Y(t.userRoleId)))}}),b.jsx(yt,{anchor:"right",open:m,transitionDuration:250,PaperProps:{component:xt,style:{width:`${xe}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>d(!1),children:b.jsx(Ut,{onClick:o=>o.stopPropagation(),children:b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:F,onCloseClick:()=>d(!1),onCompleteClick:()=>{g||t.userRoleId==null||s(Y(t.userRoleId)),d(!1)}})})})]})},Ut=R(wt)`
1
+ import{j as b}from"./liveblocks-D3ESVZyk.js";import{a as i}from"./sentry-B_92GPgU.js";import{n as W}from"./utils-Mjhh9T8E.js";import{u as Ie,h as we,g as Ee,j as T,i as ke,n as ve}from"./core-k_c8SCBE.js";import{V as Ae,N as Te,x as z,z as Fe,d9 as Oe,db as Ue,b5 as ee,r as _e,c as $,dc as G,dj as xe,D as Qe,e as De,a7 as Le,df as Ve,a2 as $e,dk as je,b1 as Re,di as Me}from"./index-Cm2LZphQ.js";import{gk as Ne,g5 as He,g6 as X,g7 as qe,fQ as te,g8 as Be,g9 as We,eV as se,eW as ze,ga as Ge,f0 as Xe,iF as Ye,iB as Je,eX as Y,fJ as Ke,fK as Ze,fL as et,fM as tt,fN as st,fO as at,fP as ot,fR as nt,fS as it,fT as J,bE as K,fU as rt,fV as lt,fW as dt,fX as ct,fY as ut,fZ as mt,fC as ft,fG as Z,f_ as pt,f$ as Ct,g0 as ht,g1 as St,g2 as gt,g3 as bt,g4 as Pt}from"./zeni-epic-state-C3zBO1No.js";import{D as yt,n as R,P as It,S as wt}from"./mui-UJrLjp1k.js";import{d as Et}from"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.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]="e10471ca-8427-475f-89da-ef6aff36ba8c",e._sentryDebugIdIdentifier="sentry-dbid-e10471ca-8427-475f-89da-ef6aff36ba8c")}catch{}})();const kt=e=>Pt(e,!1),vt=e=>bt(e.name,!1),ae="chat-response-generated",oe="cards/ask",ne="card_policy_hero";function j(e){return`/${e}/cards`}function ie(e){return`/${e}/cards/policy`}const At=ve(function(e,r){const s=se(e),C=r.isSubmitting,c=e.cardPolicyState,m=Ke(c),d=Ze(c),h=et(c);return{showSampleQuestions:r.sessionFromUrl==="new_chat"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:C,isNewChatSession:r.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${$e}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,allUsers:r.allUsers,cardPolicyCategorySearchOptions:m.map(kt),cardPolicyVendorSearchOptions:d.map(vt),cardPolicyIsVendorSearchLoading:h==="In-Progress",cardPolicyDocumentUploadState:ot(c),cardPolicyUploadedFileName:at(c),cardPolicyFormDraft:st(e.createCardPolicyState),cardsCreationFormDraft:tt(e)}},function(e,r){const{location:s,currentTenant:C,userId:c,navigate:m,currentChatSessionId:d,allSessionsWithOrderedQuestionAnswers:h,isAiCardCreationEnabled:E,isCardPolicyEnabled:P,cardPolicyPageContext:k}=r,f=C.tenantEmailDomain,O=s.state?.referrer,u=O===ne?ie(f):j(f);return{onEventReceived:(a,l)=>{if(a===ae&&typeof l.text=="string"&&typeof l.metadata=="object"){const t=l,n=Ct(t.type),p=t.metadata.chat_session_id??null,{currentChatSession:U,currentQuestionAnswer:v,currentQuestionAnswerSummary:y}=ee(h,p);n!=="answer"?$.trackAICFOChatResponseGenerated(n,v?.question.questionText??"",t.text,p,Me(y,U),t.metadata.message_id??null):$.trackAICFOChatAnswerGenerated(t.text,v?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,ht(t.visualization?.type??"")??null,p,t.summarized_title,t.metadata.message_id??null),e(St({chatSessionId:t.metadata.chat_session_id,responseType:n,fetchState:{fetchState:"Completed",error:void 0}})),e(gt({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(a,l,t,n)=>{a&&Re(e,a,l,d,h,c,n,t,k)},updateCurrentInput:a=>{e(Z(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{e(pt(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(u,{state:{...s.state}}),e(Z(""))},togglePageView:()=>{m(u,{state:{...s.state}}),r.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{d!=null&&e(ft()),m(function(a){return`/${a}/${oe}`}(f),{state:{...s.state}})},onToggleCotCollapsed:(a,l)=>{e(mt({questionAnswerId:a,isCollapsed:l}))},onCardsCreationFormChange:E?a=>{e(ut(a))}:void 0,onCardsCreationFormSubmit:E?(a,l)=>{const t=lt(a);t.length!==0&&(e(dt(t)),e(ct({sourceChatSessionId:d??void 0})),d!=null&&e(J({chatSessionId:d,id:W(),kind:"creating_cards",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(j(f),{state:{...s.state}}))}:void 0,onCardPolicyFormChange:P?a=>{e(rt(a))}:void 0,onCardPolicyFormSubmit:P?(a,l)=>{const t=je({values:a});e(it({templates:[t],sourceChatSessionId:d})),d!=null&&e(J({chatSessionId:d,id:W(),kind:"creating_policy",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(`/${f}/cards/policy`,{state:{...s.state}})}:void 0,onCardPolicyUploadDocument:P?(a,l,t)=>{a.length!==0&&e(nt(a,l,t))}:void 0,onCardPolicyRemoveDocument:P?()=>{e(te())}:void 0}})(Le(Ve)),{spendManagement:{chargeCard:{cardsAiCfoHero:re,cardPolicyAiCfoHero:le}}}=Qe.getLocalizedStrings(),F=re.pageTitle,Tt=le.pageTitle,Ft=re.chatHeaderSubtitle,Ot=le.chatHeaderSubtitle,Xt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:r}=Ae(),s=Ie(),C=we(),c=Ee(),[m,d]=i.useState(!1),{useFeatureGate:h}=Te(),{isFeatureEnabled:E}=h(z.isAiCardCreationEnabled),{isFeatureEnabled:P}=h(z.isCardPolicyEnabled);i.useEffect(()=>{s(Ne())},[s]),i.useEffect(()=>(s(He()),s(X()),s(qe("cardHolderCandidate",!1)),()=>{s(te())}),[s]);const k=T(o=>Be(o).fetchState);i.useEffect(()=>{k==="Not-Started"&&s(We(!1,!1,!1))},[k,s]);const f=i.useMemo(()=>Et(o=>{s(X(o))},250),[s]);i.useEffect(()=>()=>{f.cancel()},[f]);const O=i.useCallback(o=>{f(o)},[f]),u=T(o=>se(o)),a=Fe.getSignedInUser(),{session_id:l}=ke(),t=T(o=>ze(o)),n=u.uiState.currentChatSessionId,p=t.tenantEmailDomain,{handleUploadPromoClose:U,isUploadPromoVisible:v}=Oe({isFileUploadEnabled:e,tenantEmailDomain:p}),y=c.state,S=y?.aiCfoInitialQuestion??null,_=!!y?.aiCfoShouldSubmit,I=y?.referrer===ne,de=I?"card_policy":void 0,ce=i.useMemo(()=>({title:I?Tt:F,subtitle:I?Ot:Ft}),[I]),[ue,x]=i.useState(null),[me,Q]=i.useState(!1),D=i.useRef(!1);i.useEffect(()=>{D.current||S==null||S===""||(x(S),Q(_),D.current=!0)},[S,_]);const fe=i.useCallback(()=>{x(null),Q(!1)},[]),pe=t.masterTOSInfo,g=pe?.isMasterTOSAccepted??!1,A=i.useRef(null);i.useEffect(()=>{if(g&&A.current!=null){const{question:o,shouldSubmit:w}=A.current;A.current=null,x(o),Q(w),D.current=!1}},[g]);const{visitedSessions:M}=Ue(n),L=u.fetchState,V=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,N=n!=null?u.fetchChatSessionHistoryByChatSessionId?.[n]?.fetchState??"Not-Started":"Not-Started",H=n==null||(u.uiState.chatHistoryNextPageToken[n]?.hasMore??!0),q=u.allSessionsWithOrderedQuestionAnswers,B=T(o=>Ge(o.userState,o.userRoleState,o.userListViewState,"cardHolderCandidate")).users,Ce=i.useMemo(()=>B.map(o=>o.user).filter(o=>o!=null),[B]),{currentSessionQuestionAnswers:he}=ee(q,n),Se=he.length===0;i.useEffect(()=>{n!=null&&l!==n&&C(function(o,w){return`/${o}/${oe}/${w}`}(p,n),{state:{...c.state},replace:!0})},[n,l,p,C,c.state]),i.useEffect(()=>{l!=null&&n==null&&l!=="new_chat"&&s(Xe({sessionId:l,agentId:"controller"}))},[]);const ge=i.useMemo(()=>({events:M.map(o=>`private-encrypted-chat-${o}.${ae}`),eventCallback:(o,w,ye)=>ye.onEventReceived(o,w)}),[M]);if(i.useEffect(()=>{L!=="In-Progress"&&V&&s(Ye())},[L,V,s]),i.useEffect(()=>{n!=null&&N!=="In-Progress"&&H&&a!=null&&L==="Completed"&&!V&&s(Je(n,a.userId))},[N,H,n,a,s]),a==null)throw Error("Can't access Cards AI CFO page without signing in...");const be=l??"new_chat",Pe=n!=null&&u.responseStateByChatSessionId?.[n]?.answer?.fetchState==="In-Progress";return b.jsxs(_t,{children:[b.jsx(_e,{analytics:$,onLoad:o=>o.trackPageLoaded(De.Event.aiCFOPage)}),g?b.jsx(At,{...ge,currentChatSessionId:n,allSessionsWithOrderedQuestionAnswers:q,allUsers:Ce,isAiCardCreationEnabled:E,isCardPolicyEnabled:P,openOnboardingPage:()=>d(!0),userId:a.userId,setIsAiCfoOpen:r,navigate:C,sessionFromUrl:be,location:c,isSubmitting:Pe,isEmptyChatWithSession:Se,customPageTitle:F,chatHeader:ce,currentTenant:t,emailLinkQuestion:ue??void 0,autoSubmitEmailLinkQuestion:me,onEmailLinkQuestionProcessed:fe,isFileUploadEnabled:e,isUploadPromoVisible:v,onUploadPromoClose:U,onCardPolicyVendorSearchTextChange:O,cardPolicyPageContext:de}):b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:F,onCloseClick:()=>{C(I?ie(p):j(p),{state:{...c.state}})},onCompleteClick:()=>{g||t.userRoleId==null||(S!=null&&S!==""&&(A.current={question:S,shouldSubmit:_}),s(Y(t.userRoleId)))}}),b.jsx(yt,{anchor:"right",open:m,transitionDuration:250,PaperProps:{component:xt,style:{width:`${xe}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>d(!1),children:b.jsx(Ut,{onClick:o=>o.stopPropagation(),children:b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:F,onCloseClick:()=>d(!1),onCompleteClick:()=>{g||t.userRoleId==null||s(Y(t.userRoleId)),d(!1)}})})})]})},Ut=R(wt)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;