var L=Object.defineProperty;var S=(a,e,t)=>e in a?L(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var _=(a,e,t)=>S(a,typeof e!="symbol"?e+"":e,t);import"../chunks/CWj6FrbW.js";import{t as y,c as d,r as g,s as D,p as k,L as c,f as C,a as T,i as u}from"../chunks/CId4BCie.js";import{t as m,a as p}from"../chunks/BKnx-tix.js";import{i as M,a as $,d as H}from"../chunks/BUE_WA-f.js";import{s as w}from"../chunks/CSj7lMIP.js";import{p as x}from"../chunks/DHVlVO00.js";import{E as O}from"../chunks/B_yi7rS_.js";import{B as P,i as R,f as j}from"../chunks/CLiGvckf.js";const B={name:"ClearDebugLog",kind:"HoudiniMutation",hash:"f9ed171b7931ec8be12901b7bfc04088f4f9809a247ee215b7a9cceac2aa163b",raw:`mutation ClearDebugLog($agentId: String!) {
  clearLog(agentId: $agentId) {
    agentId
  }
}
`,rootType:"Mutation",stripVariables:[],selection:{fields:{clearLog:{type:"DebugTrace",keyRaw:"clearLog(agentId: $agentId)",selection:{fields:{agentId:{type:"String",keyRaw:"agentId",visible:!0}}},visible:!0}}},pluginData:{"houdini-svelte":{}},input:{fields:{agentId:"String"},types:{},defaults:{},runtimeScalars:{}}};class E extends P{constructor(){super(...arguments);_(this,"kind","HoudiniMutation")}async mutate(t,{metadata:r,fetch:n,event:o,abortController:l,...i}={}){await R();const{context:s}=await j(this.artifact,this.artifact.name,{fetch:n,metadata:r,event:o});return await this.observer.send({variables:t,fetch:s.fetch,metadata:r,session:s.session,abortController:l,stuff:{...i}})}}class q extends E{constructor(){super({artifact:B})}}const Z=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var z=m('<p class="text-sm text-muted-foreground"> </p>'),A=m('<div class="space-y-1"><h2 class="text-2xl font-semibold tracking-tight"> </h2> <!></div>');function N(a,e){var t=A(),r=d(t),n=d(r,!0);g(r);var o=D(r,2);{var l=i=>{var s=z(),f=d(s,!0);g(s),y(()=>w(f,e.subtitle)),p(i,s)};M(o,i=>{e.subtitle&&i(l)})}g(t),y(()=>w(n,e.title)),p(a,t)}var V=m('<!> <div class="flex h-full w-full flex-col pr-4 pl-4 overflow-auto"><!></div>',1);function ee(a,e){k(e,!0);const[t,r]=$(),n=()=>H(u(o),"$DebugTrace",t);c(()=>e.data.AgentConfig);let o=c(()=>e.data.DebugTrace),l=c(()=>n().data),i=c(()=>u(l).debugLog),s=new q;async function f(){confirm("Do you really want to clear the log?")&&(await s.mutate({agentId:x.params.id}),await u(o).fetch({policy:"NetworkOnly"}))}var v=V(),b=C(v);N(b,{get title(){return x.params.id}});var h=D(b,2),I=d(h);O(I,{get events(){return u(i).events},onClear:f}),g(h),p(a,v),T(),r()}export{ee as component,Z as universal};
