@tickernelz/wardmote-ui 2026.1118.1 → 2026.1118.2
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.
- package/dist/assets/{AdapterManager-1binbhYj.js → AdapterManager-DvntZ2AW.js} +1 -1
- package/dist/assets/{AdvancedToolsRoute-DUyXR4Xj.js → AdvancedToolsRoute-CUW8D9Ux.js} +1 -1
- package/dist/assets/{AgentActionButtons-DSmnGirw.js → AgentActionButtons-CQLGCtfu.js} +1 -1
- package/dist/assets/{AgentChat-Dj952aW1.js → AgentChat-DCwwZA2b.js} +1 -1
- package/dist/assets/{AgentChats-Fv5j4CM9.js → AgentChats-DMMLdo-o.js} +1 -1
- package/dist/assets/{AgentDetail-CffT38lI.js → AgentDetail-BMVWOVp-.js} +1 -1
- package/dist/assets/{AgentTodoCard-De5ZJbUa.js → AgentTodoCard-C4BfJg4x.js} +1 -1
- package/dist/assets/{Agents-CDDoQ4Ds.js → Agents-C0IDC6KD.js} +3 -3
- package/dist/assets/{AppDetail-DnTOxWEY.js → AppDetail-DzEGsx94.js} +1 -1
- package/dist/assets/{AppNotConnected-CgnmB3mH.js → AppNotConnected-BVL32B49.js} +1 -1
- package/dist/assets/{ApprovalCard-D6X8gzHU.js → ApprovalCard-DCQ49PuW.js} +1 -1
- package/dist/assets/{ApprovalDetail-CWxiqPs6.js → ApprovalDetail-B0J70llD.js} +1 -1
- package/dist/assets/{ApprovalPayload-DFsO21LC.js → ApprovalPayload-8lqBw-XQ.js} +1 -1
- package/dist/assets/{Approvals-BW3osPe0.js → Approvals-BkiVjx0M.js} +1 -1
- package/dist/assets/{AppsReview-4g3PeYWn.js → AppsReview-CeXp22cE.js} +1 -1
- package/dist/assets/{ArtifactCard-BoIqK207.js → ArtifactCard-BV82tDLI.js} +1 -1
- package/dist/assets/{Artifacts-DDdlgUkk.js → Artifacts-CL5ZmZ3m.js} +1 -1
- package/dist/assets/{AssistantConnection-B7yxIifb.js → AssistantConnection-C5rmoEsm.js} +1 -1
- package/dist/assets/{AttentionInteractionResolver-BdcCqDXe.js → AttentionInteractionResolver-DxZpuIIF.js} +1 -1
- package/dist/assets/{AuditHub-CI0zjHie.js → AuditHub-DDPFGvHG.js} +1 -1
- package/dist/assets/{BoardChat--69z_C0h.js → BoardChat-DlaNGzcQ.js} +1 -1
- package/dist/assets/{BootstrapSetupUxLab-UIxdNUcO.js → BootstrapSetupUxLab-B2tOIzXd.js} +1 -1
- package/dist/assets/{Browse-VPYhJopu.js → Browse-xEc9mGl7.js} +1 -1
- package/dist/assets/{BudgetPolicyCard-45TwMzp3.js → BudgetPolicyCard-Ccr3EX5M.js} +1 -1
- package/dist/assets/{CaseDetail-CRN2rF4k.js → CaseDetail-CvMk_M-F.js} +1 -1
- package/dist/assets/{Cases-CFqnLAMq.js → Cases-H1Y4Oipe.js} +1 -1
- package/dist/assets/{ChatEndpointDetail-BTYAtutu.js → ChatEndpointDetail-CjDVQWl8.js} +1 -1
- package/dist/assets/{ChatEndpointSetup-CzrgHmvH.js → ChatEndpointSetup-BfohtKVM.js} +1 -1
- package/dist/assets/{Companies-C-U5WI6o.js → Companies-C4ObCu9j.js} +1 -1
- package/dist/assets/{CompanyAccess-DLgvUIoB.js → CompanyAccess-J5Vwnko2.js} +1 -1
- package/dist/assets/{CompanyActivity-8CeynedM.js → CompanyActivity-B7-kMNmz.js} +1 -1
- package/dist/assets/{CompanyConnections-BjMmsqei.js → CompanyConnections-D2N6UWXk.js} +1 -1
- package/dist/assets/{CompanyEnvironments-D6p-TNkv.js → CompanyEnvironments-ChSu4gxW.js} +1 -1
- package/dist/assets/{CompanyExport-Dw0QDMvs.js → CompanyExport-B_opHRSJ.js} +1 -1
- package/dist/assets/{CompanyImport-OSi3fM2l.js → CompanyImport-DZAMEBBy.js} +1 -1
- package/dist/assets/{CompanySettings-B-aPUQpY.js → CompanySettings-Rz8cwgKC.js} +1 -1
- package/dist/assets/{CompanySettingsPluginPage-Kp7iOUP1.js → CompanySettingsPluginPage-CM-ViPwj.js} +1 -1
- package/dist/assets/{CompanySkills-HZqJ5DZ8.js → CompanySkills-BnwPuZze.js} +1 -1
- package/dist/assets/{ConfigureBuiltInAgentModal-DL3wv3Mb.js → ConfigureBuiltInAgentModal-BAfoTveX.js} +1 -1
- package/dist/assets/{CopyableGatewayUrl-BLjhj10P.js → CopyableGatewayUrl-D90Bjxj0.js} +1 -1
- package/dist/assets/{Dashboard-DTmjsaEr.js → Dashboard-DepIxrje.js} +1 -1
- package/dist/assets/{DecisionDateChips-Br5r2jWZ.js → DecisionDateChips-89KkV4mo.js} +1 -1
- package/dist/assets/{DecisionQueuePage-zWDMjHf9.js → DecisionQueuePage-nU9qXzln.js} +1 -1
- package/dist/assets/{DesignGuide-BsH97scx.js → DesignGuide-40TixHZ-.js} +1 -1
- package/dist/assets/{EmailEndpointSetup-C7PhFwBy.js → EmailEndpointSetup-D7-8f1XV.js} +1 -1
- package/dist/assets/{ExecutionWorkspaceDetail-CTDvazWh.js → ExecutionWorkspaceDetail-CnUD3jLO.js} +1 -1
- package/dist/assets/{GatewayDetail-BtpnGGIB.js → GatewayDetail-Bg7GU-1a.js} +1 -1
- package/dist/assets/{GatewaysList-DrRfNyqk.js → GatewaysList-4vvZCBkY.js} +1 -1
- package/dist/assets/{GoalDetail-D5QqhxMg.js → GoalDetail-h7WsjaOO.js} +1 -1
- package/dist/assets/{GoalTree-CDexmAKW.js → GoalTree-yPtfejUx.js} +1 -1
- package/dist/assets/{Goals-CZinws4s.js → Goals-DOi3E4DX.js} +1 -1
- package/dist/assets/{ImageGalleryModal-VT9I4D2p.js → ImageGalleryModal-D_VQgcBt.js} +1 -1
- package/dist/assets/{Inbox-BiE243MO.js → Inbox-COKxRKhR.js} +1 -1
- package/dist/assets/{InstanceAdvanced-D_iqUmgn.js → InstanceAdvanced-DlMlwZbU.js} +1 -1
- package/dist/assets/{InviteLanding-LR84Xv76.js → InviteLanding-BGvJMHKw.js} +1 -1
- package/dist/assets/{IssueChatLongThreadPerf-BHdYa83T.js → IssueChatLongThreadPerf-C3U2FZKJ.js} +1 -1
- package/dist/assets/{IssueChatThread-Cno8fLc-.js → IssueChatThread-CDKaIB6v.js} +1 -1
- package/dist/assets/{IssueDetail-BWZWLO4k.js → IssueDetail-BCwHANTn.js} +1 -1
- package/dist/assets/{IssueOutputSection-BuwP0RQx.js → IssueOutputSection-BzXRmoV7.js} +1 -1
- package/dist/assets/{IssueRecoveryActionCard-O4GRNsPc.js → IssueRecoveryActionCard-BYtbaP-M.js} +1 -1
- package/dist/assets/{IssueReferencePill-EbOs3MtQ.js → IssueReferencePill-BT7NBEy_.js} +1 -1
- package/dist/assets/{IssueThreadInteractionCard-BUIzNywc.js → IssueThreadInteractionCard-Btd0rZ23.js} +1 -1
- package/dist/assets/{Issues-mVYaoqsX.js → Issues-XKf7zemQ.js} +1 -1
- package/dist/assets/{LiveNowTodoLine-DP95vmnd.js → LiveNowTodoLine-CoL6ZNuK.js} +1 -1
- package/dist/assets/{ManagedAiConnectionDetails-ZByBvcqo.js → ManagedAiConnectionDetails-CebBi-Tw.js} +1 -1
- package/dist/assets/{McpConnect-D42jtK1S.js → McpConnect-ByorZN7G.js} +1 -1
- package/dist/assets/{MembershipAction-Df2Qlkdz.js → MembershipAction-De0MBfgb.js} +1 -1
- package/dist/assets/{ModelsAndProviders-BzUob8BB.js → ModelsAndProviders-BqM4UJc7.js} +1 -1
- package/dist/assets/{NewAgent-BywRvCR0.js → NewAgent-pMTQYNxn.js} +1 -1
- package/dist/assets/{PipelineSettings-DFjxoW4i.js → PipelineSettings-C2k3BzLQ.js} +1 -1
- package/dist/assets/{Pipelines-CSW-En3n.js → Pipelines-Cr6Xs32p.js} +1 -1
- package/dist/assets/{PixelsOffice-B2b8M6LM.js → PixelsOffice-Dfd4XKSj.js} +1 -1
- package/dist/assets/{PluginPage-CfSIAMQa.js → PluginPage-fPlWyFSc.js} +1 -1
- package/dist/assets/{PluginSettings-TewUkGUA.js → PluginSettings-X_VHvvo5.js} +1 -1
- package/dist/assets/{ProfileDetailRoute-CCbLcj8f.js → ProfileDetailRoute-PAsWmN-1.js} +1 -1
- package/dist/assets/{ProfileSettings-D1D_hKPu.js → ProfileSettings-BACxlGZS.js} +1 -1
- package/dist/assets/{ProfileWizardRoute-BzFGrQkr.js → ProfileWizardRoute-Dbq0n7If.js} +1 -1
- package/dist/assets/{ProjectDetail-CEjUARCN.js → ProjectDetail-DOJZUIWu.js} +1 -1
- package/dist/assets/{ProjectWorkspaceDetail-7fFllUMH.js → ProjectWorkspaceDetail-ZNnaHnuA.js} +1 -1
- package/dist/assets/{ProjectWorkspacesContent-S4UUfVU1.js → ProjectWorkspacesContent-DrWfnTJY.js} +1 -1
- package/dist/assets/{Projects-NrtT8d2x.js → Projects-CCzxmEZ8.js} +1 -1
- package/dist/assets/{PublicIssueSharePage-CfQDHmOe.js → PublicIssueSharePage-BUSkP1Js.js} +1 -1
- package/dist/assets/{ReviewQueueCard-CksOubye.js → ReviewQueueCard-CrCN_30c.js} +1 -1
- package/dist/assets/{RichWorkProductCard-XPJ4R-il.js → RichWorkProductCard-DndJn4LV.js} +1 -1
- package/dist/assets/{RoutineDetail-AcrnXhjR.js → RoutineDetail-B5MzV_74.js} +1 -1
- package/dist/assets/{RoutineRunVariablesDialog-CtSVwZjy.js → RoutineRunVariablesDialog-kGyQVBid.js} +1 -1
- package/dist/assets/{Routines-B19G6Lkw.js → Routines-B2zX9h3J.js} +1 -1
- package/dist/assets/{ScrollToBottom-csHqjOIa.js → ScrollToBottom-Dd3SpeJi.js} +1 -1
- package/dist/assets/{Search-CnO6qC0m.js → Search-D4W3cZZf.js} +1 -1
- package/dist/assets/{Secrets-Xz6WSEnG.js → Secrets-C4nbuMIh.js} +1 -1
- package/dist/assets/{SkillSourceTree-BC2Ycl7g.js → SkillSourceTree-BvGzMa2u.js} +1 -1
- package/dist/assets/{SkillSources-BMogH_qp.js → SkillSources-DL2tNkcr.js} +1 -1
- package/dist/assets/{SkillStudio-HekOqqo_.js → SkillStudio-BnZ2cfDq.js} +1 -1
- package/dist/assets/{SourceTrustBadge-CXZGc8G4.js → SourceTrustBadge-CCPQEGrC.js} +1 -1
- package/dist/assets/{StatusCards-CL-RC2Mf.js → StatusCards-BkE-9R8F.js} +1 -1
- package/dist/assets/{SummarySlotCard-BJmo-gDJ.js → SummarySlotCard-D1EyiciB.js} +1 -1
- package/dist/assets/{TaskChatLab-CIZVb5Ed.js → TaskChatLab-D3PsNRr5.js} +1 -1
- package/dist/assets/{TaskChatMarker-CdRbWeYc.js → TaskChatMarker-DEF88_sr.js} +1 -1
- package/dist/assets/{TaskChatProtocolCard-C_A2mV-g.js → TaskChatProtocolCard-Ba_vhDxn.js} +1 -1
- package/dist/assets/{TaskChatThreadView-Bd3E40e0.js → TaskChatThreadView-BsPvbxiA.js} +1 -1
- package/dist/assets/{TaskTreeControls-DK6EZXLI.js → TaskTreeControls-BKOIbilg.js} +1 -1
- package/dist/assets/{Terminal-BcD_c9Om.js → Terminal-1uPX7VEe.js} +1 -1
- package/dist/assets/{TerminalView-XV2mBbcS.js → TerminalView-DDv6s-R_.js} +1 -1
- package/dist/assets/{TrustPresetSection-Ev8RdYhN.js → TrustPresetSection-BDb0N4Pe.js} +1 -1
- package/dist/assets/{UserProfile-C_BKVfMQ.js → UserProfile-DqPRuGWk.js} +1 -1
- package/dist/assets/{WhatNeedsMe-CYs2iX06.js → WhatNeedsMe-DtBxgH24.js} +1 -1
- package/dist/assets/{Workspaces-B8Wwbx8B.js → Workspaces-BQOyG5HK.js} +1 -1
- package/dist/assets/{connection-owner-Ca1nfKiA.js → connection-owner-CPrMcD3t.js} +1 -1
- package/dist/assets/{index-LM7k1NmC.js → index-QhteFtm-.js} +3 -3
- package/dist/assets/{issue-properties-CKLKB9AO.js → issue-properties--M7WE6Ot.js} +1 -1
- package/dist/assets/{issue-workspace-selection-CJYasFEQ.js → issue-workspace-selection-pUdSkrJA.js} +1 -1
- package/dist/assets/{pipeline-stage-presentation-BzvR-f05.js → pipeline-stage-presentation-Dv1xgEPW.js} +1 -1
- package/dist/assets/{shared-CMP5lH_Q.js → shared-B75ClBUg.js} +1 -1
- package/dist/assets/{system-notice-comment-BUfjKy0_.js → system-notice-comment-D0I6rz8Y.js} +1 -1
- package/dist/assets/{transcript-adapter-DiPtVkEm.js → transcript-adapter-ClaGWYVL.js} +1 -1
- package/dist/assets/{useSummaryDraftStream-uMW1O0Ga.js → useSummaryDraftStream-BDuMgNcA.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var ze=Object.defineProperty;var s=(a,i)=>ze(a,"name",{value:i,configurable:!0});import{i as de}from"./rolldown-runtime-ZpX3ckPj.js";import{ki as we,la as Ae,m as ke,ua as _e}from"./createLucideIcon-CgrPXnTY.js";import{v as Se}from"./star-eem0qj3E.js";import{X as Ce,_ as ae,t as g,v as O}from"./queryKeys-BzT8CD34.js";import{a as Ie,n as qe,o as Q}from"./companies-query-BEdFiAhG.js";import{n as Ee}from"./CompanyContext-fQCNWI_f.js";import{o as Te,t as ne}from"./router-CJbFZfVR.js";import{t as S}from"./button-DI4w5WP7.js";import{t as U}from"./access-DhB95qNC.js";import{t as Pe}from"./health-Cn-5LIwb.js";import{n as Re}from"./adapter-display-registry-9qBBJi9B.js";import{ai as Le}from"./index-LM7k1NmC.js";import{r as se,t as P}from"./invite-memory-CHGcQdLs.js";var l=de(_e(),1),e=de(Ae(),1),Fe=we.filter(a=>a!=="wardmote_runner"),ie=new Set(["omp_local"]);function Me(a,i){let c=a;for(const r of i){if(!c||typeof c!="object")return null;c=c[r]}return typeof c=="string"&&c.trim().length>0?c:null}s(Me,"readNestedString");var N="w-full border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none focus:border-zinc-500",re="border border-zinc-800 bg-zinc-950/95 p-6",oe="flex-1 border px-3 py-2 text-sm transition-colors";function Be(a){return a?a.charAt(0).toUpperCase()+a.slice(1):null}s(Be,"formatHumanRole");function me(a){if(!a||typeof a!="object")return null;const i=a.code;return typeof i=="string"&&i.trim().length>0?i:null}s(me,"getAuthErrorCode");function We(a){if(!(a instanceof Error))return null;const i=a.message.trim();return i.length>0?i:null}s(We,"getAuthErrorMessage");function $e(a,i,c){const r=me(a),o=We(a),p=c.trim().length>0?c.trim():"that email";return r==="USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL"?{tone:"info",message:`An account already exists for ${p}. Sign in below to continue with this invite.`}:r==="INVALID_EMAIL_OR_PASSWORD"?{tone:"error",message:"That email and password did not match an existing Wardmote account. Check both fields, or create an account first if you are new here."}:i==="sign_in"&&o==="Request failed: 401"?{tone:"error",message:"That email and password did not match an existing Wardmote account. Check both fields, or create an account first if you are new here."}:i==="sign_up"&&o==="Request failed: 422"?{tone:"info",message:`An account may already exist for ${p}. Try signing in instead.`}:{tone:"error",message:o??"Authentication failed"}}s($e,"mapInviteAuthFeedback");function ce(a){return!!(a&&typeof a=="object"&&"bootstrapAccepted"in a)}s(ce,"isBootstrapAcceptancePayload");function Oe(a,i){return!a||typeof a!="object"||i?!1:a.status==="approved"}s(Oe,"isApprovedHumanJoinPayload");function K({companyDisplayName:a,companyLogoUrl:i,className:c}){return(0,e.jsx)(Le,{companyName:a,logoUrl:i,logoFit:"contain",className:c})}s(K,"InviteCompanyLogo");function le({companyDisplayName:a,companyLogoUrl:i,invitedByUserName:c,claimSecret:r=null,claimApiKeyPath:o=null,onboardingTextUrl:p=null}){return(0,e.jsx)("div",{className:"min-h-screen bg-zinc-950 px-6 py-12 text-zinc-100",children:(0,e.jsxs)("div",{className:"mx-auto max-w-md border border-zinc-800 bg-zinc-950 p-6","data-testid":"invite-pending-approval",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(K,{companyDisplayName:a,companyLogoUrl:i,className:"h-12 w-12 border border-zinc-800 rounded-none"}),(0,e.jsxs)("h1",{className:"text-lg font-semibold",children:["Request to join ",a]})]}),(0,e.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,e.jsxs)("p",{className:"text-sm text-zinc-400",children:["Your request is still awaiting approval. ",c??"An organization admin"," must approve your request to join."]}),(0,e.jsxs)("div",{className:"border border-zinc-800 p-3",children:[(0,e.jsx)("p",{className:"text-xs text-zinc-500 mb-1",children:"Approval page"}),(0,e.jsx)("p",{className:"text-sm text-zinc-200",children:"Settings → Members"})]}),(0,e.jsxs)("p",{className:"text-sm text-zinc-400",children:["Ask them to visit ",(0,e.jsx)("span",{className:"text-zinc-200",children:"Settings → Members"})," to approve your request."]}),(0,e.jsx)("p",{className:"text-xs text-zinc-500",children:"Refresh this page after you've been approved — you'll be redirected automatically."})]}),r&&o?(0,e.jsxs)("div",{className:"mt-4 space-y-1 border border-zinc-800 p-3 text-xs text-zinc-400",children:[(0,e.jsx)("div",{className:"text-zinc-200",children:"Claim secret"}),(0,e.jsx)("div",{className:"font-mono break-all",children:r}),(0,e.jsxs)("div",{className:"font-mono break-all",children:["POST ",o]})]}):null,p?(0,e.jsxs)("div",{className:"mt-4 text-xs text-zinc-400",children:["Onboarding: ",(0,e.jsx)("span",{className:"font-mono break-all",children:p})]}):null]})})}s(le,"AwaitingJoinApprovalPanel");function nt(){const a=Ce(),i=Te(),{setSelectedCompanyId:c}=Ee(),r=(Se().token??"").trim(),[o,p]=(0,l.useState)("sign_up"),[R,ue]=(0,l.useState)(""),[z,pe]=(0,l.useState)(""),[w,D]=(0,l.useState)(""),[L,xe]=(0,l.useState)(""),[H,he]=(0,l.useState)("omp_local"),[J,ge]=(0,l.useState)(""),[C,ve]=(0,l.useState)(null),[A,F]=(0,l.useState)(null),[x,v]=(0,l.useState)(null),[Y,X]=(0,l.useState)(!1),I="invite-auth-error",M=O({queryKey:g.health,queryFn:s(()=>Pe.get(),"queryFn"),retry:!1}),u=O({queryKey:g.auth.session,queryFn:s(()=>Q.getSession(),"queryFn"),retry:!1}),f=O({queryKey:g.access.invite(r),queryFn:s(()=>U.getInvite(r),"queryFn"),enabled:r.length>0,retry:!1}),q=Ie({enabled:!!u.data&&!!f.data?.companyId,staleTime:0}),E=M.data?.deploymentMode!=="local_trusted"?q.isFetchedAfterMount:!0,be=E?q.data?.companies??[]:[];(0,l.useEffect)(()=>{r&&se(r)},[r]),(0,l.useEffect)(()=>{X(!1)},[r]),(0,l.useEffect)(()=>{if(!E)return;const t=q.data?.companies;!t||!f.data?.companyId||t.some(h=>h.id===f.data.companyId)&&P(r)},[q.data,f.data,E,r]);const n=f.data,B=!!u.data&&!!n?.companyId&&!E,b=!!n?.companyId&&be.some(t=>t.id===n?.companyId),d=n?.companyName?.trim()||"this Wardmote company",T=n?.companyLogoUrl?.trim()||null,W=n?.invitedByUserName?.trim()||null,G=n?.inviteMessage?.trim()||null,ye=Be(n?.humanRole),j=n?.joinRequestStatus??null,V=n?.joinRequestType??null,$=V==="human"&&(j==="pending_approval"||j==="approved"),Z=M.data?.deploymentMode==="authenticated"&&!u.data&&n?.allowedJoinTypes!=="agent",y=n?.inviteType!=="bootstrap_ceo"&&n?.allowedJoinTypes==="agent",k=!!u.data&&!y&&n?.inviteType!=="bootstrap_ceo"&&(!j||$)&&!B&&!b&&!C&&A===null,fe=u.data?.user.name?.trim()||u.data?.user.email?.trim()||"this account",ee=z.trim().length>0&&w.trim().length>0&&(o==="sign_in"||R.trim().length>0&&w.trim().length>=8),m=ae({mutationFn:s(async()=>{if(!n)throw new Error("Invite not found");if(B)throw new Error("Checking your organization access. Try again in a moment.");if(b)throw new Error("This account already belongs to the organization.");return n.inviteType==="bootstrap_ceo"||n.allowedJoinTypes!=="agent"?U.acceptInvite(r,{requestType:"human"}):U.acceptInvite(r,{requestType:"agent",agentName:L.trim(),adapterType:H,capabilities:J.trim()||null})},"mutationFn"),onSuccess:s(async t=>{F(null),P(r);const h=ce(t);ve({kind:h?"bootstrap":"join",payload:t}),await a.invalidateQueries({queryKey:g.auth.session}),await a.invalidateQueries({queryKey:g.access.currentBoardAccess}),await a.invalidateQueries({queryKey:g.companies.all}),n?.companyId&&Oe(t,y)&&(c(n.companyId,{source:"manual"}),i("/",{replace:!0}))},"onSuccess"),onError:s(t=>{F(t instanceof Error?t.message:"Failed to accept invite")},"onError")});(0,l.useEffect)(()=>{!k||Y||m.isPending||(X(!0),F(null),m.mutate())},[m,Y,k]);const _=ae({mutationFn:s(async()=>{if(o==="sign_in"){await Q.signInEmail({email:z.trim(),password:w});return}await Q.signUpEmail({name:R.trim(),email:z.trim(),password:w})},"mutationFn"),onSuccess:s(async()=>{v(null),se(r),await a.invalidateQueries({queryKey:g.auth.session}),await a.invalidateQueries({queryKey:g.health}),await a.invalidateQueries({queryKey:g.access.currentBoardAccess});const{companies:t}=await qe(a);if(n?.companyId&&t.some(h=>h.id===n.companyId)){P(r),c(n.companyId,{source:"manual"}),i("/",{replace:!0});return}if(!(!n||n.inviteType!=="bootstrap_ceo"))try{ce(await m.mutateAsync())&&i("/",{replace:!0})}catch{return}},"onSuccess"),onError:s(t=>{const h=$e(t,o,z);me(t)==="USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL"&&(p("sign_in"),D("")),v(h)},"onError")}),te=(0,l.useMemo)(()=>n?b?"Open organization":n.inviteType==="bootstrap_ceo"?"Accept invite":y?"Submit request":u.data?"Accept invite":"Continue":"Continue",[n,b,u.data,y]);if(!r)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-bad",children:"Invalid invite token."});if(f.isLoading||M.isLoading||u.isLoading)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-ink-3",children:"Loading invite..."});if(B)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-ink-3",children:"Checking your access..."});if(f.error||!n)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)("div",{className:"border border-line bg-bg-2 p-6","data-testid":"invite-error",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Invite not available"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"This invite may be expired, revoked, or already used."})]})});if(j==="approved"&&V==="human"&&b)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-ink-3",children:"Opening organization..."});if(j==="pending_approval"&&!$)return(0,e.jsx)(le,{companyDisplayName:d,companyLogoUrl:T,invitedByUserName:W});if(j&&!$)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)("div",{className:"border border-line bg-bg-2 p-6","data-testid":"invite-error",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Invite not available"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:j==="rejected"?"This join request was not approved.":"This invite has already been used."})]})});if(C?.kind==="bootstrap")return(0,e.jsx)("div",{className:"min-h-screen bg-zinc-950 px-6 py-12 text-zinc-100",children:(0,e.jsxs)("div",{className:"mx-auto max-w-md border border-zinc-800 bg-zinc-950 p-6",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Bootstrap complete"}),(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(S,{asChild:!0,className:"rounded-none",children:(0,e.jsx)(ne,{to:"/",children:"Open board"})})})]})});if(C?.kind==="join"){const t=C.payload,h=typeof t.claimSecret=="string"?t.claimSecret:null,je=typeof t.claimApiKeyPath=="string"?t.claimApiKeyPath:null,Ne=Me(t.onboarding,["textInstructions","url"]);return!y&&t.status==="approved"?(0,e.jsx)("div",{className:"min-h-screen bg-zinc-950 px-6 py-12 text-zinc-100",children:(0,e.jsxs)("div",{className:"mx-auto max-w-md border border-zinc-800 bg-zinc-950 p-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(K,{companyDisplayName:d,companyLogoUrl:T,className:"h-12 w-12 border border-zinc-800 rounded-none"}),(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"You joined the organization"})]}),(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(S,{asChild:!0,className:"w-full rounded-none",children:(0,e.jsx)(ne,{to:"/",children:"Open board"})})})]})}):(0,e.jsx)(le,{companyDisplayName:d,companyLogoUrl:T,invitedByUserName:W,claimSecret:h,claimApiKeyPath:je,onboardingTextUrl:Ne})}return(0,e.jsx)("div",{className:"min-h-screen bg-zinc-950 px-6 py-12 text-zinc-100",children:(0,e.jsx)("div",{className:"mx-auto max-w-5xl",children:(0,e.jsxs)("div",{className:"grid gap-6 lg:grid-cols-(--gtc-36)",children:[(0,e.jsxs)("section",{className:`${re} space-y-6`,children:[(0,e.jsxs)("div",{className:"flex items-start gap-4",children:[(0,e.jsx)(K,{companyDisplayName:d,companyLogoUrl:T,className:"h-16 w-16 rounded-none border border-zinc-800"}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("p",{className:"text-xs uppercase tracking-(--tracking-caps) text-zinc-500",children:"You've been invited to join Wardmote"}),(0,e.jsx)("h1",{className:"mt-2 text-2xl font-semibold",children:n.inviteType==="bootstrap_ceo"?"Set up Wardmote":`Join ${d}`}),(0,e.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-zinc-300",children:y?"Review the invite details, then submit the agent information below to start the join request.":Z?"Create your Wardmote account first. If you already have one, switch to sign in and continue the invite with the same email.":"Your account is ready. Review the invite details, then accept it to continue."})]})]}),(0,e.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,e.jsxs)("div",{className:"border border-zinc-800 p-3",children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-caps) text-zinc-500",children:"Organization"}),(0,e.jsx)("div",{className:"mt-1 text-sm text-zinc-100",children:d})]}),(0,e.jsxs)("div",{className:"border border-zinc-800 p-3",children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-caps) text-zinc-500",children:"Invited by"}),(0,e.jsx)("div",{className:"mt-1 text-sm text-zinc-100",children:W??"Wardmote board"})]}),(0,e.jsxs)("div",{className:"border border-zinc-800 p-3",children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-caps) text-zinc-500",children:"Requested access"}),(0,e.jsx)("div",{className:"mt-1 text-sm text-zinc-100",children:y?"Agent join request":ye??"Organization access"})]}),(0,e.jsxs)("div",{className:"border border-zinc-800 p-3",children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-caps) text-zinc-500",children:"Invite expires"}),(0,e.jsx)("div",{className:"mt-1 text-sm text-zinc-100",children:ke(n.expiresAt)})]})]}),G?(0,e.jsxs)("div",{className:"border border-amber-500/40 bg-amber-500/10 p-4",children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-caps) text-amber-200/80",children:"Message from inviter"}),(0,e.jsx)("p",{className:"mt-2 text-sm leading-6 text-amber-50",children:G})]}):null,u.data?(0,e.jsxs)("div",{className:"border border-emerald-500/40 bg-emerald-500/10 p-4 text-sm text-emerald-50",children:["Signed in as ",(0,e.jsx)("span",{className:"font-medium",children:fe}),"."]}):null]}),(0,e.jsx)("section",{className:`${re} h-fit`,children:y?(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:"Submit agent details"}),(0,e.jsxs)("p",{className:"mt-1 text-sm text-zinc-400",children:["This invite will create an approval request for a new agent in ",d,"."]})]}),(0,e.jsxs)("label",{className:"block text-sm",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Agent name"}),(0,e.jsx)("input",{className:N,value:L,onChange:s(t=>xe(t.target.value),"onChange")})]}),(0,e.jsxs)("label",{className:"block text-sm",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Adapter type"}),(0,e.jsx)("select",{className:N,value:H,onChange:s(t=>he(t.target.value),"onChange"),children:Fe.map(t=>(0,e.jsxs)("option",{value:t,disabled:!ie.has(t),children:[Re(t),ie.has(t)?"":" (Coming soon)"]},t))})]}),(0,e.jsxs)("label",{className:"block text-sm",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Capabilities"}),(0,e.jsx)("textarea",{className:N,rows:4,value:J,onChange:s(t=>ge(t.target.value),"onChange")})]}),A?(0,e.jsx)("p",{className:"text-xs text-red-400",children:A}):null,(0,e.jsx)(S,{className:"w-full rounded-none",disabled:m.isPending||L.trim().length===0,onClick:s(()=>m.mutate(),"onClick"),children:m.isPending?"Working...":te})]}):Z?(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:o==="sign_up"?"Create your account":"Sign in to continue"}),(0,e.jsx)("p",{className:"mt-1 text-sm text-zinc-400",children:o==="sign_up"?`Start with a Wardmote account. After that, you'll come right back here to accept the invite for ${d}.`:"Use the Wardmote account that already matches this invite. If you do not have one yet, switch back to create account."})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)("button",{type:"button",className:`${oe} ${o==="sign_up"?"border-zinc-100 bg-zinc-100 text-zinc-950":"border-zinc-800 text-zinc-300 hover:border-zinc-600"}`,onClick:s(()=>{v(null),p("sign_up")},"onClick"),children:"Create account"}),(0,e.jsx)("button",{type:"button",className:`${oe} ${o==="sign_in"?"border-zinc-100 bg-zinc-100 text-zinc-950":"border-zinc-800 text-zinc-300 hover:border-zinc-600"}`,onClick:s(()=>{v(null),p("sign_in")},"onClick"),children:"I already have an account"})]}),(0,e.jsxs)("form",{className:"space-y-4",method:"post",action:o==="sign_up"?"/api/auth/sign-up/email":"/api/auth/sign-in/email",onSubmit:s(t=>{if(t.preventDefault(),!_.isPending){if(!ee){v({tone:"error",message:"Please fill in all required fields."});return}_.mutate()}},"onSubmit"),"data-testid":"invite-inline-auth",children:[o==="sign_up"?(0,e.jsxs)("label",{className:"block text-sm",htmlFor:"invite-name",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Name"}),(0,e.jsx)("input",{id:"invite-name",name:"name",className:N,value:R,onChange:s(t=>{ue(t.target.value),v(null)},"onChange"),autoComplete:"name",required:!0,"aria-required":"true","aria-invalid":x?.tone==="error"?!0:void 0,"aria-describedby":x?I:void 0,autoFocus:!0})]}):null,(0,e.jsxs)("label",{className:"block text-sm",htmlFor:"invite-email",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Email"}),(0,e.jsx)("input",{id:"invite-email",name:"email",type:"email",className:N,value:z,onChange:s(t=>{pe(t.target.value),v(null)},"onChange"),autoComplete:"username",required:!0,"aria-required":"true","aria-invalid":x?.tone==="error"?!0:void 0,"aria-describedby":x?I:void 0,autoFocus:o==="sign_in"})]}),(0,e.jsxs)("label",{className:"block text-sm",htmlFor:"invite-password",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Password"}),(0,e.jsx)("input",{id:"invite-password",name:"password",type:"password",className:N,value:w,onChange:s(t=>{D(t.target.value),v(null)},"onChange"),autoComplete:o==="sign_in"?"current-password":"new-password",required:!0,"aria-required":"true","aria-invalid":x?.tone==="error"?!0:void 0,"aria-describedby":x?I:void 0})]}),x?(0,e.jsx)("p",{id:I,role:"alert",className:`text-xs ${x.tone==="info"?"text-amber-300":"text-red-400"}`,children:x.message}):null,(0,e.jsx)(S,{type:"submit",className:"w-full rounded-none",disabled:_.isPending,"aria-disabled":!ee||_.isPending,children:_.isPending?"Working...":o==="sign_in"?"Sign in and continue":"Create account and continue"})]}),(0,e.jsx)("p",{className:"text-xs leading-5 text-zinc-500",children:o==="sign_up"?"Already signed up before? Use the existing-account option instead so the invite lands on the right Wardmote user.":"No account yet? Switch back to create account so you can accept the invite with a new login."})]}):(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:b?"Already in this organization":k?"Completing organization access":n.inviteType==="bootstrap_ceo"?"Accept bootstrap invite":"Accept organization invite"}),(0,e.jsx)("p",{className:"mt-1 text-sm text-zinc-400",children:k?`Granting your access to ${d}.`:b?`This account already belongs to ${d}.`:`This will ${n.inviteType==="bootstrap_ceo"?"finish setting up Wardmote":`grant or complete your access to ${d}`}.`})]}),A?(0,e.jsx)("p",{className:"text-xs text-red-400",children:A}):null,k?(0,e.jsx)("div",{className:"text-sm text-zinc-400",children:m.isPending?"Submitting request...":"Finishing sign-in..."}):(0,e.jsx)(S,{className:"w-full rounded-none",disabled:m.isPending,onClick:s(()=>{if(b&&n.companyId){P(r),c(n.companyId,{source:"manual"}),i("/",{replace:!0});return}m.mutate()},"onClick"),children:m.isPending?"Working...":te})]})})]})})})}s(nt,"InviteLandingPage");export{nt as InviteLandingPage};
|
|
1
|
+
var ze=Object.defineProperty;var s=(a,i)=>ze(a,"name",{value:i,configurable:!0});import{i as de}from"./rolldown-runtime-ZpX3ckPj.js";import{ki as we,la as Ae,m as ke,ua as _e}from"./createLucideIcon-CgrPXnTY.js";import{v as Se}from"./star-eem0qj3E.js";import{X as Ce,_ as ae,t as g,v as O}from"./queryKeys-BzT8CD34.js";import{a as Ie,n as qe,o as Q}from"./companies-query-BEdFiAhG.js";import{n as Ee}from"./CompanyContext-fQCNWI_f.js";import{o as Te,t as ne}from"./router-CJbFZfVR.js";import{t as S}from"./button-DI4w5WP7.js";import{t as U}from"./access-DhB95qNC.js";import{t as Pe}from"./health-Cn-5LIwb.js";import{n as Re}from"./adapter-display-registry-9qBBJi9B.js";import{ai as Le}from"./index-QhteFtm-.js";import{r as se,t as P}from"./invite-memory-CHGcQdLs.js";var l=de(_e(),1),e=de(Ae(),1),Fe=we.filter(a=>a!=="wardmote_runner"),ie=new Set(["omp_local"]);function Me(a,i){let c=a;for(const r of i){if(!c||typeof c!="object")return null;c=c[r]}return typeof c=="string"&&c.trim().length>0?c:null}s(Me,"readNestedString");var N="w-full border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none focus:border-zinc-500",re="border border-zinc-800 bg-zinc-950/95 p-6",oe="flex-1 border px-3 py-2 text-sm transition-colors";function Be(a){return a?a.charAt(0).toUpperCase()+a.slice(1):null}s(Be,"formatHumanRole");function me(a){if(!a||typeof a!="object")return null;const i=a.code;return typeof i=="string"&&i.trim().length>0?i:null}s(me,"getAuthErrorCode");function We(a){if(!(a instanceof Error))return null;const i=a.message.trim();return i.length>0?i:null}s(We,"getAuthErrorMessage");function $e(a,i,c){const r=me(a),o=We(a),p=c.trim().length>0?c.trim():"that email";return r==="USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL"?{tone:"info",message:`An account already exists for ${p}. Sign in below to continue with this invite.`}:r==="INVALID_EMAIL_OR_PASSWORD"?{tone:"error",message:"That email and password did not match an existing Wardmote account. Check both fields, or create an account first if you are new here."}:i==="sign_in"&&o==="Request failed: 401"?{tone:"error",message:"That email and password did not match an existing Wardmote account. Check both fields, or create an account first if you are new here."}:i==="sign_up"&&o==="Request failed: 422"?{tone:"info",message:`An account may already exist for ${p}. Try signing in instead.`}:{tone:"error",message:o??"Authentication failed"}}s($e,"mapInviteAuthFeedback");function ce(a){return!!(a&&typeof a=="object"&&"bootstrapAccepted"in a)}s(ce,"isBootstrapAcceptancePayload");function Oe(a,i){return!a||typeof a!="object"||i?!1:a.status==="approved"}s(Oe,"isApprovedHumanJoinPayload");function K({companyDisplayName:a,companyLogoUrl:i,className:c}){return(0,e.jsx)(Le,{companyName:a,logoUrl:i,logoFit:"contain",className:c})}s(K,"InviteCompanyLogo");function le({companyDisplayName:a,companyLogoUrl:i,invitedByUserName:c,claimSecret:r=null,claimApiKeyPath:o=null,onboardingTextUrl:p=null}){return(0,e.jsx)("div",{className:"min-h-screen bg-zinc-950 px-6 py-12 text-zinc-100",children:(0,e.jsxs)("div",{className:"mx-auto max-w-md border border-zinc-800 bg-zinc-950 p-6","data-testid":"invite-pending-approval",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(K,{companyDisplayName:a,companyLogoUrl:i,className:"h-12 w-12 border border-zinc-800 rounded-none"}),(0,e.jsxs)("h1",{className:"text-lg font-semibold",children:["Request to join ",a]})]}),(0,e.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,e.jsxs)("p",{className:"text-sm text-zinc-400",children:["Your request is still awaiting approval. ",c??"An organization admin"," must approve your request to join."]}),(0,e.jsxs)("div",{className:"border border-zinc-800 p-3",children:[(0,e.jsx)("p",{className:"text-xs text-zinc-500 mb-1",children:"Approval page"}),(0,e.jsx)("p",{className:"text-sm text-zinc-200",children:"Settings → Members"})]}),(0,e.jsxs)("p",{className:"text-sm text-zinc-400",children:["Ask them to visit ",(0,e.jsx)("span",{className:"text-zinc-200",children:"Settings → Members"})," to approve your request."]}),(0,e.jsx)("p",{className:"text-xs text-zinc-500",children:"Refresh this page after you've been approved — you'll be redirected automatically."})]}),r&&o?(0,e.jsxs)("div",{className:"mt-4 space-y-1 border border-zinc-800 p-3 text-xs text-zinc-400",children:[(0,e.jsx)("div",{className:"text-zinc-200",children:"Claim secret"}),(0,e.jsx)("div",{className:"font-mono break-all",children:r}),(0,e.jsxs)("div",{className:"font-mono break-all",children:["POST ",o]})]}):null,p?(0,e.jsxs)("div",{className:"mt-4 text-xs text-zinc-400",children:["Onboarding: ",(0,e.jsx)("span",{className:"font-mono break-all",children:p})]}):null]})})}s(le,"AwaitingJoinApprovalPanel");function nt(){const a=Ce(),i=Te(),{setSelectedCompanyId:c}=Ee(),r=(Se().token??"").trim(),[o,p]=(0,l.useState)("sign_up"),[R,ue]=(0,l.useState)(""),[z,pe]=(0,l.useState)(""),[w,D]=(0,l.useState)(""),[L,xe]=(0,l.useState)(""),[H,he]=(0,l.useState)("omp_local"),[J,ge]=(0,l.useState)(""),[C,ve]=(0,l.useState)(null),[A,F]=(0,l.useState)(null),[x,v]=(0,l.useState)(null),[Y,X]=(0,l.useState)(!1),I="invite-auth-error",M=O({queryKey:g.health,queryFn:s(()=>Pe.get(),"queryFn"),retry:!1}),u=O({queryKey:g.auth.session,queryFn:s(()=>Q.getSession(),"queryFn"),retry:!1}),f=O({queryKey:g.access.invite(r),queryFn:s(()=>U.getInvite(r),"queryFn"),enabled:r.length>0,retry:!1}),q=Ie({enabled:!!u.data&&!!f.data?.companyId,staleTime:0}),E=M.data?.deploymentMode!=="local_trusted"?q.isFetchedAfterMount:!0,be=E?q.data?.companies??[]:[];(0,l.useEffect)(()=>{r&&se(r)},[r]),(0,l.useEffect)(()=>{X(!1)},[r]),(0,l.useEffect)(()=>{if(!E)return;const t=q.data?.companies;!t||!f.data?.companyId||t.some(h=>h.id===f.data.companyId)&&P(r)},[q.data,f.data,E,r]);const n=f.data,B=!!u.data&&!!n?.companyId&&!E,b=!!n?.companyId&&be.some(t=>t.id===n?.companyId),d=n?.companyName?.trim()||"this Wardmote company",T=n?.companyLogoUrl?.trim()||null,W=n?.invitedByUserName?.trim()||null,G=n?.inviteMessage?.trim()||null,ye=Be(n?.humanRole),j=n?.joinRequestStatus??null,V=n?.joinRequestType??null,$=V==="human"&&(j==="pending_approval"||j==="approved"),Z=M.data?.deploymentMode==="authenticated"&&!u.data&&n?.allowedJoinTypes!=="agent",y=n?.inviteType!=="bootstrap_ceo"&&n?.allowedJoinTypes==="agent",k=!!u.data&&!y&&n?.inviteType!=="bootstrap_ceo"&&(!j||$)&&!B&&!b&&!C&&A===null,fe=u.data?.user.name?.trim()||u.data?.user.email?.trim()||"this account",ee=z.trim().length>0&&w.trim().length>0&&(o==="sign_in"||R.trim().length>0&&w.trim().length>=8),m=ae({mutationFn:s(async()=>{if(!n)throw new Error("Invite not found");if(B)throw new Error("Checking your organization access. Try again in a moment.");if(b)throw new Error("This account already belongs to the organization.");return n.inviteType==="bootstrap_ceo"||n.allowedJoinTypes!=="agent"?U.acceptInvite(r,{requestType:"human"}):U.acceptInvite(r,{requestType:"agent",agentName:L.trim(),adapterType:H,capabilities:J.trim()||null})},"mutationFn"),onSuccess:s(async t=>{F(null),P(r);const h=ce(t);ve({kind:h?"bootstrap":"join",payload:t}),await a.invalidateQueries({queryKey:g.auth.session}),await a.invalidateQueries({queryKey:g.access.currentBoardAccess}),await a.invalidateQueries({queryKey:g.companies.all}),n?.companyId&&Oe(t,y)&&(c(n.companyId,{source:"manual"}),i("/",{replace:!0}))},"onSuccess"),onError:s(t=>{F(t instanceof Error?t.message:"Failed to accept invite")},"onError")});(0,l.useEffect)(()=>{!k||Y||m.isPending||(X(!0),F(null),m.mutate())},[m,Y,k]);const _=ae({mutationFn:s(async()=>{if(o==="sign_in"){await Q.signInEmail({email:z.trim(),password:w});return}await Q.signUpEmail({name:R.trim(),email:z.trim(),password:w})},"mutationFn"),onSuccess:s(async()=>{v(null),se(r),await a.invalidateQueries({queryKey:g.auth.session}),await a.invalidateQueries({queryKey:g.health}),await a.invalidateQueries({queryKey:g.access.currentBoardAccess});const{companies:t}=await qe(a);if(n?.companyId&&t.some(h=>h.id===n.companyId)){P(r),c(n.companyId,{source:"manual"}),i("/",{replace:!0});return}if(!(!n||n.inviteType!=="bootstrap_ceo"))try{ce(await m.mutateAsync())&&i("/",{replace:!0})}catch{return}},"onSuccess"),onError:s(t=>{const h=$e(t,o,z);me(t)==="USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL"&&(p("sign_in"),D("")),v(h)},"onError")}),te=(0,l.useMemo)(()=>n?b?"Open organization":n.inviteType==="bootstrap_ceo"?"Accept invite":y?"Submit request":u.data?"Accept invite":"Continue":"Continue",[n,b,u.data,y]);if(!r)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-bad",children:"Invalid invite token."});if(f.isLoading||M.isLoading||u.isLoading)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-ink-3",children:"Loading invite..."});if(B)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-ink-3",children:"Checking your access..."});if(f.error||!n)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)("div",{className:"border border-line bg-bg-2 p-6","data-testid":"invite-error",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Invite not available"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:"This invite may be expired, revoked, or already used."})]})});if(j==="approved"&&V==="human"&&b)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10 text-sm text-ink-3",children:"Opening organization..."});if(j==="pending_approval"&&!$)return(0,e.jsx)(le,{companyDisplayName:d,companyLogoUrl:T,invitedByUserName:W});if(j&&!$)return(0,e.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,e.jsxs)("div",{className:"border border-line bg-bg-2 p-6","data-testid":"invite-error",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Invite not available"}),(0,e.jsx)("p",{className:"mt-2 text-sm text-ink-3",children:j==="rejected"?"This join request was not approved.":"This invite has already been used."})]})});if(C?.kind==="bootstrap")return(0,e.jsx)("div",{className:"min-h-screen bg-zinc-950 px-6 py-12 text-zinc-100",children:(0,e.jsxs)("div",{className:"mx-auto max-w-md border border-zinc-800 bg-zinc-950 p-6",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Bootstrap complete"}),(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(S,{asChild:!0,className:"rounded-none",children:(0,e.jsx)(ne,{to:"/",children:"Open board"})})})]})});if(C?.kind==="join"){const t=C.payload,h=typeof t.claimSecret=="string"?t.claimSecret:null,je=typeof t.claimApiKeyPath=="string"?t.claimApiKeyPath:null,Ne=Me(t.onboarding,["textInstructions","url"]);return!y&&t.status==="approved"?(0,e.jsx)("div",{className:"min-h-screen bg-zinc-950 px-6 py-12 text-zinc-100",children:(0,e.jsxs)("div",{className:"mx-auto max-w-md border border-zinc-800 bg-zinc-950 p-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(K,{companyDisplayName:d,companyLogoUrl:T,className:"h-12 w-12 border border-zinc-800 rounded-none"}),(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"You joined the organization"})]}),(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(S,{asChild:!0,className:"w-full rounded-none",children:(0,e.jsx)(ne,{to:"/",children:"Open board"})})})]})}):(0,e.jsx)(le,{companyDisplayName:d,companyLogoUrl:T,invitedByUserName:W,claimSecret:h,claimApiKeyPath:je,onboardingTextUrl:Ne})}return(0,e.jsx)("div",{className:"min-h-screen bg-zinc-950 px-6 py-12 text-zinc-100",children:(0,e.jsx)("div",{className:"mx-auto max-w-5xl",children:(0,e.jsxs)("div",{className:"grid gap-6 lg:grid-cols-(--gtc-36)",children:[(0,e.jsxs)("section",{className:`${re} space-y-6`,children:[(0,e.jsxs)("div",{className:"flex items-start gap-4",children:[(0,e.jsx)(K,{companyDisplayName:d,companyLogoUrl:T,className:"h-16 w-16 rounded-none border border-zinc-800"}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("p",{className:"text-xs uppercase tracking-(--tracking-caps) text-zinc-500",children:"You've been invited to join Wardmote"}),(0,e.jsx)("h1",{className:"mt-2 text-2xl font-semibold",children:n.inviteType==="bootstrap_ceo"?"Set up Wardmote":`Join ${d}`}),(0,e.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-zinc-300",children:y?"Review the invite details, then submit the agent information below to start the join request.":Z?"Create your Wardmote account first. If you already have one, switch to sign in and continue the invite with the same email.":"Your account is ready. Review the invite details, then accept it to continue."})]})]}),(0,e.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,e.jsxs)("div",{className:"border border-zinc-800 p-3",children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-caps) text-zinc-500",children:"Organization"}),(0,e.jsx)("div",{className:"mt-1 text-sm text-zinc-100",children:d})]}),(0,e.jsxs)("div",{className:"border border-zinc-800 p-3",children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-caps) text-zinc-500",children:"Invited by"}),(0,e.jsx)("div",{className:"mt-1 text-sm text-zinc-100",children:W??"Wardmote board"})]}),(0,e.jsxs)("div",{className:"border border-zinc-800 p-3",children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-caps) text-zinc-500",children:"Requested access"}),(0,e.jsx)("div",{className:"mt-1 text-sm text-zinc-100",children:y?"Agent join request":ye??"Organization access"})]}),(0,e.jsxs)("div",{className:"border border-zinc-800 p-3",children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-caps) text-zinc-500",children:"Invite expires"}),(0,e.jsx)("div",{className:"mt-1 text-sm text-zinc-100",children:ke(n.expiresAt)})]})]}),G?(0,e.jsxs)("div",{className:"border border-amber-500/40 bg-amber-500/10 p-4",children:[(0,e.jsx)("div",{className:"text-xs uppercase tracking-(--tracking-caps) text-amber-200/80",children:"Message from inviter"}),(0,e.jsx)("p",{className:"mt-2 text-sm leading-6 text-amber-50",children:G})]}):null,u.data?(0,e.jsxs)("div",{className:"border border-emerald-500/40 bg-emerald-500/10 p-4 text-sm text-emerald-50",children:["Signed in as ",(0,e.jsx)("span",{className:"font-medium",children:fe}),"."]}):null]}),(0,e.jsx)("section",{className:`${re} h-fit`,children:y?(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:"Submit agent details"}),(0,e.jsxs)("p",{className:"mt-1 text-sm text-zinc-400",children:["This invite will create an approval request for a new agent in ",d,"."]})]}),(0,e.jsxs)("label",{className:"block text-sm",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Agent name"}),(0,e.jsx)("input",{className:N,value:L,onChange:s(t=>xe(t.target.value),"onChange")})]}),(0,e.jsxs)("label",{className:"block text-sm",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Adapter type"}),(0,e.jsx)("select",{className:N,value:H,onChange:s(t=>he(t.target.value),"onChange"),children:Fe.map(t=>(0,e.jsxs)("option",{value:t,disabled:!ie.has(t),children:[Re(t),ie.has(t)?"":" (Coming soon)"]},t))})]}),(0,e.jsxs)("label",{className:"block text-sm",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Capabilities"}),(0,e.jsx)("textarea",{className:N,rows:4,value:J,onChange:s(t=>ge(t.target.value),"onChange")})]}),A?(0,e.jsx)("p",{className:"text-xs text-red-400",children:A}):null,(0,e.jsx)(S,{className:"w-full rounded-none",disabled:m.isPending||L.trim().length===0,onClick:s(()=>m.mutate(),"onClick"),children:m.isPending?"Working...":te})]}):Z?(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:o==="sign_up"?"Create your account":"Sign in to continue"}),(0,e.jsx)("p",{className:"mt-1 text-sm text-zinc-400",children:o==="sign_up"?`Start with a Wardmote account. After that, you'll come right back here to accept the invite for ${d}.`:"Use the Wardmote account that already matches this invite. If you do not have one yet, switch back to create account."})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)("button",{type:"button",className:`${oe} ${o==="sign_up"?"border-zinc-100 bg-zinc-100 text-zinc-950":"border-zinc-800 text-zinc-300 hover:border-zinc-600"}`,onClick:s(()=>{v(null),p("sign_up")},"onClick"),children:"Create account"}),(0,e.jsx)("button",{type:"button",className:`${oe} ${o==="sign_in"?"border-zinc-100 bg-zinc-100 text-zinc-950":"border-zinc-800 text-zinc-300 hover:border-zinc-600"}`,onClick:s(()=>{v(null),p("sign_in")},"onClick"),children:"I already have an account"})]}),(0,e.jsxs)("form",{className:"space-y-4",method:"post",action:o==="sign_up"?"/api/auth/sign-up/email":"/api/auth/sign-in/email",onSubmit:s(t=>{if(t.preventDefault(),!_.isPending){if(!ee){v({tone:"error",message:"Please fill in all required fields."});return}_.mutate()}},"onSubmit"),"data-testid":"invite-inline-auth",children:[o==="sign_up"?(0,e.jsxs)("label",{className:"block text-sm",htmlFor:"invite-name",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Name"}),(0,e.jsx)("input",{id:"invite-name",name:"name",className:N,value:R,onChange:s(t=>{ue(t.target.value),v(null)},"onChange"),autoComplete:"name",required:!0,"aria-required":"true","aria-invalid":x?.tone==="error"?!0:void 0,"aria-describedby":x?I:void 0,autoFocus:!0})]}):null,(0,e.jsxs)("label",{className:"block text-sm",htmlFor:"invite-email",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Email"}),(0,e.jsx)("input",{id:"invite-email",name:"email",type:"email",className:N,value:z,onChange:s(t=>{pe(t.target.value),v(null)},"onChange"),autoComplete:"username",required:!0,"aria-required":"true","aria-invalid":x?.tone==="error"?!0:void 0,"aria-describedby":x?I:void 0,autoFocus:o==="sign_in"})]}),(0,e.jsxs)("label",{className:"block text-sm",htmlFor:"invite-password",children:[(0,e.jsx)("span",{className:"mb-1 block text-zinc-400",children:"Password"}),(0,e.jsx)("input",{id:"invite-password",name:"password",type:"password",className:N,value:w,onChange:s(t=>{D(t.target.value),v(null)},"onChange"),autoComplete:o==="sign_in"?"current-password":"new-password",required:!0,"aria-required":"true","aria-invalid":x?.tone==="error"?!0:void 0,"aria-describedby":x?I:void 0})]}),x?(0,e.jsx)("p",{id:I,role:"alert",className:`text-xs ${x.tone==="info"?"text-amber-300":"text-red-400"}`,children:x.message}):null,(0,e.jsx)(S,{type:"submit",className:"w-full rounded-none",disabled:_.isPending,"aria-disabled":!ee||_.isPending,children:_.isPending?"Working...":o==="sign_in"?"Sign in and continue":"Create account and continue"})]}),(0,e.jsx)("p",{className:"text-xs leading-5 text-zinc-500",children:o==="sign_up"?"Already signed up before? Use the existing-account option instead so the invite lands on the right Wardmote user.":"No account yet? Switch back to create account so you can accept the invite with a new login."})]}):(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:b?"Already in this organization":k?"Completing organization access":n.inviteType==="bootstrap_ceo"?"Accept bootstrap invite":"Accept organization invite"}),(0,e.jsx)("p",{className:"mt-1 text-sm text-zinc-400",children:k?`Granting your access to ${d}.`:b?`This account already belongs to ${d}.`:`This will ${n.inviteType==="bootstrap_ceo"?"finish setting up Wardmote":`grant or complete your access to ${d}`}.`})]}),A?(0,e.jsx)("p",{className:"text-xs text-red-400",children:A}):null,k?(0,e.jsx)("div",{className:"text-sm text-zinc-400",children:m.isPending?"Submitting request...":"Finishing sign-in..."}):(0,e.jsx)(S,{className:"w-full rounded-none",disabled:m.isPending,onClick:s(()=>{if(b&&n.companyId){P(r),c(n.companyId,{source:"manual"}),i("/",{replace:!0});return}m.mutate()},"onClick"),children:m.isPending?"Working...":te})]})})]})})})}s(nt,"InviteLandingPage");export{nt as InviteLandingPage};
|
package/dist/assets/{IssueChatLongThreadPerf-BHdYa83T.js → IssueChatLongThreadPerf-C3U2FZKJ.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var S=Object.defineProperty;var n=(t,r)=>S(t,"name",{value:r,configurable:!0});import{i as I}from"./rolldown-runtime-ZpX3ckPj.js";import{la as P,ua as L}from"./createLucideIcon-CgrPXnTY.js";import{t as N}from"./badge-jeXr866I.js";import{o as x,r as b,s as v,t as w}from"./card-BVZvs7aX.js";import{n as O}from"./IssueChatThread-
|
|
1
|
+
var S=Object.defineProperty;var n=(t,r)=>S(t,"name",{value:r,configurable:!0});import{i as I}from"./rolldown-runtime-ZpX3ckPj.js";import{la as P,ua as L}from"./createLucideIcon-CgrPXnTY.js";import{t as N}from"./badge-jeXr866I.js";import{o as x,r as b,s as v,t as w}from"./card-BVZvs7aX.js";import{n as O}from"./IssueChatThread-CDKaIB6v.js";var o=I(L(),1);var E=new Date("2026-04-28T14:00:00.000Z").getTime();function i(t){return new Date(E+t*6e4)}n(i,"atMinute");function _(t,r,a,A){const l=new Date("2026-04-28T14:00:00.000Z");return{id:t,companyId:"company-long-thread",name:r,urlKey:A,role:"engineer",title:null,icon:a,status:"active",reportsTo:null,capabilities:null,adapterType:"omp_local",adapterConfig:{},runtimeConfig:{},budgetMonthlyCents:0,spentMonthlyCents:0,lastHeartbeatAt:null,metadata:null,createdAt:l,updatedAt:l,pauseReason:null,pausedAt:null,permissions:{canCreateAgents:!1}}}n(_,"createAgent");var m=_("agent-perf-codex","CodexCoder","code","codexcoder"),h=_("agent-perf-reviewer","ReviewBot","sparkles","reviewbot"),$=new Map([[m.id,m],[h.id,h]]);function B(t){return[`## Baseline note ${t}`,"",`This assistant update captures a deterministic markdown-heavy row for long-thread rendering. It references [PAP-${2600+t}](/PAP/issues/PAP-${2600+t}) and includes enough structure to exercise markdown parsing.`,"","- Parsed checklist item one with inline `code`","- Parsed checklist item two with **bold** and _italic_ text","- Parsed checklist item three with a link to [Wardmote](/PAP/dashboard)","","| Metric | Value |","| --- | ---: |",`| Fixture row | ${t} |`,`| Synthetic tokens | ${1200+t} |`,"","```ts",`const fixtureRow${t} = { markdown: true, deterministic: true };`,"```"].join(`
|
|
2
2
|
`)}n(B,"markdownBody");function U(t){return`Board checkpoint ${t}: keep the issue-detail page responsive while the thread is full of historical comments.`}n(U,"plainUserBody");function F(t){return`Processed checkpoint ${t}. The current direct-render path should keep this row mounted with the rest of the thread.`}n(F,"plainAssistantBody");function H(t){const r=t<150,a=r||t%4===1||t%4===2?t%7===0?h.id:m.id:null;return{id:`long-thread-comment-${String(t+1).padStart(3,"0")}`,companyId:"company-long-thread",issueId:"issue-long-thread",authorType:a?"agent":"user",authorAgentId:a,authorUserId:a?null:"user-board",body:r?B(t+1):a?F(t+1):U(t+1),presentation:null,metadata:null,createdAt:i(t),updatedAt:i(t)}}n(H,"createComment");var R=Array.from({length:469},(t,r)=>H(r)),G=new Set(R.slice(0,150).map(t=>t.id)),T=Array.from({length:12},(t,r)=>({id:`long-thread-event-${r+1}`,createdAt:i(r*36+18),actorType:r%3===0?"user":"agent",actorId:r%3===0?"user-board":m.id,statusChange:r%2===0?{from:r===0?"todo":"in_progress",to:"in_progress"}:void 0,assigneeChange:r%2===1?{from:{agentId:null,userId:null},to:{agentId:r%4===1?m.id:h.id,userId:null}}:void 0})),C=Array.from({length:6},(t,r)=>({runId:`long-thread-run-${r+1}`,status:r%3===0?"failed":r%3===1?"timed_out":"succeeded",agentId:r%2===0?m.id:h.id,agentName:r%2===0?m.name:h.name,adapterType:"omp_local",createdAt:i(r*72+12),startedAt:i(r*72+12),finishedAt:i(r*72+16),hasStoredOutput:!0})),V=[],k=new Map(C.map((t,r)=>[t.runId,[{kind:"thinking",ts:i(r*72+13).toISOString(),text:`Inspecting long-thread segment ${r+1}.`},{kind:"tool_call",ts:i(r*72+14).toISOString(),name:"read_file",toolUseId:`long-thread-tool-${r+1}`,input:{path:"ui/src/components/IssueChatThread.tsx"}},{kind:"tool_result",ts:i(r*72+15).toISOString(),toolUseId:`long-thread-tool-${r+1}`,content:"Confirmed the direct-render fixture keeps the full message subtree mounted.",isError:t.status!=="succeeded"},{kind:"assistant",ts:i(r*72+16).toISOString(),text:`Run ${r+1} produced a compact transcript row for adjacent run context.`}]])),W={issue:{identifier:"PAP-PERF",title:"Long-thread rendering baseline fixture",status:"in_progress",priority:"medium",projectName:"Wardmote App"},documents:["Implementation Plan","Profiler Notes","Release Checklist","QA Readout"],subIssues:["Phase 1: Add long-thread perf fixture and baseline","Phase 2: Isolate issue-thread row rendering and Markdown work","Phase 3: Apply virtualization and guard scroll behavior","Phase 4: Verify production issue profile improvement"],sidebarStats:[["Comments",String(469)],["Markdown bodies",String(150)],["Timeline events",String(12)],["Linked runs",String(6)]]},e=I(P(),1),q=n(async()=>{},"noop"),y={commitCount:0,mountActualDuration:null,latestActualDuration:null,maxActualDuration:0,totalActualDuration:0};function j(t){return t===null||!Number.isFinite(t)?"pending":`${t.toFixed(1)} ms`}n(j,"formatMs");function c({label:t,value:r,testId:a}){return(0,e.jsxs)("div",{className:"rounded-md border border-line bg-bg px-3 py-2",children:[(0,e.jsx)("div",{className:"text-(length:--text-micro) font-medium uppercase tracking-(--tracking-eyebrow) text-ink-3",children:t}),(0,e.jsx)("div",{"data-testid":a,className:"mt-1 font-mono text-sm text-ink",children:r})]})}n(c,"MetricTile");function Y(){const[t,r]=(0,o.useState)(y),a=(0,o.useRef)(y),A=(0,o.useRef)(performance.now()),l=(0,o.useRef)(null),g=(0,o.useRef)(!1),d=W,D=(0,o.useMemo)(()=>469+T.length+C.length,[]);(0,o.useEffect)(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]),(0,o.useLayoutEffect)(()=>{if(g.current||a.current.commitCount>0)return;const s=performance.now()-A.current,u={commitCount:1,mountActualDuration:s,latestActualDuration:s,maxActualDuration:s,totalActualDuration:s};a.current=u,g.current=!0,r(u)},[]);const M=n((s,u,f)=>{const p=a.current;a.current={commitCount:p.commitCount+1,mountActualDuration:u==="mount"&&p.mountActualDuration===null?f:p.mountActualDuration,latestActualDuration:f,maxActualDuration:Math.max(p.maxActualDuration,f),totalActualDuration:p.totalActualDuration+f},!(g.current||l.current!==null)&&(l.current=window.setTimeout(()=>{l.current=null,g.current=!0,r(a.current)},0))},"handleRender");return(0,e.jsxs)("div",{"data-testid":"issue-chat-long-thread-perf",className:"space-y-5",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-3 border-b border-line pb-5 lg:flex-row lg:items-end lg:justify-between",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(N,{variant:"outline",className:"font-mono text-(length:--text-micro)",children:d.issue.identifier}),(0,e.jsx)(N,{variant:"secondary",children:d.issue.status.replace(/_/g," ")}),(0,e.jsx)(N,{variant:"outline",children:d.issue.projectName})]}),(0,e.jsx)("h1",{className:"mt-3 text-2xl font-semibold tracking-tight",children:d.issue.title}),(0,e.jsx)("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-ink-3",children:"Deterministic local fixture for measuring the current direct-render issue chat path with hundreds of merged thread rows, markdown-heavy assistant bodies, linked runs, documents, sub-issues, and sidebar context."})]}),(0,e.jsxs)("div",{className:"grid min-w-(--sz-280px) grid-cols-2 gap-2",children:[(0,e.jsx)(c,{label:"Fixture rows",value:String(D),testId:"perf-fixture-row-target"}),(0,e.jsx)(c,{label:"Markdown rows",value:String(150),testId:"perf-fixture-markdown-rows"})]})]}),(0,e.jsxs)("div",{className:"grid gap-4 xl:grid-cols-(--gtc-40)",children:[(0,e.jsxs)("main",{className:"min-w-0 space-y-4",children:[(0,e.jsxs)(w,{className:"border-line/70",children:[(0,e.jsx)(x,{className:"pb-2",children:(0,e.jsx)(v,{className:"text-base",children:"Issue documents"})}),(0,e.jsx)(b,{className:"grid gap-2 sm:grid-cols-2",children:d.documents.map(s=>(0,e.jsx)("div",{className:"rounded-md border border-line bg-bg-3/30 px-3 py-2 text-sm",children:s},s))})]}),(0,e.jsxs)(w,{className:"border-line/70",children:[(0,e.jsx)(x,{className:"pb-2",children:(0,e.jsx)(v,{className:"text-base",children:"Sub-issues"})}),(0,e.jsx)(b,{className:"space-y-2",children:d.subIssues.map((s,u)=>(0,e.jsxs)("div",{className:"flex items-center gap-3 rounded-md border border-line bg-bg px-3 py-2 text-sm",children:[(0,e.jsxs)("span",{className:"font-mono text-xs text-ink-3",children:["#",u+1]}),(0,e.jsx)("span",{children:s})]},s))})]}),(0,e.jsx)(o.Profiler,{id:"issue-chat-long-thread",onRender:M,children:(0,e.jsx)(O,{comments:R,linkedRuns:C,timelineEvents:T,liveRuns:V,issueStatus:"in_progress",agentMap:$,currentUserId:"user-board",onAdd:q,showComposer:!1,showJumpToLatest:!1,enableLiveTranscriptPolling:!1,transcriptsByRunId:k,hasOutputForRun:n(s=>k.has(s),"hasOutputForRun")})})]}),(0,e.jsxs)("aside",{className:"space-y-4 xl:sticky xl:top-4 xl:self-start",children:[(0,e.jsxs)(w,{className:"border-line/70",children:[(0,e.jsx)(x,{className:"pb-2",children:(0,e.jsx)(v,{className:"text-base",children:"Baseline metrics"})}),(0,e.jsxs)(b,{className:"grid gap-2",children:[(0,e.jsx)(c,{label:"Profiler commits",value:String(t.commitCount),testId:"perf-commit-count"}),(0,e.jsx)(c,{label:"Mount duration",value:j(t.mountActualDuration),testId:"perf-mount-duration"}),(0,e.jsx)(c,{label:"Latest duration",value:j(t.latestActualDuration),testId:"perf-latest-duration"}),(0,e.jsx)(c,{label:"Max duration",value:j(t.maxActualDuration),testId:"perf-max-duration"}),(0,e.jsx)(c,{label:"Total duration",value:j(t.totalActualDuration),testId:"perf-total-duration"})]})]}),(0,e.jsxs)(w,{className:"border-line/70",children:[(0,e.jsx)(x,{className:"pb-2",children:(0,e.jsx)(v,{className:"text-base",children:"Fixture shape"})}),(0,e.jsxs)(b,{className:"space-y-2",children:[d.sidebarStats.map(([s,u])=>(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3 text-sm",children:[(0,e.jsx)("span",{className:"text-ink-3",children:s}),(0,e.jsx)("span",{className:"font-mono",children:u})]},s)),(0,e.jsx)("div",{className:"hidden","data-testid":"perf-markdown-comment-id-sample",children:[...G].slice(0,3).join(",")})]})]})]})]})]})}n(Y,"IssueChatLongThreadPerf");export{Y as IssueChatLongThreadPerf};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Tu=Object.defineProperty;var i=(t,e)=>Tu(t,"name",{value:e,configurable:!0});import{i as ui,t as Cu}from"./rolldown-runtime-ZpX3ckPj.js";import{b as ku,h as Yn,l as te,la as Au,ua as Eu}from"./createLucideIcon-CgrPXnTY.js";import{a as Pa,h as Ru}from"./star-eem0qj3E.js";import{d as ju,g as Mu,n as Nu,t as Du,u as Ou,v as Pu}from"./queryKeys-BzT8CD34.js";import{D as Bu,E as Ba,T as $u,k as Lu}from"./ConnectionSetupFlow-8alK3I_h.js";import{X as Vu}from"./mention-chips-COg-185l.js";import{r as Fu}from"./responsible-user-denial-Dyl0BwU5.js";import{Bt as Uu,I as qu,Ut as $a,_t as La,at as Va,b as zu,it as Hu,m as Fa,on as Ln,t as Is}from"./router-CJbFZfVR.js";import{a as Wu,c as Ku,i as Ju,n as Qu,o as Yu,r as Gu,s as Xu,t as Zu}from"./alert-dialog-DNbnZgRz.js";import{a as ed,n as di,t as hi}from"./avatar-qO_h93F8.js";import{i as On,p as Ua,r as qa,t as za}from"./dropdown-menu-rUbU8QKw.js";import{a as td,s as sd,t as nd}from"./MarkdownEditor-ubJimjUH.js";import{o as rd,r as id,t as od}from"./popover-CWlBonqy.js";import{t as wr}from"./arrow-right-W0iJ_-Zs.js";import{t as Ts}from"./check-Bis3vECb.js";import{t as es}from"./chevron-down-nRcQ7bok.js";import{t as ad}from"./circle-DCDVf2v0.js";import{a as cd,c as ld,d as ud,f as dd,i as hd,n as fd,o as md,p as fi,t as pd}from"./ComposerAddMenu-jKf-6Yli.js";import{_ as gd,b as bd,d as xd,p as vd,t as Gn,x as Co}from"./MarkdownBody-cPGkwwjq.js";import{t as en}from"./copy-C1cfcpxY.js";import{t as Ha}from"./ellipsis-DyXbAp4P.js";import{t as yd}from"./eye-off-DTXvEIMp.js";import{t as mi}from"./flag-i_D610oD.js";import{r as pt,t as Ee}from"./button-DI4w5WP7.js";import{h as _d,p as wd,s as Wa,t as Ka}from"./IssueThreadInteractionCard-BUIzNywc.js";import{t as Sd}from"./rotate-ccw-DpzLJhXT.js";import{t as Id}from"./search-CgZSuGC8.js";import{t as Ja}from"./square-CDo6rOf8.js";import{t as Td}from"./thumbs-down-BVZskfHA.js";import{t as Cd}from"./thumbs-up-Cqj30fzj.js";import{t as Qa}from"./trash-QxFF084e.js";import{t as Xn}from"./triangle-alert-CnHMpmva.js";import{t as kd}from"./x-6E1yeU3Q.js";import{i as pi,n as gi,t as bi}from"./tooltip-CW50mEoC.js";import{t as Kt}from"./badge-jeXr866I.js";import{t as rt}from"./AgentAvatar-BZiiDlCN.js";import{n as Zn}from"./ToastContext-DyVJ6bCh.js";import{t as Ad}from"./instanceSettings-D1nNVWU0.js";import{a as Ya,i as Ga,n as Xa,r as Za,s as ec,t as tc}from"./dialog-CeH7rDcv.js";import{r as Jt}from"./assignees-DkQNbPzi.js";import{t as Ed}from"./textarea-CTx68BDs.js";import{t as sc}from"./attachment-icon-_1iz_saB.js";import{a as Rd,c as Sr,d as Vt,g as Sn,h as ko,l as jd,m as Ft,o as Md,p as Nd,s as Ao,u as Dd,v as Eo}from"./TaskChatComposerTakeoverContext-C68QVO36.js";import{t as Od}from"./InlineEntitySelector-BboofK18.js";import{t as Pd}from"./InlineBanner-DeTqU5Gp.js";import{t as Cs}from"./clipboard-CTLKYvRL.js";import{t as $r}from"./card-BVZvs7aX.js";import{_ as Bd,a as $d,d as Ld,i as Vd,l as Fd,n as Ud,r as qd,s as zd}from"./issue-blockers-t3wlvg4M.js";import{K as Vn,Rt as Hd,_a as Wd,h as Kd,m as Jd,p as nc,to as rc,zt as Qd}from"./index-LM7k1NmC.js";import{_ as Yd,a as xi,d as Gd,h as Xd,i as Zd,n as eh,p as th,r as sh,s as nh,t as rh}from"./system-notice-comment-BUfjKy0_.js";import{n as ih,r as oh,t as ah}from"./run-log-chunks-ZnzOvrXs.js";import{t as ch}from"./useSecondTick-BRYNTPNI.js";import{a as Ro,c as lh,d as uh,f as dh,g as vi,h as hh,i as fh,l as mh,m as ph,r as gh,s as bh,t as Pn}from"./SourceTrustBadge-CXZGc8G4.js";import{t as xh}from"./IssueRecoveryActionCard-O4GRNsPc.js";import{t as vh}from"./CommentAttributionChip-BdllZVtJ.js";var x=ui(Eu(),1),c=ui(Au(),1);function jo(t){const e=t.executionWorkspaceId??t.projectWorkspaceId;return t.label??(e?e.slice(0,8):"None")}i(jo,"formatTimelineWorkspaceLabel");function ks(t){return typeof t!="object"||t===null||Array.isArray(t)?null:t}i(ks,"asRecord$2");function zt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}i(zt,"hasOwn");function Me(t){return typeof t=="string"&&t.length>0?t:null}i(Me,"nullableString");function Mo(t){return new Date(t).getTime()}i(Mo,"toTimestamp$2");function yh(t,e){return t.agentId===e.agentId&&t.userId===e.userId}i(yh,"sameAssignee");function _h(t,e){return t.projectWorkspaceId===e.projectWorkspaceId&&t.executionWorkspaceId===e.executionWorkspaceId&&t.mode===e.mode&&t.label===e.label}i(_h,"sameWorkspace");function No(t){const e=ks(t);return e?{label:Me(e.label),projectWorkspaceId:Me(e.projectWorkspaceId),executionWorkspaceId:Me(e.executionWorkspaceId),mode:Me(e.mode)}:null}i(No,"workspaceFromRecord");function wh(t){const e=ks(t.workspaceChange);if(!e)return null;const s=No(e.from),n=No(e.to);return!s||!n||_h(s,n)?null:{from:s,to:n}}i(wh,"workspaceChangeFromDetails");function ic(t){return[...t].sort((e,s)=>{const n=Mo(e.createdAt)-Mo(s.createdAt);return n!==0?n:e.id.localeCompare(s.id)})}i(ic,"sortTimelineEvents");function n_(t){const e=[];for(const s of t??[]){if(s.action!=="issue.updated")continue;const n=ks(s.details);if(!n||!zt(n,"workMode"))continue;const r=ks(n._previous);!r||!zt(r,"workMode")||e.push({id:s.id,createdAt:s.createdAt,from:Me(r.workMode),to:Me(n.workMode)})}return ic(e)}i(n_,"extractIssueWorkModeChanges");function r_(t){const e=[];for(const s of t??[]){const n=ks(s.details);if(!n)continue;if(s.action==="issue.comment_added"){if(n.followUpRequested!==!0&&n.resumeIntent!==!0||n.reopened===!0)continue;const l=Me(n.commentId);e.push({id:s.id,createdAt:s.createdAt,actorType:s.actorType,actorId:s.actorId,runId:s.runId??null,commentId:l,followUpRequested:!0});continue}if(s.action!=="issue.updated")continue;const r=ks(n._previous),o={id:s.id,createdAt:s.createdAt,actorType:s.actorType,actorId:s.actorId,runId:s.runId??null};if((n.followUpRequested===!0||n.resumeIntent===!0)&&(o.followUpRequested=!0,o.commentId=Me(n.commentId)),zt(n,"status")){const l=Me(r?.status)??Me(n.reopenedFrom),u=Me(n.status);l!==u&&(o.statusChange={from:l,to:u})}if(zt(n,"assigneeAgentId")||zt(n,"assigneeUserId")){const l={agentId:Me(r?.assigneeAgentId),userId:Me(r?.assigneeUserId)},u={agentId:zt(n,"assigneeAgentId")?Me(n.assigneeAgentId):l.agentId,userId:zt(n,"assigneeUserId")?Me(n.assigneeUserId):l.userId};yh(l,u)||(o.assigneeChange={from:l,to:u})}const a=wh(n);a&&(o.workspaceChange=a),(o.statusChange||o.assigneeChange||o.workspaceChange||o.followUpRequested)&&e.push(o)}return ic(e)}i(r_,"extractIssueTimelineEvents");var vs=null;function Sh(t,e){t.currentIndex=0,t.wipContextDeps=null,t.wipCommitCallbacks=[];const s=vs;vs=t;try{if(e(),t.isFirstRender=!1,t.cells.length!==t.currentIndex)throw new Error(`Rendered ${t.currentIndex} hooks but expected ${t.cells.length}. Hooks must be called in the exact same order in every render.`)}finally{vs=s}}i(Sh,"withResourceFiber");function et(){if(!vs)throw new Error("No resource fiber available");return vs}i(et,"getCurrentResourceFiber");function Tt(){return vs}i(Tt,"peekResourceFiber");var De=typeof process<"u"&&!1,oc=i(t=>({version:0,committedVersion:0,dispatchUpdate:t,changelog:[],committedLog:[],unsettledCount:0,rollbackCallbacks:[]}),"createResourceFiberRoot"),yi=i(t=>{t.committedVersion=t.version;for(const e of t.changelog)e.logged=!1,e.settled||(e.settled=!0,t.unsettledCount--),t.committedLog.push(e);t.changelog.length=0,t.unsettledCount===0&&(t.committedLog.length=0),t.rollbackCallbacks.length=0},"commitRoot"),Gs=i((t,e)=>{const s=t.version>e;if(t.version=e,s){for(let n=0;n<t.rollbackCallbacks.length;n++)t.rollbackCallbacks[n]();if(t.rollbackCallbacks.length=0,e<=t.committedVersion){const n=[];for(;t.committedVersion-n.length>e;){const r=t.committedLog.pop();if(r===void 0){if(De)throw new Error("tap: committed history is shorter than the replay base.");break}_i(r.fiber,r.cell),r.cell.workInProgress=r.prevState,n.push({record:r,prevState:r.prevState,eagerState:r.eagerState,hasEagerState:r.hasEagerState})}if(n.length>0){const r=t.committedVersion;er(t,()=>{for(let o=n.length-1;o>=0;o--){const a=n[o];a.record.prevState=a.prevState,a.record.eagerState=a.eagerState,a.record.hasEagerState=a.hasEagerState,t.committedLog.push(a.record)}t.committedVersion=r})}t.committedVersion=e;for(const r of t.changelog)r.logged=!1;t.changelog.length=0}else{for(;t.committedVersion+t.changelog.length>e;)t.changelog.pop().logged=!1;for(let n=0;n<t.changelog.length;n++)ac(t.changelog[n]);yi(t)}}},"setRootVersion"),ac=i(t=>{_i(t.fiber,t.cell),t.queued||(t.queued=!0,(t.cell.queue??=[]).push(t))},"applyChangelogRecord"),an=i((t,e)=>{t.wipCommitCallbacks.push(e)},"addCommit"),er=i((t,e)=>{t.rollbackCallbacks.push(e)},"addRollback"),_i=i((t,e)=>{e.isDirty||(e.isDirty=!0,t.markDirty?.(),er(t.root,()=>{if(e.queue!==null){for(const s of e.queue)s.queued=!1;e.queue=null}e.workInProgress=e.current,e.isDirty=!1}))},"markReducerDirty"),cc=Symbol.for("react.memo_cache_sentinel"),lc=i(t=>new Array(t).fill(cc),"createMemoCache"),Ih=i((t,e)=>{const s=t.memoCache;let n=s.workInProgress;if(n===null){const a=s.current;n=a===null?[]:a.map(l=>l.slice()),s.workInProgress=n,er(t.root,()=>{s.workInProgress=null})}const r=s.index++;let o=n[r];return o===void 0?(o=lc(e),n[r]=o):De&&o.length,o},"nextFiberMemoCache"),uc=i(t=>Ih(et(),t),"useMemoCache"),Th=x.default,Ch=i(t=>(0,x.useMemo)(()=>{const e=lc(t);return e[cc]=!0,e},[]),"useReactMemoCacheShim"),kh=Th.__COMPILER_RUNTIME?.c??Ch,Ah=i(()=>Tt()!==null,"inTap$1"),se=i(t=>Ah()?uc(t):kh(t),"c"),Je=i((t,...e)=>Object.assign(Object.create(null),t,...e),"nullProtoRecord"),tr=i(()=>{throw new Error("Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.")},"throwRenderedMoreHooks"),sr=i(()=>{throw new Error("Hook order changed between renders")},"throwHookOrderChanged"),Eh=i(t=>({type:t,setup:void 0,setupDeps:void 0,cleanup:void 0,deps:null,generation:0}),"newEffect");function dc(t,e,s){const n=et(),r=n.currentIndex++,o=n.cells[r],a=o===void 0?Eh(s):o.type===s?o:sr();if(o===void 0&&(n.isFirstRender||tr(),n.cells[r]=a,s==="insertion"?(n.insertionCells??=[]).push(a):n.effectCells.push(a)),a.deps!==null&&!!e!=!!a.deps)throw new Error("useEffect called with and without dependencies across re-renders");an(n,()=>{a.setup=t,a.setupDeps=e,a.generation++})}i(dc,"useEffectImpl");function gt(t,e){dc(t,e,"effect")}i(gt,"useEffect$3");var cn=i((t,e)=>{De&&(t.length,e.length);for(let s=0;s<t.length&&s<e.length;s++)if(!Object.is(t[s],e[s]))return!1;return!0},"depsShallowEqual"),Do=i((t,e)=>{an(t,()=>{e.current=e.wip,e.currentDeps=e.wipDeps,e.isDirty=!1})},"addMemoCommit"),nr=i((t,e)=>{const s=et(),n=s.currentIndex++;let r=s.cells[n];if(r===void 0){s.isFirstRender||tr();const l=t();return De&&s.devStrictMode&&t(),r={type:"memo",current:l,currentDeps:e,wip:l,wipDeps:e,isDirty:!1},s.cells[n]=r,l}r.type!=="memo"&&sr();const o=r;if(cn(o.wipDeps,e))return o.isDirty&&Do(s,o),o.wip;const a=t();return De&&s.devStrictMode&&t(),o.wip=a,o.wipDeps=e,o.isDirty||(o.isDirty=!0,er(s.root,()=>{o.wip=o.current,o.wipDeps=o.currentDeps,o.isDirty=!1})),Do(s,o),a},"useMemo$5");function Ds(t){return nr(()=>({current:t}),[])}i(Ds,"useRef$5");var wi=Symbol("tap.Context.defaultValue"),Rh=i(t=>t,"asTap"),st=new Map,Ht=new Set,jh=i(()=>new Map(st),"cloneCurrentTapContext"),Lr=i((t,e)=>{const s=st;st=t;try{return e()}finally{st=s}},"withTapContextRoot"),hc=i((t,e)=>{t[wi]=e},"attachDefaultValueToContext"),fc=i(t=>typeof t=="object"&&t!==null&&wi in t,"isTapContext"),mc=i(t=>typeof t=="object"&&t!==null&&"$$typeof"in t&&t.$$typeof===Symbol.for("react.context"),"isReactContext"),pc=i(t=>fc(t)||mc(t),"isReadableTapContext"),gc=i(t=>{if(!fc(t)){if(mc(t)){hc(t,t._currentValue??t._currentValue2);return}throw new Error("A tap resource's `use()` only accepts a tap context.")}},"assertTapContext"),rr=i((t,e,s)=>{if(typeof t!="object"||t===null)throw new Error("useContextProvider only accepts a React context.");gc(t);const n=t,r=et(),o=Ds(void 0),a=o.current===void 0||!Object.is(o.current.value,e);gt(()=>{o.current={value:e}},[e]);const l=st.get(n),u=l!==void 0||st.has(n);st.set(n,{value:e,source:r});try{return Mh(n,a,s)}finally{u?st.set(n,l):st.delete(n)}},"useContextProvider"),Mh=i((t,e,s)=>{const n=Ht.has(t);e?Ht.add(t):Ht.delete(t);try{return s()}finally{n?Ht.add(t):Ht.delete(t)}},"withChangedContext"),bc=i(t=>{gc(t);const e=t,s=Nh(e,t),n=et();return(n.wipContextDeps??=new Map).set(e,s.source),s.value},"useContext$2"),Nh=i((t,e)=>st.get(t)??{value:Rh(e)[wi],source:null},"getCurrentContextValue"),Dh=i((t,e,s,n)=>{if(!n)return s;let r=s;for(const[o,a]of n)a===e||a===t||(r??=new Map).set(o,a);return r},"mergeContextDeps"),xc=i((t,e=t.wipContextDeps)=>{const s=Tt();!s||!e||(s.wipContextDeps=Dh(s,t,s.wipContextDeps,e))},"bubbleContextDeps"),vc=i(()=>Ht.size>0,"hasChangedContexts"),Si=i(t=>{if(!t.contextDeps||!vc())return!1;for(const e of Ht.keys())if(t.contextDeps.has(e))return!0;return!1},"hasContextDepsChanged"),Oh=i((t,e,s)=>{if(t.isNeverMounted)throw new Error("Resource updated before mount");let n=!1,r=!0;t.root.unsettledCount++,t.root.dispatchUpdate(()=>(n||(n=!0,s&&t.root.changelog.length===0&&!e.cell.isDirty&&!e.hasEagerState&&(e.prevState=e.cell.workInProgress,e.eagerState=s(e.cell.workInProgress,e.action),e.hasEagerState=!0,r=!Object.is(e.cell.current,e.eagerState),!r&&!e.settled&&(e.settled=!0,t.root.unsettledCount--))),r),()=>(n=!0,r=!0,ac(e),e.logged||(e.logged=!0,t.root.changelog.push(e)),!0))},"dispatchOnFiber"),Ph=i((t,e,s,n,r)=>{const o=n?n(s):s;De&&t.devStrictMode&&n&&n(s);const a={type:"reducer",workInProgress:o,current:o,isDirty:!1,queue:null,renderQueue:null,reducer:e,dispatch:i(l=>{const u=Tt();if(u!==null){if(u!==t)throw new Error("Cannot update a resource while rendering a different resource.");(t.renderPendingCells??=new Set).add(a),(a.renderQueue??=[]).push(l)}else{const d={fiber:t,cell:a,action:l,hasEagerState:!1,eagerState:void 0,prevState:a.current,settled:!1,queued:!1,logged:!1};Oh(t,d,r?e:void 0)}},"dispatch")};return a},"createReducerCell");function yc(t,e,s,n){const r=et(),o=r.currentIndex++,a=r.cells[o],l=(()=>{if(a!==void 0)return a.type==="reducer"?a:sr();r.isFirstRender||tr();const d=Ph(r,t,e,s,n);return r.cells[o]=d,d})(),u=l.queue;if(u!==null){const d=t===l.reducer;for(let h=0;h<u.length;h++){const f=u[h];!f.hasEagerState||!d||!Object.is(f.prevState,l.workInProgress)?(f.prevState=l.workInProgress,f.eagerState=t(l.workInProgress,f.action),f.hasEagerState=!0,De&&r.devStrictMode&&(f.eagerState=t(l.workInProgress,f.action))):De&&r.devStrictMode&&t(l.workInProgress,f.action),f.queued=!1,l.workInProgress=f.eagerState}l.queue=null}if(l.reducer=t,l.renderQueue!==null){let d=l.workInProgress;for(const h of l.renderQueue)d=t(d,h);l.renderQueue=null,r.renderPendingCells?.delete(l),Object.is(d,l.workInProgress)||(_i(r,l),l.workInProgress=d)}return l.isDirty&&an(r,()=>{l.current=l.workInProgress,l.isDirty=!1}),[l.workInProgress,l.dispatch]}i(yc,"useReducerImpl");function Ii(t,e,s){return yc(t,e,s,!1)}i(Ii,"useReducer$1");var Bh=i((t,e)=>typeof e=="function"?e(t):e,"stateReducer"),$h=i(t=>t===void 0?void 0:typeof t=="function"?t():t,"stateInit");function _c(t){return yc(Bh,t,$h,!0)}i(_c,"useState$3");var Ti=i((t,e)=>nr(()=>t,e),"useCallback$4");function wc(t,e){dc(t,e,"insertion")}i(wc,"useInsertionEffect$2");function Ci(t){const e=et(),s=Ds(t);return s.current!==t&&an(e,()=>{s.current=t}),Ti(((...n)=>{if(De&&Tt())throw new Error("useEffectEvent cannot be called during render");return s.current(...n)}),[])}i(Ci,"useEffectEvent$1");var Sc=i(t=>t!==null&&typeof t=="object"&&typeof t.then=="function","isThenable$1"),Oo=i(()=>{},"noop"),Lh=i(t=>{const e=t;switch(typeof e.status!="string"?(e.status="pending",t.then(s=>{e.status==="pending"&&(e.status="fulfilled",e.value=s)},s=>{e.status==="pending"&&(e.status="rejected",e.reason=s)})):e.status!=="fulfilled"&&e.status!=="rejected"&&t.then(Oo,Oo),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw t}},"trackThenable"),ki=i(t=>Sc(t)?Lh(t):bc(t),"use$1"),Po=!1,Ic=i((t,e,s=e)=>{const n=et().isNeverMounted,r=n?s():e();De&&!Po&&(!n||s===e)&&(Object.is(r,e())||(Po=!0));const[,o]=Ii(u=>u+1,0),a=Ds(0),l=Ci(()=>{try{if(Object.is(r,e()))return a.current=0,!1}catch{}return!0});return gt(()=>t(()=>{l()&&o()}),[t]),gt(()=>{if(l()){if(++a.current>50)throw a.current=0,new Error("Maximum update depth exceeded. The result of getSnapshot should be cached to avoid an infinite loop.");o()}},[t,r,e]),r},"useSyncExternalStore$1"),Tc=i((t,e)=>{},"useDebugValue$1"),Vh=0,Fh=i(()=>{const t=Ds(null);return t.current??=`:tap${Vh++}:`,t.current},"useId$1"),Cc=i((t,e,s)=>{const n=i(()=>{if(!t)return;const r=e();if(typeof t=="function"){const o=t(r);return typeof o=="function"?o:()=>t(null)}return t.current=r,()=>{t.current=null}},"attach");s==null?gt(n):gt(n,[...s,t])},"useImperativeHandle$2"),Uh=x.default;function qh(t){const e=(0,x.useRef)(t);return(0,x.useInsertionEffect)(()=>{e.current=t}),(0,x.useCallback)(((...s)=>e.current(...s)),[])}i(qh,"useReactEffectEventShim");var zh=Uh.useEffectEvent??qh,Le=i(()=>Tt()!==null,"inTap"),ke=x.default,ye=i(t=>Le()?_c(t):ke.useState(t),"useState$2"),Hh=i((t,e,s)=>Le()?Ii(t,e,s):ke.useReducer(t,e,s),"useReducer"),$e=i(t=>Le()?Ds(t):ke.useRef(t),"useRef$3"),qe=i((t,e)=>Le()?nr(t,e):ke.useMemo(t,e),"useMemo$4"),Wh=i((t,e)=>Le()?Ti(t,e):ke.useCallback(t,e),"useCallback$2"),be=i((t,e)=>Le()?gt(t,e):ke.useEffect(t,e),"useEffect$2"),Kh=i((t,e)=>Le()?gt(t,e):ke.useLayoutEffect(t,e),"useLayoutEffect$1"),Jh=i(t=>Le()?Ci(t):zh(t),"useEffectEvent"),ir=i((t,e,s)=>Le()?Ic(t,e,s):ke.useSyncExternalStore(t,e,s),"useSyncExternalStore"),Qh=i((t,e)=>Le()?Tc(t,e):ke.useDebugValue(t,e),"useDebugValue"),Os=i((t,e)=>Le()?wc(t,e):ke.useInsertionEffect(t,e),"useInsertionEffect"),Yh=i((t,e,s)=>Le()?Cc(t,e,s):ke.useImperativeHandle(t,e,s),"useImperativeHandle$1"),Gh=i(t=>ke.forwardRef(t),"forwardRef$1"),kc=i((t,e)=>ke.memo(t,e),"memo$1"),i_=ke.Fragment,o_=ke.Children,a_=ke.Suspense,ts=i(t=>{const e=ke.createContext(t);return hc(e,t),e},"createContext$1"),Ai=i(t=>Le()&&pc(t)?ki(t):ke.use(t),"use"),or=i(t=>Le()&&pc(t)?ki(t):ke.useContext(t),"useContext$1"),Ct=i((t,e)=>{if(t.length!==0){if(t.length===1)throw t[0];for(const s of t);throw new AggregateError(t,e)}},"throwAggregated"),Xh=50,Ke={schedulers:new Set,isScheduled:!1},nt=null,Vr=[],Ac=class{static{i(this,"UpdateScheduler")}_isDirty=!1;_task;constructor(t){this._task=t}get isDirty(){return this._isDirty}markDirty(){if(nt&&(nt.get(this)??0)>=Xh)throw new Error("Maximum update depth exceeded. This can happen when a resource repeatedly calls setState inside useEffect.");this._isDirty=!0,Ke.schedulers.add(this),Ec()}runTask(){nt?.set(this,(nt.get(this)??0)+1),this._isDirty=!1,this._task()}settle(){this._isDirty=!1}},Zh=[],c_=new Ac(()=>{const t=Zh.splice(0),e=[];for(const s of t)try{s()}catch(n){e.push(n)}Ct(e,"Errors occurred while running scheduled tasks")}),ef=i(t=>{if(nt!==null){Vr.push(t);return}t()},"scheduleNotify"),Ec=i(()=>{Ke.isScheduled||(Ke.isScheduled=!0,tf())},"scheduleFlush"),Fr=i(()=>{const t=nt;nt=new Map;const e=[];try{for(const s of Ke.schedulers)if(Ke.schedulers.delete(s),!!s.isDirty)try{s.runTask()}catch(n){e.push(n)}}finally{if(nt=t,Ke.schedulers.clear(),Ke.isScheduled=!1,nt===null)for(;Vr.length>0;)try{Vr.shift()()}catch(s){e.push(s)}}Ct(e,"Errors occurred during flushSync")},"flushScheduled"),tf=(()=>{if(typeof MessageChannel<"u"){let t=null,e;return()=>{if(!t){const s=new MessageChannel;s.port1.onmessage=()=>{t?.unref?.(),Fr()},t=s.port1,e=s.port2}t.ref?.(),e.postMessage(null)}}return()=>setTimeout(Fr,0)})(),sf=i(t=>{if(nt!==null)return t();const e=Ke;Ke={schedulers:new Set,isScheduled:!0};try{const s=t();return Fr(),s}finally{const s=Ke.schedulers;if(Ke=e,s.size>0){for(const n of s)Ke.schedulers.add(n);Ec()}}},"flushTapSync");function nf(t){if(t.length===0)return;let e;for(let s=0;s<t.length;s++)try{t[s]()}catch(n){(e??=[]).push(n)}e!==void 0&&Ct(e,"Errors during commit")}i(nf,"commitAllCallbacks");function rf(t){const e=t.setup,s=t.setupDeps,n=t.generation;let r;try{const o=e();if(o!==void 0&&typeof o!="function")throw new Error(`An effect function must either return a cleanup function or nothing. Received: ${typeof o}`);r=o}finally{t.generation===n?(t.cleanup=r,t.deps=s):r?.()}}i(rf,"setupEffect");var of=i(t=>t.setup===void 0?!1:t.deps===null||t.setupDeps===void 0?!0:!cn(t.deps,t.setupDeps),"effectNeedsRun");function Bo(t,e){let s;for(const n of t)of(n)&&(s??=[]).push(n);if(s===void 0)return e;for(const n of s)if(n.deps=null,n.cleanup!==void 0)try{n.cleanup()}catch(r){(e??=[]).push(r)}finally{n.cleanup=void 0}for(const n of s)try{rf(n)}catch(r){(e??=[]).push(r)}return e}i(Bo,"reconcileCells");function $o(t,e=!0){let s;t.insertionCells!==null&&e&&(s=Bo(t.insertionCells,s)),s=Bo(t.effectCells,s),s!==void 0&&Ct(s,"Errors during commit")}i($o,"reconcileEffects");function Lo(t){let e;for(const s of t)if(s.deps=null,s.cleanup)try{s.cleanup?.()}catch(n){(e??=[]).push(n)}finally{s.cleanup=void 0}e!==void 0&&Ct(e,"Errors during cleanup")}i(Lo,"cleanupCells");var af={useState:_c,useReducer:Ii,useRef:Ds,useMemo:nr,useCallback:Ti,useEffect:gt,useLayoutEffect:gt,useInsertionEffect:wc,useEffectEvent:Ci,useContext:bc,use:ki,useSyncExternalStore:Ic,useDebugValue:Tc,useId:Fh,useImperativeHandle:Cc,useMemoCache:uc},Vo=x.default,Ut=Vo.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE??Vo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,In=Ut==null?null:"H"in Ut?{get current(){return Ut.H},set current(t){Ut.H=t}}:"ReactCurrentDispatcher"in Ut?{get current(){return Ut.ReactCurrentDispatcher.current},set current(t){Ut.ReactCurrentDispatcher.current=t}}:null;function cf(t){if(!In)return t();const e=In.current;In.current=af;try{return t()}finally{In.current=e}}i(cf,"withReactDispatcher");function Rc(t,e,s=void 0,n){return{hook:t,root:e,markDirty:s,devStrictMode:n,cells:[],effectCells:[],insertionCells:null,hostCells:null,contextDeps:null,wipContextDeps:null,wipCommitCallbacks:null,memoCache:{current:null,workInProgress:null,index:0},renderPendingCells:null,currentIndex:0,isFirstRender:!0,isMounted:!1,isReleased:!1,isNeverMounted:!0}}i(Rc,"createResourceFiber");function jc(t){t.wipCommitCallbacks=null,t.wipContextDeps=null,t.memoCache.workInProgress=null}i(jc,"discardWipRender");function As(t,e,s){try{e?(t.isReleased=!0,t.insertionCells!==null&&Lo(t.insertionCells)):t.isMounted&&(t.isMounted=!1,Lo(t.effectCells))}catch(n){(s??=[]).push(n)}if(t.hostCells!==null){for(const n of t.hostCells)if(n.fiber!==null&&(s=As(n.fiber,e,s)),n.fibers!==null)for(const{fiber:r}of n.fibers.values())s=As(r,e,s)}return s}i(As,"cleanupResourceFiber");function Ei(t,e=!0){let s;e&&(s=As(t,!0,s)),s=As(t,!1,s),s!==void 0&&Ct(s,"Errors during cleanup")}i(Ei,"unmountResourceFiber");function Mc(t){let e;for(const s of t)s.isReleased&&(e=As(s,!0,e));for(const s of t)e=As(s,!1,e);e!==void 0&&Ct(e,"Errors during cleanup")}i(Mc,"unmountResourceFibers");function St(t,e){if(t.renderPendingCells!==null){for(const r of t.renderPendingCells)r.renderQueue=null;t.renderPendingCells.clear()}let s=0,n;try{do{if(++s>25)throw new Error("Too many re-renders. tap limits the number of renders to prevent an infinite loop.");t.memoCache.index=0,Sh(t,()=>{n=cf(()=>t.hook(...e))})}while((t.renderPendingCells?.size??0)>0)}catch(r){throw jc(t),r}return xc(t),n}i(St,"renderResourceFiber");function Qt(t){const e=t.wipCommitCallbacks;t.wipCommitCallbacks=null;const s=De&&!t.isMounted&&t.devStrictMode==="root";t.isMounted=!0,t.isNeverMounted=!1,e!==null&&(t.contextDeps=t.wipContextDeps,yi(t.root),t.memoCache.workInProgress!==null&&(t.memoCache.current=t.memoCache.workInProgress,t.memoCache.workInProgress=null),nf(e)),s&&($o(t,e!==null),Ei(t,!1),t.isMounted=!0),$o(t,!s&&e!==null)}i(Qt,"commitResourceFiber");var lf=i(()=>{const t=et();return t.devStrictMode?t.isFirstRender?"child":"root":null},"getTapDevMode"),uf=i(()=>"child","child"),Fo=i(()=>null,"notDevMode"),df=i(()=>{if(!De)return Fo;const t=$e(0);return ye(()=>t.current++),t.current!==2?Fo:uf},"useDevStrictModeReact"),Nc=i(()=>Tt()?lf:df(),"useDevStrictMode"),hf=i(t=>{const e=et(),s=e.currentIndex++,n=e.cells[s];let r;if(n===void 0){e.isFirstRender||tr();const o=t instanceof Map;r={type:"host",fiber:o?null:t,fibers:o?t:null},e.cells[s]=r,(e.hostCells??=[]).push(r)}else n.type!=="host"&&sr(),r=n;return r.fibers===null&&r.fiber!==t&&an(e,()=>{r.fiber=t}),r},"useHostCell"),Uo=i((t,e)=>{if(!(t instanceof Map))return e(t);for(const{fiber:s}of t.values())e(s)},"forEachHostedFiber"),ff=i(t=>{t.isReleased=!1},"acquire"),mf=i(t=>{t.isReleased=!0,t.isMounted||queueMicrotask(()=>{t.isReleased&&Ei(t,!0)})},"release"),pf=i(t=>{Os(()=>(Uo(t,ff),()=>Uo(t,mf)),[t]),be(()=>()=>{Mc(t instanceof Map?Array.from(t.values(),({fiber:e})=>e):[t])},[t])},"useHostLifecycleReact"),ar=i(t=>Tt()?hf(t):(pf(t),null),"useHostLifecycle"),gf=i(()=>{const t=$e(0),e=t.current,s=et();return{version:e,markDirty:qe(()=>()=>{t.current++,s.markDirty?.()},[s]),root:s.root}},"useResourceFiberHostUtilsTap"),bf=i(()=>{const[t]=ye(()=>oc((r,o)=>{let a=!1;n(l=>(a=!r(),a?l:l+1)),a||s(()=>r()&&o())})),[e,s]=Hh((r,o)=>(Gs(t,r),r+(o()?1:0)),0),[,n]=ye(0);return Gs(t,e),{root:t,version:e,markDirty:void 0}},"useResourceFiberHostUtilsReact"),Ri=i(()=>{const t=Nc(),{root:e,version:s,markDirty:n}=Tt()?gf():bf();return{version:s,createFiber:Wh((r,o,a)=>Rc(r,e,a?()=>{a(),n?.()}:n,t()),[])}},"useResourceFiberHost"),xf=i(t=>t(),"useHostRoot"),vf=i(t=>{const e=[];for(const s of t)try{s()}catch(n){e.push(n)}Ct(e,"Errors occurred while notifying Tap root subscribers")},"notifySubscribers$1"),yf=i((t,e,s)=>{const n=new Ac(()=>l.handleUpdate()),r=[],o=oc((u,d)=>{r.length===0&&!u()||(r.push(d),n.markDirty())}),a=Rc(xf,o,void 0,e),l={scheduler:n,queue:r,fiber:a,subscribers:new Set,pendingHostRender:!1,isMounted:!1,hasRendered:!1,committedRender:t,context:new Map,value:void 0,applyQueue:i(()=>{Gs(o,o.committedVersion);for(const u of r)De&&a.devStrictMode&&u(),u();return Gs(o,o.committedVersion+o.changelog.length),r.length},"applyQueue"),publish:i((u,d)=>{n.isDirty||o.committedVersion!==d||l.value===u||(l.value=u,ef(()=>vf(l.subscribers)))},"publish"),finishFlush:i((u,d,h)=>{yi(o),r.splice(0,h),l.pendingHostRender=!1,r.length===0&&n.settle(),l.isMounted&&Qt(a),l.publish(u,d)},"finishFlush"),handleUpdate:i(()=>{const u=l.applyQueue();let d;try{De&&a.devStrictMode&&Lr(l.context,()=>St(a,[l.committedRender])),d=Lr(l.context,()=>St(a,[l.committedRender]))}catch(h){if(Gs(o,o.committedVersion),Sc(h)){const f=i(()=>{l.isMounted&&n.markDirty()},"retry");h.then(f,f);return}if(l.isMounted){l.pendingHostRender=!0,s(f=>f+1);return}throw h}if(n.isDirty)throw new Error("Scheduler is dirty, this should never happen");l.finishFlush(d,o.version,u)},"handleUpdate")};return l},"createInstance"),_f=i(t=>{const[,e]=ye(0),s=Nc(),n=$e(null),r=n.current??=yf(t,s(),e),o=jh(),a=r.scheduler.isDirty||r.pendingHostRender?r.applyQueue():0,l=Lr(o,()=>St(r.fiber,[t])),u={render:t,context:o,value:l,drained:a,wip:r.fiber.wipCommitCallbacks,version:r.fiber.root.version,processed:!1};return r.hasRendered||(r.hasRendered=!0,r.committedRender=t,r.context=o,r.value=l),be(()=>(r.isMounted=!0,()=>{r.isMounted=!1}),[r]),ar(r.fiber),be(()=>{if(u.processed){r.fiber.isMounted||(Qt(r.fiber),r.queue.length&&!r.scheduler.isDirty&&r.scheduler.markDirty());return}if(u.processed=!0,r.committedRender=u.render,r.context=u.context,r.fiber.wipCommitCallbacks!==u.wip){r.scheduler.isDirty||r.handleUpdate();return}if(u.drained>0&&r.fiber.root.version===u.version){r.finishFlush(u.value,u.version,u.drained);return}Qt(r.fiber),r.publish(u.value,u.version)}),qe(()=>({getValue:i(()=>r.value,"getValue"),subscribe:i(d=>(r.subscribers.add(d),()=>r.subscribers.delete(d)),"subscribe")}),[r])},"useTapRoot");function he(t){return(...e)=>({hook:t,args:e})}i(he,"resource");function Oe(t,e,s){return typeof e=="function"?(...n)=>Oe(t,e(...n)):s?{...e,key:t,deps:s}:{...e,key:t}}i(Oe,"withKey");var wf=i((t,e)=>({fiber:t,key:e,currentDeps:null,current:null,wipDeps:null,wip:null}),"createHostState");function kt(t){const{version:e,createFiber:s}=Ri(),n=$e(null),r=n.current??=wf(s(t.hook,t.key),t.key),o=qe(()=>r.fiber.hook===t.hook&&r.key===t.key&&!r.fiber.isReleased?r.fiber:s(t.hook,t.key),[r,t.hook,t.key,s]);r.wipDeps=r.currentDeps,r.wip=r.current;const a=[o,e,t.args];(Si(o)||r.currentDeps===null||!cn(r.currentDeps,a))&&(r.wipDeps=a,r.wip={value:St(o,t.args)});const l=r.wip,u=ar(o);return be(()=>{if(r.currentDeps=r.wipDeps,r.current=r.wip,r.fiber=o,r.key=t.key,Qt(o),u!==null)return()=>{u.fiber!==o&&Ei(o,!0)}},[r,u,o,t.key,l]),l.value}i(kt,"useResource");var Sf=i((t,e,s)=>{const n=$e(null),r=n.current??(n.current={wipDeps:null,wip:null,currentDeps:null,current:null});return r.wipDeps=r.currentDeps,r.wip=r.current,be(()=>{r.currentDeps=r.wipDeps,r.current=r.wip}),!s&&r.currentDeps&&cn(r.currentDeps,e)?r.current:(r.wipDeps=e,r.wip=t(),r.wip)},"useRenderMemo"),qo=i((t,e)=>{const s=t.get(e);s&&(s.isDirty=!0)},"markChildDirty"),If=i((t,e)=>!t.isDirty&&!Si(t.fiber)&&e!==void 0&&t.committedDeps!==void 0&&cn(t.committedDeps,e),"canReuse"),Tf=i(t=>{if(!vc())return!1;for(const{fiber:e}of t.values())if(Si(e))return!0;return!1},"hasAnyChildContextDepsChanged");function ji(t){const[e]=ye(()=>new Map),{version:s,createFiber:n}=Ri(),r=Tf(e);let o=!1;const a=Sf(()=>{const l=new Set,u=[];let d=0;for(let h=0;h<t.length;h++){const f=t[h],p=f.key;if(p===void 0)throw new Error(`useResources did not provide a key for array at index ${h}`);if(l.has(p))throw new Error(`Duplicate key ${p} in useResources`);l.add(p);let m=e.get(p);if(m)if(m.fiber.hook!==f.hook){const g=n(f.hook,f.key,()=>qo(e,p)),b=St(g,f.args);m.next={value:b,deps:f.deps,remount:g},o=!0}else if(If(m,f.deps))typeof m.next=="object"&&jc(m.fiber),m.fiber.contextDeps&&xc(m.fiber,m.fiber.contextDeps),m.next="skip";else{const g=St(m.fiber,f.args);m.next={value:g,deps:f.deps}}else{const g=n(f.hook,f.key,()=>qo(e,p));m={fiber:g,next:{value:St(g,f.args),deps:f.deps},isDirty:!1,committedDeps:void 0,committedValue:void 0},d++,e.set(p,m)}u.push(typeof m.next=="object"?m.next.value:m.committedValue)}if(e.size>u.length-d)for(const h of e.keys())l.has(h)||(e.get(h).next="delete",o=!0);return u},[t,e,n,s],r);return ar(e),be(()=>{if(o){const l=[];for(const[u,d]of e.entries()){const h=d.next;h==="delete"?(l.push(d.fiber),e.delete(u)):h!=="skip"&&h.remount&&(l.push(d.fiber),d.fiber=h.remount)}for(const u of l)u.isReleased=!0;Mc(l)}for(const l of e.values()){const u=l.next;u==="skip"?!l.fiber.isNeverMounted&&!l.fiber.isMounted&&Qt(l.fiber):u!=="delete"&&(Qt(l.fiber),l.committedDeps=u.deps,l.committedValue=u.value,l.isDirty=!1,l.next="skip")}},[a,e,o]),a}i(ji,"useResources");var Cf=i(t=>t(),"useHostRender"),Dc=i(t=>{const{createFiber:e}=Ri(),[s]=ye(()=>e(Cf,void 0)),n=St(s,[t]);ar(s);let r=!1;const o=i(()=>{r&&s.isMounted||(r=!0,Qt(s))},"effects");return be(o),{value:n,effects:o}},"useTapHost"),kf=i(()=>{const t=se(4),[e,s]=ye(Ef);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=i((u,d)=>(s(h=>{const f=Je(h.renderers);return f[u]=[...f[u]??[],d],{...h,renderers:f}}),()=>{s(h=>{const f=Je(h.renderers),p=f[u]?.filter(m=>m!==d)??[];return p.length>0?f[u]=p:delete f[u],{...h,renderers:f}})}),"t0"),t[0]=n):n=t[0];const r=n;let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=i(u=>(s(d=>({...d,fallbacks:[...d.fallbacks,u]})),()=>{s(d=>({...d,fallbacks:d.fallbacks.filter(h=>h!==u)}))}),"t1"),t[1]=o):o=t[1];const a=o;let l;return t[2]!==e?(l={getState:i(()=>e,"getState"),setDataUI:r,setFallbackDataUI:a},t[2]=e,t[3]=l):l=t[3],l},"useDataRenderers"),Af=he(kf);function Ef(){return{renderers:Je(),fallbacks:[]}}i(Ef,"_temp$8");var dt=i((t,e,s)=>{const n=i(r=>{},"reportError");for(const r of t)try{const o=r(typeof e=="function"?e():e);o!==null&&(typeof o=="object"||typeof o=="function")&&"then"in o&&typeof o.then=="function"&&Promise.resolve(o).catch(n)}catch(o){n(o)}},"notifyEventListeners"),Oc=i(t=>t,"AuiConfig"),Rf=new Set(["$$typeof","nodeType","then","__v_raw","__v_isRef","__v_isReactive","__v_isReadonly","__v_isShallow","__v_skip"]),Yt=i((t,e)=>{if(t===Symbol.toStringTag)return e;if(typeof t!="symbol"){if(t==="toJSON")return()=>e;if(!Rf.has(t))return!1}},"handleIntrospectionProp"),tn=class{static{i(this,"BaseProxyHandler")}getOwnPropertyDescriptor(t,e){const s=this.get(t,e);if(s!==void 0)return{value:s,writable:!1,enumerable:!0,configurable:!0}}set(){return!1}setPrototypeOf(){return!1}defineProperty(){return!1}deleteProperty(){return!1}preventExtensions(){return!1}},Es=Symbol("assistant-ui.store.clientId"),Ur=Symbol("assistant-ui.store.instanceTag"),Pc=i((t,e)=>{const s=new Proxy((()=>{}),{apply:i(()=>(e(),s),"apply"),get:i((n,r)=>r==="source"?t.source:r==="query"?t.query:r==="name"?t.name:r===Es?Mi(e()):e()[r],"get"),has:i((n,r)=>r==="source"||r==="query"||r==="name"||r===Es||r in e(),"has"),ownKeys:i(()=>Reflect.ownKeys(e()),"ownKeys"),getOwnPropertyDescriptor:i((n,r)=>{if(!(typeof r=="symbol"||!(r in e())))return{value:e()[r],writable:!1,enumerable:!0,configurable:!0}},"getOwnPropertyDescriptor")});return s},"createClientAccessor"),Bc=i((t,e)=>{const s=i(()=>{throw new Error(t)},"fail");return new Proxy((()=>{}),{apply:s,get:i((n,r)=>{if(r==="source"||r==="query")return null;if(r==="name")return e;if(r===Es)return s();const o=Yt(r,"AssistantClientAccessor");return o!==!1?o:s()},"get"),has:i((n,r)=>r==="source"||r==="query"||r==="name","has"),ownKeys:i(()=>[],"ownKeys"),getOwnPropertyDescriptor:i(()=>{},"getOwnPropertyDescriptor")})},"createErrorClientAccessor"),cr=i(t=>t?.source!=null,"isScopeAvailable"),qr=i(t=>t?.source===null,"isScopeUnavailable"),Mi=i(t=>t[Es]??t,"getClientId"),jf=i(t=>t[Ur]??Mi(t),"getClientInstanceId"),Wt=i(t=>t==="optional"||t==="subscribe"||t==="on"||t==="__proto__"||typeof t=="symbol","isIgnoredClientKey"),zr=i(t=>{const e=[];for(const s in t)Wt(s)||e.push(s);return e},"clientScopeKeys"),Mf=class extends tn{static{i(this,"OptionalClientViewProxyHandler")}#e;constructor(t){super(),this.#e=t}get(t,e){const s=Yt(e,"OptionalAssistantClient");if(s!==!1)return s;if(Wt(e))return;const n=this.#e[e];return cr(n)?n:void 0}ownKeys(){return zr(this.#e)}has(t,e){return!Wt(e)&&e in this.#e}},$c=i(t=>new Proxy({},new Mf(t)),"createOptionalClientView"),zo=i(()=>()=>{},"NO_OP_SUBSCRIBE"),Nf="You are using a component or hook that requires an AuiProvider. Wrap your component in an <AuiProvider> component.",Df=class extends tn{static{i(this,"EmptyAssistantClientProxyHandler")}#e;#t;#s;#n;constructor(t,e,s){super(),this.#e=t,this.#t=e,this.#s=s}get(t,e){if(e==="subscribe"||e==="on")return zo;if(e==="optional")return this.#n??=$c(this.#s());const s=Yt(e,this.#e);return s!==!1?s:Bc(this.#t(String(e)),String(e))}ownKeys(){return["subscribe","on","optional"]}getOwnPropertyDescriptor(t,e){if(e!=="optional")return super.getOwnPropertyDescriptor(t,e);const s=this.get(t,e);if(s!==void 0)return{value:s,writable:!1,enumerable:!1,configurable:!0}}has(t,e){return e==="subscribe"||e==="on"||e==="optional"}},Of=i((t,e)=>{const s=new Proxy({},new Df(t,e,()=>s));return s},"createEmptyAssistantClient"),ys=Of("DefaultAssistantClient",()=>Nf),Pf=i(()=>new Proxy({},{get(t,e){const s=Yt(e,"AssistantClient");return s!==!1?s:Bc(`The current scope does not have a "${String(e)}" property.`,String(e))}}),"createRootAssistantClient"),Ni=ts(ys),Bf=i(()=>{},"NOOP_EFFECT"),Lc=new WeakMap,$f=i(t=>Lc.get(t)??Bf,"getTapEffects"),Lf=i((t,e)=>{Lc.set(t,e)},"setTapEffects"),Di=i(()=>or(Ni),"useAssistantContextValue"),Vf=i((t,e)=>rr(Ni,t,e),"useAssistantContextProvider"),Hr=Symbol("assistant-ui.transform-scopes");function Vc(t,e){const s=t;if(s[Hr])throw new Error("transformScopes is already attached to this resource");s[Hr]=e}i(Vc,"attachTransformScopes");function Ff(t){return t[Hr]}i(Ff,"getTransformScopes");var Fc=i(t=>typeof t=="string"?{scope:t.split(".")[0],event:t}:{scope:t.scope,event:t.event},"normalizeEventSelector"),Wr=Symbol("assistant-ui.store.clientIndex"),Uf=i(t=>t[Wr],"getClientIndex"),Uc=ts([]),Oi=i(()=>Ai(Uc),"useClientStack"),qf=i((t,e)=>{const s=se(3),n=Oi();let r;return s[0]!==t||s[1]!==n?(r=[...n,t],s[0]=t,s[1]=n,s[2]=r):r=s[2],rr(Uc,r,e)},"useClientStackProvider"),Fn=Symbol("assistant-ui.store.getValue"),Ho=i(t=>{const e=t[Fn];if(!e)throw new Error("Client scope contains a non-client resource. Ensure your Derived get() returns a client created with useClientResource(), not a plain resource.");return e.getState?.()},"getClientState"),Wo=new Map;function zf(t){let e=Wo.get(t);return e||(e=i(function(...s){if(!this||typeof this!="object")throw new Error(`Method "${String(t)}" called without proper context. This may indicate the function was called incorrectly.`);const n=this[Fn];if(!n)throw new Error(`Method "${String(t)}" called on invalid client proxy. Ensure you are calling this method on a valid client instance.`);const r=n[t];if(!r)throw new Error(`Method "${String(t)}" is not implemented.`);if(typeof r!="function")throw new Error(`"${String(t)}" is not a function.`);return r(...s)},"template"),Wo.set(t,e)),e}i(zf,"getOrCreateProxyFn");var Hf=class extends tn{static{i(this,"ClientProxyHandler")}boundFns;cachedReceiver;outputRef;tagRef;index;self;constructor(t,e,s){super(),this.outputRef=t,this.tagRef=e,this.index=s}get(t,e,s){if(e===Fn)return this.outputRef.current;if(e===Wr)return this.index;if(e===Es)return this.self;if(e===Ur)return this.tagRef.current;const n=Yt(e,"ClientProxy");if(n!==!1)return n;const r=this.outputRef.current[e];if(typeof r=="function"){if(s===void 0)return r;(!this.boundFns||this.cachedReceiver!==s)&&(this.boundFns=new Map,this.cachedReceiver=s);let o=this.boundFns.get(e);return o||(o=zf(e).bind(s),this.boundFns.set(e,o)),o}return r}ownKeys(){return Object.keys(this.outputRef.current)}has(t,e){return e===Fn||e===Wr||e===Es||e===Ur?!0:e in this.outputRef.current}},Rs=i(t=>{const e=$e(null),s=$e(null),n=qe(()=>({}),[t.hook,t.key]),r=Oi().length,o=qe(()=>{const l=new Hf(e,s,r),u=new Proxy({},l);return l.self=u,u},[r]),a=qf(o,i(function(){return kt(t)},"WithClientStack"));return e.current||(e.current=a,s.current=n),be(()=>{e.current=a,s.current=n}),{methods:o,state:a.getState?.(),key:t.key}},"useClientResource"),qc=he(Rs),Un=0,Kr=0,Wf=i(t=>{Un++,Kr++;try{return t()}finally{Kr--,Un++}},"withBatchedStateReads"),Kf=i(t=>{let e;const s=new Map;let n=-1;const r=i(l=>{if(Kr===0)return Ho(t[l]());if(n!==Un)s.clear(),n=Un;else if(s.has(l))return s.get(l);const u=Ho(t[l]());return s.set(l,u),u},"readScopeState");class o extends tn{static{i(this,"OptionalAssistantStateProxyHandler")}get(u,d){const h=Yt(d,"OptionalAssistantState");if(h!==!1)return h;const f=d;if(!Wt(f)&&cr(t[f]))return r(f)}ownKeys(){return zr(t)}has(u,d){return!Wt(d)&&d in t}}class a extends tn{static{i(this,"ProxiedAssistantStateProxyHandler")}get(u,d){const h=Yt(d,"AssistantState");if(h!==!1)return h;if(d==="optional")return e??=new Proxy({},new o);const f=d;if(!Wt(f))return r(f)}ownKeys(){return[...zr(t),"optional"]}has(u,d){return d==="optional"||!Wt(d)&&d in t}}return new Proxy({},new a)},"createProxiedAssistantState"),Ko=new WeakMap,Jf=i(t=>{let e=Ko.get(t);return e||(e=Kf(t),Ko.set(t,e)),e},"getProxiedAssistantState"),zc=ts(null),Jo=Symbol("aui.scope-effect-unapplied"),Qf=i((t,e)=>rr(zc,t,e),"useAssistantTapContextProvider"),Pi=i(()=>{const t=Ai(zc);if(!t)throw new Error("AssistantTapContext is not available");return t},"useAssistantTapContext"),Hc=i(()=>Pi().clientRef,"useAssistantClientRef"),Wc=i((t,e,s)=>{const n=se(8),{clientRef:r}=Pi();let o;n[0]!==r||n[1]!==e||n[2]!==t?(o=i(()=>{const l=r.current;if(l===null)throw new Error("useAssistantScopeEffect ran before the client was committed. This is likely an internal bug in assistant-ui.");const u=i(()=>{const m=r.current?.[t];return m!==void 0&&cr(m)?jf(m):void 0},"identityOf");let d=Jo,h;const f=i(m=>{if(h?.(),h=void 0,d=Jo,m!==void 0){const g=e();h=typeof g=="function"?g:void 0}d=m},"apply");f(u());const p=l.subscribe(()=>{const m=u();m!==d&&f(m)});return()=>{p(),h?.()}},"t0"),n[0]=r,n[1]=e,n[2]=t,n[3]=o):o=n[3];let a;n[4]!==r||n[5]!==s||n[6]!==t?(a=[r,t,...s],n[4]=r,n[5]=s,n[6]=t,n[7]=a):a=n[7],be(o,a)},"useAssistantScopeEffect"),Ps=i(()=>{const t=se(3),{emit:e}=Pi(),s=Oi();let n;return t[0]!==s||t[1]!==e?(n=i((r,o)=>{e(r,o,s)},"t0"),t[0]=s,t[1]=e,t[2]=n):n=t[2],Jh(n)},"useAssistantEmit"),Jr=ts(void 0),Kc=i((t,e)=>{const s=Ai(Jr);return rr(Jr,t??s,e)},"useDestroySignalProvider"),Gt=i((t,e)=>{if(Array.isArray(t)!==Array.isArray(e))return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Object.is(t[n],e[n]))return!1;return!0}const s=Object.keys(t);return s.length===Object.keys(e).length&&s.every(n=>Object.hasOwn(e,n)&&Object.is(t[n],e[n]))},"shallowEqual"),Jc=Symbol("assistant-ui.derived-hook"),Yf=i(t=>{t[Jc]=!0},"markDerivedHook"),Gf=i(t=>t[Jc]===!0,"isDerivedHook"),Qo=i(t=>{},"reportListenerError"),Yo=i((t,e,s)=>{try{const n=t(e,s);n!==null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"&&Promise.resolve(n).catch(Qo)}catch(n){Qo(n)}},"invokeListener"),Xf=i(()=>{const t=new Map,e=new Set,s=new Set;return{on(n,r){const o=r;if(n==="*")return e.add(o),()=>e.delete(o);let a=t.get(n);return a||(a=new Set,t.set(n,a)),a.add(o),()=>{a.delete(o),a.size===0&&t.get(n)===a&&t.delete(n)}},emit(n,r,o){!t.has(n)&&e.size===0||queueMicrotask(()=>{const a=t.get(n);if(a)for(const l of a)Yo(l,r,o);if(e.size>0){const l={event:n,payload:r};for(const u of e)Yo(u,l,o)}})},subscribe(n){return s.add(n),()=>s.delete(n)},notifySubscribers(){Wf(()=>{for(const n of s)try{n()}catch{}})}}},"createNotificationManager"),Qc=i(()=>ye(Xf)[0],"useNotificationManager"),Yc=i(()=>{const[t]=ye(()=>({controller:new AbortController,generation:0}));return Os(()=>{const e=++t.generation;return()=>queueMicrotask(()=>{t.generation===e&&t.controller.abort()})},[t]),t.controller.signal},"useHostDestroySignal"),Qr=i(t=>{const e=qe(()=>({}),[]);return e.v!==void 0&&Gt(e.v,t)?e.v:(e.v=t,t)},"useShallowStable"),Gc=(()=>{try{return!1}catch{return!1}})(),Zf=i((t,e)=>{const s={...t},n=new Set;let r=!0;for(;r;){r=!1;for(const o of Object.values(s)){if(n.has(o.hook))continue;n.add(o.hook);const a=Ff(o.hook);if(a){a(s,e),r=!0;break}}}return s},"applyTransformScopes"),lr=i(t=>Gf(t.hook),"isDerivedElement"),em=i(t=>{if(!lr(t))return{source:"root",query:{}};const e=t.args[0];return{source:e.source,query:e.query??{}}},"metaOf"),Yr=Symbol.for("aui.event-receiver-ref"),Xc=i((t,e)=>{const s=t===ys?Pf():t,n=Object.create(s);Object.assign(n,e);let r;return Object.defineProperty(n,"optional",{get:i(()=>r??=$c(n),"get"),enumerable:!1}),n},"createClientObject"),tm=i(({notifications:t,clientRef:e})=>qe(()=>({subscribe:t.subscribe,on:i(function(s,n){if(!this)throw new Error("const { on } = useAui() is not supported. Use aui.on() instead.");const{scope:r,event:o}=Fc(s),a=s[Yr];if(r!=="*"&&!a&&qr(this[r]))throw new Error(`Scope "${r}" is not available. Use { scope: "*", event: "${o}" } to listen globally.`);const l=t.on(o,(d,h)=>{if(r==="*")return n(d);const f=((a??e).current??this)[r];if(!cr(f))return;const p=Mi(f);if(p===h[Uf(p)])return n(d)});if(r!=="*"){if(a){if(e.parent===ys)return l}else if(qr(e.parent[r]))return l}const u=e.parent.on(s,n);return()=>{l(),u()}},"on")}),[t,e]),"useClientFields"),Zc=i(t=>{const e=se(5);let s;e[0]!==t?(s=em(t),e[0]=t,e[1]=s):s=e[1];const{source:n,query:r}=s,o=Qr(r);let a;return e[2]!==n||e[3]!==o?(a={source:n,query:o},e[2]=n,e[3]=o,e[4]=a):a=e[4],Qr(a)},"useScopeMeta"),sm=i((t,e)=>{const s=se(3);let n;return s[0]!==e||s[1]!==t?(n=e?t:qc(t),s[0]=e,s[1]=t,s[2]=n):n=s[2],kt(n)},"useScopeValue"),nm=i((t,e)=>{const s=Di(),n=lr(e),r=sm(e,n),o=n?r:r.methods,a=Zc(e),l=qe(()=>Pc({name:t,...a},()=>o),[t,a,o]);return s[t]=l,l},"useScopeMount"),rm=he(nm),im=i(t=>{const e=se(2);let s;return e[0]!==t?(s=t.map(hm),e[0]=t,e[1]=s):s=e[1],ji(s)},"useScopeMounts"),el=i((t,e)=>{const s=Qr(e),n=qe(()=>({}),[]);return n.deps!==s&&(n.deps=s,n.client=t),n.client},"useCommittedClient"),tl=i(({parent:t,entries:e,clientRef:s,notifications:n})=>{const r=tm({notifications:n,clientRef:s}),o=Xc(t,r),a=qe(()=>({clientRef:s,emit:n.emit}),[s,n.emit]),l=Qf(a,i(function(){return Vf(o,i(function(){return im(e)},"WithBuildingClient"))},"WithTapContext"));return{client:el(o,[t,...l])}},"useAuiRoot"),om=i(({parent:t,entries:e,destroySignal:s})=>{const n=$e({parent:t,current:null}).current,{value:r,effects:o}=Dc(i(function(){const l=Qc(),{client:u}=Kc(s,i(function(){return tl({parent:t,entries:e,clientRef:n,notifications:l})},"useOwnedRoot"));return be(()=>t.subscribe(l.notifySubscribers),[t,l]),be(()=>l.notifySubscribers()),u},"AssistantClientHost"));return Os(()=>{n.parent=t,n.current=r},[r,t,n]),{client:r,effects:o}},"useHostedAssistantClient"),am=i(({parent:t,entries:e,destroySignal:s})=>{const n=$e({parent:t,current:null}).current,{value:r,effects:o}=Dc(i(function(){const l=Qc(),u=_f(i(function(){return Kc(s,i(function(){return tl({parent:t,entries:e,clientRef:n,notifications:l})},"useOwnedRoot"))},"AuiRoot")),d=ir(u.subscribe,()=>u.getValue().client,()=>u.getValue().client);return be(()=>{const h=i(()=>sf(()=>{n.current=u.getValue().client,l.notifySubscribers()}),"notify"),f=u.subscribe(h),p=t.subscribe(h);return()=>{f(),p()}},[u,t,l]),d},"LegacyAssistantClientHost"));return Os(()=>{n.parent=t,n.current=r},[r,t,n]),{client:r,effects:o}},"useTapRootAssistantClient"),cm=i((t,e,s,n)=>{const{get:r}=n.args[0],o=ir(t.subscribe,()=>r(t),()=>r(t)),a=Zc(n),l=qe(()=>Pc({name:s,...a},()=>o),[s,a,o]);return e[s]=l,l},"useDerivedScopeMount"),lm=i((t,e)=>{if(Gc){const[l]=ye(()=>e.map(([h])=>h).join(",")),u=e.find(([,h])=>!lr(h));if(u)throw new Error(`Scope "${u[0]}" is a root scope but this useAui mounted derived-only; remount with a new key to change scope kinds.`);const d=e.map(([h])=>h).join(",");if(d!==l)throw new Error(`A derived-only config mounted scopes [${l}] but now has [${d}]; remount with a new key to change the scope set.`)}const s=$e({parent:t,current:null}).current,n=i(function(l,u){if(!this)throw new Error("const { on } = useAui() is not supported. Use aui.on() instead.");const{scope:d,event:h}=Fc(l);if(d==="*")return t.on(l,u);const f=l[Yr];if(!f&&qr(this[d]))throw new Error(`Scope "${d}" is not available. Use { scope: "*", event: "${h}" } to listen globally.`);return t.on({scope:d,event:h,[Yr]:f??s},u)},"on"),r=Xc(t,{subscribe:t.subscribe,on:n}),o=e.map(([l,u])=>cm(t,r,l,u)),a=el(r,[t,...o]);return Os(()=>{s.parent=t,s.current=a},[a,t,s]),a},"useDerivedOnlyClient"),um=i((t,e)=>{const s=se(8);let n;s[0]!==e||s[1]!==t?(n=Object.entries(Zf(e,t)),s[0]=e,s[1]=t,s[2]=n):n=s[2];const r=n;let o;s[3]!==r?(o=i(()=>r.length===0||r.some(fm),"t1"),s[3]=r,s[4]=o):o=s[4];const[a]=ye(o);let l;return s[5]!==r||s[6]!==a?(l={entries:r,rooted:a},s[5]=r,s[6]=a,s[7]=l):l=s[7],l},"useScopeEntries"),sl=i((t,e,s,n)=>{const{entries:r,rooted:o}=um(t,e);return o?s({parent:t,entries:r,destroySignal:n}):{client:lm(t,r)}},"useConfiguredAuiImpl"),dm=i((t,e,s)=>sl(t,e,om,s),"useConfiguredAui");function Bi(t){const e=Di();if(t){const s=Yc(),{client:n,effects:r}=sl(e,t,am,s);return r&&Lf(n,r),n}return e}i(Bi,"useAui");function hm(t){const[e,s]=t;return Oe(e,rm(e,s))}i(hm,"_temp$7");function fm(t){const[,e]=t;return!lr(e)}i(fm,"_temp2$6");var mm=i(t=>{const e=se(6),s=Bi();let n;e[0]!==s?(n=Jf(s),e[0]=s,e[1]=n):n=e[1];const r=n;let o,a;e[2]!==r||e[3]!==t?(o=i(()=>t(r),"t1"),a=i(()=>t(r),"t2"),e[2]=r,e[3]=t,e[4]=o,e[5]=a):(o=e[4],a=e[5]);const l=ir(s.subscribe,o,a);if(typeof l=="object"&&l!==null&&(l===r||l===r.optional))throw new Error("You tried to return the entire AssistantState. This is not supported due to technical limitations.");return Qh(l),l},"useAuiState"),nl=i(t=>{const e=se(3),{get:s}=t,n=Bi();let r;return e[0]!==n||e[1]!==s?(r=i(()=>s(n),"t1"),e[0]=n,e[1]=s,e[2]=r):r=e[2],mm(r)},"useDerived");Yf(nl);var Tn=he(nl),rl=i(t=>{if(t.key===void 0)throw new Error("useClientLookup: Element has no key");return t.key},"getElementKey");function it(t){const e=se(12);let s;e[0]!==t?(s=t.map(bm),e[0]=t,e[1]=s):s=e[1];const n=ji(s);let r;e[2]!==t?(r=t.reduce(gm,Object.create(null)),e[2]=t,e[3]=r):r=e[3];const o=r;let a;e[4]!==n?(a=n.map(pm),e[4]=n,e[5]=a):a=e[5];const l=a;let u;e[6]!==o||e[7]!==n?(u=i(h=>{if("index"in h){if(h.index<0||h.index>=n.length)throw new Error(`useClientLookup: index ${h.index} out of bounds (length: ${n.length}) (ignore if recovered)`);return n[h.index].methods}const f=o[h.key];if(f===void 0)throw new Error(`useClientLookup: key "${h.key}" not found (ignore if recovered)`);return n[f].methods},"t3"),e[6]=o,e[7]=n,e[8]=u):u=e[8];let d;return e[9]!==l||e[10]!==u?(d={state:l,get:u},e[9]=l,e[10]=u,e[11]=d):d=e[11],d}i(it,"useClientLookup");function pm(t){return t.state}i(pm,"_temp3$3");function gm(t,e,s){return t[rl(e)]=s,t}i(gm,"_temp2$5");function bm(t){return Oe(rl(t),qc(t),t.deps)}i(bm,"_temp$6");var Xe=Symbol("skip-update"),ht=i((t,...e)=>{const s=[];for(const n of t)try{n(...e)}catch(r){s.push(r)}if(s.length===1)throw s[0];if(s.length>1){for(const n of s);throw new AggregateError(s)}},"notifySubscribers"),Bs=i(t=>{ht(t)},"runCleanups"),$i=i((t,e)=>{try{t()}catch{}throw e},"rollbackSubscription"),il=i((t,e)=>t===void 0||e===void 0?t===e:Gt(t,e),"shallowEqualOrUndefined"),Li=class{static{i(this,"BaseSubscribable")}_subscribers=new Set;subscribe(t){return this._subscribers.add(t),()=>this._subscribers.delete(t)}waitForUpdate(){return new Promise(t=>{const e=this.subscribe(()=>{e(),t()})})}_notifySubscribers(){ht(this._subscribers)}},ur=class{static{i(this,"BaseSubject")}_subscriptions=new Set;_connection;get isConnected(){return!!this._connection}notifySubscribers(t,e){if(e){dt(this._subscriptions,t,e);return}ht(this._subscriptions,t)}_updateConnection(){if(this._subscriptions.size>0){if(this._connection)return;this._connection=this._connect()}else{const t=this._connection;this._connection=void 0,t?.()}}subscribe(t){this._subscriptions.add(t);try{this._updateConnection()}catch(e){throw this._subscriptions.delete(t),e}return()=>{this._subscriptions.delete(t),this._updateConnection()}}},Ge=class extends ur{static{i(this,"ShallowMemoizeSubject")}get path(){return this.binding.path}binding;constructor(t){super(),this.binding=t;const e=t.getState();if(e===Xe)throw new Error("Entry not available in the store");this._previousState=e}_previousState;getState=i(()=>(this.isConnected||this._syncState(),this._previousState),"getState");_syncState(){const t=this.binding.getState();return t===Xe||il(t,this._previousState)?!1:(this._previousState=t,!0)}_connect(){const t=i(()=>{this._syncState()&&this.notifySubscribers()},"callback"),e=this.binding.subscribe(t);try{return this._syncState(),e}catch(s){throw $i(e,s)}}},Vi=class extends ur{static{i(this,"LazyMemoizeSubject")}get path(){return this.binding.path}binding;constructor(t){super(),this.binding=t}_previousStateDirty=!0;_previousState;getState=i(()=>{if(!this.isConnected||this._previousStateDirty){const t=this.binding.getState();t!==Xe&&(this._previousState===void 0||!il(t,this._previousState))&&(this._previousState=t),this._previousStateDirty=!1}if(this._previousState===void 0)throw new Error("Entry not available in the store");return this._previousState},"getState");_connect(){const t=i(()=>{this._previousStateDirty=!0,this.notifySubscribers()},"callback"),e=this.binding.subscribe(t);return this._previousStateDirty=!0,e}},qn=class extends ur{static{i(this,"NestedSubscriptionSubject")}get path(){return this.binding.path}binding;constructor(t){super(),this.binding=t}getState(){return this.binding.getState()}outerSubscribe(t){return this.binding.subscribe(t)}_connect(){const t=i(()=>{this.notifySubscribers()},"callback");let e=this.binding.getState(),s=e?.subscribe(t);const n=i(()=>{const o=this.binding.getState();if(o===e)return;e=o;const a=s;s=void 0;try{a?.()}finally{s=o?.subscribe(t),t()}},"onRuntimeUpdate");let r;try{r=this.outerSubscribe(n)}catch(o){throw $i(()=>s?.(),o)}return()=>Bs([()=>r(),()=>s?.()])}},ol=class extends ur{static{i(this,"EventSubscriptionSubject")}config;constructor(t){super(),this.config=t}getState(){return this.config.binding.getState()}outerSubscribe(t){return this.config.binding.subscribe(t)}_connect(){const t=`Runtime event "${this.config.event}"`,e=i(a=>{this.notifySubscribers(a,t)},"callback");let s=this.config.binding.getState(),n=s?.unstable_on(this.config.event,e);const r=i(()=>{const a=this.config.binding.getState();if(a===s)return;s=a;const l=n;n=void 0;try{l?.()}finally{n=a?.unstable_on(this.config.event,e),this.config.notifyOnRebind&&e({})}},"onRuntimeUpdate");let o;try{o=this.outerSubscribe(r)}catch(a){throw $i(()=>n?.(),a)}return()=>Bs([()=>o(),()=>n?.()])}},Ir=i(t=>{if(!t.overwrite)return t;const{overwrite:e,...s}=t;return s},"stripOverwrite"),xm=i(t=>{const e=Array.from(t).map(n=>n.getModelContext()).sort((n,r)=>(r.priority??0)-(n.priority??0)),s=Je();return e.reduce((n,r)=>{const o=r.priority??0;if(r.system&&(n.system?n.system+=`
|
|
1
|
+
var Tu=Object.defineProperty;var i=(t,e)=>Tu(t,"name",{value:e,configurable:!0});import{i as ui,t as Cu}from"./rolldown-runtime-ZpX3ckPj.js";import{b as ku,h as Yn,l as te,la as Au,ua as Eu}from"./createLucideIcon-CgrPXnTY.js";import{a as Pa,h as Ru}from"./star-eem0qj3E.js";import{d as ju,g as Mu,n as Nu,t as Du,u as Ou,v as Pu}from"./queryKeys-BzT8CD34.js";import{D as Bu,E as Ba,T as $u,k as Lu}from"./ConnectionSetupFlow-8alK3I_h.js";import{X as Vu}from"./mention-chips-COg-185l.js";import{r as Fu}from"./responsible-user-denial-Dyl0BwU5.js";import{Bt as Uu,I as qu,Ut as $a,_t as La,at as Va,b as zu,it as Hu,m as Fa,on as Ln,t as Is}from"./router-CJbFZfVR.js";import{a as Wu,c as Ku,i as Ju,n as Qu,o as Yu,r as Gu,s as Xu,t as Zu}from"./alert-dialog-DNbnZgRz.js";import{a as ed,n as di,t as hi}from"./avatar-qO_h93F8.js";import{i as On,p as Ua,r as qa,t as za}from"./dropdown-menu-rUbU8QKw.js";import{a as td,s as sd,t as nd}from"./MarkdownEditor-ubJimjUH.js";import{o as rd,r as id,t as od}from"./popover-CWlBonqy.js";import{t as wr}from"./arrow-right-W0iJ_-Zs.js";import{t as Ts}from"./check-Bis3vECb.js";import{t as es}from"./chevron-down-nRcQ7bok.js";import{t as ad}from"./circle-DCDVf2v0.js";import{a as cd,c as ld,d as ud,f as dd,i as hd,n as fd,o as md,p as fi,t as pd}from"./ComposerAddMenu-jKf-6Yli.js";import{_ as gd,b as bd,d as xd,p as vd,t as Gn,x as Co}from"./MarkdownBody-cPGkwwjq.js";import{t as en}from"./copy-C1cfcpxY.js";import{t as Ha}from"./ellipsis-DyXbAp4P.js";import{t as yd}from"./eye-off-DTXvEIMp.js";import{t as mi}from"./flag-i_D610oD.js";import{r as pt,t as Ee}from"./button-DI4w5WP7.js";import{h as _d,p as wd,s as Wa,t as Ka}from"./IssueThreadInteractionCard-Btd0rZ23.js";import{t as Sd}from"./rotate-ccw-DpzLJhXT.js";import{t as Id}from"./search-CgZSuGC8.js";import{t as Ja}from"./square-CDo6rOf8.js";import{t as Td}from"./thumbs-down-BVZskfHA.js";import{t as Cd}from"./thumbs-up-Cqj30fzj.js";import{t as Qa}from"./trash-QxFF084e.js";import{t as Xn}from"./triangle-alert-CnHMpmva.js";import{t as kd}from"./x-6E1yeU3Q.js";import{i as pi,n as gi,t as bi}from"./tooltip-CW50mEoC.js";import{t as Kt}from"./badge-jeXr866I.js";import{t as rt}from"./AgentAvatar-BZiiDlCN.js";import{n as Zn}from"./ToastContext-DyVJ6bCh.js";import{t as Ad}from"./instanceSettings-D1nNVWU0.js";import{a as Ya,i as Ga,n as Xa,r as Za,s as ec,t as tc}from"./dialog-CeH7rDcv.js";import{r as Jt}from"./assignees-DkQNbPzi.js";import{t as Ed}from"./textarea-CTx68BDs.js";import{t as sc}from"./attachment-icon-_1iz_saB.js";import{a as Rd,c as Sr,d as Vt,g as Sn,h as ko,l as jd,m as Ft,o as Md,p as Nd,s as Ao,u as Dd,v as Eo}from"./TaskChatComposerTakeoverContext-C68QVO36.js";import{t as Od}from"./InlineEntitySelector-BboofK18.js";import{t as Pd}from"./InlineBanner-DeTqU5Gp.js";import{t as Cs}from"./clipboard-CTLKYvRL.js";import{t as $r}from"./card-BVZvs7aX.js";import{_ as Bd,a as $d,d as Ld,i as Vd,l as Fd,n as Ud,r as qd,s as zd}from"./issue-blockers-t3wlvg4M.js";import{K as Vn,Rt as Hd,_a as Wd,h as Kd,m as Jd,p as nc,to as rc,zt as Qd}from"./index-QhteFtm-.js";import{_ as Yd,a as xi,d as Gd,h as Xd,i as Zd,n as eh,p as th,r as sh,s as nh,t as rh}from"./system-notice-comment-D0I6rz8Y.js";import{n as ih,r as oh,t as ah}from"./run-log-chunks-ZnzOvrXs.js";import{t as ch}from"./useSecondTick-BRYNTPNI.js";import{a as Ro,c as lh,d as uh,f as dh,g as vi,h as hh,i as fh,l as mh,m as ph,r as gh,s as bh,t as Pn}from"./SourceTrustBadge-CCPQEGrC.js";import{t as xh}from"./IssueRecoveryActionCard-BYtbaP-M.js";import{t as vh}from"./CommentAttributionChip-BdllZVtJ.js";var x=ui(Eu(),1),c=ui(Au(),1);function jo(t){const e=t.executionWorkspaceId??t.projectWorkspaceId;return t.label??(e?e.slice(0,8):"None")}i(jo,"formatTimelineWorkspaceLabel");function ks(t){return typeof t!="object"||t===null||Array.isArray(t)?null:t}i(ks,"asRecord$2");function zt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}i(zt,"hasOwn");function Me(t){return typeof t=="string"&&t.length>0?t:null}i(Me,"nullableString");function Mo(t){return new Date(t).getTime()}i(Mo,"toTimestamp$2");function yh(t,e){return t.agentId===e.agentId&&t.userId===e.userId}i(yh,"sameAssignee");function _h(t,e){return t.projectWorkspaceId===e.projectWorkspaceId&&t.executionWorkspaceId===e.executionWorkspaceId&&t.mode===e.mode&&t.label===e.label}i(_h,"sameWorkspace");function No(t){const e=ks(t);return e?{label:Me(e.label),projectWorkspaceId:Me(e.projectWorkspaceId),executionWorkspaceId:Me(e.executionWorkspaceId),mode:Me(e.mode)}:null}i(No,"workspaceFromRecord");function wh(t){const e=ks(t.workspaceChange);if(!e)return null;const s=No(e.from),n=No(e.to);return!s||!n||_h(s,n)?null:{from:s,to:n}}i(wh,"workspaceChangeFromDetails");function ic(t){return[...t].sort((e,s)=>{const n=Mo(e.createdAt)-Mo(s.createdAt);return n!==0?n:e.id.localeCompare(s.id)})}i(ic,"sortTimelineEvents");function n_(t){const e=[];for(const s of t??[]){if(s.action!=="issue.updated")continue;const n=ks(s.details);if(!n||!zt(n,"workMode"))continue;const r=ks(n._previous);!r||!zt(r,"workMode")||e.push({id:s.id,createdAt:s.createdAt,from:Me(r.workMode),to:Me(n.workMode)})}return ic(e)}i(n_,"extractIssueWorkModeChanges");function r_(t){const e=[];for(const s of t??[]){const n=ks(s.details);if(!n)continue;if(s.action==="issue.comment_added"){if(n.followUpRequested!==!0&&n.resumeIntent!==!0||n.reopened===!0)continue;const l=Me(n.commentId);e.push({id:s.id,createdAt:s.createdAt,actorType:s.actorType,actorId:s.actorId,runId:s.runId??null,commentId:l,followUpRequested:!0});continue}if(s.action!=="issue.updated")continue;const r=ks(n._previous),o={id:s.id,createdAt:s.createdAt,actorType:s.actorType,actorId:s.actorId,runId:s.runId??null};if((n.followUpRequested===!0||n.resumeIntent===!0)&&(o.followUpRequested=!0,o.commentId=Me(n.commentId)),zt(n,"status")){const l=Me(r?.status)??Me(n.reopenedFrom),u=Me(n.status);l!==u&&(o.statusChange={from:l,to:u})}if(zt(n,"assigneeAgentId")||zt(n,"assigneeUserId")){const l={agentId:Me(r?.assigneeAgentId),userId:Me(r?.assigneeUserId)},u={agentId:zt(n,"assigneeAgentId")?Me(n.assigneeAgentId):l.agentId,userId:zt(n,"assigneeUserId")?Me(n.assigneeUserId):l.userId};yh(l,u)||(o.assigneeChange={from:l,to:u})}const a=wh(n);a&&(o.workspaceChange=a),(o.statusChange||o.assigneeChange||o.workspaceChange||o.followUpRequested)&&e.push(o)}return ic(e)}i(r_,"extractIssueTimelineEvents");var vs=null;function Sh(t,e){t.currentIndex=0,t.wipContextDeps=null,t.wipCommitCallbacks=[];const s=vs;vs=t;try{if(e(),t.isFirstRender=!1,t.cells.length!==t.currentIndex)throw new Error(`Rendered ${t.currentIndex} hooks but expected ${t.cells.length}. Hooks must be called in the exact same order in every render.`)}finally{vs=s}}i(Sh,"withResourceFiber");function et(){if(!vs)throw new Error("No resource fiber available");return vs}i(et,"getCurrentResourceFiber");function Tt(){return vs}i(Tt,"peekResourceFiber");var De=typeof process<"u"&&!1,oc=i(t=>({version:0,committedVersion:0,dispatchUpdate:t,changelog:[],committedLog:[],unsettledCount:0,rollbackCallbacks:[]}),"createResourceFiberRoot"),yi=i(t=>{t.committedVersion=t.version;for(const e of t.changelog)e.logged=!1,e.settled||(e.settled=!0,t.unsettledCount--),t.committedLog.push(e);t.changelog.length=0,t.unsettledCount===0&&(t.committedLog.length=0),t.rollbackCallbacks.length=0},"commitRoot"),Gs=i((t,e)=>{const s=t.version>e;if(t.version=e,s){for(let n=0;n<t.rollbackCallbacks.length;n++)t.rollbackCallbacks[n]();if(t.rollbackCallbacks.length=0,e<=t.committedVersion){const n=[];for(;t.committedVersion-n.length>e;){const r=t.committedLog.pop();if(r===void 0){if(De)throw new Error("tap: committed history is shorter than the replay base.");break}_i(r.fiber,r.cell),r.cell.workInProgress=r.prevState,n.push({record:r,prevState:r.prevState,eagerState:r.eagerState,hasEagerState:r.hasEagerState})}if(n.length>0){const r=t.committedVersion;er(t,()=>{for(let o=n.length-1;o>=0;o--){const a=n[o];a.record.prevState=a.prevState,a.record.eagerState=a.eagerState,a.record.hasEagerState=a.hasEagerState,t.committedLog.push(a.record)}t.committedVersion=r})}t.committedVersion=e;for(const r of t.changelog)r.logged=!1;t.changelog.length=0}else{for(;t.committedVersion+t.changelog.length>e;)t.changelog.pop().logged=!1;for(let n=0;n<t.changelog.length;n++)ac(t.changelog[n]);yi(t)}}},"setRootVersion"),ac=i(t=>{_i(t.fiber,t.cell),t.queued||(t.queued=!0,(t.cell.queue??=[]).push(t))},"applyChangelogRecord"),an=i((t,e)=>{t.wipCommitCallbacks.push(e)},"addCommit"),er=i((t,e)=>{t.rollbackCallbacks.push(e)},"addRollback"),_i=i((t,e)=>{e.isDirty||(e.isDirty=!0,t.markDirty?.(),er(t.root,()=>{if(e.queue!==null){for(const s of e.queue)s.queued=!1;e.queue=null}e.workInProgress=e.current,e.isDirty=!1}))},"markReducerDirty"),cc=Symbol.for("react.memo_cache_sentinel"),lc=i(t=>new Array(t).fill(cc),"createMemoCache"),Ih=i((t,e)=>{const s=t.memoCache;let n=s.workInProgress;if(n===null){const a=s.current;n=a===null?[]:a.map(l=>l.slice()),s.workInProgress=n,er(t.root,()=>{s.workInProgress=null})}const r=s.index++;let o=n[r];return o===void 0?(o=lc(e),n[r]=o):De&&o.length,o},"nextFiberMemoCache"),uc=i(t=>Ih(et(),t),"useMemoCache"),Th=x.default,Ch=i(t=>(0,x.useMemo)(()=>{const e=lc(t);return e[cc]=!0,e},[]),"useReactMemoCacheShim"),kh=Th.__COMPILER_RUNTIME?.c??Ch,Ah=i(()=>Tt()!==null,"inTap$1"),se=i(t=>Ah()?uc(t):kh(t),"c"),Je=i((t,...e)=>Object.assign(Object.create(null),t,...e),"nullProtoRecord"),tr=i(()=>{throw new Error("Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.")},"throwRenderedMoreHooks"),sr=i(()=>{throw new Error("Hook order changed between renders")},"throwHookOrderChanged"),Eh=i(t=>({type:t,setup:void 0,setupDeps:void 0,cleanup:void 0,deps:null,generation:0}),"newEffect");function dc(t,e,s){const n=et(),r=n.currentIndex++,o=n.cells[r],a=o===void 0?Eh(s):o.type===s?o:sr();if(o===void 0&&(n.isFirstRender||tr(),n.cells[r]=a,s==="insertion"?(n.insertionCells??=[]).push(a):n.effectCells.push(a)),a.deps!==null&&!!e!=!!a.deps)throw new Error("useEffect called with and without dependencies across re-renders");an(n,()=>{a.setup=t,a.setupDeps=e,a.generation++})}i(dc,"useEffectImpl");function gt(t,e){dc(t,e,"effect")}i(gt,"useEffect$3");var cn=i((t,e)=>{De&&(t.length,e.length);for(let s=0;s<t.length&&s<e.length;s++)if(!Object.is(t[s],e[s]))return!1;return!0},"depsShallowEqual"),Do=i((t,e)=>{an(t,()=>{e.current=e.wip,e.currentDeps=e.wipDeps,e.isDirty=!1})},"addMemoCommit"),nr=i((t,e)=>{const s=et(),n=s.currentIndex++;let r=s.cells[n];if(r===void 0){s.isFirstRender||tr();const l=t();return De&&s.devStrictMode&&t(),r={type:"memo",current:l,currentDeps:e,wip:l,wipDeps:e,isDirty:!1},s.cells[n]=r,l}r.type!=="memo"&&sr();const o=r;if(cn(o.wipDeps,e))return o.isDirty&&Do(s,o),o.wip;const a=t();return De&&s.devStrictMode&&t(),o.wip=a,o.wipDeps=e,o.isDirty||(o.isDirty=!0,er(s.root,()=>{o.wip=o.current,o.wipDeps=o.currentDeps,o.isDirty=!1})),Do(s,o),a},"useMemo$5");function Ds(t){return nr(()=>({current:t}),[])}i(Ds,"useRef$5");var wi=Symbol("tap.Context.defaultValue"),Rh=i(t=>t,"asTap"),st=new Map,Ht=new Set,jh=i(()=>new Map(st),"cloneCurrentTapContext"),Lr=i((t,e)=>{const s=st;st=t;try{return e()}finally{st=s}},"withTapContextRoot"),hc=i((t,e)=>{t[wi]=e},"attachDefaultValueToContext"),fc=i(t=>typeof t=="object"&&t!==null&&wi in t,"isTapContext"),mc=i(t=>typeof t=="object"&&t!==null&&"$$typeof"in t&&t.$$typeof===Symbol.for("react.context"),"isReactContext"),pc=i(t=>fc(t)||mc(t),"isReadableTapContext"),gc=i(t=>{if(!fc(t)){if(mc(t)){hc(t,t._currentValue??t._currentValue2);return}throw new Error("A tap resource's `use()` only accepts a tap context.")}},"assertTapContext"),rr=i((t,e,s)=>{if(typeof t!="object"||t===null)throw new Error("useContextProvider only accepts a React context.");gc(t);const n=t,r=et(),o=Ds(void 0),a=o.current===void 0||!Object.is(o.current.value,e);gt(()=>{o.current={value:e}},[e]);const l=st.get(n),u=l!==void 0||st.has(n);st.set(n,{value:e,source:r});try{return Mh(n,a,s)}finally{u?st.set(n,l):st.delete(n)}},"useContextProvider"),Mh=i((t,e,s)=>{const n=Ht.has(t);e?Ht.add(t):Ht.delete(t);try{return s()}finally{n?Ht.add(t):Ht.delete(t)}},"withChangedContext"),bc=i(t=>{gc(t);const e=t,s=Nh(e,t),n=et();return(n.wipContextDeps??=new Map).set(e,s.source),s.value},"useContext$2"),Nh=i((t,e)=>st.get(t)??{value:Rh(e)[wi],source:null},"getCurrentContextValue"),Dh=i((t,e,s,n)=>{if(!n)return s;let r=s;for(const[o,a]of n)a===e||a===t||(r??=new Map).set(o,a);return r},"mergeContextDeps"),xc=i((t,e=t.wipContextDeps)=>{const s=Tt();!s||!e||(s.wipContextDeps=Dh(s,t,s.wipContextDeps,e))},"bubbleContextDeps"),vc=i(()=>Ht.size>0,"hasChangedContexts"),Si=i(t=>{if(!t.contextDeps||!vc())return!1;for(const e of Ht.keys())if(t.contextDeps.has(e))return!0;return!1},"hasContextDepsChanged"),Oh=i((t,e,s)=>{if(t.isNeverMounted)throw new Error("Resource updated before mount");let n=!1,r=!0;t.root.unsettledCount++,t.root.dispatchUpdate(()=>(n||(n=!0,s&&t.root.changelog.length===0&&!e.cell.isDirty&&!e.hasEagerState&&(e.prevState=e.cell.workInProgress,e.eagerState=s(e.cell.workInProgress,e.action),e.hasEagerState=!0,r=!Object.is(e.cell.current,e.eagerState),!r&&!e.settled&&(e.settled=!0,t.root.unsettledCount--))),r),()=>(n=!0,r=!0,ac(e),e.logged||(e.logged=!0,t.root.changelog.push(e)),!0))},"dispatchOnFiber"),Ph=i((t,e,s,n,r)=>{const o=n?n(s):s;De&&t.devStrictMode&&n&&n(s);const a={type:"reducer",workInProgress:o,current:o,isDirty:!1,queue:null,renderQueue:null,reducer:e,dispatch:i(l=>{const u=Tt();if(u!==null){if(u!==t)throw new Error("Cannot update a resource while rendering a different resource.");(t.renderPendingCells??=new Set).add(a),(a.renderQueue??=[]).push(l)}else{const d={fiber:t,cell:a,action:l,hasEagerState:!1,eagerState:void 0,prevState:a.current,settled:!1,queued:!1,logged:!1};Oh(t,d,r?e:void 0)}},"dispatch")};return a},"createReducerCell");function yc(t,e,s,n){const r=et(),o=r.currentIndex++,a=r.cells[o],l=(()=>{if(a!==void 0)return a.type==="reducer"?a:sr();r.isFirstRender||tr();const d=Ph(r,t,e,s,n);return r.cells[o]=d,d})(),u=l.queue;if(u!==null){const d=t===l.reducer;for(let h=0;h<u.length;h++){const f=u[h];!f.hasEagerState||!d||!Object.is(f.prevState,l.workInProgress)?(f.prevState=l.workInProgress,f.eagerState=t(l.workInProgress,f.action),f.hasEagerState=!0,De&&r.devStrictMode&&(f.eagerState=t(l.workInProgress,f.action))):De&&r.devStrictMode&&t(l.workInProgress,f.action),f.queued=!1,l.workInProgress=f.eagerState}l.queue=null}if(l.reducer=t,l.renderQueue!==null){let d=l.workInProgress;for(const h of l.renderQueue)d=t(d,h);l.renderQueue=null,r.renderPendingCells?.delete(l),Object.is(d,l.workInProgress)||(_i(r,l),l.workInProgress=d)}return l.isDirty&&an(r,()=>{l.current=l.workInProgress,l.isDirty=!1}),[l.workInProgress,l.dispatch]}i(yc,"useReducerImpl");function Ii(t,e,s){return yc(t,e,s,!1)}i(Ii,"useReducer$1");var Bh=i((t,e)=>typeof e=="function"?e(t):e,"stateReducer"),$h=i(t=>t===void 0?void 0:typeof t=="function"?t():t,"stateInit");function _c(t){return yc(Bh,t,$h,!0)}i(_c,"useState$3");var Ti=i((t,e)=>nr(()=>t,e),"useCallback$4");function wc(t,e){dc(t,e,"insertion")}i(wc,"useInsertionEffect$2");function Ci(t){const e=et(),s=Ds(t);return s.current!==t&&an(e,()=>{s.current=t}),Ti(((...n)=>{if(De&&Tt())throw new Error("useEffectEvent cannot be called during render");return s.current(...n)}),[])}i(Ci,"useEffectEvent$1");var Sc=i(t=>t!==null&&typeof t=="object"&&typeof t.then=="function","isThenable$1"),Oo=i(()=>{},"noop"),Lh=i(t=>{const e=t;switch(typeof e.status!="string"?(e.status="pending",t.then(s=>{e.status==="pending"&&(e.status="fulfilled",e.value=s)},s=>{e.status==="pending"&&(e.status="rejected",e.reason=s)})):e.status!=="fulfilled"&&e.status!=="rejected"&&t.then(Oo,Oo),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw t}},"trackThenable"),ki=i(t=>Sc(t)?Lh(t):bc(t),"use$1"),Po=!1,Ic=i((t,e,s=e)=>{const n=et().isNeverMounted,r=n?s():e();De&&!Po&&(!n||s===e)&&(Object.is(r,e())||(Po=!0));const[,o]=Ii(u=>u+1,0),a=Ds(0),l=Ci(()=>{try{if(Object.is(r,e()))return a.current=0,!1}catch{}return!0});return gt(()=>t(()=>{l()&&o()}),[t]),gt(()=>{if(l()){if(++a.current>50)throw a.current=0,new Error("Maximum update depth exceeded. The result of getSnapshot should be cached to avoid an infinite loop.");o()}},[t,r,e]),r},"useSyncExternalStore$1"),Tc=i((t,e)=>{},"useDebugValue$1"),Vh=0,Fh=i(()=>{const t=Ds(null);return t.current??=`:tap${Vh++}:`,t.current},"useId$1"),Cc=i((t,e,s)=>{const n=i(()=>{if(!t)return;const r=e();if(typeof t=="function"){const o=t(r);return typeof o=="function"?o:()=>t(null)}return t.current=r,()=>{t.current=null}},"attach");s==null?gt(n):gt(n,[...s,t])},"useImperativeHandle$2"),Uh=x.default;function qh(t){const e=(0,x.useRef)(t);return(0,x.useInsertionEffect)(()=>{e.current=t}),(0,x.useCallback)(((...s)=>e.current(...s)),[])}i(qh,"useReactEffectEventShim");var zh=Uh.useEffectEvent??qh,Le=i(()=>Tt()!==null,"inTap"),ke=x.default,ye=i(t=>Le()?_c(t):ke.useState(t),"useState$2"),Hh=i((t,e,s)=>Le()?Ii(t,e,s):ke.useReducer(t,e,s),"useReducer"),$e=i(t=>Le()?Ds(t):ke.useRef(t),"useRef$3"),qe=i((t,e)=>Le()?nr(t,e):ke.useMemo(t,e),"useMemo$4"),Wh=i((t,e)=>Le()?Ti(t,e):ke.useCallback(t,e),"useCallback$2"),be=i((t,e)=>Le()?gt(t,e):ke.useEffect(t,e),"useEffect$2"),Kh=i((t,e)=>Le()?gt(t,e):ke.useLayoutEffect(t,e),"useLayoutEffect$1"),Jh=i(t=>Le()?Ci(t):zh(t),"useEffectEvent"),ir=i((t,e,s)=>Le()?Ic(t,e,s):ke.useSyncExternalStore(t,e,s),"useSyncExternalStore"),Qh=i((t,e)=>Le()?Tc(t,e):ke.useDebugValue(t,e),"useDebugValue"),Os=i((t,e)=>Le()?wc(t,e):ke.useInsertionEffect(t,e),"useInsertionEffect"),Yh=i((t,e,s)=>Le()?Cc(t,e,s):ke.useImperativeHandle(t,e,s),"useImperativeHandle$1"),Gh=i(t=>ke.forwardRef(t),"forwardRef$1"),kc=i((t,e)=>ke.memo(t,e),"memo$1"),i_=ke.Fragment,o_=ke.Children,a_=ke.Suspense,ts=i(t=>{const e=ke.createContext(t);return hc(e,t),e},"createContext$1"),Ai=i(t=>Le()&&pc(t)?ki(t):ke.use(t),"use"),or=i(t=>Le()&&pc(t)?ki(t):ke.useContext(t),"useContext$1"),Ct=i((t,e)=>{if(t.length!==0){if(t.length===1)throw t[0];for(const s of t);throw new AggregateError(t,e)}},"throwAggregated"),Xh=50,Ke={schedulers:new Set,isScheduled:!1},nt=null,Vr=[],Ac=class{static{i(this,"UpdateScheduler")}_isDirty=!1;_task;constructor(t){this._task=t}get isDirty(){return this._isDirty}markDirty(){if(nt&&(nt.get(this)??0)>=Xh)throw new Error("Maximum update depth exceeded. This can happen when a resource repeatedly calls setState inside useEffect.");this._isDirty=!0,Ke.schedulers.add(this),Ec()}runTask(){nt?.set(this,(nt.get(this)??0)+1),this._isDirty=!1,this._task()}settle(){this._isDirty=!1}},Zh=[],c_=new Ac(()=>{const t=Zh.splice(0),e=[];for(const s of t)try{s()}catch(n){e.push(n)}Ct(e,"Errors occurred while running scheduled tasks")}),ef=i(t=>{if(nt!==null){Vr.push(t);return}t()},"scheduleNotify"),Ec=i(()=>{Ke.isScheduled||(Ke.isScheduled=!0,tf())},"scheduleFlush"),Fr=i(()=>{const t=nt;nt=new Map;const e=[];try{for(const s of Ke.schedulers)if(Ke.schedulers.delete(s),!!s.isDirty)try{s.runTask()}catch(n){e.push(n)}}finally{if(nt=t,Ke.schedulers.clear(),Ke.isScheduled=!1,nt===null)for(;Vr.length>0;)try{Vr.shift()()}catch(s){e.push(s)}}Ct(e,"Errors occurred during flushSync")},"flushScheduled"),tf=(()=>{if(typeof MessageChannel<"u"){let t=null,e;return()=>{if(!t){const s=new MessageChannel;s.port1.onmessage=()=>{t?.unref?.(),Fr()},t=s.port1,e=s.port2}t.ref?.(),e.postMessage(null)}}return()=>setTimeout(Fr,0)})(),sf=i(t=>{if(nt!==null)return t();const e=Ke;Ke={schedulers:new Set,isScheduled:!0};try{const s=t();return Fr(),s}finally{const s=Ke.schedulers;if(Ke=e,s.size>0){for(const n of s)Ke.schedulers.add(n);Ec()}}},"flushTapSync");function nf(t){if(t.length===0)return;let e;for(let s=0;s<t.length;s++)try{t[s]()}catch(n){(e??=[]).push(n)}e!==void 0&&Ct(e,"Errors during commit")}i(nf,"commitAllCallbacks");function rf(t){const e=t.setup,s=t.setupDeps,n=t.generation;let r;try{const o=e();if(o!==void 0&&typeof o!="function")throw new Error(`An effect function must either return a cleanup function or nothing. Received: ${typeof o}`);r=o}finally{t.generation===n?(t.cleanup=r,t.deps=s):r?.()}}i(rf,"setupEffect");var of=i(t=>t.setup===void 0?!1:t.deps===null||t.setupDeps===void 0?!0:!cn(t.deps,t.setupDeps),"effectNeedsRun");function Bo(t,e){let s;for(const n of t)of(n)&&(s??=[]).push(n);if(s===void 0)return e;for(const n of s)if(n.deps=null,n.cleanup!==void 0)try{n.cleanup()}catch(r){(e??=[]).push(r)}finally{n.cleanup=void 0}for(const n of s)try{rf(n)}catch(r){(e??=[]).push(r)}return e}i(Bo,"reconcileCells");function $o(t,e=!0){let s;t.insertionCells!==null&&e&&(s=Bo(t.insertionCells,s)),s=Bo(t.effectCells,s),s!==void 0&&Ct(s,"Errors during commit")}i($o,"reconcileEffects");function Lo(t){let e;for(const s of t)if(s.deps=null,s.cleanup)try{s.cleanup?.()}catch(n){(e??=[]).push(n)}finally{s.cleanup=void 0}e!==void 0&&Ct(e,"Errors during cleanup")}i(Lo,"cleanupCells");var af={useState:_c,useReducer:Ii,useRef:Ds,useMemo:nr,useCallback:Ti,useEffect:gt,useLayoutEffect:gt,useInsertionEffect:wc,useEffectEvent:Ci,useContext:bc,use:ki,useSyncExternalStore:Ic,useDebugValue:Tc,useId:Fh,useImperativeHandle:Cc,useMemoCache:uc},Vo=x.default,Ut=Vo.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE??Vo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,In=Ut==null?null:"H"in Ut?{get current(){return Ut.H},set current(t){Ut.H=t}}:"ReactCurrentDispatcher"in Ut?{get current(){return Ut.ReactCurrentDispatcher.current},set current(t){Ut.ReactCurrentDispatcher.current=t}}:null;function cf(t){if(!In)return t();const e=In.current;In.current=af;try{return t()}finally{In.current=e}}i(cf,"withReactDispatcher");function Rc(t,e,s=void 0,n){return{hook:t,root:e,markDirty:s,devStrictMode:n,cells:[],effectCells:[],insertionCells:null,hostCells:null,contextDeps:null,wipContextDeps:null,wipCommitCallbacks:null,memoCache:{current:null,workInProgress:null,index:0},renderPendingCells:null,currentIndex:0,isFirstRender:!0,isMounted:!1,isReleased:!1,isNeverMounted:!0}}i(Rc,"createResourceFiber");function jc(t){t.wipCommitCallbacks=null,t.wipContextDeps=null,t.memoCache.workInProgress=null}i(jc,"discardWipRender");function As(t,e,s){try{e?(t.isReleased=!0,t.insertionCells!==null&&Lo(t.insertionCells)):t.isMounted&&(t.isMounted=!1,Lo(t.effectCells))}catch(n){(s??=[]).push(n)}if(t.hostCells!==null){for(const n of t.hostCells)if(n.fiber!==null&&(s=As(n.fiber,e,s)),n.fibers!==null)for(const{fiber:r}of n.fibers.values())s=As(r,e,s)}return s}i(As,"cleanupResourceFiber");function Ei(t,e=!0){let s;e&&(s=As(t,!0,s)),s=As(t,!1,s),s!==void 0&&Ct(s,"Errors during cleanup")}i(Ei,"unmountResourceFiber");function Mc(t){let e;for(const s of t)s.isReleased&&(e=As(s,!0,e));for(const s of t)e=As(s,!1,e);e!==void 0&&Ct(e,"Errors during cleanup")}i(Mc,"unmountResourceFibers");function St(t,e){if(t.renderPendingCells!==null){for(const r of t.renderPendingCells)r.renderQueue=null;t.renderPendingCells.clear()}let s=0,n;try{do{if(++s>25)throw new Error("Too many re-renders. tap limits the number of renders to prevent an infinite loop.");t.memoCache.index=0,Sh(t,()=>{n=cf(()=>t.hook(...e))})}while((t.renderPendingCells?.size??0)>0)}catch(r){throw jc(t),r}return xc(t),n}i(St,"renderResourceFiber");function Qt(t){const e=t.wipCommitCallbacks;t.wipCommitCallbacks=null;const s=De&&!t.isMounted&&t.devStrictMode==="root";t.isMounted=!0,t.isNeverMounted=!1,e!==null&&(t.contextDeps=t.wipContextDeps,yi(t.root),t.memoCache.workInProgress!==null&&(t.memoCache.current=t.memoCache.workInProgress,t.memoCache.workInProgress=null),nf(e)),s&&($o(t,e!==null),Ei(t,!1),t.isMounted=!0),$o(t,!s&&e!==null)}i(Qt,"commitResourceFiber");var lf=i(()=>{const t=et();return t.devStrictMode?t.isFirstRender?"child":"root":null},"getTapDevMode"),uf=i(()=>"child","child"),Fo=i(()=>null,"notDevMode"),df=i(()=>{if(!De)return Fo;const t=$e(0);return ye(()=>t.current++),t.current!==2?Fo:uf},"useDevStrictModeReact"),Nc=i(()=>Tt()?lf:df(),"useDevStrictMode"),hf=i(t=>{const e=et(),s=e.currentIndex++,n=e.cells[s];let r;if(n===void 0){e.isFirstRender||tr();const o=t instanceof Map;r={type:"host",fiber:o?null:t,fibers:o?t:null},e.cells[s]=r,(e.hostCells??=[]).push(r)}else n.type!=="host"&&sr(),r=n;return r.fibers===null&&r.fiber!==t&&an(e,()=>{r.fiber=t}),r},"useHostCell"),Uo=i((t,e)=>{if(!(t instanceof Map))return e(t);for(const{fiber:s}of t.values())e(s)},"forEachHostedFiber"),ff=i(t=>{t.isReleased=!1},"acquire"),mf=i(t=>{t.isReleased=!0,t.isMounted||queueMicrotask(()=>{t.isReleased&&Ei(t,!0)})},"release"),pf=i(t=>{Os(()=>(Uo(t,ff),()=>Uo(t,mf)),[t]),be(()=>()=>{Mc(t instanceof Map?Array.from(t.values(),({fiber:e})=>e):[t])},[t])},"useHostLifecycleReact"),ar=i(t=>Tt()?hf(t):(pf(t),null),"useHostLifecycle"),gf=i(()=>{const t=$e(0),e=t.current,s=et();return{version:e,markDirty:qe(()=>()=>{t.current++,s.markDirty?.()},[s]),root:s.root}},"useResourceFiberHostUtilsTap"),bf=i(()=>{const[t]=ye(()=>oc((r,o)=>{let a=!1;n(l=>(a=!r(),a?l:l+1)),a||s(()=>r()&&o())})),[e,s]=Hh((r,o)=>(Gs(t,r),r+(o()?1:0)),0),[,n]=ye(0);return Gs(t,e),{root:t,version:e,markDirty:void 0}},"useResourceFiberHostUtilsReact"),Ri=i(()=>{const t=Nc(),{root:e,version:s,markDirty:n}=Tt()?gf():bf();return{version:s,createFiber:Wh((r,o,a)=>Rc(r,e,a?()=>{a(),n?.()}:n,t()),[])}},"useResourceFiberHost"),xf=i(t=>t(),"useHostRoot"),vf=i(t=>{const e=[];for(const s of t)try{s()}catch(n){e.push(n)}Ct(e,"Errors occurred while notifying Tap root subscribers")},"notifySubscribers$1"),yf=i((t,e,s)=>{const n=new Ac(()=>l.handleUpdate()),r=[],o=oc((u,d)=>{r.length===0&&!u()||(r.push(d),n.markDirty())}),a=Rc(xf,o,void 0,e),l={scheduler:n,queue:r,fiber:a,subscribers:new Set,pendingHostRender:!1,isMounted:!1,hasRendered:!1,committedRender:t,context:new Map,value:void 0,applyQueue:i(()=>{Gs(o,o.committedVersion);for(const u of r)De&&a.devStrictMode&&u(),u();return Gs(o,o.committedVersion+o.changelog.length),r.length},"applyQueue"),publish:i((u,d)=>{n.isDirty||o.committedVersion!==d||l.value===u||(l.value=u,ef(()=>vf(l.subscribers)))},"publish"),finishFlush:i((u,d,h)=>{yi(o),r.splice(0,h),l.pendingHostRender=!1,r.length===0&&n.settle(),l.isMounted&&Qt(a),l.publish(u,d)},"finishFlush"),handleUpdate:i(()=>{const u=l.applyQueue();let d;try{De&&a.devStrictMode&&Lr(l.context,()=>St(a,[l.committedRender])),d=Lr(l.context,()=>St(a,[l.committedRender]))}catch(h){if(Gs(o,o.committedVersion),Sc(h)){const f=i(()=>{l.isMounted&&n.markDirty()},"retry");h.then(f,f);return}if(l.isMounted){l.pendingHostRender=!0,s(f=>f+1);return}throw h}if(n.isDirty)throw new Error("Scheduler is dirty, this should never happen");l.finishFlush(d,o.version,u)},"handleUpdate")};return l},"createInstance"),_f=i(t=>{const[,e]=ye(0),s=Nc(),n=$e(null),r=n.current??=yf(t,s(),e),o=jh(),a=r.scheduler.isDirty||r.pendingHostRender?r.applyQueue():0,l=Lr(o,()=>St(r.fiber,[t])),u={render:t,context:o,value:l,drained:a,wip:r.fiber.wipCommitCallbacks,version:r.fiber.root.version,processed:!1};return r.hasRendered||(r.hasRendered=!0,r.committedRender=t,r.context=o,r.value=l),be(()=>(r.isMounted=!0,()=>{r.isMounted=!1}),[r]),ar(r.fiber),be(()=>{if(u.processed){r.fiber.isMounted||(Qt(r.fiber),r.queue.length&&!r.scheduler.isDirty&&r.scheduler.markDirty());return}if(u.processed=!0,r.committedRender=u.render,r.context=u.context,r.fiber.wipCommitCallbacks!==u.wip){r.scheduler.isDirty||r.handleUpdate();return}if(u.drained>0&&r.fiber.root.version===u.version){r.finishFlush(u.value,u.version,u.drained);return}Qt(r.fiber),r.publish(u.value,u.version)}),qe(()=>({getValue:i(()=>r.value,"getValue"),subscribe:i(d=>(r.subscribers.add(d),()=>r.subscribers.delete(d)),"subscribe")}),[r])},"useTapRoot");function he(t){return(...e)=>({hook:t,args:e})}i(he,"resource");function Oe(t,e,s){return typeof e=="function"?(...n)=>Oe(t,e(...n)):s?{...e,key:t,deps:s}:{...e,key:t}}i(Oe,"withKey");var wf=i((t,e)=>({fiber:t,key:e,currentDeps:null,current:null,wipDeps:null,wip:null}),"createHostState");function kt(t){const{version:e,createFiber:s}=Ri(),n=$e(null),r=n.current??=wf(s(t.hook,t.key),t.key),o=qe(()=>r.fiber.hook===t.hook&&r.key===t.key&&!r.fiber.isReleased?r.fiber:s(t.hook,t.key),[r,t.hook,t.key,s]);r.wipDeps=r.currentDeps,r.wip=r.current;const a=[o,e,t.args];(Si(o)||r.currentDeps===null||!cn(r.currentDeps,a))&&(r.wipDeps=a,r.wip={value:St(o,t.args)});const l=r.wip,u=ar(o);return be(()=>{if(r.currentDeps=r.wipDeps,r.current=r.wip,r.fiber=o,r.key=t.key,Qt(o),u!==null)return()=>{u.fiber!==o&&Ei(o,!0)}},[r,u,o,t.key,l]),l.value}i(kt,"useResource");var Sf=i((t,e,s)=>{const n=$e(null),r=n.current??(n.current={wipDeps:null,wip:null,currentDeps:null,current:null});return r.wipDeps=r.currentDeps,r.wip=r.current,be(()=>{r.currentDeps=r.wipDeps,r.current=r.wip}),!s&&r.currentDeps&&cn(r.currentDeps,e)?r.current:(r.wipDeps=e,r.wip=t(),r.wip)},"useRenderMemo"),qo=i((t,e)=>{const s=t.get(e);s&&(s.isDirty=!0)},"markChildDirty"),If=i((t,e)=>!t.isDirty&&!Si(t.fiber)&&e!==void 0&&t.committedDeps!==void 0&&cn(t.committedDeps,e),"canReuse"),Tf=i(t=>{if(!vc())return!1;for(const{fiber:e}of t.values())if(Si(e))return!0;return!1},"hasAnyChildContextDepsChanged");function ji(t){const[e]=ye(()=>new Map),{version:s,createFiber:n}=Ri(),r=Tf(e);let o=!1;const a=Sf(()=>{const l=new Set,u=[];let d=0;for(let h=0;h<t.length;h++){const f=t[h],p=f.key;if(p===void 0)throw new Error(`useResources did not provide a key for array at index ${h}`);if(l.has(p))throw new Error(`Duplicate key ${p} in useResources`);l.add(p);let m=e.get(p);if(m)if(m.fiber.hook!==f.hook){const g=n(f.hook,f.key,()=>qo(e,p)),b=St(g,f.args);m.next={value:b,deps:f.deps,remount:g},o=!0}else if(If(m,f.deps))typeof m.next=="object"&&jc(m.fiber),m.fiber.contextDeps&&xc(m.fiber,m.fiber.contextDeps),m.next="skip";else{const g=St(m.fiber,f.args);m.next={value:g,deps:f.deps}}else{const g=n(f.hook,f.key,()=>qo(e,p));m={fiber:g,next:{value:St(g,f.args),deps:f.deps},isDirty:!1,committedDeps:void 0,committedValue:void 0},d++,e.set(p,m)}u.push(typeof m.next=="object"?m.next.value:m.committedValue)}if(e.size>u.length-d)for(const h of e.keys())l.has(h)||(e.get(h).next="delete",o=!0);return u},[t,e,n,s],r);return ar(e),be(()=>{if(o){const l=[];for(const[u,d]of e.entries()){const h=d.next;h==="delete"?(l.push(d.fiber),e.delete(u)):h!=="skip"&&h.remount&&(l.push(d.fiber),d.fiber=h.remount)}for(const u of l)u.isReleased=!0;Mc(l)}for(const l of e.values()){const u=l.next;u==="skip"?!l.fiber.isNeverMounted&&!l.fiber.isMounted&&Qt(l.fiber):u!=="delete"&&(Qt(l.fiber),l.committedDeps=u.deps,l.committedValue=u.value,l.isDirty=!1,l.next="skip")}},[a,e,o]),a}i(ji,"useResources");var Cf=i(t=>t(),"useHostRender"),Dc=i(t=>{const{createFiber:e}=Ri(),[s]=ye(()=>e(Cf,void 0)),n=St(s,[t]);ar(s);let r=!1;const o=i(()=>{r&&s.isMounted||(r=!0,Qt(s))},"effects");return be(o),{value:n,effects:o}},"useTapHost"),kf=i(()=>{const t=se(4),[e,s]=ye(Ef);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=i((u,d)=>(s(h=>{const f=Je(h.renderers);return f[u]=[...f[u]??[],d],{...h,renderers:f}}),()=>{s(h=>{const f=Je(h.renderers),p=f[u]?.filter(m=>m!==d)??[];return p.length>0?f[u]=p:delete f[u],{...h,renderers:f}})}),"t0"),t[0]=n):n=t[0];const r=n;let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=i(u=>(s(d=>({...d,fallbacks:[...d.fallbacks,u]})),()=>{s(d=>({...d,fallbacks:d.fallbacks.filter(h=>h!==u)}))}),"t1"),t[1]=o):o=t[1];const a=o;let l;return t[2]!==e?(l={getState:i(()=>e,"getState"),setDataUI:r,setFallbackDataUI:a},t[2]=e,t[3]=l):l=t[3],l},"useDataRenderers"),Af=he(kf);function Ef(){return{renderers:Je(),fallbacks:[]}}i(Ef,"_temp$8");var dt=i((t,e,s)=>{const n=i(r=>{},"reportError");for(const r of t)try{const o=r(typeof e=="function"?e():e);o!==null&&(typeof o=="object"||typeof o=="function")&&"then"in o&&typeof o.then=="function"&&Promise.resolve(o).catch(n)}catch(o){n(o)}},"notifyEventListeners"),Oc=i(t=>t,"AuiConfig"),Rf=new Set(["$$typeof","nodeType","then","__v_raw","__v_isRef","__v_isReactive","__v_isReadonly","__v_isShallow","__v_skip"]),Yt=i((t,e)=>{if(t===Symbol.toStringTag)return e;if(typeof t!="symbol"){if(t==="toJSON")return()=>e;if(!Rf.has(t))return!1}},"handleIntrospectionProp"),tn=class{static{i(this,"BaseProxyHandler")}getOwnPropertyDescriptor(t,e){const s=this.get(t,e);if(s!==void 0)return{value:s,writable:!1,enumerable:!0,configurable:!0}}set(){return!1}setPrototypeOf(){return!1}defineProperty(){return!1}deleteProperty(){return!1}preventExtensions(){return!1}},Es=Symbol("assistant-ui.store.clientId"),Ur=Symbol("assistant-ui.store.instanceTag"),Pc=i((t,e)=>{const s=new Proxy((()=>{}),{apply:i(()=>(e(),s),"apply"),get:i((n,r)=>r==="source"?t.source:r==="query"?t.query:r==="name"?t.name:r===Es?Mi(e()):e()[r],"get"),has:i((n,r)=>r==="source"||r==="query"||r==="name"||r===Es||r in e(),"has"),ownKeys:i(()=>Reflect.ownKeys(e()),"ownKeys"),getOwnPropertyDescriptor:i((n,r)=>{if(!(typeof r=="symbol"||!(r in e())))return{value:e()[r],writable:!1,enumerable:!0,configurable:!0}},"getOwnPropertyDescriptor")});return s},"createClientAccessor"),Bc=i((t,e)=>{const s=i(()=>{throw new Error(t)},"fail");return new Proxy((()=>{}),{apply:s,get:i((n,r)=>{if(r==="source"||r==="query")return null;if(r==="name")return e;if(r===Es)return s();const o=Yt(r,"AssistantClientAccessor");return o!==!1?o:s()},"get"),has:i((n,r)=>r==="source"||r==="query"||r==="name","has"),ownKeys:i(()=>[],"ownKeys"),getOwnPropertyDescriptor:i(()=>{},"getOwnPropertyDescriptor")})},"createErrorClientAccessor"),cr=i(t=>t?.source!=null,"isScopeAvailable"),qr=i(t=>t?.source===null,"isScopeUnavailable"),Mi=i(t=>t[Es]??t,"getClientId"),jf=i(t=>t[Ur]??Mi(t),"getClientInstanceId"),Wt=i(t=>t==="optional"||t==="subscribe"||t==="on"||t==="__proto__"||typeof t=="symbol","isIgnoredClientKey"),zr=i(t=>{const e=[];for(const s in t)Wt(s)||e.push(s);return e},"clientScopeKeys"),Mf=class extends tn{static{i(this,"OptionalClientViewProxyHandler")}#e;constructor(t){super(),this.#e=t}get(t,e){const s=Yt(e,"OptionalAssistantClient");if(s!==!1)return s;if(Wt(e))return;const n=this.#e[e];return cr(n)?n:void 0}ownKeys(){return zr(this.#e)}has(t,e){return!Wt(e)&&e in this.#e}},$c=i(t=>new Proxy({},new Mf(t)),"createOptionalClientView"),zo=i(()=>()=>{},"NO_OP_SUBSCRIBE"),Nf="You are using a component or hook that requires an AuiProvider. Wrap your component in an <AuiProvider> component.",Df=class extends tn{static{i(this,"EmptyAssistantClientProxyHandler")}#e;#t;#s;#n;constructor(t,e,s){super(),this.#e=t,this.#t=e,this.#s=s}get(t,e){if(e==="subscribe"||e==="on")return zo;if(e==="optional")return this.#n??=$c(this.#s());const s=Yt(e,this.#e);return s!==!1?s:Bc(this.#t(String(e)),String(e))}ownKeys(){return["subscribe","on","optional"]}getOwnPropertyDescriptor(t,e){if(e!=="optional")return super.getOwnPropertyDescriptor(t,e);const s=this.get(t,e);if(s!==void 0)return{value:s,writable:!1,enumerable:!1,configurable:!0}}has(t,e){return e==="subscribe"||e==="on"||e==="optional"}},Of=i((t,e)=>{const s=new Proxy({},new Df(t,e,()=>s));return s},"createEmptyAssistantClient"),ys=Of("DefaultAssistantClient",()=>Nf),Pf=i(()=>new Proxy({},{get(t,e){const s=Yt(e,"AssistantClient");return s!==!1?s:Bc(`The current scope does not have a "${String(e)}" property.`,String(e))}}),"createRootAssistantClient"),Ni=ts(ys),Bf=i(()=>{},"NOOP_EFFECT"),Lc=new WeakMap,$f=i(t=>Lc.get(t)??Bf,"getTapEffects"),Lf=i((t,e)=>{Lc.set(t,e)},"setTapEffects"),Di=i(()=>or(Ni),"useAssistantContextValue"),Vf=i((t,e)=>rr(Ni,t,e),"useAssistantContextProvider"),Hr=Symbol("assistant-ui.transform-scopes");function Vc(t,e){const s=t;if(s[Hr])throw new Error("transformScopes is already attached to this resource");s[Hr]=e}i(Vc,"attachTransformScopes");function Ff(t){return t[Hr]}i(Ff,"getTransformScopes");var Fc=i(t=>typeof t=="string"?{scope:t.split(".")[0],event:t}:{scope:t.scope,event:t.event},"normalizeEventSelector"),Wr=Symbol("assistant-ui.store.clientIndex"),Uf=i(t=>t[Wr],"getClientIndex"),Uc=ts([]),Oi=i(()=>Ai(Uc),"useClientStack"),qf=i((t,e)=>{const s=se(3),n=Oi();let r;return s[0]!==t||s[1]!==n?(r=[...n,t],s[0]=t,s[1]=n,s[2]=r):r=s[2],rr(Uc,r,e)},"useClientStackProvider"),Fn=Symbol("assistant-ui.store.getValue"),Ho=i(t=>{const e=t[Fn];if(!e)throw new Error("Client scope contains a non-client resource. Ensure your Derived get() returns a client created with useClientResource(), not a plain resource.");return e.getState?.()},"getClientState"),Wo=new Map;function zf(t){let e=Wo.get(t);return e||(e=i(function(...s){if(!this||typeof this!="object")throw new Error(`Method "${String(t)}" called without proper context. This may indicate the function was called incorrectly.`);const n=this[Fn];if(!n)throw new Error(`Method "${String(t)}" called on invalid client proxy. Ensure you are calling this method on a valid client instance.`);const r=n[t];if(!r)throw new Error(`Method "${String(t)}" is not implemented.`);if(typeof r!="function")throw new Error(`"${String(t)}" is not a function.`);return r(...s)},"template"),Wo.set(t,e)),e}i(zf,"getOrCreateProxyFn");var Hf=class extends tn{static{i(this,"ClientProxyHandler")}boundFns;cachedReceiver;outputRef;tagRef;index;self;constructor(t,e,s){super(),this.outputRef=t,this.tagRef=e,this.index=s}get(t,e,s){if(e===Fn)return this.outputRef.current;if(e===Wr)return this.index;if(e===Es)return this.self;if(e===Ur)return this.tagRef.current;const n=Yt(e,"ClientProxy");if(n!==!1)return n;const r=this.outputRef.current[e];if(typeof r=="function"){if(s===void 0)return r;(!this.boundFns||this.cachedReceiver!==s)&&(this.boundFns=new Map,this.cachedReceiver=s);let o=this.boundFns.get(e);return o||(o=zf(e).bind(s),this.boundFns.set(e,o)),o}return r}ownKeys(){return Object.keys(this.outputRef.current)}has(t,e){return e===Fn||e===Wr||e===Es||e===Ur?!0:e in this.outputRef.current}},Rs=i(t=>{const e=$e(null),s=$e(null),n=qe(()=>({}),[t.hook,t.key]),r=Oi().length,o=qe(()=>{const l=new Hf(e,s,r),u=new Proxy({},l);return l.self=u,u},[r]),a=qf(o,i(function(){return kt(t)},"WithClientStack"));return e.current||(e.current=a,s.current=n),be(()=>{e.current=a,s.current=n}),{methods:o,state:a.getState?.(),key:t.key}},"useClientResource"),qc=he(Rs),Un=0,Kr=0,Wf=i(t=>{Un++,Kr++;try{return t()}finally{Kr--,Un++}},"withBatchedStateReads"),Kf=i(t=>{let e;const s=new Map;let n=-1;const r=i(l=>{if(Kr===0)return Ho(t[l]());if(n!==Un)s.clear(),n=Un;else if(s.has(l))return s.get(l);const u=Ho(t[l]());return s.set(l,u),u},"readScopeState");class o extends tn{static{i(this,"OptionalAssistantStateProxyHandler")}get(u,d){const h=Yt(d,"OptionalAssistantState");if(h!==!1)return h;const f=d;if(!Wt(f)&&cr(t[f]))return r(f)}ownKeys(){return zr(t)}has(u,d){return!Wt(d)&&d in t}}class a extends tn{static{i(this,"ProxiedAssistantStateProxyHandler")}get(u,d){const h=Yt(d,"AssistantState");if(h!==!1)return h;if(d==="optional")return e??=new Proxy({},new o);const f=d;if(!Wt(f))return r(f)}ownKeys(){return[...zr(t),"optional"]}has(u,d){return d==="optional"||!Wt(d)&&d in t}}return new Proxy({},new a)},"createProxiedAssistantState"),Ko=new WeakMap,Jf=i(t=>{let e=Ko.get(t);return e||(e=Kf(t),Ko.set(t,e)),e},"getProxiedAssistantState"),zc=ts(null),Jo=Symbol("aui.scope-effect-unapplied"),Qf=i((t,e)=>rr(zc,t,e),"useAssistantTapContextProvider"),Pi=i(()=>{const t=Ai(zc);if(!t)throw new Error("AssistantTapContext is not available");return t},"useAssistantTapContext"),Hc=i(()=>Pi().clientRef,"useAssistantClientRef"),Wc=i((t,e,s)=>{const n=se(8),{clientRef:r}=Pi();let o;n[0]!==r||n[1]!==e||n[2]!==t?(o=i(()=>{const l=r.current;if(l===null)throw new Error("useAssistantScopeEffect ran before the client was committed. This is likely an internal bug in assistant-ui.");const u=i(()=>{const m=r.current?.[t];return m!==void 0&&cr(m)?jf(m):void 0},"identityOf");let d=Jo,h;const f=i(m=>{if(h?.(),h=void 0,d=Jo,m!==void 0){const g=e();h=typeof g=="function"?g:void 0}d=m},"apply");f(u());const p=l.subscribe(()=>{const m=u();m!==d&&f(m)});return()=>{p(),h?.()}},"t0"),n[0]=r,n[1]=e,n[2]=t,n[3]=o):o=n[3];let a;n[4]!==r||n[5]!==s||n[6]!==t?(a=[r,t,...s],n[4]=r,n[5]=s,n[6]=t,n[7]=a):a=n[7],be(o,a)},"useAssistantScopeEffect"),Ps=i(()=>{const t=se(3),{emit:e}=Pi(),s=Oi();let n;return t[0]!==s||t[1]!==e?(n=i((r,o)=>{e(r,o,s)},"t0"),t[0]=s,t[1]=e,t[2]=n):n=t[2],Jh(n)},"useAssistantEmit"),Jr=ts(void 0),Kc=i((t,e)=>{const s=Ai(Jr);return rr(Jr,t??s,e)},"useDestroySignalProvider"),Gt=i((t,e)=>{if(Array.isArray(t)!==Array.isArray(e))return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Object.is(t[n],e[n]))return!1;return!0}const s=Object.keys(t);return s.length===Object.keys(e).length&&s.every(n=>Object.hasOwn(e,n)&&Object.is(t[n],e[n]))},"shallowEqual"),Jc=Symbol("assistant-ui.derived-hook"),Yf=i(t=>{t[Jc]=!0},"markDerivedHook"),Gf=i(t=>t[Jc]===!0,"isDerivedHook"),Qo=i(t=>{},"reportListenerError"),Yo=i((t,e,s)=>{try{const n=t(e,s);n!==null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"&&Promise.resolve(n).catch(Qo)}catch(n){Qo(n)}},"invokeListener"),Xf=i(()=>{const t=new Map,e=new Set,s=new Set;return{on(n,r){const o=r;if(n==="*")return e.add(o),()=>e.delete(o);let a=t.get(n);return a||(a=new Set,t.set(n,a)),a.add(o),()=>{a.delete(o),a.size===0&&t.get(n)===a&&t.delete(n)}},emit(n,r,o){!t.has(n)&&e.size===0||queueMicrotask(()=>{const a=t.get(n);if(a)for(const l of a)Yo(l,r,o);if(e.size>0){const l={event:n,payload:r};for(const u of e)Yo(u,l,o)}})},subscribe(n){return s.add(n),()=>s.delete(n)},notifySubscribers(){Wf(()=>{for(const n of s)try{n()}catch{}})}}},"createNotificationManager"),Qc=i(()=>ye(Xf)[0],"useNotificationManager"),Yc=i(()=>{const[t]=ye(()=>({controller:new AbortController,generation:0}));return Os(()=>{const e=++t.generation;return()=>queueMicrotask(()=>{t.generation===e&&t.controller.abort()})},[t]),t.controller.signal},"useHostDestroySignal"),Qr=i(t=>{const e=qe(()=>({}),[]);return e.v!==void 0&&Gt(e.v,t)?e.v:(e.v=t,t)},"useShallowStable"),Gc=(()=>{try{return!1}catch{return!1}})(),Zf=i((t,e)=>{const s={...t},n=new Set;let r=!0;for(;r;){r=!1;for(const o of Object.values(s)){if(n.has(o.hook))continue;n.add(o.hook);const a=Ff(o.hook);if(a){a(s,e),r=!0;break}}}return s},"applyTransformScopes"),lr=i(t=>Gf(t.hook),"isDerivedElement"),em=i(t=>{if(!lr(t))return{source:"root",query:{}};const e=t.args[0];return{source:e.source,query:e.query??{}}},"metaOf"),Yr=Symbol.for("aui.event-receiver-ref"),Xc=i((t,e)=>{const s=t===ys?Pf():t,n=Object.create(s);Object.assign(n,e);let r;return Object.defineProperty(n,"optional",{get:i(()=>r??=$c(n),"get"),enumerable:!1}),n},"createClientObject"),tm=i(({notifications:t,clientRef:e})=>qe(()=>({subscribe:t.subscribe,on:i(function(s,n){if(!this)throw new Error("const { on } = useAui() is not supported. Use aui.on() instead.");const{scope:r,event:o}=Fc(s),a=s[Yr];if(r!=="*"&&!a&&qr(this[r]))throw new Error(`Scope "${r}" is not available. Use { scope: "*", event: "${o}" } to listen globally.`);const l=t.on(o,(d,h)=>{if(r==="*")return n(d);const f=((a??e).current??this)[r];if(!cr(f))return;const p=Mi(f);if(p===h[Uf(p)])return n(d)});if(r!=="*"){if(a){if(e.parent===ys)return l}else if(qr(e.parent[r]))return l}const u=e.parent.on(s,n);return()=>{l(),u()}},"on")}),[t,e]),"useClientFields"),Zc=i(t=>{const e=se(5);let s;e[0]!==t?(s=em(t),e[0]=t,e[1]=s):s=e[1];const{source:n,query:r}=s,o=Qr(r);let a;return e[2]!==n||e[3]!==o?(a={source:n,query:o},e[2]=n,e[3]=o,e[4]=a):a=e[4],Qr(a)},"useScopeMeta"),sm=i((t,e)=>{const s=se(3);let n;return s[0]!==e||s[1]!==t?(n=e?t:qc(t),s[0]=e,s[1]=t,s[2]=n):n=s[2],kt(n)},"useScopeValue"),nm=i((t,e)=>{const s=Di(),n=lr(e),r=sm(e,n),o=n?r:r.methods,a=Zc(e),l=qe(()=>Pc({name:t,...a},()=>o),[t,a,o]);return s[t]=l,l},"useScopeMount"),rm=he(nm),im=i(t=>{const e=se(2);let s;return e[0]!==t?(s=t.map(hm),e[0]=t,e[1]=s):s=e[1],ji(s)},"useScopeMounts"),el=i((t,e)=>{const s=Qr(e),n=qe(()=>({}),[]);return n.deps!==s&&(n.deps=s,n.client=t),n.client},"useCommittedClient"),tl=i(({parent:t,entries:e,clientRef:s,notifications:n})=>{const r=tm({notifications:n,clientRef:s}),o=Xc(t,r),a=qe(()=>({clientRef:s,emit:n.emit}),[s,n.emit]),l=Qf(a,i(function(){return Vf(o,i(function(){return im(e)},"WithBuildingClient"))},"WithTapContext"));return{client:el(o,[t,...l])}},"useAuiRoot"),om=i(({parent:t,entries:e,destroySignal:s})=>{const n=$e({parent:t,current:null}).current,{value:r,effects:o}=Dc(i(function(){const l=Qc(),{client:u}=Kc(s,i(function(){return tl({parent:t,entries:e,clientRef:n,notifications:l})},"useOwnedRoot"));return be(()=>t.subscribe(l.notifySubscribers),[t,l]),be(()=>l.notifySubscribers()),u},"AssistantClientHost"));return Os(()=>{n.parent=t,n.current=r},[r,t,n]),{client:r,effects:o}},"useHostedAssistantClient"),am=i(({parent:t,entries:e,destroySignal:s})=>{const n=$e({parent:t,current:null}).current,{value:r,effects:o}=Dc(i(function(){const l=Qc(),u=_f(i(function(){return Kc(s,i(function(){return tl({parent:t,entries:e,clientRef:n,notifications:l})},"useOwnedRoot"))},"AuiRoot")),d=ir(u.subscribe,()=>u.getValue().client,()=>u.getValue().client);return be(()=>{const h=i(()=>sf(()=>{n.current=u.getValue().client,l.notifySubscribers()}),"notify"),f=u.subscribe(h),p=t.subscribe(h);return()=>{f(),p()}},[u,t,l]),d},"LegacyAssistantClientHost"));return Os(()=>{n.parent=t,n.current=r},[r,t,n]),{client:r,effects:o}},"useTapRootAssistantClient"),cm=i((t,e,s,n)=>{const{get:r}=n.args[0],o=ir(t.subscribe,()=>r(t),()=>r(t)),a=Zc(n),l=qe(()=>Pc({name:s,...a},()=>o),[s,a,o]);return e[s]=l,l},"useDerivedScopeMount"),lm=i((t,e)=>{if(Gc){const[l]=ye(()=>e.map(([h])=>h).join(",")),u=e.find(([,h])=>!lr(h));if(u)throw new Error(`Scope "${u[0]}" is a root scope but this useAui mounted derived-only; remount with a new key to change scope kinds.`);const d=e.map(([h])=>h).join(",");if(d!==l)throw new Error(`A derived-only config mounted scopes [${l}] but now has [${d}]; remount with a new key to change the scope set.`)}const s=$e({parent:t,current:null}).current,n=i(function(l,u){if(!this)throw new Error("const { on } = useAui() is not supported. Use aui.on() instead.");const{scope:d,event:h}=Fc(l);if(d==="*")return t.on(l,u);const f=l[Yr];if(!f&&qr(this[d]))throw new Error(`Scope "${d}" is not available. Use { scope: "*", event: "${h}" } to listen globally.`);return t.on({scope:d,event:h,[Yr]:f??s},u)},"on"),r=Xc(t,{subscribe:t.subscribe,on:n}),o=e.map(([l,u])=>cm(t,r,l,u)),a=el(r,[t,...o]);return Os(()=>{s.parent=t,s.current=a},[a,t,s]),a},"useDerivedOnlyClient"),um=i((t,e)=>{const s=se(8);let n;s[0]!==e||s[1]!==t?(n=Object.entries(Zf(e,t)),s[0]=e,s[1]=t,s[2]=n):n=s[2];const r=n;let o;s[3]!==r?(o=i(()=>r.length===0||r.some(fm),"t1"),s[3]=r,s[4]=o):o=s[4];const[a]=ye(o);let l;return s[5]!==r||s[6]!==a?(l={entries:r,rooted:a},s[5]=r,s[6]=a,s[7]=l):l=s[7],l},"useScopeEntries"),sl=i((t,e,s,n)=>{const{entries:r,rooted:o}=um(t,e);return o?s({parent:t,entries:r,destroySignal:n}):{client:lm(t,r)}},"useConfiguredAuiImpl"),dm=i((t,e,s)=>sl(t,e,om,s),"useConfiguredAui");function Bi(t){const e=Di();if(t){const s=Yc(),{client:n,effects:r}=sl(e,t,am,s);return r&&Lf(n,r),n}return e}i(Bi,"useAui");function hm(t){const[e,s]=t;return Oe(e,rm(e,s))}i(hm,"_temp$7");function fm(t){const[,e]=t;return!lr(e)}i(fm,"_temp2$6");var mm=i(t=>{const e=se(6),s=Bi();let n;e[0]!==s?(n=Jf(s),e[0]=s,e[1]=n):n=e[1];const r=n;let o,a;e[2]!==r||e[3]!==t?(o=i(()=>t(r),"t1"),a=i(()=>t(r),"t2"),e[2]=r,e[3]=t,e[4]=o,e[5]=a):(o=e[4],a=e[5]);const l=ir(s.subscribe,o,a);if(typeof l=="object"&&l!==null&&(l===r||l===r.optional))throw new Error("You tried to return the entire AssistantState. This is not supported due to technical limitations.");return Qh(l),l},"useAuiState"),nl=i(t=>{const e=se(3),{get:s}=t,n=Bi();let r;return e[0]!==n||e[1]!==s?(r=i(()=>s(n),"t1"),e[0]=n,e[1]=s,e[2]=r):r=e[2],mm(r)},"useDerived");Yf(nl);var Tn=he(nl),rl=i(t=>{if(t.key===void 0)throw new Error("useClientLookup: Element has no key");return t.key},"getElementKey");function it(t){const e=se(12);let s;e[0]!==t?(s=t.map(bm),e[0]=t,e[1]=s):s=e[1];const n=ji(s);let r;e[2]!==t?(r=t.reduce(gm,Object.create(null)),e[2]=t,e[3]=r):r=e[3];const o=r;let a;e[4]!==n?(a=n.map(pm),e[4]=n,e[5]=a):a=e[5];const l=a;let u;e[6]!==o||e[7]!==n?(u=i(h=>{if("index"in h){if(h.index<0||h.index>=n.length)throw new Error(`useClientLookup: index ${h.index} out of bounds (length: ${n.length}) (ignore if recovered)`);return n[h.index].methods}const f=o[h.key];if(f===void 0)throw new Error(`useClientLookup: key "${h.key}" not found (ignore if recovered)`);return n[f].methods},"t3"),e[6]=o,e[7]=n,e[8]=u):u=e[8];let d;return e[9]!==l||e[10]!==u?(d={state:l,get:u},e[9]=l,e[10]=u,e[11]=d):d=e[11],d}i(it,"useClientLookup");function pm(t){return t.state}i(pm,"_temp3$3");function gm(t,e,s){return t[rl(e)]=s,t}i(gm,"_temp2$5");function bm(t){return Oe(rl(t),qc(t),t.deps)}i(bm,"_temp$6");var Xe=Symbol("skip-update"),ht=i((t,...e)=>{const s=[];for(const n of t)try{n(...e)}catch(r){s.push(r)}if(s.length===1)throw s[0];if(s.length>1){for(const n of s);throw new AggregateError(s)}},"notifySubscribers"),Bs=i(t=>{ht(t)},"runCleanups"),$i=i((t,e)=>{try{t()}catch{}throw e},"rollbackSubscription"),il=i((t,e)=>t===void 0||e===void 0?t===e:Gt(t,e),"shallowEqualOrUndefined"),Li=class{static{i(this,"BaseSubscribable")}_subscribers=new Set;subscribe(t){return this._subscribers.add(t),()=>this._subscribers.delete(t)}waitForUpdate(){return new Promise(t=>{const e=this.subscribe(()=>{e(),t()})})}_notifySubscribers(){ht(this._subscribers)}},ur=class{static{i(this,"BaseSubject")}_subscriptions=new Set;_connection;get isConnected(){return!!this._connection}notifySubscribers(t,e){if(e){dt(this._subscriptions,t,e);return}ht(this._subscriptions,t)}_updateConnection(){if(this._subscriptions.size>0){if(this._connection)return;this._connection=this._connect()}else{const t=this._connection;this._connection=void 0,t?.()}}subscribe(t){this._subscriptions.add(t);try{this._updateConnection()}catch(e){throw this._subscriptions.delete(t),e}return()=>{this._subscriptions.delete(t),this._updateConnection()}}},Ge=class extends ur{static{i(this,"ShallowMemoizeSubject")}get path(){return this.binding.path}binding;constructor(t){super(),this.binding=t;const e=t.getState();if(e===Xe)throw new Error("Entry not available in the store");this._previousState=e}_previousState;getState=i(()=>(this.isConnected||this._syncState(),this._previousState),"getState");_syncState(){const t=this.binding.getState();return t===Xe||il(t,this._previousState)?!1:(this._previousState=t,!0)}_connect(){const t=i(()=>{this._syncState()&&this.notifySubscribers()},"callback"),e=this.binding.subscribe(t);try{return this._syncState(),e}catch(s){throw $i(e,s)}}},Vi=class extends ur{static{i(this,"LazyMemoizeSubject")}get path(){return this.binding.path}binding;constructor(t){super(),this.binding=t}_previousStateDirty=!0;_previousState;getState=i(()=>{if(!this.isConnected||this._previousStateDirty){const t=this.binding.getState();t!==Xe&&(this._previousState===void 0||!il(t,this._previousState))&&(this._previousState=t),this._previousStateDirty=!1}if(this._previousState===void 0)throw new Error("Entry not available in the store");return this._previousState},"getState");_connect(){const t=i(()=>{this._previousStateDirty=!0,this.notifySubscribers()},"callback"),e=this.binding.subscribe(t);return this._previousStateDirty=!0,e}},qn=class extends ur{static{i(this,"NestedSubscriptionSubject")}get path(){return this.binding.path}binding;constructor(t){super(),this.binding=t}getState(){return this.binding.getState()}outerSubscribe(t){return this.binding.subscribe(t)}_connect(){const t=i(()=>{this.notifySubscribers()},"callback");let e=this.binding.getState(),s=e?.subscribe(t);const n=i(()=>{const o=this.binding.getState();if(o===e)return;e=o;const a=s;s=void 0;try{a?.()}finally{s=o?.subscribe(t),t()}},"onRuntimeUpdate");let r;try{r=this.outerSubscribe(n)}catch(o){throw $i(()=>s?.(),o)}return()=>Bs([()=>r(),()=>s?.()])}},ol=class extends ur{static{i(this,"EventSubscriptionSubject")}config;constructor(t){super(),this.config=t}getState(){return this.config.binding.getState()}outerSubscribe(t){return this.config.binding.subscribe(t)}_connect(){const t=`Runtime event "${this.config.event}"`,e=i(a=>{this.notifySubscribers(a,t)},"callback");let s=this.config.binding.getState(),n=s?.unstable_on(this.config.event,e);const r=i(()=>{const a=this.config.binding.getState();if(a===s)return;s=a;const l=n;n=void 0;try{l?.()}finally{n=a?.unstable_on(this.config.event,e),this.config.notifyOnRebind&&e({})}},"onRuntimeUpdate");let o;try{o=this.outerSubscribe(r)}catch(a){throw $i(()=>n?.(),a)}return()=>Bs([()=>o(),()=>n?.()])}},Ir=i(t=>{if(!t.overwrite)return t;const{overwrite:e,...s}=t;return s},"stripOverwrite"),xm=i(t=>{const e=Array.from(t).map(n=>n.getModelContext()).sort((n,r)=>(r.priority??0)-(n.priority??0)),s=Je();return e.reduce((n,r)=>{const o=r.priority??0;if(r.system&&(n.system?n.system+=`
|
|
2
2
|
|
|
3
3
|
${r.system}`:n.system=r.system),r.tools)for(const[a,l]of Object.entries(r.tools)){const u=n.tools!==void 0&&Object.hasOwn(n.tools,a)?n.tools[a]:void 0;if(u&&u!==l){const d=s[a];if(d===o){if(!l.overwrite)throw new Error(`You tried to define a tool with the name ${a}, but it already exists.`);n.tools[a]=Ir(l);continue}const h=d>o?u:l,f=d>o?l:u;n.tools[a]=Ir({...f,...h}),s[a]=Math.max(d,o);continue}n.tools||(n.tools=Je()),n.tools[a]=Ir(l),Object.hasOwn(s,a)||(s[a]=o)}return r.config&&(n.config={...r.config,...n.config}),r.callSettings&&(n.callSettings={...r.callSettings,...n.callSettings}),r.unstable_composerMetadata&&(n.unstable_composerMetadata={...r.unstable_composerMetadata,...n.unstable_composerMetadata}),n},{})},"mergeModelContexts"),al=class{static{i(this,"CompositeContextProvider")}_providers=new Map;_providerUnsubscribes=new Map;getModelContext(){return xm(new Set(this._providers.values()))}registerModelContextProvider(t){const e=Symbol();this._providers.set(e,t);let s;try{s=t.subscribe?.(()=>{this.notifySubscribers()})}catch(r){this._providers.delete(e);try{this.notifySubscribers()}catch{}throw r}this._providerUnsubscribes.set(e,s),this.notifySubscribers();let n=!1;return()=>{if(n)return;n=!0,this._providers.delete(e);const r=this._providerUnsubscribes.get(e);this._providerUnsubscribes.delete(e);let o=!1,a;const l=i(u=>{try{u()}catch(d){o||(o=!0,a=d)}},"runCleanup");if(r&&l(r),l(()=>this.notifySubscribers()),o)throw a}}_subscribers=new Set;notifySubscribers(){ht(this._subscribers)}subscribe(t){return this._subscribers.add(t),()=>{this._subscribers.delete(t)}}},vm=i((t,e)=>t.length===e.length&&t.every((s,n)=>Object.is(s,e[n])),"depsEqual"),Go=i((t,e)=>{const[s]=ye(()=>({pending:void 0}));be(()=>{const n=s.pending;s.pending=void 0;let r;return n!==void 0&&vm(n.deps,e)?r=n:(n?.cleanup?.(),r={deps:e,cleanup:t()}),()=>{s.pending=r,queueMicrotask(()=>{s.pending===r&&(s.pending=void 0,r.cleanup?.())})}},e)},"useReplaySafeEffect"),Gr=[],ym={modelName:void 0,toolNames:Gr},_m=i((t,e)=>t===e||Gt(t,e),"toolNamesEqual"),Cn=i((t,e)=>{const s=t.getModelContext(),n=s.config?.modelName,r=s.tools?Object.keys(s.tools).sort():Gr,o=r.length?r:Gr;return n===e.modelName&&_m(o,e.toolNames)?e:{modelName:n,toolNames:o}},"deriveState"),wm=i(()=>{const t=se(11);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=new al,t[0]=e):e=t[0];const s=e;let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i(()=>Cn(s,ym),"t1"),t[1]=n):n=t[1];const[r,o]=ye(n);let a,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=i(()=>(o(m=>Cn(s,m)),s.subscribe(()=>{o(m=>Cn(s,m))})),"t2"),l=[s],t[2]=a,t[3]=l):(a=t[2],l=t[3]),be(a,l);let u;t[4]!==r?(u=i(()=>Cn(s,r),"t4"),t[4]=r,t[5]=u):u=t[5];let d,h,f;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=i(()=>s.getModelContext(),"t5"),h=i(m=>s.subscribe(m),"t6"),f=i(m=>s.registerModelContextProvider(m),"t7"),t[6]=d,t[7]=h,t[8]=f):(d=t[6],h=t[7],f=t[8]);let p;return t[9]!==u?(p={getState:u,getModelContext:d,subscribe:h,register:f},t[9]=u,t[10]=p):p=t[10],p},"useModelContext"),cl=he(wm),Sm=i((t,e)=>{if(!(e.status?.type==="running"||e.status?.type==="requires-action")){const n=t.complete;return typeof n!="function"?n??null:n({args:e.args,result:e.result})}const s=t.running;return typeof s!="function"?s??null:s({args:e.args})},"resolveToolCallText"),Im=i(t=>t.display!==void 0?t.display==="standalone":t.type==="human","isStandaloneToolDisplay"),Tm=i(t=>i(function(s){return Sm(t,s)},"ToolCallTextComponent"),"makeToolCallTextComponent"),ll=i(t=>{const e=se(16),{toolkit:s,mcpApp:n}=t;let r;e[0]!==n?(r=n?[Oe("mcpApp",n)]:[],e[0]=n,e[1]=r):r=e[1];const o=ji(r)[0],[a,l]=ye(km);let u;e[2]!==o||e[3]!==a?(u={toolUIs:a,mcpApp:o},e[2]=o,e[3]=a,e[4]=u):u=e[4];const d=u,h=Hc();let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=i((v,y,T)=>{const E={render:y,renderText:T?.renderText,standalone:T?.standalone??!1};return l(C=>{const N=Je(C);return N[v]=[...N[v]??[],E],N}),()=>{l(C=>{const N=C[v]?.filter(M=>M!==E)??[],U=Je(C);return N.length>0?(U[v]=N,U):(delete U[v],U)})}},"t3"),e[5]=f):f=e[5];const p=f;let m,g;e[6]!==s?(m=i(()=>{if(!s)return;const v=[];for(const[y,T]of Object.entries(s)){const E="render"in T?T.render:void 0,C="renderText"in T?T.renderText:void 0,N=E??(C?Tm(C):void 0);N&&v.push(p(y,N,{standalone:Im(T),renderText:C}))}return()=>Bs(v)},"t4"),g=[s,p],e[6]=s,e[7]=m,e[8]=g):(m=e[7],g=e[8]),be(m,g);let b;e[9]!==h||e[10]!==s?(b=i(()=>{if(!s)return;const v=Object.entries(s).reduce(Am,Je());return h.current.modelContext().register({getModelContext:i(()=>({tools:v}),"getModelContext")})},"t6"),e[9]=h,e[10]=s,e[11]=b):b=e[11];let S;e[12]!==s?(S=[s],e[12]=s,e[13]=S):S=e[13],Wc("modelContext",b,S);let w;return e[14]!==d?(w={getState:i(()=>d,"getState"),setToolUI:p},e[14]=d,e[15]=w):w=e[15],w},"useTools"),Cm=he(ll);Vc(ll,(t,e)=>{!t.modelContext&&e.modelContext.source===null&&(t.modelContext=cl())});function km(){return Je()}i(km,"_temp$5");function Am(t,e){const[s,n]=e;if(n.type==="mcp")return t;const{display:r,render:o,renderText:a,...l}=n;return t[s]=l,t}i(Am,"_temp2$4");var ss=i(t=>ir(t.subscribe,t.getState,t.getServerSnapshot),"useSubscribable"),Em=Symbol.for("assistant-ui.silent-runtime-action"),Rm=i(t=>typeof t=="object"&&t!==null&&Em in t,"isSilentRuntimeAction"),ul=i((t,e)=>{const s=e();return s.catch(n=>{Rm(n)}),s},"handleRuntimeAction"),jm=i(t=>{const e=se(9),{runtime:s}=t,n=ss(s);let r;e[0]!==n?(r=i(()=>n,"t1"),e[0]=n,e[1]=r):r=e[1];let o,a;e[2]!==s?(o=i(()=>ul("attachment remove",s.remove),"t2"),a=i(()=>s,"t3"),e[2]=s,e[3]=o,e[4]=a):(o=e[3],a=e[4]);let l;return e[5]!==r||e[6]!==o||e[7]!==a?(l={getState:r,remove:o,__internal_getRuntime:a},e[5]=r,e[6]=o,e[7]=a,e[8]=l):l=e[8],l},"useAttachmentRuntimeClient"),dl=he(jm),Mm=i(t=>{const e=se(5),{runtime:s,index:n}=t;let r;e[0]!==n||e[1]!==s?(r=s.getAttachmentByIndex(n),e[0]=n,e[1]=s,e[2]=r):r=e[2];const o=r;let a;return e[3]!==o?(a=dl({runtime:o}),e[3]=o,e[4]=a):a=e[4],kt(a)},"useComposerAttachmentClientByIndex"),Nm=he(Mm),Dm=i(({item:t,onMove:e,onRemove:s})=>({getState:i(()=>t,"getState"),steer:i(()=>e({lane:"steer",insertAfter:null}),"steer"),move:e,remove:s}),"useQueueItemClient"),Om=he(Dm),Pm=i(t=>{const e=se(65),{threadIdRef:s,messageIdRef:n,runtime:r,isSuggestion:o}=t,a=ss(r),l=Ps(),u=$e(!1);let d,h;e[0]!==l||e[1]!==n||e[2]!==r||e[3]!==s?(d=i(()=>{const k=[],P=r.unstable_on("send",H=>{const Y=u.current;u.current=!1,l("composer.send",{threadId:s.current,...n&&{messageId:n.current},chars:H.chars,attachments:H.attachments,...Y?{suggestion:!0}:void 0})});k.push(P);const L=r.unstable_on("attachmentAdd",H=>{l("composer.attachmentAdd",{threadId:s.current,...n&&{messageId:n.current},...H.contentType?{contentType:H.contentType}:void 0})});return k.push(L),k.push(r.unstable_on("attachmentAddError",H=>{l("composer.attachmentAddError",{threadId:s.current,...n&&{messageId:n.current},...H.attachmentId&&{attachmentId:H.attachmentId},reason:H.reason,message:H.message,...H.contentType?{contentType:H.contentType}:void 0})})),()=>Bs(k)},"t1"),h=[r,l,s,n],e[0]=l,e[1]=n,e[2]=r,e[3]=s,e[4]=d,e[5]=h):(d=e[4],h=e[5]),be(d,h);let f;if(e[6]!==r||e[7]!==a.attachments){let k;e[9]!==r?(k=i((P,L)=>Oe(P.id,Nm({runtime:r,index:L}),[r,L]),"t4"),e[9]=r,e[10]=k):k=e[10],f=a.attachments.map(k),e[6]=r,e[7]=a.attachments,e[8]=f}else f=e[8];const p=it(f),m=a.queue;let g;if(e[11]!==m||e[12]!==r){let k;e[14]!==r?(k=i(P=>Oe(P.id,Om({item:P,onMove:i(L=>r.moveQueueItem(P.id,L),"onMove"),onRemove:i(()=>r.removeQueueItem(P.id),"onRemove")})),"t5"),e[14]=r,e[15]=k):k=e[15],g=m.map(k),e[11]=m,e[12]=r,e[13]=g}else g=e[13];const b=it(g),S=a.type??"thread";let w;e[16]!==p.state||e[17]!==m||e[18]!==a.attachmentAccept||e[19]!==a.canCancel||e[20]!==a.canSend||e[21]!==a.dictation||e[22]!==a.inTransit||e[23]!==a.isEditing||e[24]!==a.isEmpty||e[25]!==a.quote||e[26]!==a.role||e[27]!==a.runConfig||e[28]!==a.submission||e[29]!==a.text||e[30]!==S?(w={text:a.text,role:a.role,attachments:p.state,runConfig:a.runConfig,isEditing:a.isEditing,canCancel:a.canCancel,canSend:a.canSend,attachmentAccept:a.attachmentAccept,isEmpty:a.isEmpty,type:S,dictation:a.dictation,quote:a.quote,queue:m,submission:a.submission,inTransit:a.inTransit},e[16]=p.state,e[17]=m,e[18]=a.attachmentAccept,e[19]=a.canCancel,e[20]=a.canSend,e[21]=a.dictation,e[22]=a.inTransit,e[23]=a.isEditing,e[24]=a.isEmpty,e[25]=a.quote,e[26]=a.role,e[27]=a.runConfig,e[28]=a.submission,e[29]=a.text,e[30]=S,e[31]=w):w=e[31];const v=w;let y;e[32]!==v?(y=i(()=>v,"t7"),e[32]=v,e[33]=y):y=e[33];let T;e[34]!==o||e[35]!==r?(T=i(k=>{const P=r.getState();u.current=P.canSend&&(o?.(P.text)??!1),r.send(k)},"t8"),e[34]=o,e[35]=r,e[36]=T):T=e[36];let E;e[37]!==l||e[38]!==n||e[39]!==r||e[40]!==s?(E=i(()=>{!n&&r.getState().canCancel&&l("composer.cancel",{threadId:s.current}),r.cancel()},"t9"),e[37]=l,e[38]=n,e[39]=r,e[40]=s,e[41]=E):E=e[41];const C=r.beginEdit??Bm;let N;e[42]!==p?(N=i(k=>"id"in k?p.get({key:k.id}):p.get(k),"t11"),e[42]=p,e[43]=N):N=e[43];let U;e[44]!==b?(U=i(k=>"id"in k?b.get({key:k.id}):b.get(k),"t12"),e[44]=b,e[45]=U):U=e[45];let M;e[46]!==r?(M=i(()=>r,"t13"),e[46]=r,e[47]=M):M=e[47];let R;return e[48]!==r.addAttachment||e[49]!==r.clearAttachments||e[50]!==r.reset||e[51]!==r.setQuote||e[52]!==r.setRole||e[53]!==r.setRunConfig||e[54]!==r.setText||e[55]!==r.startDictation||e[56]!==r.stopDictation||e[57]!==C||e[58]!==N||e[59]!==U||e[60]!==M||e[61]!==y||e[62]!==T||e[63]!==E?(R={getState:y,setText:r.setText,setRole:r.setRole,setRunConfig:r.setRunConfig,addAttachment:r.addAttachment,reset:r.reset,clearAttachments:r.clearAttachments,send:T,cancel:E,beginEdit:C,startDictation:r.startDictation,stopDictation:r.stopDictation,setQuote:r.setQuote,attachment:N,queueItem:U,__internal_getRuntime:M},e[48]=r.addAttachment,e[49]=r.clearAttachments,e[50]=r.reset,e[51]=r.setQuote,e[52]=r.setRole,e[53]=r.setRunConfig,e[54]=r.setText,e[55]=r.startDictation,e[56]=r.stopDictation,e[57]=C,e[58]=N,e[59]=U,e[60]=M,e[61]=y,e[62]=T,e[63]=E,e[64]=R):R=e[64],R},"useComposerClient"),hl=he(Pm);function Bm(){throw new Error("beginEdit is not supported in this runtime")}i(Bm,"_temp$4");var fl=i(t=>({get current(){return t()}}),"liveRef"),$m=i(t=>{const e=se(17),{runtime:s}=t,n=ss(s);let r;e[0]!==n?(r=i(()=>n,"t1"),e[0]=n,e[1]=r):r=e[1];let o,a,l;e[2]!==s?(o=i(f=>s.addToolResult(f),"t2"),a=i(f=>s.resumeToolCall(f),"t3"),l=i(f=>s.respondToToolApproval(f),"t4"),e[2]=s,e[3]=o,e[4]=a,e[5]=l):(o=e[3],a=e[4],l=e[5]);let u;e[6]!==s.unstable_recordInteraction?(u=s.unstable_recordInteraction&&{unstable_recordInteraction:i(f=>s.unstable_recordInteraction(f),"unstable_recordInteraction")},e[6]=s.unstable_recordInteraction,e[7]=u):u=e[7];let d;e[8]!==s?(d=i(()=>s,"t6"),e[8]=s,e[9]=d):d=e[9];let h;return e[10]!==r||e[11]!==o||e[12]!==a||e[13]!==l||e[14]!==u||e[15]!==d?(h={getState:r,addToolResult:o,resumeToolCall:a,respondToToolApproval:l,...u,__internal_getRuntime:d},e[10]=r,e[11]=o,e[12]=a,e[13]=l,e[14]=u,e[15]=d,e[16]=h):h=e[16],h},"useMessagePartClient"),Lm=he($m),Vm=i(t=>{const e=se(5),{runtime:s,index:n}=t;let r;e[0]!==n||e[1]!==s?(r=s.getAttachmentByIndex(n),e[0]=n,e[1]=s,e[2]=r):r=e[2];const o=r;let a;return e[3]!==o?(a=dl({runtime:o}),e[3]=o,e[4]=a):a=e[4],kt(a)},"useMessageAttachmentClientByIndex"),Fm=he(Vm),Um=i(t=>{const e=se(5),{runtime:s,index:n}=t;let r;e[0]!==n||e[1]!==s?(r=s.getMessagePartByIndex(n),e[0]=n,e[1]=s,e[2]=r):r=e[2];const o=r;let a;return e[3]!==o?(a=Lm({runtime:o}),e[3]=o,e[4]=a):a=e[4],kt(a)},"useMessagePartByIndex"),qm=he(Um),zm=i(t=>{const e=se(77),{runtime:s,threadIdRef:n,threadId:r,isLast:o}=t,a=ss(s),l=Ps(),[u,d]=ye(!1),[h,f]=ye(!1);let p;e[0]!==s?(p=fl(()=>s.getState().id),e[0]=s,e[1]=p):p=e[1];const m=p,g=$e(a.status);let b;e[2]!==l||e[3]!==s||e[4]!==r?(b=i(A=>{l(A,{threadId:r,messageId:s.getState().id})},"t2"),e[2]=l,e[3]=s,e[4]=r,e[5]=b):b=e[5];const S=b;let w,v;e[6]!==l||e[7]!==a.id||e[8]!==a.status||e[9]!==r?(w=i(()=>{const A=a.status,$=g.current;g.current=A,A?.type==="incomplete"&&A.reason==="error"&&($?.type!=="incomplete"||$.reason!=="error")&&l("message.error",{threadId:r,messageId:a.id,reason:"error"})},"t3"),v=[a.status,a.id,l,r],e[6]=l,e[7]=a.id,e[8]=a.status,e[9]=r,e[10]=w,e[11]=v):(w=e[10],v=e[11]),be(w,v);let y;e[12]!==m||e[13]!==s.composer||e[14]!==n?(y=hl({runtime:s.composer,threadIdRef:n,messageIdRef:m}),e[12]=m,e[13]=s.composer,e[14]=n,e[15]=y):y=e[15];const T=Rs(y);let E;if(e[16]!==s||e[17]!==a.content){let A;e[19]!==s?(A=i(($,K)=>Oe("toolCallId"in $&&$.toolCallId!=null?`toolCallId-${$.toolCallId}`:`index-${K}`,qm({runtime:s,index:K}),[s,K]),"t7"),e[19]=s,e[20]=A):A=e[20],E=a.content.map(A),e[16]=s,e[17]=a.content,e[18]=E}else E=e[18];const C=it(E);let N;e[21]!==a.attachments?(N=a.attachments??[],e[21]=a.attachments,e[22]=N):N=e[22];let U;if(e[23]!==s||e[24]!==N){let A;e[26]!==s?(A=i(($,K)=>Oe($.id,Fm({runtime:s,index:K}),[s,K]),"t9"),e[26]=s,e[27]=A):A=e[27],U=N.map(A),e[23]=s,e[24]=N,e[25]=U}else U=e[25];const M=it(U),R=a;let k;e[28]!==o?(k=o===!1?{isLast:o}:{},e[28]=o,e[29]=k):k=e[29];let P;e[30]!==T.state||e[31]!==u||e[32]!==h||e[33]!==C.state||e[34]!==k||e[35]!==R?(P={...R,...k,parts:C.state,composer:T.state,isCopied:u,isHovering:h},e[30]=T.state,e[31]=u,e[32]=h,e[33]=C.state,e[34]=k,e[35]=R,e[36]=P):P=e[36];const L=P;let H;e[37]!==L?(H=i(()=>L,"t12"),e[37]=L,e[38]=H):H=e[38];let Y;e[39]!==T.methods?(Y=i(()=>T.methods,"t13"),e[39]=T.methods,e[40]=Y):Y=e[40];let I;e[41]!==s?(I=i(()=>s.delete(),"t14"),e[41]=s,e[42]=I):I=e[42];let V,q;e[43]!==S||e[44]!==s?(V=i(A=>(S("message.reload"),s.reload(A)),"t15"),q=i(()=>(S("message.speak"),s.speak()),"t16"),e[43]=S,e[44]=s,e[45]=V,e[46]=q):(V=e[45],q=e[46]);let G,ne;e[47]!==s?(G=i(()=>s.stopSpeaking(),"t17"),ne=i(A=>s.submitFeedback(A),"t18"),e[47]=s,e[48]=G,e[49]=ne):(G=e[48],ne=e[49]);let X;e[50]!==S||e[51]!==s?(X=i(A=>(S("message.branchSwitched"),s.switchToBranch(A)),"t19"),e[50]=S,e[51]=s,e[52]=X):X=e[52];let we;e[53]!==s?(we=i(()=>s.unstable_getCopyText(),"t20"),e[53]=s,e[54]=we):we=e[54];let pe;e[55]!==C?(pe=i(A=>"index"in A?C.get({index:A.index}):C.get({key:`toolCallId-${A.toolCallId}`}),"t21"),e[55]=C,e[56]=pe):pe=e[56];let fe;e[57]!==M?(fe=i(A=>"id"in A?M.get({key:A.id}):M.get(A),"t22"),e[57]=M,e[58]=fe):fe=e[58];let xe;e[59]!==S?(xe=i(A=>{A&&S("message.copied"),d(A)},"t23"),e[59]=S,e[60]=xe):xe=e[60];let ue;e[61]!==s?(ue=i(()=>s,"t24"),e[61]=s,e[62]=ue):ue=e[62];let j;return e[63]!==H||e[64]!==Y||e[65]!==I||e[66]!==V||e[67]!==q||e[68]!==G||e[69]!==ne||e[70]!==X||e[71]!==we||e[72]!==pe||e[73]!==fe||e[74]!==xe||e[75]!==ue?(j={getState:H,composer:Y,delete:I,reload:V,speak:q,stopSpeaking:G,submitFeedback:ne,switchToBranch:X,getCopyText:we,part:pe,attachment:fe,setIsCopied:xe,setIsHovering:f,__internal_getRuntime:ue},e[63]=H,e[64]=Y,e[65]=I,e[66]=V,e[67]=q,e[68]=G,e[69]=ne,e[70]=X,e[71]=we,e[72]=pe,e[73]=fe,e[74]=xe,e[75]=ue,e[76]=j):j=e[76],j},"useMessageClient"),Hm=he(zm),js=i(t=>t.content.filter(e=>e.type==="text").map(e=>e.text).join(`
|
|
4
4
|
|