signetai 0.74.1 → 0.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dashboard/_app/immutable/chunks/{3x1W0g_f.js → 1xHZGfA-.js} +1 -1
  2. package/dashboard/_app/immutable/chunks/{dPUp9rAt.js → B-bVqHDj.js} +1 -1
  3. package/dashboard/_app/immutable/chunks/{8XynCtu8.js → B1GMNgUg.js} +1 -1
  4. package/dashboard/_app/immutable/chunks/{oDrxhs-K.js → B9uvxRxZ.js} +1 -1
  5. package/dashboard/_app/immutable/chunks/{CvBiS37n.js → BAmT5qpx.js} +1 -1
  6. package/dashboard/_app/immutable/chunks/{J3ob45Rf.js → BCDhVTpp.js} +1 -1
  7. package/dashboard/_app/immutable/chunks/{p7HRdvmI.js → BIkihbkY.js} +1 -1
  8. package/dashboard/_app/immutable/chunks/{x8gxU3ku.js → BJSGs6yF.js} +1 -1
  9. package/dashboard/_app/immutable/chunks/{wCsrXq1a.js → BOIbYfZ7.js} +1 -1
  10. package/dashboard/_app/immutable/chunks/{DacFq9N9.js → BTAhHHO5.js} +1 -1
  11. package/dashboard/_app/immutable/chunks/{Bn85XmBz.js → BX5xdU5r.js} +1 -1
  12. package/dashboard/_app/immutable/chunks/{D2Bqoq9J.js → BmUABGba.js} +1 -1
  13. package/dashboard/_app/immutable/chunks/{odAbPrMg.js → BuqtMiJD.js} +1 -1
  14. package/dashboard/_app/immutable/chunks/C22FMCZq.js +1 -0
  15. package/dashboard/_app/immutable/chunks/{Dg6QtpKo.js → C7AxlEo3.js} +1 -1
  16. package/dashboard/_app/immutable/chunks/{B3W7uGVP.js → C7N7mAT1.js} +1 -1
  17. package/dashboard/_app/immutable/chunks/{B72Z8MoK.js → C9uX3Md6.js} +2 -2
  18. package/dashboard/_app/immutable/chunks/{CxejGD3d.js → CMlSq8FO.js} +1 -1
  19. package/dashboard/_app/immutable/chunks/{BJr5v2NF.js → CWFeH2QI.js} +1 -1
  20. package/dashboard/_app/immutable/chunks/{aHR_cVwV.js → CZ0Y3d0G.js} +1 -1
  21. package/dashboard/_app/immutable/chunks/{da59D-gJ.js → CkT_occz.js} +1 -1
  22. package/dashboard/_app/immutable/chunks/{BJD0MCyW.js → Cl5DS5o5.js} +1 -1
  23. package/dashboard/_app/immutable/chunks/{Bn515alG.js → CsNY9iTL.js} +1 -1
  24. package/dashboard/_app/immutable/chunks/{aQzqzTOh.js → Cuos723x.js} +1 -1
  25. package/dashboard/_app/immutable/chunks/{DFnGkbg3.js → CyLqI7gf.js} +1 -1
  26. package/dashboard/_app/immutable/chunks/{CLVo33jT.js → D1K4auXR.js} +1 -1
  27. package/dashboard/_app/immutable/chunks/{BeZRJoa2.js → D2HUnJYi.js} +1 -1
  28. package/dashboard/_app/immutable/chunks/{BoVzsJ3j.js → D4o0E_KQ.js} +1 -1
  29. package/dashboard/_app/immutable/chunks/{BgfQ4FKr.js → DJoUPWd3.js} +3 -3
  30. package/dashboard/_app/immutable/chunks/{CgXfnXj5.js → DQgCHmza.js} +1 -1
  31. package/dashboard/_app/immutable/chunks/{BWTYQrYj.js → DRW99DlB.js} +1 -1
  32. package/dashboard/_app/immutable/chunks/{JNtttNu4.js → DTd5Xup3.js} +1 -1
  33. package/dashboard/_app/immutable/chunks/{BabEcLYZ.js → DU5vuH4q.js} +1 -1
  34. package/dashboard/_app/immutable/chunks/{n-Z9ZzqS.js → DWPQenc_.js} +1 -1
  35. package/dashboard/_app/immutable/chunks/{iMB050gz.js → DXMsv7fq.js} +1 -1
  36. package/dashboard/_app/immutable/chunks/{B7ED8jaB.js → Dc0WnZiX.js} +1 -1
  37. package/dashboard/_app/immutable/chunks/{BiODVoNE.js → DdD5Lgyj.js} +1 -1
  38. package/dashboard/_app/immutable/chunks/{D9y_miCH.js → Dr3xI2Tl.js} +1 -1
  39. package/dashboard/_app/immutable/chunks/{UZkGIFVx.js → DuSNCGzP.js} +1 -1
  40. package/dashboard/_app/immutable/chunks/{xsozU46G.js → DycICGZv.js} +1 -1
  41. package/dashboard/_app/immutable/chunks/{BEXxAHH7.js → DzOsbcNC.js} +1 -1
  42. package/dashboard/_app/immutable/chunks/{zYE805Km.js → I7uuH0C0.js} +1 -1
  43. package/dashboard/_app/immutable/chunks/{apNQ7iXc.js → ISUpYJwM.js} +1 -1
  44. package/dashboard/_app/immutable/chunks/{DYvh8ZS_.js → IjxXzeQD.js} +1 -1
  45. package/dashboard/_app/immutable/chunks/{ChkgSyTn.js → SvurlP1x.js} +1 -1
  46. package/dashboard/_app/immutable/chunks/{B3bP-7Xq.js → btzFZXqN.js} +1 -1
  47. package/dashboard/_app/immutable/chunks/{Cpk4ODLj.js → yTmZ10mE.js} +1 -1
  48. package/dashboard/_app/immutable/entry/{app.Bg_VDpQC.js → app.Bzz0EdCL.js} +2 -2
  49. package/dashboard/_app/immutable/entry/start.CIGm8dFn.js +1 -0
  50. package/dashboard/_app/immutable/nodes/{1.S7H5hRXo.js → 1.C3KCw8fT.js} +1 -1
  51. package/dashboard/_app/immutable/nodes/2.Bm71DIx0.js +1 -0
  52. package/dashboard/_app/version.json +1 -1
  53. package/dashboard/index.html +6 -6
  54. package/dist/cli.js +861 -332
  55. package/package.json +1 -1
  56. package/dashboard/_app/immutable/chunks/CBqNZrnI.js +0 -1
  57. package/dashboard/_app/immutable/entry/start.DCSg9sp8.js +0 -1
  58. package/dashboard/_app/immutable/nodes/2.C3l_uRAE.js +0 -1
@@ -1 +1 @@
1
- import{p,s as c,c as l,f as d,a as i,n as m,b as f,d as h,r as u}from"./Bh3nIh1p.js";import{I as $}from"./BgfQ4FKr.js";function P(e,a){p(a,!0);let o=u(a,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];$(e,c({name:"pencil"},()=>o,{get iconNode(){return t},children:(n,_)=>{var s=l(),r=d(s);i(r,()=>a.children??m),f(n,s)},$$slots:{default:!0}})),h()}export{P};
1
+ import{p,s as c,c as l,f as d,a as i,n as m,b as f,d as h,r as u}from"./Bh3nIh1p.js";import{I as $}from"./DJoUPWd3.js";function P(e,a){p(a,!0);let o=u(a,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];$(e,c({name:"pencil"},()=>o,{get iconNode(){return t},children:(n,_)=>{var s=l(),r=d(s);i(r,()=>a.children??m),f(n,s)},$$slots:{default:!0}})),h()}export{P};
@@ -1 +1 @@
1
- import{p as n,s as d,c,f as l,a as i,n as m,b as u,d as f,r as h}from"./Bh3nIh1p.js";import{I as $}from"./BgfQ4FKr.js";function P(e,s){n(s,!0);let o=h(s,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];$(e,d({name:"plus"},()=>o,{get iconNode(){return t},children:(r,v)=>{var a=c(),p=l(a);i(p,()=>s.children??m),u(r,a)},$$slots:{default:!0}})),f()}export{P};
1
+ import{p as n,s as d,c,f as l,a as i,n as m,b as u,d as f,r as h}from"./Bh3nIh1p.js";import{I as $}from"./DJoUPWd3.js";function P(e,s){n(s,!0);let o=h(s,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];$(e,d({name:"plus"},()=>o,{get iconNode(){return t},children:(r,v)=>{var a=c(),p=l(a);i(p,()=>s.children??m),u(r,a)},$$slots:{default:!0}})),f()}export{P};
@@ -1,3 +1,3 @@
1
- import{e as Rt,p as tt,Q as Ft,i as e,v as x,j as r,k as I,t as s,l as t,y as _,B as Fe,D as v,z as f,O as mt,b as l,d as rt,u as E,o as V,aj as de,P as Ut,f as Z,A as Oe,G as pt,N as $t,ai as jt,c as Ve,h as ke,w as he,x as Ee,m as D,q as nr,s as ir,ad as Bt,F as lr}from"./Bh3nIh1p.js";import{B as Tt}from"./Bn85XmBz.js";import{aP as dr,S as cr,J as vr,K as ur,N as fr,L as gr,aQ as mr,t as zt,aR as pr,f as hr,n as xr,E as br,B as gt}from"./BgfQ4FKr.js";import{S as Wt}from"./Dg6QtpKo.js";import{P as _r,a as yr,b as wr}from"./Cpk4ODLj.js";import{w as Pt,s as Yt}from"./pP_VsnEc.js";import{P as kr}from"./Bfse3fCo.js";import{T as Sr}from"./CjrslgAi.js";const Te={harness:"#4dabf7",daemon:"#ff922b",pipeline:"#da77f2",db:"#ffd43b",search:"#da77f2",files:"#20c997",configs:"#4dabf7",llm:"#fcc419"},Ge={harness:"AI Harness",daemon:"Signet Daemon",pipeline:"Pipeline Workers",db:"memories.db",search:"Hybrid Recall",files:"~/.agents/",configs:"Harness Configs",llm:"LLM Provider"},Cr={harness:{x:20,y:20,w:240,h:120,label:Ge.harness,color:Te.harness},daemon:{x:300,y:20,w:340,h:280,label:Ge.daemon,color:Te.daemon},pipeline:{x:20,y:360,w:620,h:140,label:Ge.pipeline,color:Te.pipeline},db:{x:680,y:160,w:200,h:200,label:Ge.db,color:Te.db},search:{x:920,y:160,w:200,h:140,label:Ge.search,color:Te.search},files:{x:680,y:400,w:200,h:100,label:Ge.files,color:Te.files},configs:{x:920,y:400,w:200,h:100,label:Ge.configs,color:Te.configs},llm:{x:680,y:540,w:200,h:80,label:Ge.llm,color:Te.llm}},at=[{id:"harness",label:"AI Client",group:"harness",x:40,y:55,w:200,h:50,logCategories:["hooks","session-tracker"],icon:"terminal",description:"Claude Code / OpenCode / OpenClaw — sends session hooks"},{id:"hooks",label:"Hook Handlers",group:"daemon",x:320,y:50,w:140,h:40,logCategories:["hooks"],icon:"webhook",description:"Session lifecycle hooks (start, submit, remember, recall, end)"},{id:"mutex",label:"Session Mutex",group:"daemon",x:320,y:110,w:140,h:40,logCategories:["session-tracker"],icon:"lock",description:"Plugin vs legacy runtime path enforcement"},{id:"queue",label:"Job Queues",group:"daemon",x:320,y:170,w:140,h:40,logCategories:["pipeline"],diagnosticDomain:"queue",icon:"layers",description:"memory_jobs + summary_jobs durable queues"},{id:"watcher",label:"File Watcher",group:"daemon",x:490,y:110,w:130,h:40,logCategories:["watcher"],icon:"eye",description:"Chokidar file change detection on ~/.agents/"},{id:"sync",label:"Harness Sync",group:"daemon",x:490,y:170,w:130,h:40,logCategories:["sync"],diagnosticDomain:"connector",icon:"refresh-cw",description:"Generate CLAUDE.md, AGENTS.md from identity files"},{id:"extraction",label:"Extraction",group:"pipeline",x:40,y:395,w:110,h:40,logCategories:["pipeline"],diagnosticDomain:"queue",icon:"cpu",description:"LLM extracts facts + entities (2s poll)"},{id:"summary",label:"Summary",group:"pipeline",x:165,y:395,w:100,h:40,logCategories:["summary-worker"],icon:"file-text",description:"Session-end transcript summarizer (5s poll)"},{id:"document",label:"Document",group:"pipeline",x:280,y:395,w:100,h:40,logCategories:["document-worker"],icon:"file-plus",description:"Chunk + embed documents (10s poll)"},{id:"retention",label:"Retention",group:"pipeline",x:395,y:395,w:100,h:40,logCategories:["retention"],diagnosticDomain:"mutation",icon:"trash-2",description:"Purge expired data (6h interval)"},{id:"maintenance",label:"Maintenance",group:"pipeline",x:510,y:395,w:110,h:40,logCategories:["maintenance"],icon:"wrench",description:"Self-repair + diagnostics (30min interval)"},{id:"database",label:"SQLite",group:"db",x:710,y:220,w:140,h:80,logCategories:["memory","embedding"],diagnosticDomain:"storage",icon:"database",description:"memories, embeddings, entities, relations, history"},{id:"search",label:"Hybrid Recall",group:"search",x:940,y:200,w:160,h:60,logCategories:["memory"],diagnosticDomain:"index",icon:"search",description:"BM25 + vector similarity + graph boost"},{id:"files",label:"Identity Files",group:"files",x:710,y:430,w:140,h:40,logCategories:["sync"],icon:"folder",description:"AGENTS.md, SOUL.md, IDENTITY.md, USER.md, MEMORY.md"},{id:"configs",label:"CLAUDE.md",group:"configs",x:950,y:430,w:140,h:40,logCategories:["harness"],icon:"file-code",description:"Generated harness config files"},{id:"llm",label:"LLM Provider",group:"llm",x:710,y:560,w:140,h:40,logCategories:["llm"],diagnosticDomain:"provider",icon:"brain",description:"Ollama qwen3:4b (or configured provider)"}],qt=new Map(at.map(g=>[g.id,g])),Pr=[{from:"harness",to:"hooks",label:"POST"},{from:"hooks",to:"mutex"},{from:"hooks",to:"queue",label:"enqueue"},{from:"queue",to:"extraction"},{from:"queue",to:"summary"},{from:"queue",to:"document"},{from:"extraction",to:"database",label:"write"},{from:"summary",to:"database"},{from:"document",to:"database"},{from:"retention",to:"database"},{from:"maintenance",to:"database"},{from:"extraction",to:"llm"},{from:"summary",to:"llm"},{from:"database",to:"search"},{from:"search",to:"harness",dashed:!0,label:"recall"},{from:"watcher",to:"sync"},{from:"files",to:"watcher"},{from:"sync",to:"configs"},{from:"files",to:"sync"},{from:"summary",to:"files",label:".md"},{from:"configs",to:"harness",dashed:!0,label:"next session"}];function $r(){return{health:"unknown",score:0,lastActivity:null,pulseCount:0,queueDepth:0,processingRate:0,errorCount:0,recentLogs:[],metrics:{}}}const Gt=new Map;for(const g of at)for(const o of g.logCategories){const i=Gt.get(o);i?i.push(g.id):Gt.set(o,[g.id])}const Xt=20;function Tr(){const g={};for(const o of at)g[o.id]=$r();return g}const Vt=50,S=Rt({nodes:Tr(),mode:"unknown",connected:!1,lastPoll:null,selectedNodeId:null,feed:[]});let pe=null;function Zt(){pe&&(pe.close(),pe=null);const g="";pe=new EventSource(`${g}/api/logs/stream`),pe.onopen=()=>{S.connected=!0},pe.onmessage=o=>{try{const i=JSON.parse(o.data);if(i.type==="connected"){S.connected=!0;return}const d=[...S.feed,i];S.feed=d.length>Vt?d.slice(-Vt):d;const c=Gt.get(i.category);if(!c)return;for(const N of c){const M=S.nodes[N];if(!M)continue;M.pulseCount+=1,M.lastActivity=i.timestamp;const A=[...M.recentLogs,i];M.recentLogs=A.length>Xt?A.slice(-Xt):A,i.level==="error"&&(M.errorCount+=1)}}catch{}},pe.onerror=()=>{S.connected=!1,pe?.close(),pe=null,setTimeout(()=>{pe||Zt()},3e3)}}function Er(){S.connected=!1,pe?.close(),pe=null}let ht=null;function Mr(g){return g>=.8?"healthy":g>=.5?"degraded":g>0?"unhealthy":"unknown"}function Dr(g){for(const o of at){if(!o.diagnosticDomain)continue;const i=g[o.diagnosticDomain];if(!i)continue;const d=S.nodes[o.id];if(!d)continue;const c=typeof i.score=="number"?i.score:0;d.score=c,d.health=Mr(c),d.metrics=i}}function Lr(g){const o=S.nodes.queue;if(o){const c=g.memory,N=g.summary;o.queueDepth=c.pending+c.leased+N.pending+N.leased,o.metrics={memory:c,summary:N}}const i=S.nodes.extraction;i&&(i.queueDepth=g.memory.pending);const d=S.nodes.summary;d&&(d.queueDepth=g.summary.pending)}async function Qt(){try{const g=await dr();if(!g)return;if(S.mode=g.mode,S.lastPoll=new Date().toISOString(),g.diagnostics&&Dr(g.diagnostics),g.queues&&Lr(g.queues),g.workers)for(const[o,i]of Object.entries(g.workers)){const d=S.nodes[o];d&&i.running&&d.health==="unknown"&&(d.health="healthy",d.score=1)}if(g.errorSummary)for(const[o,i]of Object.entries(g.errorSummary)){const d=o==="extraction"||o==="decision"?"extraction":o==="embedding"||o==="mutation"?"database":o==="connector"?"sync":null;if(d){const c=S.nodes[d];c&&(c.errorCount=i)}}}catch{}}function Or(g=5e3){ht||(Qt(),ht=setInterval(Qt,g))}function Nr(){ht&&(clearInterval(ht),ht=null)}function Jt(g){S.selectedNodeId=g}var Ar=de('<rect class="glow-bg svelte-1tib701" x="-6" y="-6" rx="10" ry="10" opacity="0.12"></rect>'),Ir=de('<rect class="pulse-ring svelte-1tib701" x="-4" y="-4" rx="10" ry="10" fill="none"></rect>'),Rr=de('<rect class="flash-overlay svelte-1tib701" rx="6" ry="6"></rect>'),jr=de('<animate attributeName="opacity" values="1;0.4;1" dur="1.5s" repeatCount="indefinite" class="svelte-1tib701"></animate>'),qr=de('<g class="svelte-1tib701"><rect x="-12" y="-7" width="24" height="14" rx="7" opacity="0.95" class="svelte-1tib701"></rect><text x="0" y="1" text-anchor="middle" dominant-baseline="middle" fill="#fff" font-size="9" font-weight="600" font-family="var(--font-mono)" class="svelte-1tib701"> </text></g>'),Gr=de('<g transform="translate(8, -6)" class="svelte-1tib701"><rect x="-12" y="-7" width="24" height="14" rx="7" fill="#ef4444" opacity="0.95" class="svelte-1tib701"></rect><text x="0" y="1" text-anchor="middle" dominant-baseline="middle" fill="#fff" font-size="9" font-weight="600" font-family="var(--font-mono)" class="svelte-1tib701"> </text></g>'),Fr=de('<g style="cursor: pointer"><!><!><rect class="node-rect svelte-1tib701" rx="6" ry="6"></rect><!><circle cx="10" class="svelte-1tib701"><!></circle><text text-anchor="middle" dominant-baseline="middle" font-size="11" font-family="var(--font-mono)" class="svelte-1tib701"> </text><!><!></g>');function Hr(g,o){tt(o,!0);let i=E(()=>Te[o.def.group]);const d={healthy:"#4ade80",degraded:"#fbbf24",unhealthy:"#f87171",unknown:"#6b6b76"};let c=E(()=>d[o.nodeState.health]),N=E(()=>o.nodeState.health==="unknown"?e(i)+"88":e(c)),M=V(0),A=V(!1),y=V(!1),C=null;Ft(()=>{if(o.nodeState.pulseCount>e(M)){x(M,o.nodeState.pulseCount,!0),x(A,!0);const h=setTimeout(()=>{x(A,!1)},1200);return x(y,!0),C&&clearTimeout(C),C=setTimeout(()=>{x(y,!1)},3e3),()=>{clearTimeout(h),C&&clearTimeout(C)}}});function ee(){o.onselectnode(o.def.id)}var P=Fr();let $;var L=r(P);{var H=h=>{var p=Ar();_(()=>{v(p,"width",o.def.w+12),v(p,"height",o.def.h+12),v(p,"fill",e(i))}),l(h,p)};I(L,h=>{e(y)&&h(H)})}var B=s(L);{var Q=h=>{var p=Ir();_(()=>{v(p,"width",o.def.w+8),v(p,"height",o.def.h+8),v(p,"stroke",e(i))}),l(h,p)};I(B,h=>{e(A)&&h(Q)})}var b=s(B),w=s(b);{var T=h=>{var p=Rr();_(()=>{v(p,"width",o.def.w),v(p,"height",o.def.h),v(p,"fill",e(i))}),l(h,p)};I(w,h=>{e(A)&&h(T)})}var O=s(w),J=r(O);{var F=h=>{var p=jr();l(h,p)};I(J,h=>{e(y)&&h(F)})}t(O);var R=s(O),u=r(R,!0);t(R);var k=s(R);{var q=h=>{var p=qr(),Y=r(p),te=s(Y),Ne=r(te,!0);t(te),t(p),_(()=>{v(p,"transform",`translate(${o.def.w-8}, -6)`),v(Y,"fill",e(i)),f(Ne,o.nodeState.queueDepth)}),l(h,p)};I(k,h=>{o.nodeState.queueDepth>0&&h(q)})}var j=s(k);{var K=h=>{var p=Gr(),Y=s(r(p)),te=r(Y,!0);t(Y),t(p),_(()=>f(te,o.nodeState.errorCount)),l(h,p)};I(j,h=>{o.nodeState.errorCount>0&&h(K)})}t(P),_(()=>{$=Fe(P,0,"pipeline-node svelte-1tib701",null,$,{"pipeline-node--selected":o.selected,"pipeline-node--active":e(y)}),v(P,"transform",`translate(${o.def.x??""}, ${o.def.y??""})`),v(b,"width",o.def.w),v(b,"height",o.def.h),v(b,"fill",e(y)?e(i)+"18":"var(--sig-surface-raised)"),v(b,"stroke",e(y)?e(i):e(N)),v(b,"stroke-width",o.selected?2.5:e(y)?1.5:1),v(O,"cy",o.def.h/2),v(O,"r",e(y)?4:3),v(O,"fill",e(y)?e(i):e(c)),v(O,"opacity",e(y)?1:.7),v(R,"x",o.def.w/2),v(R,"y",o.def.h/2+1),v(R,"fill",e(y)?e(i):"var(--sig-text-bright)"),v(R,"font-weight",e(y)?"600":"400"),f(u,o.def.label)}),mt("click",P,ee),l(g,P),rt()}Ut(["click"]);var Br=de('<path fill="none" stroke-width="4" opacity="0.15" class="edge-glow svelte-kl8ook"></path>'),zr=de('<circle r="2" opacity="0.6" class="svelte-kl8ook"><animateMotion repeatCount="indefinite" begin="0.5s" class="svelte-kl8ook"></animateMotion></circle>'),Yr=de('<circle class="svelte-kl8ook"><animateMotion repeatCount="indefinite" class="svelte-kl8ook"></animateMotion></circle><!>',1),Xr=de('<text text-anchor="middle" font-size="9" font-family="var(--font-mono)" class="svelte-kl8ook"> </text>'),Vr=de('<g class="pipeline-edge svelte-kl8ook"><path fill="none"></path><!><!><!></g>');function Qr(g,o){tt(o,!0);let i=E(()=>qt.get(o.edge.from)),d=E(()=>qt.get(o.edge.to)),c=E(()=>e(i)?Te[e(i).group]:"#6b6b76"),N=E(()=>{if(!e(i)||!e(d))return"";const b=e(i).x+e(i).w/2,w=e(i).y+e(i).h/2,T=e(d).x+e(d).w/2,O=e(d).y+e(d).h/2,J=(b+T)/2,F=(w+O)/2,R=Math.abs(T-b),u=Math.abs(O-w);return R>u?`M ${b} ${w} Q ${J} ${w}, ${J} ${F} Q ${J} ${O}, ${T} ${O}`:`M ${b} ${w} Q ${b} ${F}, ${J} ${F} Q ${T} ${F}, ${T} ${O}`}),M=E(()=>!e(i)||!e(d)?{x:0,y:0}:{x:(e(i).x+e(i).w/2+e(d).x+e(d).w/2)/2,y:(e(i).y+e(i).h/2+e(d).y+e(d).h/2)/2-8}),A=E(()=>o.active?"1s":"3s");var y=Vr(),C=r(y);let ee;var P=s(C);{var $=b=>{var w=Br();_(()=>{v(w,"d",e(N)),v(w,"stroke",e(c))}),l(b,w)};I(P,b=>{o.active&&!o.edge.dashed&&b($)})}var L=s(P);{var H=b=>{var w=Yr(),T=Z(w),O=r(T);t(T);var J=s(T);{var F=R=>{var u=zr(),k=r(u);t(u),_(()=>{v(u,"fill",e(c)),v(k,"dur",e(A)),v(k,"path",e(N))}),l(R,u)};I(J,R=>{o.active&&R(F)})}_(()=>{v(T,"r",o.active?3.5:2),v(T,"fill",o.active?e(c):"var(--sig-border)"),v(T,"opacity",o.active?1:.3),v(O,"dur",e(A)),v(O,"path",e(N))}),l(b,w)};I(L,b=>{o.edge.dashed||b(H)})}var B=s(L);{var Q=b=>{var w=Xr(),T=r(w,!0);t(w),_(()=>{v(w,"x",e(M).x),v(w,"y",e(M).y),v(w,"fill",o.active?e(c):"var(--sig-text-muted)"),v(w,"opacity",o.active?.9:.45),f(T,o.edge.label)}),l(b,w)};I(B,b=>{o.edge.label&&b(Q)})}t(y),_(()=>{v(C,"d",e(N)),v(C,"stroke",o.active?e(c):"var(--sig-border)"),v(C,"stroke-width",o.active?1.5:.8),v(C,"stroke-dasharray",o.edge.dashed?"6 4":"none"),v(C,"opacity",o.active?.8:.25),ee=Fe(C,0,"svelte-kl8ook",null,ee,{"edge-active":o.active})}),l(g,y),rt()}var Ur=de('<g><rect rx="8" ry="8" fill-opacity="0.06" stroke-opacity="0.25" stroke-width="1" stroke-dasharray="4 3"></rect><text font-size="9" font-family="var(--font-mono)" opacity="0.6" letter-spacing="0.08em"> </text></g>'),Wr=de('<svg viewBox="0 0 1160 650" preserveAspectRatio="xMidYMid meet" class="w-full h-full select-none" xmlns="http://www.w3.org/2000/svg" role="application" aria-label="Pipeline graph. Use mouse wheel to zoom, drag background to pan, double-click to reset."><defs><filter id="glow" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="3" result="blur"></feGaussianBlur><feMerge><feMergeNode in="blur"></feMergeNode><feMergeNode in="SourceGraphic"></feMergeNode></feMerge></filter><marker id="arrow" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="var(--sig-border-strong)"></path></marker></defs><g><!><!><!></g></svg>');function Zr(g,o){tt(o,!0);const i=Object.entries(Cr),d=.7,c=2.4,N=.12;let M=V(1),A=V(0),y=V(0),C=V(!1),ee=V(0),P=V(0);function $(u){const k=S.nodes[u];return k?.lastActivity?Date.now()-new Date(k.lastActivity).getTime()<5e3:!1}function L(u){return Math.min(c,Math.max(d,u))}function H(){x(M,1),x(A,0),x(y,0)}function B(u){u.preventDefault();const k=u.currentTarget;if(!(k instanceof SVGSVGElement))return;const q=k.getBoundingClientRect(),j=u.clientX-q.left,K=u.clientY-q.top,h=u.deltaY<0?1:-1,p=L(e(M)+h*N);if(p===e(M))return;const Y=(j-e(A))/e(M),te=(K-e(y))/e(M);x(M,p,!0),x(A,j-Y*p),x(y,K-te*p)}function Q(u){if(u.button!==0||u.target!==u.currentTarget)return;const k=u.currentTarget;k instanceof SVGSVGElement&&k.setPointerCapture(u.pointerId),x(C,!0),x(ee,u.clientX,!0),x(P,u.clientY,!0)}function b(u){if(!e(C))return;const k=u.clientX-e(ee),q=u.clientY-e(P);x(ee,u.clientX,!0),x(P,u.clientY,!0),x(A,e(A)+k),x(y,e(y)+q)}function w(u){if(!e(C))return;const k=u.currentTarget;k instanceof SVGSVGElement&&k.releasePointerCapture(u.pointerId),x(C,!1)}var T=Wr(),O=s(r(T)),J=r(O);Oe(J,17,()=>i,pt,(u,k)=>{var q=E(()=>jt(e(k),2));let j=()=>e(q)[1];var K=Ur(),h=r(K),p=s(h),Y=r(p,!0);t(p),t(K),_(te=>{v(h,"x",j().x),v(h,"y",j().y),v(h,"width",j().w),v(h,"height",j().h),v(h,"fill",j().color),v(h,"stroke",j().color),v(p,"x",j().x+8),v(p,"y",j().y+14),v(p,"fill",j().color),f(Y,te)},[()=>j().label.toUpperCase()]),l(u,K)});var F=s(J);Oe(F,17,()=>Pr,u=>u.from+"-"+u.to,(u,k)=>{{let q=E(()=>$(e(k).from));Qr(u,{get edge(){return e(k)},get active(){return e(q)}})}});var R=s(F);Oe(R,17,()=>at,u=>u.id,(u,k)=>{{let q=E(()=>S.selectedNodeId===e(k).id);Hr(u,{get def(){return e(k)},get nodeState(){return S.nodes[e(k).id]},get selected(){return e(q)},get onselectnode(){return o.onselectnode}})}}),t(O),t(T),_(()=>v(O,"transform",`translate(${e(A)} ${e(y)}) scale(${e(M)})`)),$t("wheel",T,B),mt("pointerdown",T,Q),mt("pointermove",T,b),mt("pointerup",T,w),$t("pointercancel",T,w),$t("pointerleave",T,w),mt("dblclick",T,H),l(g,T),rt()}Ut(["pointerdown","pointermove","pointerup","dblclick"]);var Jr=D(" <!>",1),Kr=D("<!> <!>",1),ea=D('<div class="flex justify-between px-2"><span class="text-[var(--sig-text-muted)]"> </span> <span class="text-[var(--sig-text-bright)]"> </span></div>'),ta=D('<div class="text-[var(--sig-text-muted)] mt-1"> </div> <!>',1),ra=D('<div class="flex justify-between"><span class="text-[var(--sig-text-muted)]"> </span> <span class="text-[var(--sig-text-bright)]"> </span></div>'),aa=D('<section><h4 class="text-[10px] uppercase tracking-[0.1em] text-[var(--sig-text-muted)] mb-2 font-[family-name:var(--font-display)]">Queue Details</h4> <div class="space-y-1 text-[11px] font-[family-name:var(--font-mono)]"></div></section>'),oa=D('<section><h4 class="text-[10px] uppercase tracking-[0.1em] text-[var(--sig-text-muted)] mb-1 font-[family-name:var(--font-display)]">Last Activity</h4> <span class="text-[11px] text-[var(--sig-text)] font-[family-name:var(--font-mono)]"> </span></section>'),sa=D('<div class="flex gap-2 py-1 px-1 text-[10px] font-[family-name:var(--font-mono)] hover:bg-[var(--sig-surface-raised)] rounded"><span class="text-[var(--sig-text-muted)] shrink-0 w-[52px]"> </span> <span> </span> <span class="text-[var(--sig-text)] truncate"> </span></div>'),na=D('<div class="text-[10px] text-[var(--sig-text-muted)] italic py-2">No recent activity</div>'),ia=D('<!> <div class="mt-4 space-y-4 overflow-y-auto pr-2" style="max-height: calc(100vh - 140px);"><section><h4 class="text-[10px] uppercase tracking-[0.1em] text-[var(--sig-text-muted)] mb-2 font-[family-name:var(--font-display)]">Metrics</h4> <div class="grid grid-cols-3 gap-2"><div class="p-2 rounded bg-[var(--sig-surface)] border border-[var(--sig-border)]"><div class="text-[9px] text-[var(--sig-text-muted)] uppercase">Score</div> <div class="text-[15px] text-[var(--sig-text-bright)] font-[family-name:var(--font-mono)]"> </div></div> <div class="p-2 rounded bg-[var(--sig-surface)] border border-[var(--sig-border)]"><div class="text-[9px] text-[var(--sig-text-muted)] uppercase">Queue</div> <div class="text-[15px] text-[var(--sig-text-bright)] font-[family-name:var(--font-mono)]"> </div></div> <div class="p-2 rounded bg-[var(--sig-surface)] border border-[var(--sig-border)]"><div class="text-[9px] text-[var(--sig-text-muted)] uppercase">Errors</div> <div> </div></div></div></section> <!> <!> <section><h4 class="text-[10px] uppercase tracking-[0.1em] text-[var(--sig-text-muted)] mb-2 font-[family-name:var(--font-display)]"> </h4> <div class="space-y-px max-h-[300px] overflow-y-auto"><!> <!></div></section></div>',1);function la(g,o){tt(o,!0);let i=E(()=>S.selectedNodeId),d=E(()=>e(i)?qt.get(e(i))??null:null),c=E(()=>e(i)?S.nodes[e(i)]??null:null),N=E(()=>e(i)!==null);function M($){$||Jt(null)}function A($){try{return new Date($).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return $}}function y($){switch($){case"error":return"text-[#e06c75]";case"warn":return"text-[#e5c07b]";case"debug":return"text-[#6b6b76]";default:return"text-[var(--sig-text)]"}}let C=E(()=>{if(!e(c)?.metrics)return null;const $=e(c).metrics;return $.memory||$.summary||typeof $.depth=="number"?$:null});var ee=Ve(),P=Z(ee);ke(P,()=>fr,($,L)=>{L($,{get open(){return e(N)},onOpenChange:M,children:(H,B)=>{var Q=Ve(),b=Z(Q);ke(b,()=>cr,(w,T)=>{T(w,{side:"right",class:"w-[380px] bg-[var(--sig-bg)] border-l border-[var(--sig-border)]",children:(O,J)=>{var F=Ve(),R=Z(F);{var u=k=>{var q=ia(),j=Z(q);ke(j,()=>vr,(G,X)=>{X(G,{children:(re,ge)=>{var me=Kr(),ce=Z(me);ke(ce,()=>ur,(se,be)=>{be(se,{class:"flex items-center gap-2 font-[family-name:var(--font-display)] text-[var(--sig-text-bright)]",children:(Me,Be)=>{he();var ae=Jr(),ve=Z(ae),ne=s(ve);{let _e=E(()=>e(c).health==="healthy"?"border-[#4a7a5e] text-[#4a7a5e]":e(c).health==="degraded"?"border-[#b8860b] text-[#b8860b]":e(c).health==="unhealthy"?"border-[#8a4a48] text-[#8a4a48]":"border-[var(--sig-border)] text-[var(--sig-text-muted)]");Tt(ne,{variant:"outline",get class(){return`text-[9px] px-1.5 py-0 font-[family-name:var(--font-mono)]
1
+ import{e as Rt,p as tt,Q as Ft,i as e,v as x,j as r,k as I,t as s,l as t,y as _,B as Fe,D as v,z as f,O as mt,b as l,d as rt,u as E,o as V,aj as de,P as Ut,f as Z,A as Oe,G as pt,N as $t,ai as jt,c as Ve,h as ke,w as he,x as Ee,m as D,q as nr,s as ir,ad as Bt,F as lr}from"./Bh3nIh1p.js";import{B as Tt}from"./BX5xdU5r.js";import{aP as dr,S as cr,J as vr,K as ur,N as fr,L as gr,aQ as mr,t as zt,aR as pr,f as hr,n as xr,E as br,B as gt}from"./DJoUPWd3.js";import{S as Wt}from"./C7AxlEo3.js";import{P as _r,a as yr,b as wr}from"./yTmZ10mE.js";import{w as Pt,s as Yt}from"./pP_VsnEc.js";import{P as kr}from"./Bfse3fCo.js";import{T as Sr}from"./CjrslgAi.js";const Te={harness:"#4dabf7",daemon:"#ff922b",pipeline:"#da77f2",db:"#ffd43b",search:"#da77f2",files:"#20c997",configs:"#4dabf7",llm:"#fcc419"},Ge={harness:"AI Harness",daemon:"Signet Daemon",pipeline:"Pipeline Workers",db:"memories.db",search:"Hybrid Recall",files:"~/.agents/",configs:"Harness Configs",llm:"LLM Provider"},Cr={harness:{x:20,y:20,w:240,h:120,label:Ge.harness,color:Te.harness},daemon:{x:300,y:20,w:340,h:280,label:Ge.daemon,color:Te.daemon},pipeline:{x:20,y:360,w:620,h:140,label:Ge.pipeline,color:Te.pipeline},db:{x:680,y:160,w:200,h:200,label:Ge.db,color:Te.db},search:{x:920,y:160,w:200,h:140,label:Ge.search,color:Te.search},files:{x:680,y:400,w:200,h:100,label:Ge.files,color:Te.files},configs:{x:920,y:400,w:200,h:100,label:Ge.configs,color:Te.configs},llm:{x:680,y:540,w:200,h:80,label:Ge.llm,color:Te.llm}},at=[{id:"harness",label:"AI Client",group:"harness",x:40,y:55,w:200,h:50,logCategories:["hooks","session-tracker"],icon:"terminal",description:"Claude Code / OpenCode / OpenClaw — sends session hooks"},{id:"hooks",label:"Hook Handlers",group:"daemon",x:320,y:50,w:140,h:40,logCategories:["hooks"],icon:"webhook",description:"Session lifecycle hooks (start, submit, remember, recall, end)"},{id:"mutex",label:"Session Mutex",group:"daemon",x:320,y:110,w:140,h:40,logCategories:["session-tracker"],icon:"lock",description:"Plugin vs legacy runtime path enforcement"},{id:"queue",label:"Job Queues",group:"daemon",x:320,y:170,w:140,h:40,logCategories:["pipeline"],diagnosticDomain:"queue",icon:"layers",description:"memory_jobs + summary_jobs durable queues"},{id:"watcher",label:"File Watcher",group:"daemon",x:490,y:110,w:130,h:40,logCategories:["watcher"],icon:"eye",description:"Chokidar file change detection on ~/.agents/"},{id:"sync",label:"Harness Sync",group:"daemon",x:490,y:170,w:130,h:40,logCategories:["sync"],diagnosticDomain:"connector",icon:"refresh-cw",description:"Generate CLAUDE.md, AGENTS.md from identity files"},{id:"extraction",label:"Extraction",group:"pipeline",x:40,y:395,w:110,h:40,logCategories:["pipeline"],diagnosticDomain:"queue",icon:"cpu",description:"LLM extracts facts + entities (2s poll)"},{id:"summary",label:"Summary",group:"pipeline",x:165,y:395,w:100,h:40,logCategories:["summary-worker"],icon:"file-text",description:"Session-end transcript summarizer (5s poll)"},{id:"document",label:"Document",group:"pipeline",x:280,y:395,w:100,h:40,logCategories:["document-worker"],icon:"file-plus",description:"Chunk + embed documents (10s poll)"},{id:"retention",label:"Retention",group:"pipeline",x:395,y:395,w:100,h:40,logCategories:["retention"],diagnosticDomain:"mutation",icon:"trash-2",description:"Purge expired data (6h interval)"},{id:"maintenance",label:"Maintenance",group:"pipeline",x:510,y:395,w:110,h:40,logCategories:["maintenance"],icon:"wrench",description:"Self-repair + diagnostics (30min interval)"},{id:"database",label:"SQLite",group:"db",x:710,y:220,w:140,h:80,logCategories:["memory","embedding"],diagnosticDomain:"storage",icon:"database",description:"memories, embeddings, entities, relations, history"},{id:"search",label:"Hybrid Recall",group:"search",x:940,y:200,w:160,h:60,logCategories:["memory"],diagnosticDomain:"index",icon:"search",description:"BM25 + vector similarity + graph boost"},{id:"files",label:"Identity Files",group:"files",x:710,y:430,w:140,h:40,logCategories:["sync"],icon:"folder",description:"AGENTS.md, SOUL.md, IDENTITY.md, USER.md, MEMORY.md"},{id:"configs",label:"CLAUDE.md",group:"configs",x:950,y:430,w:140,h:40,logCategories:["harness"],icon:"file-code",description:"Generated harness config files"},{id:"llm",label:"LLM Provider",group:"llm",x:710,y:560,w:140,h:40,logCategories:["llm"],diagnosticDomain:"provider",icon:"brain",description:"Ollama qwen3:4b (or configured provider)"}],qt=new Map(at.map(g=>[g.id,g])),Pr=[{from:"harness",to:"hooks",label:"POST"},{from:"hooks",to:"mutex"},{from:"hooks",to:"queue",label:"enqueue"},{from:"queue",to:"extraction"},{from:"queue",to:"summary"},{from:"queue",to:"document"},{from:"extraction",to:"database",label:"write"},{from:"summary",to:"database"},{from:"document",to:"database"},{from:"retention",to:"database"},{from:"maintenance",to:"database"},{from:"extraction",to:"llm"},{from:"summary",to:"llm"},{from:"database",to:"search"},{from:"search",to:"harness",dashed:!0,label:"recall"},{from:"watcher",to:"sync"},{from:"files",to:"watcher"},{from:"sync",to:"configs"},{from:"files",to:"sync"},{from:"summary",to:"files",label:".md"},{from:"configs",to:"harness",dashed:!0,label:"next session"}];function $r(){return{health:"unknown",score:0,lastActivity:null,pulseCount:0,queueDepth:0,processingRate:0,errorCount:0,recentLogs:[],metrics:{}}}const Gt=new Map;for(const g of at)for(const o of g.logCategories){const i=Gt.get(o);i?i.push(g.id):Gt.set(o,[g.id])}const Xt=20;function Tr(){const g={};for(const o of at)g[o.id]=$r();return g}const Vt=50,S=Rt({nodes:Tr(),mode:"unknown",connected:!1,lastPoll:null,selectedNodeId:null,feed:[]});let pe=null;function Zt(){pe&&(pe.close(),pe=null);const g="";pe=new EventSource(`${g}/api/logs/stream`),pe.onopen=()=>{S.connected=!0},pe.onmessage=o=>{try{const i=JSON.parse(o.data);if(i.type==="connected"){S.connected=!0;return}const d=[...S.feed,i];S.feed=d.length>Vt?d.slice(-Vt):d;const c=Gt.get(i.category);if(!c)return;for(const N of c){const M=S.nodes[N];if(!M)continue;M.pulseCount+=1,M.lastActivity=i.timestamp;const A=[...M.recentLogs,i];M.recentLogs=A.length>Xt?A.slice(-Xt):A,i.level==="error"&&(M.errorCount+=1)}}catch{}},pe.onerror=()=>{S.connected=!1,pe?.close(),pe=null,setTimeout(()=>{pe||Zt()},3e3)}}function Er(){S.connected=!1,pe?.close(),pe=null}let ht=null;function Mr(g){return g>=.8?"healthy":g>=.5?"degraded":g>0?"unhealthy":"unknown"}function Dr(g){for(const o of at){if(!o.diagnosticDomain)continue;const i=g[o.diagnosticDomain];if(!i)continue;const d=S.nodes[o.id];if(!d)continue;const c=typeof i.score=="number"?i.score:0;d.score=c,d.health=Mr(c),d.metrics=i}}function Lr(g){const o=S.nodes.queue;if(o){const c=g.memory,N=g.summary;o.queueDepth=c.pending+c.leased+N.pending+N.leased,o.metrics={memory:c,summary:N}}const i=S.nodes.extraction;i&&(i.queueDepth=g.memory.pending);const d=S.nodes.summary;d&&(d.queueDepth=g.summary.pending)}async function Qt(){try{const g=await dr();if(!g)return;if(S.mode=g.mode,S.lastPoll=new Date().toISOString(),g.diagnostics&&Dr(g.diagnostics),g.queues&&Lr(g.queues),g.workers)for(const[o,i]of Object.entries(g.workers)){const d=S.nodes[o];d&&i.running&&d.health==="unknown"&&(d.health="healthy",d.score=1)}if(g.errorSummary)for(const[o,i]of Object.entries(g.errorSummary)){const d=o==="extraction"||o==="decision"?"extraction":o==="embedding"||o==="mutation"?"database":o==="connector"?"sync":null;if(d){const c=S.nodes[d];c&&(c.errorCount=i)}}}catch{}}function Or(g=5e3){ht||(Qt(),ht=setInterval(Qt,g))}function Nr(){ht&&(clearInterval(ht),ht=null)}function Jt(g){S.selectedNodeId=g}var Ar=de('<rect class="glow-bg svelte-1tib701" x="-6" y="-6" rx="10" ry="10" opacity="0.12"></rect>'),Ir=de('<rect class="pulse-ring svelte-1tib701" x="-4" y="-4" rx="10" ry="10" fill="none"></rect>'),Rr=de('<rect class="flash-overlay svelte-1tib701" rx="6" ry="6"></rect>'),jr=de('<animate attributeName="opacity" values="1;0.4;1" dur="1.5s" repeatCount="indefinite" class="svelte-1tib701"></animate>'),qr=de('<g class="svelte-1tib701"><rect x="-12" y="-7" width="24" height="14" rx="7" opacity="0.95" class="svelte-1tib701"></rect><text x="0" y="1" text-anchor="middle" dominant-baseline="middle" fill="#fff" font-size="9" font-weight="600" font-family="var(--font-mono)" class="svelte-1tib701"> </text></g>'),Gr=de('<g transform="translate(8, -6)" class="svelte-1tib701"><rect x="-12" y="-7" width="24" height="14" rx="7" fill="#ef4444" opacity="0.95" class="svelte-1tib701"></rect><text x="0" y="1" text-anchor="middle" dominant-baseline="middle" fill="#fff" font-size="9" font-weight="600" font-family="var(--font-mono)" class="svelte-1tib701"> </text></g>'),Fr=de('<g style="cursor: pointer"><!><!><rect class="node-rect svelte-1tib701" rx="6" ry="6"></rect><!><circle cx="10" class="svelte-1tib701"><!></circle><text text-anchor="middle" dominant-baseline="middle" font-size="11" font-family="var(--font-mono)" class="svelte-1tib701"> </text><!><!></g>');function Hr(g,o){tt(o,!0);let i=E(()=>Te[o.def.group]);const d={healthy:"#4ade80",degraded:"#fbbf24",unhealthy:"#f87171",unknown:"#6b6b76"};let c=E(()=>d[o.nodeState.health]),N=E(()=>o.nodeState.health==="unknown"?e(i)+"88":e(c)),M=V(0),A=V(!1),y=V(!1),C=null;Ft(()=>{if(o.nodeState.pulseCount>e(M)){x(M,o.nodeState.pulseCount,!0),x(A,!0);const h=setTimeout(()=>{x(A,!1)},1200);return x(y,!0),C&&clearTimeout(C),C=setTimeout(()=>{x(y,!1)},3e3),()=>{clearTimeout(h),C&&clearTimeout(C)}}});function ee(){o.onselectnode(o.def.id)}var P=Fr();let $;var L=r(P);{var H=h=>{var p=Ar();_(()=>{v(p,"width",o.def.w+12),v(p,"height",o.def.h+12),v(p,"fill",e(i))}),l(h,p)};I(L,h=>{e(y)&&h(H)})}var B=s(L);{var Q=h=>{var p=Ir();_(()=>{v(p,"width",o.def.w+8),v(p,"height",o.def.h+8),v(p,"stroke",e(i))}),l(h,p)};I(B,h=>{e(A)&&h(Q)})}var b=s(B),w=s(b);{var T=h=>{var p=Rr();_(()=>{v(p,"width",o.def.w),v(p,"height",o.def.h),v(p,"fill",e(i))}),l(h,p)};I(w,h=>{e(A)&&h(T)})}var O=s(w),J=r(O);{var F=h=>{var p=jr();l(h,p)};I(J,h=>{e(y)&&h(F)})}t(O);var R=s(O),u=r(R,!0);t(R);var k=s(R);{var q=h=>{var p=qr(),Y=r(p),te=s(Y),Ne=r(te,!0);t(te),t(p),_(()=>{v(p,"transform",`translate(${o.def.w-8}, -6)`),v(Y,"fill",e(i)),f(Ne,o.nodeState.queueDepth)}),l(h,p)};I(k,h=>{o.nodeState.queueDepth>0&&h(q)})}var j=s(k);{var K=h=>{var p=Gr(),Y=s(r(p)),te=r(Y,!0);t(Y),t(p),_(()=>f(te,o.nodeState.errorCount)),l(h,p)};I(j,h=>{o.nodeState.errorCount>0&&h(K)})}t(P),_(()=>{$=Fe(P,0,"pipeline-node svelte-1tib701",null,$,{"pipeline-node--selected":o.selected,"pipeline-node--active":e(y)}),v(P,"transform",`translate(${o.def.x??""}, ${o.def.y??""})`),v(b,"width",o.def.w),v(b,"height",o.def.h),v(b,"fill",e(y)?e(i)+"18":"var(--sig-surface-raised)"),v(b,"stroke",e(y)?e(i):e(N)),v(b,"stroke-width",o.selected?2.5:e(y)?1.5:1),v(O,"cy",o.def.h/2),v(O,"r",e(y)?4:3),v(O,"fill",e(y)?e(i):e(c)),v(O,"opacity",e(y)?1:.7),v(R,"x",o.def.w/2),v(R,"y",o.def.h/2+1),v(R,"fill",e(y)?e(i):"var(--sig-text-bright)"),v(R,"font-weight",e(y)?"600":"400"),f(u,o.def.label)}),mt("click",P,ee),l(g,P),rt()}Ut(["click"]);var Br=de('<path fill="none" stroke-width="4" opacity="0.15" class="edge-glow svelte-kl8ook"></path>'),zr=de('<circle r="2" opacity="0.6" class="svelte-kl8ook"><animateMotion repeatCount="indefinite" begin="0.5s" class="svelte-kl8ook"></animateMotion></circle>'),Yr=de('<circle class="svelte-kl8ook"><animateMotion repeatCount="indefinite" class="svelte-kl8ook"></animateMotion></circle><!>',1),Xr=de('<text text-anchor="middle" font-size="9" font-family="var(--font-mono)" class="svelte-kl8ook"> </text>'),Vr=de('<g class="pipeline-edge svelte-kl8ook"><path fill="none"></path><!><!><!></g>');function Qr(g,o){tt(o,!0);let i=E(()=>qt.get(o.edge.from)),d=E(()=>qt.get(o.edge.to)),c=E(()=>e(i)?Te[e(i).group]:"#6b6b76"),N=E(()=>{if(!e(i)||!e(d))return"";const b=e(i).x+e(i).w/2,w=e(i).y+e(i).h/2,T=e(d).x+e(d).w/2,O=e(d).y+e(d).h/2,J=(b+T)/2,F=(w+O)/2,R=Math.abs(T-b),u=Math.abs(O-w);return R>u?`M ${b} ${w} Q ${J} ${w}, ${J} ${F} Q ${J} ${O}, ${T} ${O}`:`M ${b} ${w} Q ${b} ${F}, ${J} ${F} Q ${T} ${F}, ${T} ${O}`}),M=E(()=>!e(i)||!e(d)?{x:0,y:0}:{x:(e(i).x+e(i).w/2+e(d).x+e(d).w/2)/2,y:(e(i).y+e(i).h/2+e(d).y+e(d).h/2)/2-8}),A=E(()=>o.active?"1s":"3s");var y=Vr(),C=r(y);let ee;var P=s(C);{var $=b=>{var w=Br();_(()=>{v(w,"d",e(N)),v(w,"stroke",e(c))}),l(b,w)};I(P,b=>{o.active&&!o.edge.dashed&&b($)})}var L=s(P);{var H=b=>{var w=Yr(),T=Z(w),O=r(T);t(T);var J=s(T);{var F=R=>{var u=zr(),k=r(u);t(u),_(()=>{v(u,"fill",e(c)),v(k,"dur",e(A)),v(k,"path",e(N))}),l(R,u)};I(J,R=>{o.active&&R(F)})}_(()=>{v(T,"r",o.active?3.5:2),v(T,"fill",o.active?e(c):"var(--sig-border)"),v(T,"opacity",o.active?1:.3),v(O,"dur",e(A)),v(O,"path",e(N))}),l(b,w)};I(L,b=>{o.edge.dashed||b(H)})}var B=s(L);{var Q=b=>{var w=Xr(),T=r(w,!0);t(w),_(()=>{v(w,"x",e(M).x),v(w,"y",e(M).y),v(w,"fill",o.active?e(c):"var(--sig-text-muted)"),v(w,"opacity",o.active?.9:.45),f(T,o.edge.label)}),l(b,w)};I(B,b=>{o.edge.label&&b(Q)})}t(y),_(()=>{v(C,"d",e(N)),v(C,"stroke",o.active?e(c):"var(--sig-border)"),v(C,"stroke-width",o.active?1.5:.8),v(C,"stroke-dasharray",o.edge.dashed?"6 4":"none"),v(C,"opacity",o.active?.8:.25),ee=Fe(C,0,"svelte-kl8ook",null,ee,{"edge-active":o.active})}),l(g,y),rt()}var Ur=de('<g><rect rx="8" ry="8" fill-opacity="0.06" stroke-opacity="0.25" stroke-width="1" stroke-dasharray="4 3"></rect><text font-size="9" font-family="var(--font-mono)" opacity="0.6" letter-spacing="0.08em"> </text></g>'),Wr=de('<svg viewBox="0 0 1160 650" preserveAspectRatio="xMidYMid meet" class="w-full h-full select-none" xmlns="http://www.w3.org/2000/svg" role="application" aria-label="Pipeline graph. Use mouse wheel to zoom, drag background to pan, double-click to reset."><defs><filter id="glow" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="3" result="blur"></feGaussianBlur><feMerge><feMergeNode in="blur"></feMergeNode><feMergeNode in="SourceGraphic"></feMergeNode></feMerge></filter><marker id="arrow" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="var(--sig-border-strong)"></path></marker></defs><g><!><!><!></g></svg>');function Zr(g,o){tt(o,!0);const i=Object.entries(Cr),d=.7,c=2.4,N=.12;let M=V(1),A=V(0),y=V(0),C=V(!1),ee=V(0),P=V(0);function $(u){const k=S.nodes[u];return k?.lastActivity?Date.now()-new Date(k.lastActivity).getTime()<5e3:!1}function L(u){return Math.min(c,Math.max(d,u))}function H(){x(M,1),x(A,0),x(y,0)}function B(u){u.preventDefault();const k=u.currentTarget;if(!(k instanceof SVGSVGElement))return;const q=k.getBoundingClientRect(),j=u.clientX-q.left,K=u.clientY-q.top,h=u.deltaY<0?1:-1,p=L(e(M)+h*N);if(p===e(M))return;const Y=(j-e(A))/e(M),te=(K-e(y))/e(M);x(M,p,!0),x(A,j-Y*p),x(y,K-te*p)}function Q(u){if(u.button!==0||u.target!==u.currentTarget)return;const k=u.currentTarget;k instanceof SVGSVGElement&&k.setPointerCapture(u.pointerId),x(C,!0),x(ee,u.clientX,!0),x(P,u.clientY,!0)}function b(u){if(!e(C))return;const k=u.clientX-e(ee),q=u.clientY-e(P);x(ee,u.clientX,!0),x(P,u.clientY,!0),x(A,e(A)+k),x(y,e(y)+q)}function w(u){if(!e(C))return;const k=u.currentTarget;k instanceof SVGSVGElement&&k.releasePointerCapture(u.pointerId),x(C,!1)}var T=Wr(),O=s(r(T)),J=r(O);Oe(J,17,()=>i,pt,(u,k)=>{var q=E(()=>jt(e(k),2));let j=()=>e(q)[1];var K=Ur(),h=r(K),p=s(h),Y=r(p,!0);t(p),t(K),_(te=>{v(h,"x",j().x),v(h,"y",j().y),v(h,"width",j().w),v(h,"height",j().h),v(h,"fill",j().color),v(h,"stroke",j().color),v(p,"x",j().x+8),v(p,"y",j().y+14),v(p,"fill",j().color),f(Y,te)},[()=>j().label.toUpperCase()]),l(u,K)});var F=s(J);Oe(F,17,()=>Pr,u=>u.from+"-"+u.to,(u,k)=>{{let q=E(()=>$(e(k).from));Qr(u,{get edge(){return e(k)},get active(){return e(q)}})}});var R=s(F);Oe(R,17,()=>at,u=>u.id,(u,k)=>{{let q=E(()=>S.selectedNodeId===e(k).id);Hr(u,{get def(){return e(k)},get nodeState(){return S.nodes[e(k).id]},get selected(){return e(q)},get onselectnode(){return o.onselectnode}})}}),t(O),t(T),_(()=>v(O,"transform",`translate(${e(A)} ${e(y)}) scale(${e(M)})`)),$t("wheel",T,B),mt("pointerdown",T,Q),mt("pointermove",T,b),mt("pointerup",T,w),$t("pointercancel",T,w),$t("pointerleave",T,w),mt("dblclick",T,H),l(g,T),rt()}Ut(["pointerdown","pointermove","pointerup","dblclick"]);var Jr=D(" <!>",1),Kr=D("<!> <!>",1),ea=D('<div class="flex justify-between px-2"><span class="text-[var(--sig-text-muted)]"> </span> <span class="text-[var(--sig-text-bright)]"> </span></div>'),ta=D('<div class="text-[var(--sig-text-muted)] mt-1"> </div> <!>',1),ra=D('<div class="flex justify-between"><span class="text-[var(--sig-text-muted)]"> </span> <span class="text-[var(--sig-text-bright)]"> </span></div>'),aa=D('<section><h4 class="text-[10px] uppercase tracking-[0.1em] text-[var(--sig-text-muted)] mb-2 font-[family-name:var(--font-display)]">Queue Details</h4> <div class="space-y-1 text-[11px] font-[family-name:var(--font-mono)]"></div></section>'),oa=D('<section><h4 class="text-[10px] uppercase tracking-[0.1em] text-[var(--sig-text-muted)] mb-1 font-[family-name:var(--font-display)]">Last Activity</h4> <span class="text-[11px] text-[var(--sig-text)] font-[family-name:var(--font-mono)]"> </span></section>'),sa=D('<div class="flex gap-2 py-1 px-1 text-[10px] font-[family-name:var(--font-mono)] hover:bg-[var(--sig-surface-raised)] rounded"><span class="text-[var(--sig-text-muted)] shrink-0 w-[52px]"> </span> <span> </span> <span class="text-[var(--sig-text)] truncate"> </span></div>'),na=D('<div class="text-[10px] text-[var(--sig-text-muted)] italic py-2">No recent activity</div>'),ia=D('<!> <div class="mt-4 space-y-4 overflow-y-auto pr-2" style="max-height: calc(100vh - 140px);"><section><h4 class="text-[10px] uppercase tracking-[0.1em] text-[var(--sig-text-muted)] mb-2 font-[family-name:var(--font-display)]">Metrics</h4> <div class="grid grid-cols-3 gap-2"><div class="p-2 rounded bg-[var(--sig-surface)] border border-[var(--sig-border)]"><div class="text-[9px] text-[var(--sig-text-muted)] uppercase">Score</div> <div class="text-[15px] text-[var(--sig-text-bright)] font-[family-name:var(--font-mono)]"> </div></div> <div class="p-2 rounded bg-[var(--sig-surface)] border border-[var(--sig-border)]"><div class="text-[9px] text-[var(--sig-text-muted)] uppercase">Queue</div> <div class="text-[15px] text-[var(--sig-text-bright)] font-[family-name:var(--font-mono)]"> </div></div> <div class="p-2 rounded bg-[var(--sig-surface)] border border-[var(--sig-border)]"><div class="text-[9px] text-[var(--sig-text-muted)] uppercase">Errors</div> <div> </div></div></div></section> <!> <!> <section><h4 class="text-[10px] uppercase tracking-[0.1em] text-[var(--sig-text-muted)] mb-2 font-[family-name:var(--font-display)]"> </h4> <div class="space-y-px max-h-[300px] overflow-y-auto"><!> <!></div></section></div>',1);function la(g,o){tt(o,!0);let i=E(()=>S.selectedNodeId),d=E(()=>e(i)?qt.get(e(i))??null:null),c=E(()=>e(i)?S.nodes[e(i)]??null:null),N=E(()=>e(i)!==null);function M($){$||Jt(null)}function A($){try{return new Date($).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return $}}function y($){switch($){case"error":return"text-[#e06c75]";case"warn":return"text-[#e5c07b]";case"debug":return"text-[#6b6b76]";default:return"text-[var(--sig-text)]"}}let C=E(()=>{if(!e(c)?.metrics)return null;const $=e(c).metrics;return $.memory||$.summary||typeof $.depth=="number"?$:null});var ee=Ve(),P=Z(ee);ke(P,()=>fr,($,L)=>{L($,{get open(){return e(N)},onOpenChange:M,children:(H,B)=>{var Q=Ve(),b=Z(Q);ke(b,()=>cr,(w,T)=>{T(w,{side:"right",class:"w-[380px] bg-[var(--sig-bg)] border-l border-[var(--sig-border)]",children:(O,J)=>{var F=Ve(),R=Z(F);{var u=k=>{var q=ia(),j=Z(q);ke(j,()=>vr,(G,X)=>{X(G,{children:(re,ge)=>{var me=Kr(),ce=Z(me);ke(ce,()=>ur,(se,be)=>{be(se,{class:"flex items-center gap-2 font-[family-name:var(--font-display)] text-[var(--sig-text-bright)]",children:(Me,Be)=>{he();var ae=Jr(),ve=Z(ae),ne=s(ve);{let _e=E(()=>e(c).health==="healthy"?"border-[#4a7a5e] text-[#4a7a5e]":e(c).health==="degraded"?"border-[#b8860b] text-[#b8860b]":e(c).health==="unhealthy"?"border-[#8a4a48] text-[#8a4a48]":"border-[var(--sig-border)] text-[var(--sig-text-muted)]");Tt(ne,{variant:"outline",get class(){return`text-[9px] px-1.5 py-0 font-[family-name:var(--font-mono)]
2
2
  ${e(_e)??""}`},children:(Re,ze)=>{he();var Ze=Ee();_(()=>f(Ze,e(c).health)),l(Re,Ze)},$$slots:{default:!0}})}_(()=>f(ve,`${e(d).label??""} `)),l(Me,ae)},$$slots:{default:!0}})});var Pe=s(ce,2);{var xe=se=>{var be=Ve(),Me=Z(be);ke(Me,()=>gr,(Be,ae)=>{ae(Be,{class:"text-[11px] text-[var(--sig-text-muted)] font-[family-name:var(--font-mono)]",children:(ve,ne)=>{he();var _e=Ee();_(()=>f(_e,e(d).description)),l(ve,_e)},$$slots:{default:!0}})}),l(se,be)};I(Pe,se=>{e(d).description&&se(xe)})}l(re,me)},$$slots:{default:!0}})});var K=s(j,2),h=r(K),p=s(r(h),2),Y=r(p),te=s(r(Y),2),Ne=r(te,!0);t(te),t(Y);var U=s(Y,2),fe=s(r(U),2),Se=r(fe,!0);t(fe),t(U);var Ce=s(U,2),Ae=s(r(Ce),2);let Ie;var Qe=r(Ae,!0);t(Ae),t(Ce),t(p),t(h);var He=s(h,2);{var ot=G=>{var X=aa(),re=s(r(X),2);Oe(re,21,()=>Object.entries(e(C)),pt,(ge,me)=>{var ce=E(()=>jt(e(me),2));let Pe=()=>e(ce)[0],xe=()=>e(ce)[1];var se=Ve(),be=Z(se);{var Me=ae=>{var ve=ta(),ne=Z(ve),_e=r(ne,!0);t(ne);var Re=s(ne,2);Oe(Re,17,()=>Object.entries(xe()),pt,(ze,Ze)=>{var Ye=E(()=>jt(e(Ze),2));let yt=()=>e(Ye)[0],Lt=()=>e(Ye)[1];var nt=ea(),it=r(nt),a=r(it,!0);t(it);var n=s(it,2),m=r(n,!0);t(n),t(nt),_(()=>{f(a,yt()),f(m,Lt())}),l(ze,nt)}),_(()=>f(_e,Pe())),l(ae,ve)},Be=ae=>{var ve=ra(),ne=r(ve),_e=r(ne,!0);t(ne);var Re=s(ne,2),ze=r(Re,!0);t(Re),t(ve),_(()=>{f(_e,Pe()),f(ze,xe())}),l(ae,ve)};I(be,ae=>{typeof xe()=="object"&&xe()!==null?ae(Me):ae(Be,-1)})}l(ge,se)}),t(re),t(X),l(G,X)};I(He,G=>{e(C)&&G(ot)})}var st=s(He,2);{var Et=G=>{var X=oa(),re=s(r(X),2),ge=r(re,!0);t(re),t(X),_(me=>f(ge,me),[()=>A(e(c).lastActivity)]),l(G,X)};I(st,G=>{e(c).lastActivity&&G(Et)})}var xt=s(st,2),Ue=r(xt),Mt=r(Ue);t(Ue);var bt=s(Ue,2),We=r(bt);Oe(We,17,()=>e(c).recentLogs,pt,(G,X)=>{var re=sa(),ge=r(re),me=r(ge,!0);t(ge);var ce=s(ge,2),Pe=r(ce,!0);t(ce);var xe=s(ce,2),se=r(xe,!0);t(xe),t(re),_((be,Me)=>{f(me,be),Fe(ce,1,`${Me??""} shrink-0 w-[34px] uppercase`),f(Pe,e(X).level),f(se,e(X).message)},[()=>A(e(X).timestamp),()=>y(e(X).level)]),l(G,re)});var Dt=s(We,2);{var _t=G=>{var X=na();l(G,X)};I(Dt,G=>{e(c).recentLogs.length===0&&G(_t)})}t(bt),t(xt),t(K),_(G=>{f(Ne,G),f(Se,e(c).queueDepth),Ie=Fe(Ae,1,"text-[15px] font-[family-name:var(--font-mono)]",null,Ie,{"text-[#8a4a48]":e(c).errorCount>0,"text-[var(--sig-text-bright)]":e(c).errorCount===0}),f(Qe,e(c).errorCount),f(Mt,`Recent Logs (${e(c).recentLogs.length??""})`)},[()=>e(c).score>0?(e(c).score*100).toFixed(0)+"%":"--"]),l(k,q)};I(R,k=>{e(d)&&e(c)&&k(u)})}l(O,F)},$$slots:{default:!0}})}),l(H,Q)},$$slots:{default:!0}})}),l(g,ee),rt()}var da=D('<div class="border-t border-[var(--sig-border)]"></div>'),ca=D('<!> <div class="flex items-center justify-between px-3 py-2 gap-3"><div class="flex items-center gap-3 min-w-0"><span class="font-mono text-[var(--font-size-sm)] text-[var(--sig-text)] truncate"> </span> <!> <span class="sig-meta text-[var(--sig-text-muted)] shrink-0"> </span></div> <div class="flex items-center gap-2 shrink-0"><span> </span> <!></div></div>',1),va=D('<div class="mb-4"><div class="flex items-center gap-2 mb-2"><span class="sig-heading">ACTIVE SESSIONS</span> <!></div> <div class="rounded-md border border-[var(--sig-border)]" style="background: var(--sig-surface)"></div></div>');function ua(g,o){tt(o,!0);let i=V(Rt([])),d=V(!0),c=V(Rt(new Set));async function N(){try{const P=await mr();x(i,[...P.sessions],!0)}catch{zt("Failed to load sessions","error")}finally{x(d,!1)}}async function M(P,$){if(!e(c).has(P.key)){x(c,new Set([...e(c),P.key]),!0);try{const L=await pr(P.key,$);L?x(i,e(i).map(H=>H.key===P.key?{...H,bypassed:L.bypassed}:H),!0):zt("Failed to toggle bypass","error")}finally{const L=new Set(e(c));L.delete(P.key),x(c,L,!0)}}}function A(P){const $=Date.now()-new Date(P).getTime();if(!Number.isFinite($)||$<0)return"just now";const L=Math.floor($/1e3);if(L<60)return`${L}s ago`;const H=Math.floor(L/60);if(H<60)return`${H}m ago`;const B=Math.floor(H/60);return B<24?`${B}h ago`:`${Math.floor(B/24)}d ago`}Ft(()=>{N();const P=setInterval(N,3e4);return()=>clearInterval(P)});var y=Ve(),C=Z(y);{var ee=P=>{var $=va(),L=r($),H=s(r(L),2);Tt(H,{variant:"outline",class:"sig-badge px-1.5 py-0",children:(Q,b)=>{he();var w=Ee();_(()=>f(w,e(i).length)),l(Q,w)},$$slots:{default:!0}}),t(L);var B=s(L,2);Oe(B,23,()=>e(i),Q=>Q.key,(Q,b,w)=>{var T=ca(),O=Z(T);{var J=U=>{var fe=da();l(U,fe)};I(O,U=>{e(w)>0&&U(J)})}var F=s(O,2),R=r(F),u=r(R),k=r(u,!0);t(u);var q=s(u,2);Tt(q,{variant:"outline",class:"sig-badge px-1.5 py-0 shrink-0",children:(U,fe)=>{he();var Se=Ee();_(()=>f(Se,e(b).runtimePath)),l(U,Se)},$$slots:{default:!0}});var j=s(q,2),K=r(j,!0);t(j),t(R);var h=s(R,2),p=r(h);let Y;var te=r(p,!0);t(p);var Ne=s(p,2);{let U=E(()=>e(c).has(e(b).key));ke(Ne,()=>Wt,(fe,Se)=>{Se(fe,{get checked(){return e(b).bypassed},get disabled(){return e(U)},onCheckedChange:Ce=>M(e(b),Ce),get"aria-label"(){return`Bypass session ${e(b).key??""}`},children:(Ce,Ae)=>{var Ie=Ve(),Qe=Z(Ie);ke(Qe,()=>{},(He,ot)=>{ot(He,{})}),l(Ce,Ie)},$$slots:{default:!0}})})}t(h),t(F),_((U,fe)=>{v(u,"title",e(b).key),f(k,U),f(K,fe),Y=Fe(p,1,"sig-meta",null,Y,{"text-[var(--sig-text-muted)]":!e(b).bypassed,"text-[var(--sig-accent)]":e(b).bypassed}),f(te,e(b).bypassed?"bypassed":"active")},[()=>e(b).key.slice(0,12),()=>A(e(b).claimedAt)]),l(Q,T)}),t(B),t($),l(P,$)};I(C,P=>{!e(d)&&e(i).length>0&&P(ee)})}l(g,y),rt()}var fa=D('<span class="sig-eyebrow text-[#4ade80]"> </span>'),ga=D('<span class="sig-meta"> </span>'),ma=D('<div class="flex flex-col gap-1"><!> <!></div>'),pa=D("<!> <!>",1),ha=D('<div class="flex items-start justify-between gap-2 border-b border-[var(--sig-border)]/30 pb-[1px]"><span class="text-[var(--sig-text-muted)]"> </span> <span class="text-[var(--sig-text)] break-all text-right normal-case"> </span></div>'),xa=D('<div class="mt-1 pl-[56px] sig-micro"> </div>'),ba=D('<div class="mt-1 pl-[56px] sig-meta text-[#f87171] whitespace-pre-wrap break-words"> </div>'),_a=D('<details class="mt-1 pl-[56px]"><summary class="cursor-pointer sig-micro">Raw payload</summary> <pre class="mt-1 p-2 border border-[var(--sig-border)] bg-[var(--sig-surface)] sig-micro text-[var(--sig-text)] whitespace-pre-wrap break-words normal-case"> </pre></details>'),ya=D('<div class="mt-1 pl-[56px] inline-flex items-center gap-2 sig-micro"><span class="px-1 py-[1px] border border-[var(--sig-border)]"> </span> <span> </span></div> <div class="sig-eyebrow text-[var(--sig-text)] mt-0.5 pl-[56px] whitespace-pre-wrap break-words normal-case tracking-normal"> </div> <div class="mt-1 pl-[56px] grid grid-cols-1 md:grid-cols-2 gap-x-3 gap-y-1 sig-micro"></div> <!> <!> <!>',1),wa=D('<details class="mt-0.5 pl-[56px] group"><summary class="list-none cursor-pointer sig-eyebrow text-[var(--sig-text)] normal-case tracking-normal line-clamp-2 break-words [&amp;::-webkit-details-marker]:hidden"> </summary> <div class="mt-1 sig-eyebrow text-[var(--sig-text)] normal-case tracking-normal whitespace-pre-wrap break-words"> </div></details>'),ka=D('<div class="sig-eyebrow text-[var(--sig-text)] normal-case tracking-normal mt-0.5 pl-[56px] whitespace-pre-wrap break-words"> </div>'),Sa=D('<span class="sig-micro pl-[56px]"> </span>'),Ca=D("<!> <!>",1),Pa=D('<div class="feed-entry px-2 py-1.5 rounded hover:bg-[var(--sig-surface-raised)] transition-colors svelte-1kgvdra"><div class="flex items-center gap-1.5"><span class="sig-meta shrink-0 w-[48px]"> </span> <span class="inline-block w-1.5 h-1.5 rounded-full shrink-0"></span> <span class="sig-meta shrink-0"> </span></div> <!></div>'),$a=D('<div class="flex items-center justify-center h-full sig-label italic">Waiting for events...</div>'),Ta=D('<div class="flex flex-col flex-1 min-h-0 overflow-hidden"><!> <div class="flex items-center justify-between px-4 py-2 border-b border-[var(--sig-border)] shrink-0"><div class="flex items-center gap-3"><div class="flex items-center gap-1.5"><span></span> <span class="sig-eyebrow"> </span></div> <!> <!></div> <div class="flex items-center gap-3"><!></div></div> <div class="px-4 pt-2"><!></div> <div class="flex flex-1 min-h-0 flex-col lg:flex-row"><div class="flex-1 min-w-0 min-h-[46vh] lg:min-h-0 p-4 overflow-auto"><!></div> <div><div class="px-3 py-2 border-b border-[var(--sig-border)] space-y-2"><div class="flex items-center justify-between gap-2"><span class="sig-heading text-[10px]">Live Feed</span> <div class="flex items-center gap-2"><span class="sig-meta"> </span> <span> </span></div></div> <div class="flex items-center justify-between gap-2 min-w-0"><label class="inline-flex items-center gap-1.5 sig-eyebrow text-[var(--sig-text)] cursor-pointer min-w-0"><!> <span>Auto-scroll</span></label> <div class="hidden lg:flex items-center gap-1.5 shrink-0"><!> <!></div> <div class="lg:hidden shrink-0"><!></div></div></div> <div class="flex-1 overflow-y-auto px-1 py-1"><!> <!></div></div></div></div> <!>',1);function Ra(g,o){tt(o,!0);function i(a){Jt(S.selectedNodeId===a?null:a)}let d=V(null),c=V(!0),N=V(!1),M=V(!1);const A=24;let y=V(!0),C=V(!0),ee=E(()=>e(N)?"lg:w-[420px]":"lg:w-[320px]"),P=E(()=>e(y)?"Latest":"Oldest"),$=E(()=>e(N)?"Expanded":"Compact");function L(a="smooth"){e(d)&&e(d).scrollTo({top:e(d).scrollHeight,behavior:a})}function H(){return e(d)?e(d).scrollHeight-e(d).scrollTop-e(d).clientHeight<=A:!0}function B(){if(!(!e(d)||(x(C,H(),!0),!(e(d).scrollHeight-e(d).clientHeight>A)))){if(e(C)){x(y,!0);return}e(d).scrollTop<=A&&x(y,!1)}}function Q(a){e(d)&&(e(y)?(x(c,!1),x(C,!1),x(y,!1),e(d).scrollTo({top:0,behavior:"smooth"})):(x(c,!0),x(C,!0),x(y,!0),L("auto")),a?.currentTarget instanceof HTMLElement&&a.currentTarget.blur(),x(M,!1))}function b(a){x(c,a,!0),Pt.pipeline.autoScroll=a,Yt(),a&&(x(C,!0),x(y,!0),requestAnimationFrame(()=>{L("auto"),B()}))}function w(a){x(N,!e(N)),Pt.pipeline.feedExpanded=e(N),Yt(),a?.currentTarget instanceof HTMLElement&&a.currentTarget.blur(),x(M,!1)}function T(a){if(!a)return"";const n=Object.keys(a);if(n.length===0)return"";const m=n.slice(0,4).join(", ");return n.length>4?`${m} +${n.length-4}`:m}Ft(()=>{if(S.feed.length,B(),e(c)&&e(d)){if(!e(C))return;requestAnimationFrame(()=>{L("auto"),x(C,!0),x(y,!0),B()})}}),nr(()=>(Zt(),Or(),x(c,Pt.pipeline.autoScroll,!0),x(N,Pt.pipeline.feedExpanded,!0),()=>{Er(),Nr()}));const O={"controlled-write":"border-[#4ade80] text-[#4ade80]",shadow:"border-[#fbbf24] text-[#fbbf24]",frozen:"border-[#94a3b8] text-[#94a3b8]",disabled:"border-[#f87171] text-[#f87171]",unknown:"border-[var(--sig-border)] text-[var(--sig-text-muted)]"};let J=E(()=>O[S.mode]??O.unknown),F=E(()=>at.filter(a=>{const n=S.nodes[a.id];return n?.lastActivity?Date.now()-new Date(n.lastActivity).getTime()<5e3:!1}).length);function R(a){try{return new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return a}}const u={error:"#f87171",warn:"#fbbf24",info:"#4ade80",debug:"#6b6b76"},k={hooks:"#4dabf7","session-tracker":"#4dabf7",pipeline:"#da77f2","summary-worker":"#da77f2","document-worker":"#da77f2",retention:"#da77f2",maintenance:"#da77f2",memory:"#ffd43b",embedding:"#ffd43b",sync:"#ff922b",watcher:"#ff922b",harness:"#4dabf7",llm:"#fcc419"},q=["jobId","memoryId","sessionKey","project","attempt","maxRetries","mode","provider","model","facts","entities","proposals","added","updated","deleted","deduped","skippedLowConfidence","blockedDestructive","runId","taskId","path","port","pid","error"];function j(a){const n=Date.now()-new Date(a).getTime();if(!Number.isFinite(n)||n<0)return"just now";const m=Math.floor(n/1e3);if(m<60)return`${m}s ago`;const z=Math.floor(m/60);if(z<60)return`${z}m ago`;const W=Math.floor(z/60);return W<24?`${W}h ago`:`${Math.floor(W/24)}d ago`}function K(a){return a.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/^./,n=>n.toUpperCase())}function h(a){return a===null?"null":a===void 0?"undefined":typeof a=="string"?a:typeof a=="number"||typeof a=="boolean"?String(a):Array.isArray(a)?`[${a.length} items]`:typeof a=="object"?"{object}":String(a)}function p(a){const n=a.message.toLowerCase(),m=a.category.replace(/-/g," ");if(n.includes("job failed")){const z=a.data?.attempt;return typeof z=="number"?`${m} failed (attempt ${z})`:`${m} failed`}return n.includes("completed")?`${m} completed`:n.includes("started")||n.includes("starting")?`${m} started`:n.includes("enqueued")?`${m} queued`:n.includes("failed")?`${m} warning`:n.includes("file changed")?"watcher detected file change":`${m} event`}function Y(a){const n=[{label:"Level",value:a.level},{label:"Category",value:a.category}];a.duration!==void 0&&n.push({label:"Duration",value:`${a.duration} ms`});const m=a.data;if(!m)return n;const z=new Set;for(const W of q)W in m&&(n.push({label:K(W),value:h(m[W])}),z.add(W));for(const W of Object.keys(m).sort())z.has(W)||n.push({label:K(W),value:h(m[W])});return n}function te(a){const n={};if(a.data&&(n.data=a.data),a.error&&(n.error=a.error),Object.keys(n).length===0)return"";const m=JSON.stringify(n,null,2);if(!m)return"";const z=3200;return m.length<=z?m:`${m.slice(0,z)}
3
3
  ...truncated`}var Ne=Ta(),U=Z(Ne),fe=r(U);kr(fe,{title:"Pipeline",children:(a,n)=>{Sr(a,{group:"engine",get tabs(){return br},get activeTab(){return xr.activeTab},onselect:(m,z)=>hr(z)})}});var Se=s(fe,2),Ce=r(Se),Ae=r(Ce),Ie=r(Ae);let Qe;var He=s(Ie,2),ot=r(He,!0);t(He),t(Ae);var st=s(Ae,2);Tt(st,{variant:"outline",get class(){return`sig-badge px-1.5 py-0 ${e(J)??""}`},children:(a,n)=>{he();var m=Ee();_(()=>f(m,S.mode)),l(a,m)},$$slots:{default:!0}});var Et=s(st,2);{var xt=a=>{var n=fa(),m=r(n);t(n),_(()=>f(m,`${e(F)??""} active`)),l(a,n)};I(Et,a=>{e(F)>0&&a(xt)})}t(Ce);var Ue=s(Ce,2),Mt=r(Ue);{var bt=a=>{var n=ga(),m=r(n);t(n),_(z=>f(m,`polled ${z??""}`),[()=>R(S.lastPoll)]),l(a,n)};I(Mt,a=>{S.lastPoll&&a(bt)})}t(Ue),t(Se);var We=s(Se,2),Dt=r(We);ua(Dt,{}),t(We);var _t=s(We,2),G=r(_t),X=r(G);Zr(X,{onselectnode:i}),t(G);var re=s(G,2),ge=r(re),me=r(ge),ce=s(r(me),2),Pe=r(ce),xe=r(Pe);t(Pe);var se=s(Pe,2);let be;var Me=r(se,!0);t(se),t(ce),t(me);var Be=s(me,2),ae=r(Be),ve=r(ae);ke(ve,()=>Wt,(a,n)=>{n(a,{get checked(){return e(c)},onCheckedChange:m=>b(m),class:"scale-90"})}),he(2),t(ae);var ne=s(ae,2),_e=r(ne);gt(_e,{variant:"outline",size:"sm",class:"sig-meta uppercase tracking-[0.08em] px-2 py-[3px] h-auto hover:text-[var(--sig-text)] hover:border-[var(--sig-border-strong)]",onclick:a=>Q(a),children:(a,n)=>{he();var m=Ee();_(()=>f(m,e(P))),l(a,m)},$$slots:{default:!0}});var Re=s(_e,2);gt(Re,{variant:"outline",size:"sm",class:"sig-meta uppercase tracking-[0.08em] px-2 py-[3px] h-auto hover:text-[var(--sig-text)] hover:border-[var(--sig-border-strong)]",onclick:a=>w(a),children:(a,n)=>{he();var m=Ee();_(()=>f(m,e($))),l(a,m)},$$slots:{default:!0}}),t(ne);var ze=s(ne,2),Ze=r(ze);ke(Ze,()=>wr,(a,n)=>{n(a,{get open(){return e(M)},set open(m){x(M,m,!0)},children:(m,z)=>{var W=pa(),Je=Z(W);{const lt=(je,De)=>{gt(je,ir(()=>De?.().props,{variant:"outline",size:"sm",class:"sig-meta uppercase tracking-[0.08em] px-2 py-[3px] h-auto hover:text-[var(--sig-text)] hover:border-[var(--sig-border-strong)]",children:(Le,ct)=>{he();var Ke=Ee("Feed actions");l(Le,Ke)},$$slots:{default:!0}}))};ke(Je,()=>_r,(je,De)=>{De(je,{child:lt,$$slots:{child:!0}})})}var Ot=s(Je,2);ke(Ot,()=>yr,(lt,je)=>{je(lt,{align:"end",side:"bottom",class:"w-[170px] p-1 bg-[var(--sig-surface-raised)] border-[var(--sig-border-strong)] rounded-lg",children:(De,dt)=>{var Le=ma(),ct=r(Le);gt(ct,{variant:"outline",size:"sm",class:"w-full justify-start sig-eyebrow tracking-[0.08em] px-2 py-1 h-auto hover:text-[var(--sig-text)] hover:border-[var(--sig-border-strong)]",onclick:ye=>Q(ye),children:(ye,Nt)=>{he();var Xe=Ee();_(()=>f(Xe,e(P))),l(ye,Xe)},$$slots:{default:!0}});var Ke=s(ct,2);gt(Ke,{variant:"outline",size:"sm",class:"w-full justify-start sig-eyebrow tracking-[0.08em] px-2 py-1 h-auto hover:text-[var(--sig-text)] hover:border-[var(--sig-border-strong)]",onclick:ye=>w(ye),children:(ye,Nt)=>{he();var Xe=Ee();_(()=>f(Xe,e($))),l(ye,Xe)},$$slots:{default:!0}}),t(Le),l(De,Le)},$$slots:{default:!0}})}),l(m,W)},$$slots:{default:!0}})}),t(ze),t(Be),t(ge);var Ye=s(ge,2),yt=r(Ye);Oe(yt,19,()=>S.feed,(a,n)=>a.timestamp+"-"+n,(a,n)=>{const m=E(()=>k[e(n).category]??"var(--sig-text-muted)"),z=E(()=>u[e(n).level]??"#6b6b76"),W=E(()=>e(n).message.length>72),Je=E(()=>T(e(n).data)),Ot=E(()=>p(e(n))),lt=E(()=>Y(e(n))),je=E(()=>te(e(n)));var De=Pa(),dt=r(De),Le=r(dt),ct=r(Le,!0);t(Le);var Ke=s(Le,2),ye=s(Ke,2),Nt=r(ye,!0);t(ye),t(dt);var Xe=s(dt,2);{var Kt=qe=>{var vt=ya(),et=Z(vt),ut=r(et),At=r(ut,!0);t(ut);var wt=s(ut,2),It=r(wt,!0);t(wt),t(et);var ie=s(et,2),ue=r(ie,!0);t(ie);var we=s(ie,2);Oe(we,21,()=>e(lt),pt,(oe,le)=>{var $e=ha(),ft=r($e),or=r(ft,!0);t(ft);var Ht=s(ft,2),sr=r(Ht,!0);t(Ht),t($e),_(()=>{f(or,e(le).label),f(sr,e(le).value)}),l(oe,$e)}),t(we);var kt=s(we,2);{var St=oe=>{var le=xa(),$e=r(le);t(le),_(()=>f($e,`Data keys: ${e(Je)??""}`)),l(oe,le)};I(kt,oe=>{e(Je)&&oe(St)})}var Ct=s(kt,2);{var tr=oe=>{var le=ba(),$e=r(le);t(le),_(()=>f($e,`${e(n).error.name??""}: ${e(n).error.message??""}`)),l(oe,le)};I(Ct,oe=>{e(n).error&&oe(tr)})}var rr=s(Ct,2);{var ar=oe=>{var le=_a(),$e=s(r(le),2),ft=r($e,!0);t($e),t(le),_(()=>f(ft,e(je))),l(oe,le)};I(rr,oe=>{e(je)&&oe(ar)})}_(oe=>{f(At,e(Ot)),f(It,oe),f(ue,e(n).message)},[()=>j(e(n).timestamp)]),l(qe,vt)},er=qe=>{var vt=Ca(),et=Z(vt);{var ut=ie=>{var ue=wa(),we=r(ue),kt=r(we,!0);t(we);var St=s(we,2),Ct=r(St,!0);t(St),t(ue),_(()=>{f(kt,e(n).message),f(Ct,e(n).message)}),l(ie,ue)},At=ie=>{var ue=ka(),we=r(ue,!0);t(ue),_(()=>f(we,e(n).message)),l(ie,ue)};I(et,ie=>{e(W)?ie(ut):ie(At,-1)})}var wt=s(et,2);{var It=ie=>{var ue=Sa(),we=r(ue);t(ue),_(()=>f(we,`${e(n).duration??""}ms`)),l(ie,ue)};I(wt,ie=>{e(n).duration&&ie(It)})}l(qe,vt)};I(Xe,qe=>{e(N)?qe(Kt):qe(er,-1)})}t(De),_(qe=>{f(ct,qe),Bt(Ke,`background-color: ${e(z)??""}`),Bt(ye,`color: ${e(m)??""}`),f(Nt,e(n).category)},[()=>R(e(n).timestamp)]),l(a,De)});var Lt=s(yt,2);{var nt=a=>{var n=$a();l(a,n)};I(Lt,a=>{S.feed.length===0&&a(nt)})}t(Ye),lr(Ye,a=>x(d,a),()=>e(d)),t(re),t(_t),t(U);var it=s(U,2);la(it,{}),_(()=>{Qe=Fe(Ie,1,"inline-block w-2 h-2 rounded-full",null,Qe,{"bg-[#4ade80]":S.connected,"bg-[#f87171]":!S.connected,"animate-pulse":S.connected}),f(ot,S.connected?"LIVE":"DISCONNECTED"),Fe(re,1,`w-full shrink-0 border-t lg:border-t-0 border-[var(--sig-border)] flex flex-col bg-[var(--sig-bg)] min-h-[220px] max-h-[40vh] lg:max-h-none ${e(ee)}`,"svelte-1kgvdra"),f(xe,`${S.feed.length??""} events`),be=Fe(se,1,"sig-meta",null,be,{"text-[#4ade80]":e(c)&&e(C),"text-[var(--sig-text-muted)]":!e(c)||!e(C)}),f(Me,e(c)&&e(C)?"following":"paused")}),$t("scroll",Ye,B),l(g,Ne),rt()}export{Ra as default};
@@ -1,4 +1,4 @@
1
- import{p as Pt,Q as Mt,i as r,v as d,c as Be,f as R,h as C,w as x,x as m,y,z as _,b as a,t as n,k as D,j as g,l as f,N as Tt,d as It,u as Y,o as X,A as Je,m as h,$ as Nt,G as at,E as Ft,B as _t,U as yt,O as Ge,a1 as qt,a2 as zt,P as Rt}from"./Bh3nIh1p.js";import{P as Bt}from"./Bfse3fCo.js";import{T as Lt}from"./CjrslgAi.js";import{S as Ut,J as Ot,K as Wt,L as jt,B as ve,N as Vt,O as Kt,P as Gt,T as Jt,h as Qt,n as bt,i as Xt,Q as l,R as $t,U as Yt,V as Ht,W as Zt,A as wt,X as er,Y as st,Z as kt,_ as tr}from"./BgfQ4FKr.js";import{I as Le}from"./CvBiS37n.js";import{L as ue}from"./CgXfnXj5.js";import{T as ht}from"./da59D-gJ.js";import{c as Dt,S as At,a as Ct,b as Qe}from"./aHR_cVwV.js";import{S as St}from"./Dg6QtpKo.js";import{B as Re}from"./Bn85XmBz.js";import{P as rr,a as ar,b as sr}from"./Cpk4ODLj.js";import{C as or,a as nr}from"./UZkGIFVx.js";var ir=h("<!> <!>",1),lr=h("<!> <!> <!>",1),dr=h("<!> <!>",1),cr=h('<div class="flex flex-col gap-1"><!> <!></div>'),ur=h('Reason for change <span class="text-[var(--sig-accent)]">*</span>',1),vr=h('<div class="flex flex-col gap-1"><!> <!></div> <div class="grid grid-cols-2 gap-3"><div class="flex flex-col gap-1"><!> <!></div> <div class="flex flex-col gap-1"><!> <!></div></div> <!> <div class="flex flex-col gap-1"><!> <!></div> <div class="flex items-center justify-between"><!> <!></div> <div class="flex flex-col gap-1"><!> <!></div>',1),fr=h('<span class="px-1.5 py-px border border-[var(--sig-border-strong)]"> </span>'),gr=h(`This memory is <strong>pinned</strong>. Deleting it requires
1
+ import{p as Pt,Q as Mt,i as r,v as d,c as Be,f as R,h as C,w as x,x as m,y,z as _,b as a,t as n,k as D,j as g,l as f,N as Tt,d as It,u as Y,o as X,A as Je,m as h,$ as Nt,G as at,E as Ft,B as _t,U as yt,O as Ge,a1 as qt,a2 as zt,P as Rt}from"./Bh3nIh1p.js";import{P as Bt}from"./Bfse3fCo.js";import{T as Lt}from"./CjrslgAi.js";import{S as Ut,J as Ot,K as Wt,L as jt,B as ve,N as Vt,O as Kt,P as Gt,T as Jt,h as Qt,n as bt,i as Xt,Q as l,R as $t,U as Yt,V as Ht,W as Zt,A as wt,X as er,Y as st,Z as kt,_ as tr}from"./DJoUPWd3.js";import{I as Le}from"./BAmT5qpx.js";import{L as ue}from"./DQgCHmza.js";import{T as ht}from"./CkT_occz.js";import{c as Dt,S as At,a as Ct,b as Qe}from"./CZ0Y3d0G.js";import{S as St}from"./C7AxlEo3.js";import{B as Re}from"./BX5xdU5r.js";import{P as rr,a as ar,b as sr}from"./yTmZ10mE.js";import{C as or,a as nr}from"./DuSNCGzP.js";var ir=h("<!> <!>",1),lr=h("<!> <!> <!>",1),dr=h("<!> <!>",1),cr=h('<div class="flex flex-col gap-1"><!> <!></div>'),ur=h('Reason for change <span class="text-[var(--sig-accent)]">*</span>',1),vr=h('<div class="flex flex-col gap-1"><!> <!></div> <div class="grid grid-cols-2 gap-3"><div class="flex flex-col gap-1"><!> <!></div> <div class="flex flex-col gap-1"><!> <!></div></div> <!> <div class="flex flex-col gap-1"><!> <!></div> <div class="flex items-center justify-between"><!> <!></div> <div class="flex flex-col gap-1"><!> <!></div>',1),fr=h('<span class="px-1.5 py-px border border-[var(--sig-border-strong)]"> </span>'),gr=h(`This memory is <strong>pinned</strong>. Deleting it requires
2
2
  force, which removes it permanently from search results.`,1),pr=h('<div class="flex items-center gap-2"><!> <!></div>'),mr=h('Reason for deletion <span class="text-[var(--sig-accent)]">*</span>',1),xr=h(`<div class="flex flex-col gap-2 p-3 border border-[var(--sig-border-strong)]
3
3
  bg-[var(--sig-surface-raised)]"><p class="m-0 text-[var(--sig-text-bright)] text-[11px]
4
4
  leading-[1.5] whitespace-pre-wrap break-words"> </p> <div class="flex flex-wrap gap-1 text-[9px]
@@ -1 +1 @@
1
- import{p as _,g as o,c as w,f as k,k as I,b as s,d as E,E as c,F as f,K as F,J as v,m as g,r as J}from"./Bh3nIh1p.js";import{c as b}from"./BgfQ4FKr.js";var K=g("<input/>"),P=g("<input/>");function q(p,i){_(i,!0);let a=o(i,"ref",15,null),d=o(i,"value",15),m=o(i,"files",15),n=o(i,"data-slot",3,"input"),l=J(i,["$$slots","$$events","$$legacy","ref","value","type","files","class","data-slot"]);var u=w(),x=k(u);{var y=t=>{var e=K();c(e,r=>({"data-slot":n(),class:r,type:"file",...l}),[()=>b("selection:bg-primary dark:bg-input/30 selection:text-primary-foreground border-input ring-offset-background placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i.class)],void 0,void 0,void 0,!0),f(e,r=>a(r),()=>a()),F(e,m),v(e,d),s(t,e)},h=t=>{var e=P();c(e,r=>({"data-slot":n(),class:r,type:i.type,...l}),[()=>b("border-input bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i.class)],void 0,void 0,void 0,!0),f(e,r=>a(r),()=>a()),v(e,d),s(t,e)};I(x,t=>{i.type==="file"?t(y):t(h,-1)})}s(p,u),E()}export{q as I};
1
+ import{p as _,g as o,c as w,f as k,k as I,b as s,d as E,E as c,F as f,K as F,J as v,m as g,r as J}from"./Bh3nIh1p.js";import{c as b}from"./DJoUPWd3.js";var K=g("<input/>"),P=g("<input/>");function q(p,i){_(i,!0);let a=o(i,"ref",15,null),d=o(i,"value",15),m=o(i,"files",15),n=o(i,"data-slot",3,"input"),l=J(i,["$$slots","$$events","$$legacy","ref","value","type","files","class","data-slot"]);var u=w(),x=k(u);{var y=t=>{var e=K();c(e,r=>({"data-slot":n(),class:r,type:"file",...l}),[()=>b("selection:bg-primary dark:bg-input/30 selection:text-primary-foreground border-input ring-offset-background placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i.class)],void 0,void 0,void 0,!0),f(e,r=>a(r),()=>a()),F(e,m),v(e,d),s(t,e)},h=t=>{var e=P();c(e,r=>({"data-slot":n(),class:r,type:i.type,...l}),[()=>b("border-input bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i.class)],void 0,void 0,void 0,!0),f(e,r=>a(r),()=>a()),v(e,d),s(t,e)};I(x,t=>{i.type==="file"?t(y):t(h,-1)})}s(p,u),E()}export{q as I};
@@ -1 +1 @@
1
- import{p,s as c,c as i,f as d,a as h,n as l,b as m,d as f,r as u}from"./Bh3nIh1p.js";import{I as $}from"./BgfQ4FKr.js";function C(o,s){p(s,!0);let r=u(s,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"m9 18 6-6-6-6"}]];$(o,c({name:"chevron-right"},()=>r,{get iconNode(){return t},children:(a,g)=>{var e=i(),n=d(e);h(n,()=>s.children??l),m(a,e)},$$slots:{default:!0}})),f()}export{C};
1
+ import{p,s as c,c as i,f as d,a as h,n as l,b as m,d as f,r as u}from"./Bh3nIh1p.js";import{I as $}from"./DJoUPWd3.js";function C(o,s){p(s,!0);let r=u(s,["$$slots","$$events","$$legacy"]);const t=[["path",{d:"m9 18 6-6-6-6"}]];$(o,c({name:"chevron-right"},()=>r,{get iconNode(){return t},children:(a,g)=>{var e=i(),n=d(e);h(n,()=>s.children??l),m(a,e)},$$slots:{default:!0}})),f()}export{C};
@@ -1,4 +1,4 @@
1
- import{e as We,p as re,s as he,c as de,f as se,a as fe,n as ve,b as w,d as ie,r as we,j as c,k as J,t as _,l as s,y as ee,z as ae,D as ge,A as Te,i as t,m as N,v as m,o as Y,g as ft,Q as Ze,q as ze,aT as Ve,F as Je,B as xe,u as pe,O as G,P as Se,ad as et,N as Ee,af as Ie,w as ke,J as Me,x as vt,G as wt,R as yt}from"./Bh3nIh1p.js";import{H as me,I as ye,aN as bt,be as xt,bf as _t,ac as Et}from"./BgfQ4FKr.js";import{W as at,L as Tt}from"./iMB050gz.js";import{R as st}from"./n-Z9ZzqS.js";import{P as qe}from"./dPUp9rAt.js";import{P as kt}from"./DacFq9N9.js";import{T as St}from"./BEXxAHH7.js";const k=We({entries:[],loading:!1,error:null,groups:[],activeGroup:null,draggingId:null,focusedId:null,widgetCacheVersion:0}),be=new Map,He=new Set;function Ct(){return k.entries.filter(n=>n.state==="tray")}function Nt(){const n=k.entries.filter(e=>e.state==="grid");if(k.activeGroup){const e=k.groups.find(r=>r.id===k.activeGroup);if(e)return n.filter(r=>e.items.includes(r.id))}return n}function It(){return k.entries.filter(n=>n.state==="dock")}const tt=12;function Qe(n,e,r){const a=r?.x??0,d=r?.y??0;function p(L,P,D,H){for(const A of n)if(L<A.x+A.w&&L+D>A.x&&P<A.y+A.h&&P+H>A.y)return!0;return!1}const o=Math.max(0,Math.min(tt-e.w,a)),y=Math.max(0,d);if(!p(o,y,e.w,e.h))return{x:o,y,w:e.w,h:e.h};for(let L=1;L<=20;L++)for(let P=-L;P<=L;P++)for(let D=-L;D<=L;D++){if(Math.abs(D)!==L&&Math.abs(P)!==L)continue;const H=Math.max(0,Math.min(tt-e.w,a+D)),A=Math.max(0,d+P);if(!p(H,A,e.w,e.h))return{x:H,y:A,w:e.w,h:e.h}}return{x:0,y:n.reduce((L,P)=>Math.max(L,P.y+P.h),0),w:e.w,h:e.h}}async function Oe(){k.loading=!0,k.error=null;try{const n=await fetch(`${me}/api/os/tray`);if(!n.ok)throw new Error(`HTTP ${n.status}`);const e=await n.json();k.entries=e.entries??[]}catch(n){k.error=n instanceof Error?n.message:String(n)}finally{k.loading=!1}}async function Ae(n,e,r){try{const a={state:e};r&&(a.gridPosition=r);const d=await fetch(`${me}/api/os/tray/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!d.ok)return!1;const p=await d.json();if(p.success&&p.entry){const o=k.entries.findIndex(y=>y.id===n);o>=0&&(k.entries[o]=p.entry)}return!0}catch{return!1}}async function nt(n,e){return Ae(n,"grid",e)}async function Xe(n,e){const r=k.entries.find(o=>o.id===n);if(!r)return!1;if(e)return Ae(n,"grid",e);const a=r.manifest?.defaultSize??{w:4,h:3},d=k.entries.flatMap(o=>o.id!==n&&o.state==="grid"&&o.gridPosition?[o.gridPosition]:[]),p=Qe(d,a);return Ae(n,"grid",p)}async function Mt(n){return Ae(n,"dock")}async function lt(n){return Ae(n,"tray")}const ct="signet-os-sidebar-groups";function At(){try{const n=localStorage.getItem(ct);n&&(k.groups=JSON.parse(n))}catch{k.groups=[]}}function Fe(){localStorage.setItem(ct,JSON.stringify(k.groups))}function Dt(n){const e={id:`group_${Date.now()}`,name:n,items:[]};return k.groups=[...k.groups,e],Fe(),e}function Rt(n){k.groups=k.groups.filter(e=>e.id!==n),k.activeGroup===n&&(k.activeGroup=null),Fe()}function Lt(n,e){k.groups=k.groups.map(r=>r.id===n?{...r,name:e}:r),Fe()}function Ht(n,e){k.groups=k.groups.map(r=>r.id!==n||r.items.includes(e)?r:{...r,items:[...r.items,e]}),Fe()}function Ge(n){k.activeGroup=n}let Pe=We(new Map),rt=0;function it(n,e,r){Pe.set(n,{action:e,data:r,_seq:++rt}),setTimeout(()=>{const a=Pe.get(n);a&&a._seq===rt&&Pe.delete(n)},500)}function Pt(n){return Pe.get(n)}function Ot(n){k.focusedId=n}function Re(){k.focusedId=null}async function $e(n){if(be.has(n))return be.get(n)??null;try{const e=await fetch(`${me}/api/os/widget/${encodeURIComponent(n)}`);if(!e.ok)return null;const r=await e.json();return r.html?(be.set(n,r.html),k.widgetCacheVersion++,r.html):null}catch{return null}}async function dt(n){if(!He.has(n)){He.add(n),k.widgetCacheVersion++;try{const r=await(await fetch(`${me}/api/os/widget/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:n,force:!1})})).json();r.status==="cached"&&r.html&&be.set(n,r.html)}catch{}finally{be.has(n)&&He.delete(n),k.widgetCacheVersion++}}}const Ke=new Map;function $t(n,e){Ke.set(n,e)}function Wt(n){Ke.delete(n)}function Le(n){return Ke.get(n)}const zt=We({current:null});function _e(n){zt.current=n}function Ye(n,e){re(e,!0);let r=we(e,["$$slots","$$events","$$legacy"]);const a=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]];ye(n,he({name:"box"},()=>r,{get iconNode(){return a},children:(d,p)=>{var o=de(),y=se(o);fe(y,()=>e.children??ve),w(d,o)},$$slots:{default:!0}})),ie()}var Vt=N('<img class="auto-card-icon svelte-1y09vim" referrerpolicy="no-referrer"/>'),Ft=N('<div class="auto-card-icon-placeholder svelte-1y09vim"><!></div>'),jt=N('<button class="auto-card-tool-btn sig-switch svelte-1y09vim" disabled=""><!> <span class="truncate"> </span></button>'),Bt=N('<div class="auto-card-tools svelte-1y09vim"></div>'),Gt=N('<div class="auto-card-empty svelte-1y09vim"><span class="sig-label">No tools exposed</span></div>'),Ut=N('<div class="auto-card svelte-1y09vim"><div class="auto-card-header svelte-1y09vim"><!> <span class="auto-card-name svelte-1y09vim"> </span> <span class="sig-meta ml-auto"> </span></div> <!></div>');function qt(n,e){re(e,!0);var r=Ut(),a=c(r),d=c(a);{var p=O=>{var S=Vt();ee(()=>{ge(S,"src",e.icon),ge(S,"alt",e.name)}),w(O,S)},o=O=>{var S=Ft(),$=c(S);Ye($,{class:"size-4"}),s(S),w(O,S)};J(d,O=>{e.icon?O(p):O(o,-1)})}var y=_(d,2),U=c(y,!0);s(y);var L=_(y,2),P=c(L);s(L),s(a);var D=_(a,2);{var H=O=>{var S=Bt();Te(S,21,()=>e.autoCard.tools,$=>$.name,($,W)=>{var j=jt(),F=c(j);at(F,{class:"size-3 shrink-0 opacity-50"});var te=_(F,2),I=c(te,!0);s(te),s(j),ee(()=>{ge(j,"title",t(W).description||t(W).name),ae(I,t(W).name)}),w($,j)}),s(S),w(O,S)},A=O=>{var S=Gt();w(O,S)};J(D,O=>{e.autoCard.tools.length>0?O(H):O(A,-1)})}s(r),ee(()=>{ae(U,e.name),ae(P,`${e.autoCard.tools.length??""} tools`)}),w(n,r),ie()}const Xt='// Signet Page Agent bundle - PageController + lightweight cursor mask\n// Auto-generated from @page-agent/page-controller v1.6.0\n\n\n(function(){\n // Lightweight SimulatorMask - cursor + overlay, no ai-motion dependency\n var CSS_TEXT = \'.__pa_mask{position:fixed;inset:0;z-index:2147483641;cursor:wait;overflow:hidden;display:none;background:rgba(0,0,0,0.02)}.__pa_mask.__pa_vis{display:block}.__pa_cur{position:absolute;width:40px;height:40px;pointer-events:none;z-index:10000;transition:none}.__pa_cur_fill{position:absolute;width:100%;height:100%;background:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' fill=\\\'%23ffffff\\\' stroke=\\\'%23333\\\' stroke-width=\\\'4\\\'/%3e%3c/svg%3e");background-size:100% 100%;transform-origin:center;transform:rotate(-135deg) scale(1.1);margin-left:-8px;margin-top:-14px}.__pa_cur_border{position:absolute;width:100%;height:100%;background:linear-gradient(45deg,rgb(57,182,255),rgb(189,69,251));mask-image:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\' fill=\\\'none\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' stroke=\\\'%23000\\\' stroke-width=\\\'6\\\'/%3e%3c/svg%3e");mask-size:100% 100%;mask-repeat:no-repeat;transform-origin:center;transform:rotate(-135deg) scale(1.2);margin-left:-10px;margin-top:-18px}.__pa_ripple{position:absolute;width:100%;height:100%;pointer-events:none;margin-left:-50%;margin-top:-50%}.__pa_ripple::after{content:\\\'\\\';opacity:0;position:absolute;inset:0;border:3px solid rgba(57,182,255,1);border-radius:50%}.__pa_cur.__pa_click .__pa_ripple::after{animation:__pa_rip 300ms ease-out forwards}@keyframes __pa_rip{0%{transform:scale(0);opacity:1}100%{transform:scale(2);opacity:0}}\';\n \n try{\n var s=document.createElement(\'style\');\n s.appendChild(document.createTextNode(CSS_TEXT));\n document.head.appendChild(s);\n }catch(e){}\n\n function LiteMask(){\n this.shown=false;\n this.wrapper=document.createElement(\'div\');\n this.wrapper.className=\'__pa_mask\';\n this.wrapper.setAttribute(\'data-page-agent-ignore\',\'true\');\n \n this._cursor=document.createElement(\'div\');\n this._cursor.className=\'__pa_cur\';\n var ripple=document.createElement(\'div\');ripple.className=\'__pa_ripple\';this._cursor.appendChild(ripple);\n var fill=document.createElement(\'div\');fill.className=\'__pa_cur_fill\';this._cursor.appendChild(fill);\n var border=document.createElement(\'div\');border.className=\'__pa_cur_border\';this._cursor.appendChild(border);\n this.wrapper.appendChild(this._cursor);\n \n this._cx=0;this._cy=0;this._tx=0;this._ty=0;\n \n // Block interactions on mask\n [\'click\',\'mousedown\',\'mouseup\',\'mousemove\',\'wheel\',\'keydown\',\'keyup\'].forEach(function(evt){\n this.wrapper.addEventListener(evt,function(e){e.stopPropagation();e.preventDefault();});\n }.bind(this));\n \n document.body.appendChild(this.wrapper);\n this._animate();\n \n var self=this;\n window.addEventListener(\'PageAgent::MovePointerTo\',function(e){\n var d=e.detail;self._tx=d.x;self._ty=d.y;\n });\n window.addEventListener(\'PageAgent::ClickPointer\',function(){\n self._cursor.classList.remove(\'__pa_click\');\n void self._cursor.offsetHeight;\n self._cursor.classList.add(\'__pa_click\');\n });\n }\n \n LiteMask.prototype._animate=function(){\n var nx=this._cx+(this._tx-this._cx)*0.2;\n var ny=this._cy+(this._ty-this._cy)*0.2;\n if(Math.abs(nx-this._tx)>0){this._cx=Math.abs(nx-this._tx)<2?this._tx:nx;this._cursor.style.left=this._cx+\'px\';}\n if(Math.abs(ny-this._ty)>0){this._cy=Math.abs(ny-this._ty)<2?this._ty:ny;this._cursor.style.top=this._cy+\'px\';}\n requestAnimationFrame(this._animate.bind(this));\n };\n \n LiteMask.prototype.show=function(){\n if(this.shown)return;this.shown=true;\n this.wrapper.classList.add(\'__pa_vis\');\n this._cx=window.innerWidth/2;this._cy=window.innerHeight/2;\n this._tx=this._cx;this._ty=this._cy;\n this._cursor.style.left=this._cx+\'px\';this._cursor.style.top=this._cy+\'px\';\n };\n \n LiteMask.prototype.hide=function(){\n if(!this.shown)return;this.shown=false;\n this._cursor.classList.remove(\'__pa_click\');\n var w=this.wrapper;\n setTimeout(function(){w.classList.remove(\'__pa_vis\');},300);\n };\n \n LiteMask.prototype.dispose=function(){this.wrapper.remove();};\n \n window.__LiteMask=LiteMask;\n})();\n\n// --- PageController (modified: SimulatorMask replaced with LiteMask) ---\n(function(){\n(function(){var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function isHTMLElement(el){return!!el&&el.nodeType===1}__name(isHTMLElement,"isHTMLElement");function isInputElement(el){return el?.nodeType===1&&el.tagName==="INPUT"}__name(isInputElement,"isInputElement");function isTextAreaElement(el){return el?.nodeType===1&&el.tagName==="TEXTAREA"}__name(isTextAreaElement,"isTextAreaElement");function isSelectElement(el){return el?.nodeType===1&&el.tagName==="SELECT"}__name(isSelectElement,"isSelectElement");function isAnchorElement(el){return el?.nodeType===1&&el.tagName==="A"}__name(isAnchorElement,"isAnchorElement");function getIframeOffset(element){const frame=element.ownerDocument.defaultView?.frameElement;if(!frame)return{x:0,y:0};const rect=frame.getBoundingClientRect();return{x:rect.left,y:rect.top}}__name(getIframeOffset,"getIframeOffset");function getNativeValueSetter(element){return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element),"value").set}__name(getNativeValueSetter,"getNativeValueSetter");async function waitFor(seconds){await new Promise((resolve)=>setTimeout(resolve,seconds*1000))}__name(waitFor,"waitFor");async function movePointerToElement(element){const rect=element.getBoundingClientRect();const offset=getIframeOffset(element);const x=rect.left+rect.width/2+offset.x;const y=rect.top+rect.height/2+offset.y;window.dispatchEvent(new CustomEvent("PageAgent::MovePointerTo",{detail:{x,y}}));await waitFor(0.3)}__name(movePointerToElement,"movePointerToElement");function getElementByIndex(selectorMap,index){const interactiveNode=selectorMap.get(index);if(!interactiveNode){throw new Error(`No interactive element found at index ${index}`)}const element=interactiveNode.ref;if(!element){throw new Error(`Element at index ${index} does not have a reference`)}if(!isHTMLElement(element)){throw new Error(`Element at index ${index} is not an HTMLElement`)}return element}__name(getElementByIndex,"getElementByIndex");let lastClickedElement=null;function blurLastClickedElement(){if(lastClickedElement){lastClickedElement.blur();lastClickedElement.dispatchEvent(new MouseEvent("mouseout",{bubbles:true,cancelable:true}));lastClickedElement.dispatchEvent(new MouseEvent("mouseleave",{bubbles:false,cancelable:true}));lastClickedElement=null}}__name(blurLastClickedElement,"blurLastClickedElement");async function clickElement(element){blurLastClickedElement();lastClickedElement=element;await scrollIntoViewIfNeeded(element);const frame=element.ownerDocument.defaultView?.frameElement;if(frame)await scrollIntoViewIfNeeded(frame);await movePointerToElement(element);window.dispatchEvent(new CustomEvent("PageAgent::ClickPointer"));await waitFor(0.1);element.dispatchEvent(new MouseEvent("mouseenter",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mouseover",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mousedown",{bubbles:true,cancelable:true}));element.focus();element.dispatchEvent(new MouseEvent("mouseup",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("click",{bubbles:true,cancelable:true}));await waitFor(0.2)}__name(clickElement,"clickElement");async function inputTextElement(element,text){const isContentEditable=element.isContentEditable;if(!isInputElement(element)&&!isTextAreaElement(element)&&!isContentEditable){throw new Error("Element is not an input, textarea, or contenteditable")}await clickElement(element);if(isContentEditable){if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"deleteContent"}))){element.innerText="";element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"deleteContent"}))}if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"insertText",data:text}))){element.innerText=text;element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:text}))}const planASucceeded=element.innerText.trim()===text.trim();if(!planASucceeded){element.focus();const doc=element.ownerDocument;const selection=(doc.defaultView||window).getSelection();const range=doc.createRange();range.selectNodeContents(element);selection?.removeAllRanges();selection?.addRange(range);doc.execCommand("delete",false);doc.execCommand("insertText",false,text)}element.dispatchEvent(new Event("change",{bubbles:true}));element.blur()}else{getNativeValueSetter(element).call(element,text)}if(!isContentEditable){element.dispatchEvent(new Event("input",{bubbles:true}))}await waitFor(0.1);blurLastClickedElement()}__name(inputTextElement,"inputTextElement");async function selectOptionElement(selectElement,optionText){if(!isSelectElement(selectElement)){throw new Error("Element is not a select element")}const options=Array.from(selectElement.options);const option=options.find((opt)=>opt.textContent?.trim()===optionText.trim());if(!option){throw new Error(`Option with text "${optionText}" not found in select element`)}selectElement.value=option.value;selectElement.dispatchEvent(new Event("change",{bubbles:true}));await waitFor(0.1)}__name(selectOptionElement,"selectOptionElement");async function scrollIntoViewIfNeeded(element){const el=element;if(typeof el.scrollIntoViewIfNeeded==="function"){el.scrollIntoViewIfNeeded()}else{element.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})}}__name(scrollIntoViewIfNeeded,"scrollIntoViewIfNeeded");async function scrollVertically(down,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dy2=scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableY=/(auto|scroll|overlay)/.test(computedStyle.overflowY);const canScrollVertically=currentElement.scrollHeight>currentElement.clientHeight;if(hasScrollableY&&canScrollVertically){const beforeScroll=currentElement.scrollTop;const maxScroll=currentElement.scrollHeight-currentElement.clientHeight;let scrollAmount=dy2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollTop=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollTop;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) by ${scrollDelta}px`}else{return`No scrollable container found for element (${targetElement.tagName})`}}const dy=scroll_amount;const bigEnough=__name((el2)=>el2.clientHeight>=window.innerHeight*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowY)&&el2.scrollHeight>el2.clientHeight&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollY;const scrollMax=document.documentElement.scrollHeight-window.innerHeight;window.scrollBy(0,dy);const scrollAfter=window.scrollY;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of the page, cannot scroll down further.`:`⚠️ Already at the top of the page, cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled page by ${scrolled}px. Reached the bottom of the page.`;if(reachedTop)return`✅ Scrolled page by ${scrolled}px. Reached the top of the page.`;return`✅ Scrolled page by ${scrolled}px.`}else{const scrollBefore=el.scrollTop;const scrollMax=el.scrollHeight-el.clientHeight;el.scrollBy({top:dy,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollTop;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of container (${el.tagName}), cannot scroll down further.`:`⚠️ Already at the top of container (${el.tagName}), cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the bottom.`;if(reachedTop)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the top.`;return`✅ Scrolled container (${el.tagName}) by ${scrolled}px.`}}__name(scrollVertically,"scrollVertically");async function scrollHorizontally(right,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dx2=right?scroll_amount:-scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableX=/(auto|scroll|overlay)/.test(computedStyle.overflowX);const canScrollHorizontally=currentElement.scrollWidth>currentElement.clientWidth;if(hasScrollableX&&canScrollHorizontally){const beforeScroll=currentElement.scrollLeft;const maxScroll=currentElement.scrollWidth-currentElement.clientWidth;let scrollAmount=dx2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollLeft=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollLeft;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) horizontally by ${scrollDelta}px`}else{return`No horizontally scrollable container found for element (${targetElement.tagName})`}}const dx=right?scroll_amount:-scroll_amount;const bigEnough=__name((el2)=>el2.clientWidth>=window.innerWidth*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowX)&&el2.scrollWidth>el2.clientWidth&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollX;const scrollMax=document.documentElement.scrollWidth-window.innerWidth;window.scrollBy(dx,0);const scrollAfter=window.scrollX;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of the page, cannot scroll right further.`:`⚠️ Already at the left edge of the page, cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled page by ${scrolled}px. Reached the right edge of the page.`;if(reachedLeft)return`✅ Scrolled page by ${scrolled}px. Reached the left edge of the page.`;return`✅ Scrolled page horizontally by ${scrolled}px.`}else{const scrollBefore=el.scrollLeft;const scrollMax=el.scrollWidth-el.clientWidth;el.scrollBy({left:dx,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollLeft;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of container (${el.tagName}), cannot scroll right further.`:`⚠️ Already at the left edge of container (${el.tagName}), cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the right edge.`;if(reachedLeft)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the left edge.`;return`✅ Scrolled container (${el.tagName}) horizontally by ${scrolled}px.`}}__name(scrollHorizontally,"scrollHorizontally");const domTree=__name((args={doHighlightElements:true,focusHighlightIndex:-1,viewportExpansion:0,debugMode:false,interactiveBlacklist:[],interactiveWhitelist:[],highlightOpacity:0.1,highlightLabelOpacity:0.5})=>{const{interactiveBlacklist,interactiveWhitelist,highlightOpacity,highlightLabelOpacity}=args;const{doHighlightElements,focusHighlightIndex,viewportExpansion,debugMode}=args;let highlightIndex=0;const extraData=new WeakMap;function addExtraData(element,data){if(!element||element.nodeType!==Node.ELEMENT_NODE)return;extraData.set(element,{...extraData.get(element),...data})}__name(addExtraData,"addExtraData");const DOM_CACHE={boundingRects:new WeakMap,clientRects:new WeakMap,computedStyles:new WeakMap,clearCache:__name(()=>{DOM_CACHE.boundingRects=new WeakMap;DOM_CACHE.clientRects=new WeakMap;DOM_CACHE.computedStyles=new WeakMap},"clearCache")};function getCachedBoundingRect(element){if(!element)return null;if(DOM_CACHE.boundingRects.has(element)){return DOM_CACHE.boundingRects.get(element)}const rect=element.getBoundingClientRect();if(rect){DOM_CACHE.boundingRects.set(element,rect)}return rect}__name(getCachedBoundingRect,"getCachedBoundingRect");function getCachedComputedStyle(element){if(!element)return null;if(DOM_CACHE.computedStyles.has(element)){return DOM_CACHE.computedStyles.get(element)}const style=window.getComputedStyle(element);if(style){DOM_CACHE.computedStyles.set(element,style)}return style}__name(getCachedComputedStyle,"getCachedComputedStyle");function getCachedClientRects(element){if(!element)return null;if(DOM_CACHE.clientRects.has(element)){return DOM_CACHE.clientRects.get(element)}const rects=element.getClientRects();if(rects){DOM_CACHE.clientRects.set(element,rects)}return rects}__name(getCachedClientRects,"getCachedClientRects");const DOM_HASH_MAP={};const ID={current:0};const HIGHLIGHT_CONTAINER_ID="playwright-highlight-container";function highlightElement(element,index,parentIframe=null){if(!element)return index;const overlays=[];let label=null;let labelWidth=20;let labelHeight=16;let cleanupFn=null;try{let container=document.getElementById(HIGHLIGHT_CONTAINER_ID);if(!container){container=document.createElement("div");container.id=HIGHLIGHT_CONTAINER_ID;container.style.position="fixed";container.style.pointerEvents="none";container.style.top="0";container.style.left="0";container.style.width="100%";container.style.height="100%";container.style.zIndex="2147483640";container.style.backgroundColor="transparent";document.body.appendChild(container)}const rects=element.getClientRects();if(!rects||rects.length===0)return index;const colors=["#FF0000","#00FF00","#0000FF","#FFA500","#800080","#008080","#FF69B4","#4B0082","#FF4500","#2E8B57","#DC143C","#4682B4"];const colorIndex=index%colors.length;let baseColor=colors[colorIndex];const backgroundColor=baseColor+Math.floor(highlightOpacity*255).toString(16).padStart(2,"0");baseColor=baseColor+Math.floor(highlightLabelOpacity*255).toString(16).padStart(2,"0");let iframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();iframeOffset.x=iframeRect.left;iframeOffset.y=iframeRect.top}const fragment=document.createDocumentFragment();for(const rect of rects){if(rect.width===0||rect.height===0)continue;const overlay=document.createElement("div");overlay.style.position="fixed";overlay.style.border=`2px solid ${baseColor}`;overlay.style.backgroundColor=backgroundColor;overlay.style.pointerEvents="none";overlay.style.boxSizing="border-box";const top=rect.top+iframeOffset.y;const left=rect.left+iframeOffset.x;overlay.style.top=`${top}px`;overlay.style.left=`${left}px`;overlay.style.width=`${rect.width}px`;overlay.style.height=`${rect.height}px`;fragment.appendChild(overlay);overlays.push({element:overlay,initialRect:rect})}const firstRect=rects[0];label=document.createElement("div");label.className="playwright-highlight-label";label.style.position="fixed";label.style.background=baseColor;label.style.color="white";label.style.padding="1px 4px";label.style.borderRadius="4px";label.style.fontSize=`${Math.min(12,Math.max(8,firstRect.height/2))}px`;label.textContent=index.toString();labelWidth=label.offsetWidth>0?label.offsetWidth:labelWidth;labelHeight=label.offsetHeight>0?label.offsetHeight:labelHeight;const firstRectTop=firstRect.top+iframeOffset.y;const firstRectLeft=firstRect.left+iframeOffset.x;let labelTop=firstRectTop+2;let labelLeft=firstRectLeft+firstRect.width-labelWidth-2;if(firstRect.width<labelWidth+4||firstRect.height<labelHeight+4){labelTop=firstRectTop-labelHeight-2;labelLeft=firstRectLeft+firstRect.width-labelWidth;if(labelLeft<iframeOffset.x)labelLeft=firstRectLeft}labelTop=Math.max(0,Math.min(labelTop,window.innerHeight-labelHeight));labelLeft=Math.max(0,Math.min(labelLeft,window.innerWidth-labelWidth));label.style.top=`${labelTop}px`;label.style.left=`${labelLeft}px`;fragment.appendChild(label);const updatePositions=__name(()=>{const newRects=element.getClientRects();let newIframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();newIframeOffset.x=iframeRect.left;newIframeOffset.y=iframeRect.top}overlays.forEach((overlayData,i)=>{if(i<newRects.length){const newRect=newRects[i];const newTop=newRect.top+newIframeOffset.y;const newLeft=newRect.left+newIframeOffset.x;overlayData.element.style.top=`${newTop}px`;overlayData.element.style.left=`${newLeft}px`;overlayData.element.style.width=`${newRect.width}px`;overlayData.element.style.height=`${newRect.height}px`;overlayData.element.style.display=newRect.width===0||newRect.height===0?"none":"block"}else{overlayData.element.style.display="none"}});if(newRects.length<overlays.length){for(let i=newRects.length;i<overlays.length;i++){overlays[i].element.style.display="none"}}if(label&&newRects.length>0){const firstNewRect=newRects[0];const firstNewRectTop=firstNewRect.top+newIframeOffset.y;const firstNewRectLeft=firstNewRect.left+newIframeOffset.x;let newLabelTop=firstNewRectTop+2;let newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth-2;if(firstNewRect.width<labelWidth+4||firstNewRect.height<labelHeight+4){newLabelTop=firstNewRectTop-labelHeight-2;newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth;if(newLabelLeft<newIframeOffset.x)newLabelLeft=firstNewRectLeft}newLabelTop=Math.max(0,Math.min(newLabelTop,window.innerHeight-labelHeight));newLabelLeft=Math.max(0,Math.min(newLabelLeft,window.innerWidth-labelWidth));label.style.top=`${newLabelTop}px`;label.style.left=`${newLabelLeft}px`;label.style.display="block"}else if(label){label.style.display="none"}},"updatePositions");const throttleFunction=__name((func,delay)=>{let lastCall=0;return(...args2)=>{const now=performance.now();if(now-lastCall<delay)return;lastCall=now;return func(...args2)}},"throttleFunction");const throttledUpdatePositions=throttleFunction(updatePositions,16);window.addEventListener("scroll",throttledUpdatePositions,true);window.addEventListener("resize",throttledUpdatePositions);cleanupFn=__name(()=>{window.removeEventListener("scroll",throttledUpdatePositions,true);window.removeEventListener("resize",throttledUpdatePositions);overlays.forEach((overlay)=>overlay.element.remove());if(label)label.remove()},"cleanupFn");container.appendChild(fragment);return index+1}finally{if(cleanupFn){(window._highlightCleanupFunctions=window._highlightCleanupFunctions||[]).push(cleanupFn)}}}__name(highlightElement,"highlightElement");function isScrollableElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return null}const style=getCachedComputedStyle(element);if(!style)return null;const display=style.display;if(display==="inline"||display==="inline-block"){return null}const overflowX=style.overflowX;const overflowY=style.overflowY;const scrollableX=overflowX==="auto"||overflowX==="scroll";const scrollableY=overflowY==="auto"||overflowY==="scroll";if(!scrollableX&&!scrollableY){return null}const scrollWidth=element.scrollWidth-element.clientWidth;const scrollHeight=element.scrollHeight-element.clientHeight;const threshold=4;if(scrollWidth<threshold&&scrollHeight<threshold){return null}if(!scrollableY&&scrollWidth<threshold){return null}if(!scrollableX&&scrollHeight<threshold){return null}const distanceToTop=element.scrollTop;const distanceToLeft=element.scrollLeft;const distanceToRight=element.scrollWidth-element.clientWidth-element.scrollLeft;const distanceToBottom=element.scrollHeight-element.clientHeight-element.scrollTop;const scrollData={top:distanceToTop,right:distanceToRight,bottom:distanceToBottom,left:distanceToLeft};addExtraData(element,{scrollable:true,scrollData});return scrollData}__name(isScrollableElement,"isScrollableElement");function isTextNodeVisible(textNode){try{if(viewportExpansion===-1){const parentElement2=textNode.parentElement;if(!parentElement2)return false;try{return parentElement2.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement2);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}const range=document.createRange();range.selectNodeContents(textNode);const rects=range.getClientRects();if(!rects||rects.length===0){return false}let isAnyRectVisible=false;let isAnyRectInViewport=false;for(const rect of rects){if(rect.width>0&&rect.height>0){isAnyRectVisible=true;if(!(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}}if(!isAnyRectVisible||!isAnyRectInViewport){return false}const parentElement=textNode.parentElement;if(!parentElement)return false;try{return parentElement.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}catch(e){console.warn("Error checking text node visibility:",e);return false}}__name(isTextNodeVisible,"isTextNodeVisible");function isElementAccepted(element){if(!element||!element.tagName)return false;const alwaysAccept=new Set(["body","div","main","article","section","nav","header","footer"]);const tagName=element.tagName.toLowerCase();if(alwaysAccept.has(tagName))return true;const leafElementDenyList=new Set(["svg","script","style","link","meta","noscript","template"]);return!leafElementDenyList.has(tagName)}__name(isElementAccepted,"isElementAccepted");function isElementVisible(element){const style=getCachedComputedStyle(element);return element.offsetWidth>0&&element.offsetHeight>0&&style?.visibility!=="hidden"&&style?.display!=="none"}__name(isElementVisible,"isElementVisible");function isInteractiveElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}if(interactiveBlacklist.includes(element)){return false}if(interactiveWhitelist.includes(element)){return true}const tagName=element.tagName.toLowerCase();const style=getCachedComputedStyle(element);const interactiveCursors=new Set(["pointer","move","text","grab","grabbing","cell","copy","alias","all-scroll","col-resize","context-menu","crosshair","e-resize","ew-resize","help","n-resize","ne-resize","nesw-resize","ns-resize","nw-resize","nwse-resize","row-resize","s-resize","se-resize","sw-resize","vertical-text","w-resize","zoom-in","zoom-out"]);const nonInteractiveCursors=new Set(["not-allowed","no-drop","wait","progress","initial","inherit"]);function doesElementHaveInteractivePointer(element2){if(element2.tagName.toLowerCase()==="html")return false;if(style?.cursor&&interactiveCursors.has(style.cursor))return true;return false}__name(doesElementHaveInteractivePointer,"doesElementHaveInteractivePointer");let isInteractiveCursor=doesElementHaveInteractivePointer(element);if(isInteractiveCursor){return true}const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label","option","optgroup","fieldset","legend"]);const explicitDisableTags=new Set(["disabled","readonly"]);if(interactiveElements.has(tagName)){if(style?.cursor&&nonInteractiveCursors.has(style.cursor)){return false}for(const disableTag of explicitDisableTags){if(element.hasAttribute(disableTag)||element.getAttribute(disableTag)==="true"||element.getAttribute(disableTag)===""){return false}}if(element.disabled){return false}if(element.readOnly){return false}if(element.inert){return false}return true}const role=element.getAttribute("role");const ariaRole=element.getAttribute("aria-role");if(element.getAttribute("contenteditable")==="true"||element.isContentEditable){return true}if(element.classList&&(element.classList.contains("button")||element.classList.contains("dropdown-toggle")||element.getAttribute("data-index")||element.getAttribute("data-toggle")==="dropdown"||element.getAttribute("aria-haspopup")==="true")){return true}const interactiveRoles=new Set(["button","menu","menubar","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);const hasInteractiveRole=interactiveElements.has(tagName)||role&&interactiveRoles.has(role)||ariaRole&&interactiveRoles.has(ariaRole);if(hasInteractiveRole)return true;try{if(typeof getEventListeners==="function"){const listeners=getEventListeners(element);const mouseEvents=["click","mousedown","mouseup","dblclick"];for(const eventType of mouseEvents){if(listeners[eventType]&&listeners[eventType].length>0){return true}}}const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonMouseAttrs=["onclick","onmousedown","onmouseup","ondblclick"];for(const attr of commonMouseAttrs){if(element.hasAttribute(attr)||typeof element[attr]==="function"){return true}}}catch(e){}if(isScrollableElement(element)){return true}return false}__name(isInteractiveElement,"isInteractiveElement");function isTopElement(element){if(viewportExpansion===-1){return true}const rects=getCachedClientRects(element);if(!rects||rects.length===0){return false}let isAnyRectInViewport=false;for(const rect2 of rects){if(rect2.width>0&&rect2.height>0&&!(rect2.bottom<-viewportExpansion||rect2.top>window.innerHeight+viewportExpansion||rect2.right<-viewportExpansion||rect2.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}if(!isAnyRectInViewport){return false}let doc=element.ownerDocument;if(doc!==window.document){return true}let rect=Array.from(rects).find((r)=>r.width>0&&r.height>0);if(!rect){return false}const shadowRoot=element.getRootNode();if(shadowRoot instanceof ShadowRoot){const centerX=rect.left+rect.width/2;const centerY=rect.top+rect.height/2;try{const topEl=shadowRoot.elementFromPoint(centerX,centerY);if(!topEl)return false;let current=topEl;while(current&&current!==shadowRoot){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}}const margin=5;const checkPoints=[{x:rect.left+rect.width/2,y:rect.top+rect.height/2},{x:rect.left+margin,y:rect.top+margin},{x:rect.right-margin,y:rect.bottom-margin}];return checkPoints.some(({x,y})=>{try{const topEl=document.elementFromPoint(x,y);if(!topEl)return false;let current=topEl;while(current&&current!==document.documentElement){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}})}__name(isTopElement,"isTopElement");function isInExpandedViewport(element,viewportExpansion2){if(viewportExpansion2===-1){return true}const rects=element.getClientRects();if(!rects||rects.length===0){const boundingRect=getCachedBoundingRect(element);if(!boundingRect||boundingRect.width===0||boundingRect.height===0){return false}return!(boundingRect.bottom<-viewportExpansion2||boundingRect.top>window.innerHeight+viewportExpansion2||boundingRect.right<-viewportExpansion2||boundingRect.left>window.innerWidth+viewportExpansion2)}for(const rect of rects){if(rect.width===0||rect.height===0)continue;if(!(rect.bottom<-viewportExpansion2||rect.top>window.innerHeight+viewportExpansion2||rect.right<-viewportExpansion2||rect.left>window.innerWidth+viewportExpansion2)){return true}}return false}__name(isInExpandedViewport,"isInExpandedViewport");function isInteractiveCandidate(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;const tagName=element.tagName.toLowerCase();const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label"]);if(interactiveElements.has(tagName))return true;const hasQuickInteractiveAttr=element.hasAttribute("onclick")||element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("aria-")||element.hasAttribute("data-action")||element.getAttribute("contenteditable")==="true";return hasQuickInteractiveAttr}__name(isInteractiveCandidate,"isInteractiveCandidate");const DISTINCT_INTERACTIVE_TAGS=new Set(["a","button","input","select","textarea","summary","details","label","option"]);const INTERACTIVE_ROLES=new Set(["button","link","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);function isHeuristicallyInteractive(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;if(!isElementVisible(element))return false;const hasInteractiveAttributes=element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("onclick")||typeof element.onclick==="function";const hasInteractiveClass=/\\b(btn|clickable|menu|item|entry|link)\\b/i.test(element.className||"");const isInKnownContainer=Boolean(element.closest(\'button,a,[role="button"],.menu,.dropdown,.list,.toolbar\'));const hasVisibleChildren=[...element.children].some(isElementVisible);const isParentBody=element.parentElement&&element.parentElement.isSameNode(document.body);return(isInteractiveElement(element)||hasInteractiveAttributes||hasInteractiveClass)&&hasVisibleChildren&&isInKnownContainer&&!isParentBody}__name(isHeuristicallyInteractive,"isHeuristicallyInteractive");function isElementDistinctInteraction(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}const tagName=element.tagName.toLowerCase();const role=element.getAttribute("role");if(tagName==="iframe"){return true}if(DISTINCT_INTERACTIVE_TAGS.has(tagName)){return true}if(role&&INTERACTIVE_ROLES.has(role)){return true}if(element.isContentEditable||element.getAttribute("contenteditable")==="true"){return true}if(element.hasAttribute("data-testid")||element.hasAttribute("data-cy")||element.hasAttribute("data-test")){return true}if(element.hasAttribute("onclick")||typeof element.onclick==="function"){return true}try{const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonEventAttrs=["onmousedown","onmouseup","onkeydown","onkeyup","onsubmit","onchange","oninput","onfocus","onblur"];if(commonEventAttrs.some((attr)=>element.hasAttribute(attr))){return true}}catch(e){}if(isHeuristicallyInteractive(element)){return true}return false}__name(isElementDistinctInteraction,"isElementDistinctInteraction");function handleHighlighting(nodeData,node,parentIframe,isParentHighlighted){if(!nodeData.isInteractive)return false;let shouldHighlight=false;if(!isParentHighlighted){shouldHighlight=true}else{if(isElementDistinctInteraction(node)){shouldHighlight=true}else{shouldHighlight=false}}if(shouldHighlight){nodeData.isInViewport=isInExpandedViewport(node,viewportExpansion);if(nodeData.isInViewport||viewportExpansion===-1){nodeData.highlightIndex=highlightIndex++;if(doHighlightElements){if(focusHighlightIndex>=0){if(focusHighlightIndex===nodeData.highlightIndex){highlightElement(node,nodeData.highlightIndex,parentIframe)}}else{highlightElement(node,nodeData.highlightIndex,parentIframe)}return true}}}return false}__name(handleHighlighting,"handleHighlighting");function buildDomTree(node,parentIframe=null,isParentHighlighted=false){if(!node||node.id===HIGHLIGHT_CONTAINER_ID||node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(!node||node.id===HIGHLIGHT_CONTAINER_ID){return null}if(node.dataset?.browserUseIgnore==="true"||node.dataset?.pageAgentIgnore==="true"){return null}if(node.getAttribute&&node.getAttribute("aria-hidden")==="true"){return null}if(node===document.body){const nodeData2={tagName:"body",attributes:{},xpath:"/body",children:[]};for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,false);if(domElement)nodeData2.children.push(domElement)}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]=nodeData2;return id2}if(node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(node.nodeType===Node.TEXT_NODE){const textContent=node.textContent?.trim();if(!textContent){return null}const parentElement=node.parentElement;if(!parentElement||parentElement.tagName.toLowerCase()==="script"){return null}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]={type:"TEXT_NODE",text:textContent,isVisible:isTextNodeVisible(node)};return id2}if(node.nodeType===Node.ELEMENT_NODE&&!isElementAccepted(node)){return null}if(viewportExpansion!==-1&&!node.shadowRoot){const rect=getCachedBoundingRect(node);const style=getCachedComputedStyle(node);const isFixedOrSticky=style&&(style.position==="fixed"||style.position==="sticky");const hasSize=node.offsetWidth>0||node.offsetHeight>0;if(!rect||!isFixedOrSticky&&!hasSize&&(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){return null}}const nodeData={tagName:node.tagName.toLowerCase(),attributes:{},children:[]};if(isInteractiveCandidate(node)||node.tagName.toLowerCase()==="iframe"||node.tagName.toLowerCase()==="body"){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}if(node.tagName.toLowerCase()==="input"&&(node.type==="checkbox"||node.type==="radio")){nodeData.attributes.checked=node.checked?"true":"false"}}let nodeWasHighlighted=false;if(node.nodeType===Node.ELEMENT_NODE){nodeData.isVisible=isElementVisible(node);if(nodeData.isVisible){nodeData.isTopElement=isTopElement(node);const role=node.getAttribute("role");const isMenuContainer=role==="menu"||role==="menubar"||role==="listbox";if(nodeData.isTopElement||isMenuContainer){nodeData.isInteractive=isInteractiveElement(node);nodeWasHighlighted=handleHighlighting(nodeData,node,parentIframe,isParentHighlighted);nodeData.ref=node;if(nodeData.isInteractive&&Object.keys(nodeData.attributes).length===0){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}}}}}if(node.tagName){const tagName=node.tagName.toLowerCase();if(tagName==="iframe"){try{const iframeDoc=node.contentDocument||node.contentWindow?.document;if(iframeDoc){for(const child of iframeDoc.childNodes){const domElement=buildDomTree(child,node,false);if(domElement)nodeData.children.push(domElement)}}}catch(e){console.warn("Unable to access iframe:",e)}}else if(node.isContentEditable||node.getAttribute("contenteditable")==="true"||node.id==="tinymce"||node.classList.contains("mce-content-body")||tagName==="body"&&node.getAttribute("data-id")?.startsWith("mce_")){for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}else{if(node.shadowRoot){nodeData.shadowRoot=true;for(const child of node.shadowRoot.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}for(const child of node.childNodes){const passHighlightStatusToChild=nodeWasHighlighted||isParentHighlighted;const domElement=buildDomTree(child,parentIframe,passHighlightStatusToChild);if(domElement)nodeData.children.push(domElement)}}}if(nodeData.tagName==="a"&&nodeData.children.length===0&&!nodeData.attributes.href){const rect=getCachedBoundingRect(node);const hasSize=rect&&rect.width>0&&rect.height>0||node.offsetWidth>0||node.offsetHeight>0;if(!hasSize){return null}}nodeData.extra=extraData.get(node)||null;const id=`${ID.current++}`;DOM_HASH_MAP[id]=nodeData;return id}__name(buildDomTree,"buildDomTree");const rootId=buildDomTree(document.body);DOM_CACHE.clearCache();return{rootId,map:DOM_HASH_MAP}},"domTree");const DEFAULT_VIEWPORT_EXPANSION=-1;function resolveViewportExpansion(viewportExpansion){return viewportExpansion??DEFAULT_VIEWPORT_EXPANSION}__name(resolveViewportExpansion,"resolveViewportExpansion");const newElementsCache=new WeakMap;function getFlatTree(config){const viewportExpansion=resolveViewportExpansion(config.viewportExpansion);const interactiveBlacklist=[];for(const item of config.interactiveBlacklist||[]){if(typeof item==="function"){interactiveBlacklist.push(item())}else{interactiveBlacklist.push(item)}}const interactiveWhitelist=[];for(const item of config.interactiveWhitelist||[]){if(typeof item==="function"){interactiveWhitelist.push(item())}else{interactiveWhitelist.push(item)}}const elements=domTree({doHighlightElements:true,debugMode:true,focusHighlightIndex:-1,viewportExpansion,interactiveBlacklist,interactiveWhitelist,highlightOpacity:config.highlightOpacity??0,highlightLabelOpacity:config.highlightLabelOpacity??0.1});const currentUrl=window.location.href;for(const nodeId in elements.map){const node=elements.map[nodeId];if(node.isInteractive&&node.ref){const ref=node.ref;if(!newElementsCache.has(ref)){newElementsCache.set(ref,currentUrl);node.isNew=true}}}return elements}__name(getFlatTree,"getFlatTree");const globRegexCache=new Map;function globToRegex(pattern){let regex=globRegexCache.get(pattern);if(!regex){const escaped=pattern.replace(/[.+^${}()|[\\]\\\\]/g,"\\\\$&");regex=new RegExp(`^${escaped.replace(/\\*/g,".*")}$`);globRegexCache.set(pattern,regex)}return regex}__name(globToRegex,"globToRegex");function matchAttributes(attrs,patterns){const result2={};for(const pattern of patterns){if(pattern.includes("*")){const regex=globToRegex(pattern);for(const key of Object.keys(attrs)){if(regex.test(key)&&attrs[key].trim()){result2[key]=attrs[key].trim()}}}else{const value=attrs[pattern];if(value&&value.trim()){result2[pattern]=value.trim()}}}return result2}__name(matchAttributes,"matchAttributes");function flatTreeToString(flatTree,includeAttributes){const DEFAULT_INCLUDE_ATTRIBUTES=["title","type","checked","name","role","value","placeholder","data-date-format","alt","aria-label","aria-expanded","data-state","aria-checked","id","for","target","aria-haspopup","aria-controls","aria-owns","contenteditable"];const includeAttrs=[...includeAttributes||[],...DEFAULT_INCLUDE_ATTRIBUTES];const capTextLength=__name((text,maxLength)=>{if(text.length>maxLength){return text.substring(0,maxLength)+"..."}return text},"capTextLength");const buildTreeNode=__name((nodeId)=>{const node=flatTree.map[nodeId];if(!node)return null;if(node.type==="TEXT_NODE"){const textNode=node;return{type:"text",text:textNode.text,isVisible:textNode.isVisible,parent:null,children:[]}}else{const elementNode=node;const children=[];if(elementNode.children){for(const childId of elementNode.children){const child=buildTreeNode(childId);if(child){child.parent=null;children.push(child)}}}return{type:"element",tagName:elementNode.tagName,attributes:elementNode.attributes??{},isVisible:elementNode.isVisible??false,isInteractive:elementNode.isInteractive??false,isTopElement:elementNode.isTopElement??false,isNew:elementNode.isNew??false,highlightIndex:elementNode.highlightIndex,parent:null,children,extra:elementNode.extra??{}}}},"buildTreeNode");const setParentReferences=__name((node,parent=null)=>{node.parent=parent;for(const child of node.children){setParentReferences(child,node)}},"setParentReferences");const rootNode=buildTreeNode(flatTree.rootId);if(!rootNode)return"";setParentReferences(rootNode);const hasParentWithHighlightIndex=__name((node)=>{let current=node.parent;while(current){if(current.type==="element"&&current.highlightIndex!==undefined){return true}current=current.parent}return false},"hasParentWithHighlightIndex");const processNode=__name((node,depth,result22)=>{let nextDepth=depth;const depthStr="\\t".repeat(depth);if(node.type==="element"){if(node.highlightIndex!==undefined){nextDepth+=1;const text=getAllTextTillNextClickableElement(node);let attributesHtmlStr="";if(includeAttrs.length>0&&node.attributes){const attributesToInclude=matchAttributes(node.attributes,includeAttrs);const keys=Object.keys(attributesToInclude);if(keys.length>1){const keysToRemove=new Set;const seenValues={};for(const key of keys){const value=attributesToInclude[key];if(value.length>5){if(value in seenValues){keysToRemove.add(key)}else{seenValues[value]=key}}}for(const key of keysToRemove){delete attributesToInclude[key]}}if(attributesToInclude.role===node.tagName){delete attributesToInclude.role}const attrsToRemoveIfTextMatches=["aria-label","placeholder","title"];for(const attr of attrsToRemoveIfTextMatches){if(attributesToInclude[attr]&&attributesToInclude[attr].toLowerCase().trim()===text.toLowerCase().trim()){delete attributesToInclude[attr]}}if(Object.keys(attributesToInclude).length>0){attributesHtmlStr=Object.entries(attributesToInclude).map(([key,value])=>`${key}=${capTextLength(value,20)}`).join(" ")}}const highlightIndicator=node.isNew?`*[${node.highlightIndex}]`:`[${node.highlightIndex}]`;let line=`${depthStr}${highlightIndicator}<${node.tagName??""}`;if(attributesHtmlStr){line+=` ${attributesHtmlStr}`}if(node.extra){if(node.extra.scrollable){let scrollDataText="";if(node.extra.scrollData?.left)scrollDataText+=`left=${node.extra.scrollData.left}, `;if(node.extra.scrollData?.top)scrollDataText+=`top=${node.extra.scrollData.top}, `;if(node.extra.scrollData?.right)scrollDataText+=`right=${node.extra.scrollData.right}, `;if(node.extra.scrollData?.bottom)scrollDataText+=`bottom=${node.extra.scrollData.bottom}`;line+=` data-scrollable="${scrollDataText}"`}}if(text){const trimmedText=text.trim();if(!attributesHtmlStr){line+=" "}line+=`>${trimmedText}`}else if(!attributesHtmlStr){line+=" "}line+=" />";result22.push(line)}for(const child of node.children){processNode(child,nextDepth,result22)}}else if(node.type==="text"){if(hasParentWithHighlightIndex(node)){return}if(node.parent&&node.parent.type==="element"&&node.parent.isVisible&&node.parent.isTopElement){result22.push(`${depthStr}${node.text??""}`)}}},"processNode");const result2=[];processNode(rootNode,0,result2);return result2.join(`\n`)}__name(flatTreeToString,"flatTreeToString");const getAllTextTillNextClickableElement=__name((node,maxDepth=-1)=>{const textParts=[];const collectText=__name((currentNode,currentDepth)=>{if(maxDepth!==-1&&currentDepth>maxDepth){return}if(currentNode.type==="element"&&currentNode!==node&&currentNode.highlightIndex!==undefined){return}if(currentNode.type==="text"&&currentNode.text){textParts.push(currentNode.text)}else if(currentNode.type==="element"){for(const child of currentNode.children){collectText(child,currentDepth+1)}}},"collectText");collectText(node,0);return textParts.join(`\n`).trim()},"getAllTextTillNextClickableElement");function getSelectorMap(flatTree){const selectorMap=new Map;const keys=Object.keys(flatTree.map);for(const key of keys){const node=flatTree.map[key];if(node.isInteractive&&typeof node.highlightIndex==="number"){selectorMap.set(node.highlightIndex,node)}}return selectorMap}__name(getSelectorMap,"getSelectorMap");function getElementTextMap(simplifiedHTML){const lines=simplifiedHTML.split(`\n`).map((line)=>line.trim()).filter((line)=>line.length>0);const elementTextMap=new Map;for(const line of lines){const regex=/^\\[(\\d+)\\]<[^>]+>([^<]*)/;const match=regex.exec(line);if(match){const index=parseInt(match[1],10);elementTextMap.set(index,line)}}return elementTextMap}__name(getElementTextMap,"getElementTextMap");function cleanUpHighlights(){const cleanupFunctions=window._highlightCleanupFunctions||[];for(const cleanup of cleanupFunctions){if(typeof cleanup==="function"){cleanup()}}window._highlightCleanupFunctions=[]}__name(cleanUpHighlights,"cleanUpHighlights");window.addEventListener("popstate",()=>{cleanUpHighlights()});window.addEventListener("hashchange",()=>{cleanUpHighlights()});window.addEventListener("beforeunload",()=>{cleanUpHighlights()});const navigation=window.navigation;if(navigation&&typeof navigation.addEventListener==="function"){navigation.addEventListener("navigate",()=>{cleanUpHighlights()})}else{let currentUrl=window.location.href;setInterval(()=>{if(window.location.href!==currentUrl){currentUrl=window.location.href;cleanUpHighlights()}},500)}function getPageInfo(){const viewport_width=window.innerWidth;const viewport_height=window.innerHeight;const page_width=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth||0);const page_height=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight||0);const scroll_x=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0;const scroll_y=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;const pixels_below=Math.max(0,page_height-(window.innerHeight+scroll_y));const pixels_right=Math.max(0,page_width-(window.innerWidth+scroll_x));return{viewport_width,viewport_height,page_width,page_height,scroll_x,scroll_y,pixels_above:scroll_y,pixels_below,pages_above:viewport_height>0?scroll_y/viewport_height:0,pages_below:viewport_height>0?pixels_below/viewport_height:0,total_pages:viewport_height>0?page_height/viewport_height:0,current_page_position:scroll_y/Math.max(1,page_height-viewport_height),pixels_left:scroll_x,pixels_right}}__name(getPageInfo,"getPageInfo");function patchReact(pageController){const reactRootElements=document.querySelectorAll(\'[data-reactroot], [data-reactid], [data-react-checksum], #root, #app, [id^="root-"], [id^="app-"], #adex-wrapper, #adex-root\');for(const element of reactRootElements){element.setAttribute("data-page-agent-not-interactive","true")}}__name(patchReact,"patchReact");const _PageController=class _PageController extends EventTarget{config;flatTree=null;selectorMap=new Map;elementTextMap=new Map;simplifiedHTML="<EMPTY>";lastTimeUpdate=0;isIndexed=false;mask=null;maskReady=null;constructor(config={}){super();this.config=config;patchReact();if(config.enableMask)this.initMask()}initMask(){if(this.maskReady!==null)return;this.maskReady=(async()=>{var SimulatorMask = window.__LiteMask;this.mask=new SimulatorMask})()}async getCurrentUrl(){return window.location.href}async getLastUpdateTime(){return this.lastTimeUpdate}async getBrowserState(){const url=window.location.href;const title=document.title;const pi=getPageInfo();const viewportExpansion=resolveViewportExpansion(this.config.viewportExpansion);await this.updateTree();const content=this.simplifiedHTML;const titleLine=`Current Page: [${title}](${url})`;const pageInfoLine=`Page info: ${pi.viewport_width}x${pi.viewport_height}px viewport, ${pi.page_width}x${pi.page_height}px total page size, ${pi.pages_above.toFixed(1)} pages above, ${pi.pages_below.toFixed(1)} pages below, ${pi.total_pages.toFixed(1)} total pages, at ${(pi.current_page_position*100).toFixed(0)}% of page`;const elementsLabel=viewportExpansion===-1?"Interactive elements from top layer of the current page (full page):":"Interactive elements from top layer of the current page inside the viewport:";const hasContentAbove=pi.pixels_above>4;const scrollHintAbove=hasContentAbove&&viewportExpansion!==-1?`... ${pi.pixels_above} pixels above (${pi.pages_above.toFixed(1)} pages) - scroll to see more ...`:"[Start of page]";const header=`${titleLine}\n${pageInfoLine}\n\n${elementsLabel}\n\n${scrollHintAbove}`;const hasContentBelow=pi.pixels_below>4;const footer=hasContentBelow&&viewportExpansion!==-1?`... ${pi.pixels_below} pixels below (${pi.pages_below.toFixed(1)} pages) - scroll to see more ...`:"[End of page]";return{url,title,header,content,footer}}async updateTree(){this.dispatchEvent(new Event("beforeUpdate"));this.lastTimeUpdate=Date.now();if(this.mask){this.mask.wrapper.style.pointerEvents="none"}cleanUpHighlights();const blacklist=[...this.config.interactiveBlacklist||[],...document.querySelectorAll("[data-page-agent-not-interactive]").values()];this.flatTree=getFlatTree({...this.config,interactiveBlacklist:blacklist});this.simplifiedHTML=flatTreeToString(this.flatTree,this.config.includeAttributes);this.selectorMap.clear();this.selectorMap=getSelectorMap(this.flatTree);this.elementTextMap.clear();this.elementTextMap=getElementTextMap(this.simplifiedHTML);this.isIndexed=true;if(this.mask){this.mask.wrapper.style.pointerEvents="auto"}this.dispatchEvent(new Event("afterUpdate"));return this.simplifiedHTML}async cleanUpHighlights(){cleanUpHighlights()}assertIndexed(){if(!this.isIndexed){throw new Error("DOM tree not indexed yet. Can not perform actions on elements.")}}async clickElement(index){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await clickElement(element);if(isAnchorElement(element)&&element.target==="_blank"){return{success:true,message:`✅ Clicked element (${elemText??index}). ⚠️ Link opened in a new tab.`}}return{success:true,message:`✅ Clicked element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to click element: ${error}`}}}async inputText(index,text){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await inputTextElement(element,text);return{success:true,message:`✅ Input text (${text}) into element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to input text: ${error}`}}}async selectOption(index,optionText){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await selectOptionElement(element,optionText);return{success:true,message:`✅ Selected option (${optionText}) in element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to select option: ${error}`}}}async scroll(options){try{const{down,numPages,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels??numPages*(down?1:-1)*window.innerHeight;const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollVertically(down,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll: ${error}`}}}async scrollHorizontally(options){try{const{right,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels*(right?1:-1);const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollHorizontally(right,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll horizontally: ${error}`}}}async executeJavascript(script){try{const asyncFunction=eval(`(async () => { ${script} })`);const result=await asyncFunction();return{success:true,message:`✅ Executed JavaScript. Result: ${result}`}}catch(error){return{success:false,message:`❌ Error executing JavaScript: ${error}`}}}async showMask(){await this.maskReady;this.mask?.show()}async hideMask(){await this.maskReady;this.mask?.hide()}dispose(){cleanUpHighlights();this.flatTree=null;this.selectorMap.clear();this.elementTextMap.clear();this.simplifiedHTML="<EMPTY>";this.isIndexed=false;this.mask?.dispose();this.mask=null}};__name(_PageController,"PageController");let PageController=_PageController;window.__PageController=PageController})();\n})();\n\n// --- Signet Page Agent API ---\n(function(){\n var pc = new window.__PageController({ enableMask: false, highlightOpacity: 0, highlightLabelOpacity: 0 });\n \n window.signet = window.signet || {};\n window.signet.pageController = pc;\n \n window.signet.getDomState = async function(){\n try {\n var state = await pc.getBrowserState();\n return { success: true, state: state };\n } catch(e) {\n return { success: false, error: e.message || String(e) };\n }\n };\n \n window.signet.executeAction = async function(action){\n try {\n var result;\n switch(action.type){\n case \'click_element\':\n result = await pc.clickElement(action.index);\n break;\n case \'input_text\':\n result = await pc.inputText(action.index, action.text);\n break;\n case \'select_option\':\n result = await pc.selectOption(action.index, action.text);\n break;\n case \'scroll\':\n result = await pc.scroll({ down: action.direction === \'down\', numPages: action.amount || 1 });\n break;\n default:\n result = { success: false, message: \'Unknown action type: \' + action.type };\n }\n return result;\n } catch(e) {\n return { success: false, message: e.message || String(e) };\n }\n };\n \n window.signet.agentStart = async function(){\n pc.initMask();\n await pc.showMask();\n };\n \n window.signet.agentStop = async function(){\n await pc.hideMask();\n };\n})();',Yt=`
1
+ import{e as We,p as re,s as he,c as de,f as se,a as fe,n as ve,b as w,d as ie,r as we,j as c,k as J,t as _,l as s,y as ee,z as ae,D as ge,A as Te,i as t,m as N,v as m,o as Y,g as ft,Q as Ze,q as ze,aT as Ve,F as Je,B as xe,u as pe,O as G,P as Se,ad as et,N as Ee,af as Ie,w as ke,J as Me,x as vt,G as wt,R as yt}from"./Bh3nIh1p.js";import{H as me,I as ye,aN as bt,be as xt,bf as _t,ac as Et}from"./DJoUPWd3.js";import{W as at,L as Tt}from"./DXMsv7fq.js";import{R as st}from"./DWPQenc_.js";import{P as qe}from"./B-bVqHDj.js";import{P as kt}from"./BTAhHHO5.js";import{T as St}from"./DzOsbcNC.js";const k=We({entries:[],loading:!1,error:null,groups:[],activeGroup:null,draggingId:null,focusedId:null,widgetCacheVersion:0}),be=new Map,He=new Set;function Ct(){return k.entries.filter(n=>n.state==="tray")}function Nt(){const n=k.entries.filter(e=>e.state==="grid");if(k.activeGroup){const e=k.groups.find(r=>r.id===k.activeGroup);if(e)return n.filter(r=>e.items.includes(r.id))}return n}function It(){return k.entries.filter(n=>n.state==="dock")}const tt=12;function Qe(n,e,r){const a=r?.x??0,d=r?.y??0;function p(L,P,D,H){for(const A of n)if(L<A.x+A.w&&L+D>A.x&&P<A.y+A.h&&P+H>A.y)return!0;return!1}const o=Math.max(0,Math.min(tt-e.w,a)),y=Math.max(0,d);if(!p(o,y,e.w,e.h))return{x:o,y,w:e.w,h:e.h};for(let L=1;L<=20;L++)for(let P=-L;P<=L;P++)for(let D=-L;D<=L;D++){if(Math.abs(D)!==L&&Math.abs(P)!==L)continue;const H=Math.max(0,Math.min(tt-e.w,a+D)),A=Math.max(0,d+P);if(!p(H,A,e.w,e.h))return{x:H,y:A,w:e.w,h:e.h}}return{x:0,y:n.reduce((L,P)=>Math.max(L,P.y+P.h),0),w:e.w,h:e.h}}async function Oe(){k.loading=!0,k.error=null;try{const n=await fetch(`${me}/api/os/tray`);if(!n.ok)throw new Error(`HTTP ${n.status}`);const e=await n.json();k.entries=e.entries??[]}catch(n){k.error=n instanceof Error?n.message:String(n)}finally{k.loading=!1}}async function Ae(n,e,r){try{const a={state:e};r&&(a.gridPosition=r);const d=await fetch(`${me}/api/os/tray/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!d.ok)return!1;const p=await d.json();if(p.success&&p.entry){const o=k.entries.findIndex(y=>y.id===n);o>=0&&(k.entries[o]=p.entry)}return!0}catch{return!1}}async function nt(n,e){return Ae(n,"grid",e)}async function Xe(n,e){const r=k.entries.find(o=>o.id===n);if(!r)return!1;if(e)return Ae(n,"grid",e);const a=r.manifest?.defaultSize??{w:4,h:3},d=k.entries.flatMap(o=>o.id!==n&&o.state==="grid"&&o.gridPosition?[o.gridPosition]:[]),p=Qe(d,a);return Ae(n,"grid",p)}async function Mt(n){return Ae(n,"dock")}async function lt(n){return Ae(n,"tray")}const ct="signet-os-sidebar-groups";function At(){try{const n=localStorage.getItem(ct);n&&(k.groups=JSON.parse(n))}catch{k.groups=[]}}function Fe(){localStorage.setItem(ct,JSON.stringify(k.groups))}function Dt(n){const e={id:`group_${Date.now()}`,name:n,items:[]};return k.groups=[...k.groups,e],Fe(),e}function Rt(n){k.groups=k.groups.filter(e=>e.id!==n),k.activeGroup===n&&(k.activeGroup=null),Fe()}function Lt(n,e){k.groups=k.groups.map(r=>r.id===n?{...r,name:e}:r),Fe()}function Ht(n,e){k.groups=k.groups.map(r=>r.id!==n||r.items.includes(e)?r:{...r,items:[...r.items,e]}),Fe()}function Ge(n){k.activeGroup=n}let Pe=We(new Map),rt=0;function it(n,e,r){Pe.set(n,{action:e,data:r,_seq:++rt}),setTimeout(()=>{const a=Pe.get(n);a&&a._seq===rt&&Pe.delete(n)},500)}function Pt(n){return Pe.get(n)}function Ot(n){k.focusedId=n}function Re(){k.focusedId=null}async function $e(n){if(be.has(n))return be.get(n)??null;try{const e=await fetch(`${me}/api/os/widget/${encodeURIComponent(n)}`);if(!e.ok)return null;const r=await e.json();return r.html?(be.set(n,r.html),k.widgetCacheVersion++,r.html):null}catch{return null}}async function dt(n){if(!He.has(n)){He.add(n),k.widgetCacheVersion++;try{const r=await(await fetch(`${me}/api/os/widget/generate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverId:n,force:!1})})).json();r.status==="cached"&&r.html&&be.set(n,r.html)}catch{}finally{be.has(n)&&He.delete(n),k.widgetCacheVersion++}}}const Ke=new Map;function $t(n,e){Ke.set(n,e)}function Wt(n){Ke.delete(n)}function Le(n){return Ke.get(n)}const zt=We({current:null});function _e(n){zt.current=n}function Ye(n,e){re(e,!0);let r=we(e,["$$slots","$$events","$$legacy"]);const a=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]];ye(n,he({name:"box"},()=>r,{get iconNode(){return a},children:(d,p)=>{var o=de(),y=se(o);fe(y,()=>e.children??ve),w(d,o)},$$slots:{default:!0}})),ie()}var Vt=N('<img class="auto-card-icon svelte-1y09vim" referrerpolicy="no-referrer"/>'),Ft=N('<div class="auto-card-icon-placeholder svelte-1y09vim"><!></div>'),jt=N('<button class="auto-card-tool-btn sig-switch svelte-1y09vim" disabled=""><!> <span class="truncate"> </span></button>'),Bt=N('<div class="auto-card-tools svelte-1y09vim"></div>'),Gt=N('<div class="auto-card-empty svelte-1y09vim"><span class="sig-label">No tools exposed</span></div>'),Ut=N('<div class="auto-card svelte-1y09vim"><div class="auto-card-header svelte-1y09vim"><!> <span class="auto-card-name svelte-1y09vim"> </span> <span class="sig-meta ml-auto"> </span></div> <!></div>');function qt(n,e){re(e,!0);var r=Ut(),a=c(r),d=c(a);{var p=O=>{var S=Vt();ee(()=>{ge(S,"src",e.icon),ge(S,"alt",e.name)}),w(O,S)},o=O=>{var S=Ft(),$=c(S);Ye($,{class:"size-4"}),s(S),w(O,S)};J(d,O=>{e.icon?O(p):O(o,-1)})}var y=_(d,2),U=c(y,!0);s(y);var L=_(y,2),P=c(L);s(L),s(a);var D=_(a,2);{var H=O=>{var S=Bt();Te(S,21,()=>e.autoCard.tools,$=>$.name,($,W)=>{var j=jt(),F=c(j);at(F,{class:"size-3 shrink-0 opacity-50"});var te=_(F,2),I=c(te,!0);s(te),s(j),ee(()=>{ge(j,"title",t(W).description||t(W).name),ae(I,t(W).name)}),w($,j)}),s(S),w(O,S)},A=O=>{var S=Gt();w(O,S)};J(D,O=>{e.autoCard.tools.length>0?O(H):O(A,-1)})}s(r),ee(()=>{ae(U,e.name),ae(P,`${e.autoCard.tools.length??""} tools`)}),w(n,r),ie()}const Xt='// Signet Page Agent bundle - PageController + lightweight cursor mask\n// Auto-generated from @page-agent/page-controller v1.6.0\n\n\n(function(){\n // Lightweight SimulatorMask - cursor + overlay, no ai-motion dependency\n var CSS_TEXT = \'.__pa_mask{position:fixed;inset:0;z-index:2147483641;cursor:wait;overflow:hidden;display:none;background:rgba(0,0,0,0.02)}.__pa_mask.__pa_vis{display:block}.__pa_cur{position:absolute;width:40px;height:40px;pointer-events:none;z-index:10000;transition:none}.__pa_cur_fill{position:absolute;width:100%;height:100%;background:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' fill=\\\'%23ffffff\\\' stroke=\\\'%23333\\\' stroke-width=\\\'4\\\'/%3e%3c/svg%3e");background-size:100% 100%;transform-origin:center;transform:rotate(-135deg) scale(1.1);margin-left:-8px;margin-top:-14px}.__pa_cur_border{position:absolute;width:100%;height:100%;background:linear-gradient(45deg,rgb(57,182,255),rgb(189,69,251));mask-image:url("data:image/svg+xml,%3csvg xmlns=\\\'http://www.w3.org/2000/svg\\\' viewBox=\\\'0 0 100 100\\\' fill=\\\'none\\\'%3e%3cpath d=\\\'M 15 42 L 15 36.99 Q 15 31.99 23.7 31.99 L 28.05 31.99 Q 32.41 31.99 32.41 21.99 L 32.41 17 Q 32.41 12 41.09 16.95 L 76.31 37.05 Q 85 42 76.31 46.95 L 41.09 67.05 Q 32.41 72 32.41 62.01 L 32.41 57.01 Q 32.41 52.01 23.7 52.01 L 19.35 52.01 Q 15 52.01 15 47.01 Z\\\' stroke=\\\'%23000\\\' stroke-width=\\\'6\\\'/%3e%3c/svg%3e");mask-size:100% 100%;mask-repeat:no-repeat;transform-origin:center;transform:rotate(-135deg) scale(1.2);margin-left:-10px;margin-top:-18px}.__pa_ripple{position:absolute;width:100%;height:100%;pointer-events:none;margin-left:-50%;margin-top:-50%}.__pa_ripple::after{content:\\\'\\\';opacity:0;position:absolute;inset:0;border:3px solid rgba(57,182,255,1);border-radius:50%}.__pa_cur.__pa_click .__pa_ripple::after{animation:__pa_rip 300ms ease-out forwards}@keyframes __pa_rip{0%{transform:scale(0);opacity:1}100%{transform:scale(2);opacity:0}}\';\n \n try{\n var s=document.createElement(\'style\');\n s.appendChild(document.createTextNode(CSS_TEXT));\n document.head.appendChild(s);\n }catch(e){}\n\n function LiteMask(){\n this.shown=false;\n this.wrapper=document.createElement(\'div\');\n this.wrapper.className=\'__pa_mask\';\n this.wrapper.setAttribute(\'data-page-agent-ignore\',\'true\');\n \n this._cursor=document.createElement(\'div\');\n this._cursor.className=\'__pa_cur\';\n var ripple=document.createElement(\'div\');ripple.className=\'__pa_ripple\';this._cursor.appendChild(ripple);\n var fill=document.createElement(\'div\');fill.className=\'__pa_cur_fill\';this._cursor.appendChild(fill);\n var border=document.createElement(\'div\');border.className=\'__pa_cur_border\';this._cursor.appendChild(border);\n this.wrapper.appendChild(this._cursor);\n \n this._cx=0;this._cy=0;this._tx=0;this._ty=0;\n \n // Block interactions on mask\n [\'click\',\'mousedown\',\'mouseup\',\'mousemove\',\'wheel\',\'keydown\',\'keyup\'].forEach(function(evt){\n this.wrapper.addEventListener(evt,function(e){e.stopPropagation();e.preventDefault();});\n }.bind(this));\n \n document.body.appendChild(this.wrapper);\n this._animate();\n \n var self=this;\n window.addEventListener(\'PageAgent::MovePointerTo\',function(e){\n var d=e.detail;self._tx=d.x;self._ty=d.y;\n });\n window.addEventListener(\'PageAgent::ClickPointer\',function(){\n self._cursor.classList.remove(\'__pa_click\');\n void self._cursor.offsetHeight;\n self._cursor.classList.add(\'__pa_click\');\n });\n }\n \n LiteMask.prototype._animate=function(){\n var nx=this._cx+(this._tx-this._cx)*0.2;\n var ny=this._cy+(this._ty-this._cy)*0.2;\n if(Math.abs(nx-this._tx)>0){this._cx=Math.abs(nx-this._tx)<2?this._tx:nx;this._cursor.style.left=this._cx+\'px\';}\n if(Math.abs(ny-this._ty)>0){this._cy=Math.abs(ny-this._ty)<2?this._ty:ny;this._cursor.style.top=this._cy+\'px\';}\n requestAnimationFrame(this._animate.bind(this));\n };\n \n LiteMask.prototype.show=function(){\n if(this.shown)return;this.shown=true;\n this.wrapper.classList.add(\'__pa_vis\');\n this._cx=window.innerWidth/2;this._cy=window.innerHeight/2;\n this._tx=this._cx;this._ty=this._cy;\n this._cursor.style.left=this._cx+\'px\';this._cursor.style.top=this._cy+\'px\';\n };\n \n LiteMask.prototype.hide=function(){\n if(!this.shown)return;this.shown=false;\n this._cursor.classList.remove(\'__pa_click\');\n var w=this.wrapper;\n setTimeout(function(){w.classList.remove(\'__pa_vis\');},300);\n };\n \n LiteMask.prototype.dispose=function(){this.wrapper.remove();};\n \n window.__LiteMask=LiteMask;\n})();\n\n// --- PageController (modified: SimulatorMask replaced with LiteMask) ---\n(function(){\n(function(){var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});function isHTMLElement(el){return!!el&&el.nodeType===1}__name(isHTMLElement,"isHTMLElement");function isInputElement(el){return el?.nodeType===1&&el.tagName==="INPUT"}__name(isInputElement,"isInputElement");function isTextAreaElement(el){return el?.nodeType===1&&el.tagName==="TEXTAREA"}__name(isTextAreaElement,"isTextAreaElement");function isSelectElement(el){return el?.nodeType===1&&el.tagName==="SELECT"}__name(isSelectElement,"isSelectElement");function isAnchorElement(el){return el?.nodeType===1&&el.tagName==="A"}__name(isAnchorElement,"isAnchorElement");function getIframeOffset(element){const frame=element.ownerDocument.defaultView?.frameElement;if(!frame)return{x:0,y:0};const rect=frame.getBoundingClientRect();return{x:rect.left,y:rect.top}}__name(getIframeOffset,"getIframeOffset");function getNativeValueSetter(element){return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element),"value").set}__name(getNativeValueSetter,"getNativeValueSetter");async function waitFor(seconds){await new Promise((resolve)=>setTimeout(resolve,seconds*1000))}__name(waitFor,"waitFor");async function movePointerToElement(element){const rect=element.getBoundingClientRect();const offset=getIframeOffset(element);const x=rect.left+rect.width/2+offset.x;const y=rect.top+rect.height/2+offset.y;window.dispatchEvent(new CustomEvent("PageAgent::MovePointerTo",{detail:{x,y}}));await waitFor(0.3)}__name(movePointerToElement,"movePointerToElement");function getElementByIndex(selectorMap,index){const interactiveNode=selectorMap.get(index);if(!interactiveNode){throw new Error(`No interactive element found at index ${index}`)}const element=interactiveNode.ref;if(!element){throw new Error(`Element at index ${index} does not have a reference`)}if(!isHTMLElement(element)){throw new Error(`Element at index ${index} is not an HTMLElement`)}return element}__name(getElementByIndex,"getElementByIndex");let lastClickedElement=null;function blurLastClickedElement(){if(lastClickedElement){lastClickedElement.blur();lastClickedElement.dispatchEvent(new MouseEvent("mouseout",{bubbles:true,cancelable:true}));lastClickedElement.dispatchEvent(new MouseEvent("mouseleave",{bubbles:false,cancelable:true}));lastClickedElement=null}}__name(blurLastClickedElement,"blurLastClickedElement");async function clickElement(element){blurLastClickedElement();lastClickedElement=element;await scrollIntoViewIfNeeded(element);const frame=element.ownerDocument.defaultView?.frameElement;if(frame)await scrollIntoViewIfNeeded(frame);await movePointerToElement(element);window.dispatchEvent(new CustomEvent("PageAgent::ClickPointer"));await waitFor(0.1);element.dispatchEvent(new MouseEvent("mouseenter",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mouseover",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("mousedown",{bubbles:true,cancelable:true}));element.focus();element.dispatchEvent(new MouseEvent("mouseup",{bubbles:true,cancelable:true}));element.dispatchEvent(new MouseEvent("click",{bubbles:true,cancelable:true}));await waitFor(0.2)}__name(clickElement,"clickElement");async function inputTextElement(element,text){const isContentEditable=element.isContentEditable;if(!isInputElement(element)&&!isTextAreaElement(element)&&!isContentEditable){throw new Error("Element is not an input, textarea, or contenteditable")}await clickElement(element);if(isContentEditable){if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"deleteContent"}))){element.innerText="";element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"deleteContent"}))}if(element.dispatchEvent(new InputEvent("beforeinput",{bubbles:true,cancelable:true,inputType:"insertText",data:text}))){element.innerText=text;element.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:text}))}const planASucceeded=element.innerText.trim()===text.trim();if(!planASucceeded){element.focus();const doc=element.ownerDocument;const selection=(doc.defaultView||window).getSelection();const range=doc.createRange();range.selectNodeContents(element);selection?.removeAllRanges();selection?.addRange(range);doc.execCommand("delete",false);doc.execCommand("insertText",false,text)}element.dispatchEvent(new Event("change",{bubbles:true}));element.blur()}else{getNativeValueSetter(element).call(element,text)}if(!isContentEditable){element.dispatchEvent(new Event("input",{bubbles:true}))}await waitFor(0.1);blurLastClickedElement()}__name(inputTextElement,"inputTextElement");async function selectOptionElement(selectElement,optionText){if(!isSelectElement(selectElement)){throw new Error("Element is not a select element")}const options=Array.from(selectElement.options);const option=options.find((opt)=>opt.textContent?.trim()===optionText.trim());if(!option){throw new Error(`Option with text "${optionText}" not found in select element`)}selectElement.value=option.value;selectElement.dispatchEvent(new Event("change",{bubbles:true}));await waitFor(0.1)}__name(selectOptionElement,"selectOptionElement");async function scrollIntoViewIfNeeded(element){const el=element;if(typeof el.scrollIntoViewIfNeeded==="function"){el.scrollIntoViewIfNeeded()}else{element.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})}}__name(scrollIntoViewIfNeeded,"scrollIntoViewIfNeeded");async function scrollVertically(down,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dy2=scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableY=/(auto|scroll|overlay)/.test(computedStyle.overflowY);const canScrollVertically=currentElement.scrollHeight>currentElement.clientHeight;if(hasScrollableY&&canScrollVertically){const beforeScroll=currentElement.scrollTop;const maxScroll=currentElement.scrollHeight-currentElement.clientHeight;let scrollAmount=dy2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollTop=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollTop;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) by ${scrollDelta}px`}else{return`No scrollable container found for element (${targetElement.tagName})`}}const dy=scroll_amount;const bigEnough=__name((el2)=>el2.clientHeight>=window.innerHeight*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowY)&&el2.scrollHeight>el2.clientHeight&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollY;const scrollMax=document.documentElement.scrollHeight-window.innerHeight;window.scrollBy(0,dy);const scrollAfter=window.scrollY;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of the page, cannot scroll down further.`:`⚠️ Already at the top of the page, cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled page by ${scrolled}px. Reached the bottom of the page.`;if(reachedTop)return`✅ Scrolled page by ${scrolled}px. Reached the top of the page.`;return`✅ Scrolled page by ${scrolled}px.`}else{const scrollBefore=el.scrollTop;const scrollMax=el.scrollHeight-el.clientHeight;el.scrollBy({top:dy,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollTop;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dy>0?`⚠️ Already at the bottom of container (${el.tagName}), cannot scroll down further.`:`⚠️ Already at the top of container (${el.tagName}), cannot scroll up further.`}const reachedBottom=dy>0&&scrollAfter>=scrollMax-1;const reachedTop=dy<0&&scrollAfter<=1;if(reachedBottom)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the bottom.`;if(reachedTop)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the top.`;return`✅ Scrolled container (${el.tagName}) by ${scrolled}px.`}}__name(scrollVertically,"scrollVertically");async function scrollHorizontally(right,scroll_amount,element){if(element){const targetElement=element;let currentElement=targetElement;let scrollSuccess=false;let scrolledElement=null;let scrollDelta=0;let attempts=0;const dx2=right?scroll_amount:-scroll_amount;while(currentElement&&attempts<10){const computedStyle=window.getComputedStyle(currentElement);const hasScrollableX=/(auto|scroll|overlay)/.test(computedStyle.overflowX);const canScrollHorizontally=currentElement.scrollWidth>currentElement.clientWidth;if(hasScrollableX&&canScrollHorizontally){const beforeScroll=currentElement.scrollLeft;const maxScroll=currentElement.scrollWidth-currentElement.clientWidth;let scrollAmount=dx2/3;if(scrollAmount>0){scrollAmount=Math.min(scrollAmount,maxScroll-beforeScroll)}else{scrollAmount=Math.max(scrollAmount,-beforeScroll)}currentElement.scrollLeft=beforeScroll+scrollAmount;const afterScroll=currentElement.scrollLeft;const actualScrollDelta=afterScroll-beforeScroll;if(Math.abs(actualScrollDelta)>0.5){scrollSuccess=true;scrolledElement=currentElement;scrollDelta=actualScrollDelta;break}}if(currentElement===document.body||currentElement===document.documentElement){break}currentElement=currentElement.parentElement;attempts++}if(scrollSuccess){return`Scrolled container (${scrolledElement?.tagName}) horizontally by ${scrollDelta}px`}else{return`No horizontally scrollable container found for element (${targetElement.tagName})`}}const dx=right?scroll_amount:-scroll_amount;const bigEnough=__name((el2)=>el2.clientWidth>=window.innerWidth*0.5,"bigEnough");const canScroll=__name((el2)=>el2&&/(auto|scroll|overlay)/.test(getComputedStyle(el2).overflowX)&&el2.scrollWidth>el2.clientWidth&&bigEnough(el2),"canScroll");let el=document.activeElement;while(el&&!canScroll(el)&&el!==document.body)el=el.parentElement;el=canScroll(el)?el:Array.from(document.querySelectorAll("*")).find(canScroll)||document.scrollingElement||document.documentElement;if(el===document.scrollingElement||el===document.documentElement||el===document.body){const scrollBefore=window.scrollX;const scrollMax=document.documentElement.scrollWidth-window.innerWidth;window.scrollBy(dx,0);const scrollAfter=window.scrollX;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of the page, cannot scroll right further.`:`⚠️ Already at the left edge of the page, cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled page by ${scrolled}px. Reached the right edge of the page.`;if(reachedLeft)return`✅ Scrolled page by ${scrolled}px. Reached the left edge of the page.`;return`✅ Scrolled page horizontally by ${scrolled}px.`}else{const scrollBefore=el.scrollLeft;const scrollMax=el.scrollWidth-el.clientWidth;el.scrollBy({left:dx,behavior:"smooth"});await waitFor(0.1);const scrollAfter=el.scrollLeft;const scrolled=scrollAfter-scrollBefore;if(Math.abs(scrolled)<1){return dx>0?`⚠️ Already at the right edge of container (${el.tagName}), cannot scroll right further.`:`⚠️ Already at the left edge of container (${el.tagName}), cannot scroll left further.`}const reachedRight=dx>0&&scrollAfter>=scrollMax-1;const reachedLeft=dx<0&&scrollAfter<=1;if(reachedRight)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the right edge.`;if(reachedLeft)return`✅ Scrolled container (${el.tagName}) by ${scrolled}px. Reached the left edge.`;return`✅ Scrolled container (${el.tagName}) horizontally by ${scrolled}px.`}}__name(scrollHorizontally,"scrollHorizontally");const domTree=__name((args={doHighlightElements:true,focusHighlightIndex:-1,viewportExpansion:0,debugMode:false,interactiveBlacklist:[],interactiveWhitelist:[],highlightOpacity:0.1,highlightLabelOpacity:0.5})=>{const{interactiveBlacklist,interactiveWhitelist,highlightOpacity,highlightLabelOpacity}=args;const{doHighlightElements,focusHighlightIndex,viewportExpansion,debugMode}=args;let highlightIndex=0;const extraData=new WeakMap;function addExtraData(element,data){if(!element||element.nodeType!==Node.ELEMENT_NODE)return;extraData.set(element,{...extraData.get(element),...data})}__name(addExtraData,"addExtraData");const DOM_CACHE={boundingRects:new WeakMap,clientRects:new WeakMap,computedStyles:new WeakMap,clearCache:__name(()=>{DOM_CACHE.boundingRects=new WeakMap;DOM_CACHE.clientRects=new WeakMap;DOM_CACHE.computedStyles=new WeakMap},"clearCache")};function getCachedBoundingRect(element){if(!element)return null;if(DOM_CACHE.boundingRects.has(element)){return DOM_CACHE.boundingRects.get(element)}const rect=element.getBoundingClientRect();if(rect){DOM_CACHE.boundingRects.set(element,rect)}return rect}__name(getCachedBoundingRect,"getCachedBoundingRect");function getCachedComputedStyle(element){if(!element)return null;if(DOM_CACHE.computedStyles.has(element)){return DOM_CACHE.computedStyles.get(element)}const style=window.getComputedStyle(element);if(style){DOM_CACHE.computedStyles.set(element,style)}return style}__name(getCachedComputedStyle,"getCachedComputedStyle");function getCachedClientRects(element){if(!element)return null;if(DOM_CACHE.clientRects.has(element)){return DOM_CACHE.clientRects.get(element)}const rects=element.getClientRects();if(rects){DOM_CACHE.clientRects.set(element,rects)}return rects}__name(getCachedClientRects,"getCachedClientRects");const DOM_HASH_MAP={};const ID={current:0};const HIGHLIGHT_CONTAINER_ID="playwright-highlight-container";function highlightElement(element,index,parentIframe=null){if(!element)return index;const overlays=[];let label=null;let labelWidth=20;let labelHeight=16;let cleanupFn=null;try{let container=document.getElementById(HIGHLIGHT_CONTAINER_ID);if(!container){container=document.createElement("div");container.id=HIGHLIGHT_CONTAINER_ID;container.style.position="fixed";container.style.pointerEvents="none";container.style.top="0";container.style.left="0";container.style.width="100%";container.style.height="100%";container.style.zIndex="2147483640";container.style.backgroundColor="transparent";document.body.appendChild(container)}const rects=element.getClientRects();if(!rects||rects.length===0)return index;const colors=["#FF0000","#00FF00","#0000FF","#FFA500","#800080","#008080","#FF69B4","#4B0082","#FF4500","#2E8B57","#DC143C","#4682B4"];const colorIndex=index%colors.length;let baseColor=colors[colorIndex];const backgroundColor=baseColor+Math.floor(highlightOpacity*255).toString(16).padStart(2,"0");baseColor=baseColor+Math.floor(highlightLabelOpacity*255).toString(16).padStart(2,"0");let iframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();iframeOffset.x=iframeRect.left;iframeOffset.y=iframeRect.top}const fragment=document.createDocumentFragment();for(const rect of rects){if(rect.width===0||rect.height===0)continue;const overlay=document.createElement("div");overlay.style.position="fixed";overlay.style.border=`2px solid ${baseColor}`;overlay.style.backgroundColor=backgroundColor;overlay.style.pointerEvents="none";overlay.style.boxSizing="border-box";const top=rect.top+iframeOffset.y;const left=rect.left+iframeOffset.x;overlay.style.top=`${top}px`;overlay.style.left=`${left}px`;overlay.style.width=`${rect.width}px`;overlay.style.height=`${rect.height}px`;fragment.appendChild(overlay);overlays.push({element:overlay,initialRect:rect})}const firstRect=rects[0];label=document.createElement("div");label.className="playwright-highlight-label";label.style.position="fixed";label.style.background=baseColor;label.style.color="white";label.style.padding="1px 4px";label.style.borderRadius="4px";label.style.fontSize=`${Math.min(12,Math.max(8,firstRect.height/2))}px`;label.textContent=index.toString();labelWidth=label.offsetWidth>0?label.offsetWidth:labelWidth;labelHeight=label.offsetHeight>0?label.offsetHeight:labelHeight;const firstRectTop=firstRect.top+iframeOffset.y;const firstRectLeft=firstRect.left+iframeOffset.x;let labelTop=firstRectTop+2;let labelLeft=firstRectLeft+firstRect.width-labelWidth-2;if(firstRect.width<labelWidth+4||firstRect.height<labelHeight+4){labelTop=firstRectTop-labelHeight-2;labelLeft=firstRectLeft+firstRect.width-labelWidth;if(labelLeft<iframeOffset.x)labelLeft=firstRectLeft}labelTop=Math.max(0,Math.min(labelTop,window.innerHeight-labelHeight));labelLeft=Math.max(0,Math.min(labelLeft,window.innerWidth-labelWidth));label.style.top=`${labelTop}px`;label.style.left=`${labelLeft}px`;fragment.appendChild(label);const updatePositions=__name(()=>{const newRects=element.getClientRects();let newIframeOffset={x:0,y:0};if(parentIframe){const iframeRect=parentIframe.getBoundingClientRect();newIframeOffset.x=iframeRect.left;newIframeOffset.y=iframeRect.top}overlays.forEach((overlayData,i)=>{if(i<newRects.length){const newRect=newRects[i];const newTop=newRect.top+newIframeOffset.y;const newLeft=newRect.left+newIframeOffset.x;overlayData.element.style.top=`${newTop}px`;overlayData.element.style.left=`${newLeft}px`;overlayData.element.style.width=`${newRect.width}px`;overlayData.element.style.height=`${newRect.height}px`;overlayData.element.style.display=newRect.width===0||newRect.height===0?"none":"block"}else{overlayData.element.style.display="none"}});if(newRects.length<overlays.length){for(let i=newRects.length;i<overlays.length;i++){overlays[i].element.style.display="none"}}if(label&&newRects.length>0){const firstNewRect=newRects[0];const firstNewRectTop=firstNewRect.top+newIframeOffset.y;const firstNewRectLeft=firstNewRect.left+newIframeOffset.x;let newLabelTop=firstNewRectTop+2;let newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth-2;if(firstNewRect.width<labelWidth+4||firstNewRect.height<labelHeight+4){newLabelTop=firstNewRectTop-labelHeight-2;newLabelLeft=firstNewRectLeft+firstNewRect.width-labelWidth;if(newLabelLeft<newIframeOffset.x)newLabelLeft=firstNewRectLeft}newLabelTop=Math.max(0,Math.min(newLabelTop,window.innerHeight-labelHeight));newLabelLeft=Math.max(0,Math.min(newLabelLeft,window.innerWidth-labelWidth));label.style.top=`${newLabelTop}px`;label.style.left=`${newLabelLeft}px`;label.style.display="block"}else if(label){label.style.display="none"}},"updatePositions");const throttleFunction=__name((func,delay)=>{let lastCall=0;return(...args2)=>{const now=performance.now();if(now-lastCall<delay)return;lastCall=now;return func(...args2)}},"throttleFunction");const throttledUpdatePositions=throttleFunction(updatePositions,16);window.addEventListener("scroll",throttledUpdatePositions,true);window.addEventListener("resize",throttledUpdatePositions);cleanupFn=__name(()=>{window.removeEventListener("scroll",throttledUpdatePositions,true);window.removeEventListener("resize",throttledUpdatePositions);overlays.forEach((overlay)=>overlay.element.remove());if(label)label.remove()},"cleanupFn");container.appendChild(fragment);return index+1}finally{if(cleanupFn){(window._highlightCleanupFunctions=window._highlightCleanupFunctions||[]).push(cleanupFn)}}}__name(highlightElement,"highlightElement");function isScrollableElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return null}const style=getCachedComputedStyle(element);if(!style)return null;const display=style.display;if(display==="inline"||display==="inline-block"){return null}const overflowX=style.overflowX;const overflowY=style.overflowY;const scrollableX=overflowX==="auto"||overflowX==="scroll";const scrollableY=overflowY==="auto"||overflowY==="scroll";if(!scrollableX&&!scrollableY){return null}const scrollWidth=element.scrollWidth-element.clientWidth;const scrollHeight=element.scrollHeight-element.clientHeight;const threshold=4;if(scrollWidth<threshold&&scrollHeight<threshold){return null}if(!scrollableY&&scrollWidth<threshold){return null}if(!scrollableX&&scrollHeight<threshold){return null}const distanceToTop=element.scrollTop;const distanceToLeft=element.scrollLeft;const distanceToRight=element.scrollWidth-element.clientWidth-element.scrollLeft;const distanceToBottom=element.scrollHeight-element.clientHeight-element.scrollTop;const scrollData={top:distanceToTop,right:distanceToRight,bottom:distanceToBottom,left:distanceToLeft};addExtraData(element,{scrollable:true,scrollData});return scrollData}__name(isScrollableElement,"isScrollableElement");function isTextNodeVisible(textNode){try{if(viewportExpansion===-1){const parentElement2=textNode.parentElement;if(!parentElement2)return false;try{return parentElement2.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement2);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}const range=document.createRange();range.selectNodeContents(textNode);const rects=range.getClientRects();if(!rects||rects.length===0){return false}let isAnyRectVisible=false;let isAnyRectInViewport=false;for(const rect of rects){if(rect.width>0&&rect.height>0){isAnyRectVisible=true;if(!(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}}if(!isAnyRectVisible||!isAnyRectInViewport){return false}const parentElement=textNode.parentElement;if(!parentElement)return false;try{return parentElement.checkVisibility({checkOpacity:true,checkVisibilityCSS:true})}catch(e){const style=window.getComputedStyle(parentElement);return style.display!=="none"&&style.visibility!=="hidden"&&style.opacity!=="0"}}catch(e){console.warn("Error checking text node visibility:",e);return false}}__name(isTextNodeVisible,"isTextNodeVisible");function isElementAccepted(element){if(!element||!element.tagName)return false;const alwaysAccept=new Set(["body","div","main","article","section","nav","header","footer"]);const tagName=element.tagName.toLowerCase();if(alwaysAccept.has(tagName))return true;const leafElementDenyList=new Set(["svg","script","style","link","meta","noscript","template"]);return!leafElementDenyList.has(tagName)}__name(isElementAccepted,"isElementAccepted");function isElementVisible(element){const style=getCachedComputedStyle(element);return element.offsetWidth>0&&element.offsetHeight>0&&style?.visibility!=="hidden"&&style?.display!=="none"}__name(isElementVisible,"isElementVisible");function isInteractiveElement(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}if(interactiveBlacklist.includes(element)){return false}if(interactiveWhitelist.includes(element)){return true}const tagName=element.tagName.toLowerCase();const style=getCachedComputedStyle(element);const interactiveCursors=new Set(["pointer","move","text","grab","grabbing","cell","copy","alias","all-scroll","col-resize","context-menu","crosshair","e-resize","ew-resize","help","n-resize","ne-resize","nesw-resize","ns-resize","nw-resize","nwse-resize","row-resize","s-resize","se-resize","sw-resize","vertical-text","w-resize","zoom-in","zoom-out"]);const nonInteractiveCursors=new Set(["not-allowed","no-drop","wait","progress","initial","inherit"]);function doesElementHaveInteractivePointer(element2){if(element2.tagName.toLowerCase()==="html")return false;if(style?.cursor&&interactiveCursors.has(style.cursor))return true;return false}__name(doesElementHaveInteractivePointer,"doesElementHaveInteractivePointer");let isInteractiveCursor=doesElementHaveInteractivePointer(element);if(isInteractiveCursor){return true}const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label","option","optgroup","fieldset","legend"]);const explicitDisableTags=new Set(["disabled","readonly"]);if(interactiveElements.has(tagName)){if(style?.cursor&&nonInteractiveCursors.has(style.cursor)){return false}for(const disableTag of explicitDisableTags){if(element.hasAttribute(disableTag)||element.getAttribute(disableTag)==="true"||element.getAttribute(disableTag)===""){return false}}if(element.disabled){return false}if(element.readOnly){return false}if(element.inert){return false}return true}const role=element.getAttribute("role");const ariaRole=element.getAttribute("aria-role");if(element.getAttribute("contenteditable")==="true"||element.isContentEditable){return true}if(element.classList&&(element.classList.contains("button")||element.classList.contains("dropdown-toggle")||element.getAttribute("data-index")||element.getAttribute("data-toggle")==="dropdown"||element.getAttribute("aria-haspopup")==="true")){return true}const interactiveRoles=new Set(["button","menu","menubar","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);const hasInteractiveRole=interactiveElements.has(tagName)||role&&interactiveRoles.has(role)||ariaRole&&interactiveRoles.has(ariaRole);if(hasInteractiveRole)return true;try{if(typeof getEventListeners==="function"){const listeners=getEventListeners(element);const mouseEvents=["click","mousedown","mouseup","dblclick"];for(const eventType of mouseEvents){if(listeners[eventType]&&listeners[eventType].length>0){return true}}}const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonMouseAttrs=["onclick","onmousedown","onmouseup","ondblclick"];for(const attr of commonMouseAttrs){if(element.hasAttribute(attr)||typeof element[attr]==="function"){return true}}}catch(e){}if(isScrollableElement(element)){return true}return false}__name(isInteractiveElement,"isInteractiveElement");function isTopElement(element){if(viewportExpansion===-1){return true}const rects=getCachedClientRects(element);if(!rects||rects.length===0){return false}let isAnyRectInViewport=false;for(const rect2 of rects){if(rect2.width>0&&rect2.height>0&&!(rect2.bottom<-viewportExpansion||rect2.top>window.innerHeight+viewportExpansion||rect2.right<-viewportExpansion||rect2.left>window.innerWidth+viewportExpansion)){isAnyRectInViewport=true;break}}if(!isAnyRectInViewport){return false}let doc=element.ownerDocument;if(doc!==window.document){return true}let rect=Array.from(rects).find((r)=>r.width>0&&r.height>0);if(!rect){return false}const shadowRoot=element.getRootNode();if(shadowRoot instanceof ShadowRoot){const centerX=rect.left+rect.width/2;const centerY=rect.top+rect.height/2;try{const topEl=shadowRoot.elementFromPoint(centerX,centerY);if(!topEl)return false;let current=topEl;while(current&&current!==shadowRoot){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}}const margin=5;const checkPoints=[{x:rect.left+rect.width/2,y:rect.top+rect.height/2},{x:rect.left+margin,y:rect.top+margin},{x:rect.right-margin,y:rect.bottom-margin}];return checkPoints.some(({x,y})=>{try{const topEl=document.elementFromPoint(x,y);if(!topEl)return false;let current=topEl;while(current&&current!==document.documentElement){if(current===element)return true;current=current.parentElement}return false}catch(e){return true}})}__name(isTopElement,"isTopElement");function isInExpandedViewport(element,viewportExpansion2){if(viewportExpansion2===-1){return true}const rects=element.getClientRects();if(!rects||rects.length===0){const boundingRect=getCachedBoundingRect(element);if(!boundingRect||boundingRect.width===0||boundingRect.height===0){return false}return!(boundingRect.bottom<-viewportExpansion2||boundingRect.top>window.innerHeight+viewportExpansion2||boundingRect.right<-viewportExpansion2||boundingRect.left>window.innerWidth+viewportExpansion2)}for(const rect of rects){if(rect.width===0||rect.height===0)continue;if(!(rect.bottom<-viewportExpansion2||rect.top>window.innerHeight+viewportExpansion2||rect.right<-viewportExpansion2||rect.left>window.innerWidth+viewportExpansion2)){return true}}return false}__name(isInExpandedViewport,"isInExpandedViewport");function isInteractiveCandidate(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;const tagName=element.tagName.toLowerCase();const interactiveElements=new Set(["a","button","input","select","textarea","details","summary","label"]);if(interactiveElements.has(tagName))return true;const hasQuickInteractiveAttr=element.hasAttribute("onclick")||element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("aria-")||element.hasAttribute("data-action")||element.getAttribute("contenteditable")==="true";return hasQuickInteractiveAttr}__name(isInteractiveCandidate,"isInteractiveCandidate");const DISTINCT_INTERACTIVE_TAGS=new Set(["a","button","input","select","textarea","summary","details","label","option"]);const INTERACTIVE_ROLES=new Set(["button","link","menuitem","menuitemradio","menuitemcheckbox","radio","checkbox","tab","switch","slider","spinbutton","combobox","searchbox","textbox","listbox","option","scrollbar"]);function isHeuristicallyInteractive(element){if(!element||element.nodeType!==Node.ELEMENT_NODE)return false;if(!isElementVisible(element))return false;const hasInteractiveAttributes=element.hasAttribute("role")||element.hasAttribute("tabindex")||element.hasAttribute("onclick")||typeof element.onclick==="function";const hasInteractiveClass=/\\b(btn|clickable|menu|item|entry|link)\\b/i.test(element.className||"");const isInKnownContainer=Boolean(element.closest(\'button,a,[role="button"],.menu,.dropdown,.list,.toolbar\'));const hasVisibleChildren=[...element.children].some(isElementVisible);const isParentBody=element.parentElement&&element.parentElement.isSameNode(document.body);return(isInteractiveElement(element)||hasInteractiveAttributes||hasInteractiveClass)&&hasVisibleChildren&&isInKnownContainer&&!isParentBody}__name(isHeuristicallyInteractive,"isHeuristicallyInteractive");function isElementDistinctInteraction(element){if(!element||element.nodeType!==Node.ELEMENT_NODE){return false}const tagName=element.tagName.toLowerCase();const role=element.getAttribute("role");if(tagName==="iframe"){return true}if(DISTINCT_INTERACTIVE_TAGS.has(tagName)){return true}if(role&&INTERACTIVE_ROLES.has(role)){return true}if(element.isContentEditable||element.getAttribute("contenteditable")==="true"){return true}if(element.hasAttribute("data-testid")||element.hasAttribute("data-cy")||element.hasAttribute("data-test")){return true}if(element.hasAttribute("onclick")||typeof element.onclick==="function"){return true}try{const getEventListenersForNode=element?.ownerDocument?.defaultView?.getEventListenersForNode||window.getEventListenersForNode;if(typeof getEventListenersForNode==="function"){const listeners=getEventListenersForNode(element);const interactionEvents=["click","mousedown","mouseup","keydown","keyup","submit","change","input","focus","blur"];for(const eventType of interactionEvents){for(const listener of listeners){if(listener.type===eventType){return true}}}}const commonEventAttrs=["onmousedown","onmouseup","onkeydown","onkeyup","onsubmit","onchange","oninput","onfocus","onblur"];if(commonEventAttrs.some((attr)=>element.hasAttribute(attr))){return true}}catch(e){}if(isHeuristicallyInteractive(element)){return true}return false}__name(isElementDistinctInteraction,"isElementDistinctInteraction");function handleHighlighting(nodeData,node,parentIframe,isParentHighlighted){if(!nodeData.isInteractive)return false;let shouldHighlight=false;if(!isParentHighlighted){shouldHighlight=true}else{if(isElementDistinctInteraction(node)){shouldHighlight=true}else{shouldHighlight=false}}if(shouldHighlight){nodeData.isInViewport=isInExpandedViewport(node,viewportExpansion);if(nodeData.isInViewport||viewportExpansion===-1){nodeData.highlightIndex=highlightIndex++;if(doHighlightElements){if(focusHighlightIndex>=0){if(focusHighlightIndex===nodeData.highlightIndex){highlightElement(node,nodeData.highlightIndex,parentIframe)}}else{highlightElement(node,nodeData.highlightIndex,parentIframe)}return true}}}return false}__name(handleHighlighting,"handleHighlighting");function buildDomTree(node,parentIframe=null,isParentHighlighted=false){if(!node||node.id===HIGHLIGHT_CONTAINER_ID||node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(!node||node.id===HIGHLIGHT_CONTAINER_ID){return null}if(node.dataset?.browserUseIgnore==="true"||node.dataset?.pageAgentIgnore==="true"){return null}if(node.getAttribute&&node.getAttribute("aria-hidden")==="true"){return null}if(node===document.body){const nodeData2={tagName:"body",attributes:{},xpath:"/body",children:[]};for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,false);if(domElement)nodeData2.children.push(domElement)}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]=nodeData2;return id2}if(node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE){return null}if(node.nodeType===Node.TEXT_NODE){const textContent=node.textContent?.trim();if(!textContent){return null}const parentElement=node.parentElement;if(!parentElement||parentElement.tagName.toLowerCase()==="script"){return null}const id2=`${ID.current++}`;DOM_HASH_MAP[id2]={type:"TEXT_NODE",text:textContent,isVisible:isTextNodeVisible(node)};return id2}if(node.nodeType===Node.ELEMENT_NODE&&!isElementAccepted(node)){return null}if(viewportExpansion!==-1&&!node.shadowRoot){const rect=getCachedBoundingRect(node);const style=getCachedComputedStyle(node);const isFixedOrSticky=style&&(style.position==="fixed"||style.position==="sticky");const hasSize=node.offsetWidth>0||node.offsetHeight>0;if(!rect||!isFixedOrSticky&&!hasSize&&(rect.bottom<-viewportExpansion||rect.top>window.innerHeight+viewportExpansion||rect.right<-viewportExpansion||rect.left>window.innerWidth+viewportExpansion)){return null}}const nodeData={tagName:node.tagName.toLowerCase(),attributes:{},children:[]};if(isInteractiveCandidate(node)||node.tagName.toLowerCase()==="iframe"||node.tagName.toLowerCase()==="body"){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}if(node.tagName.toLowerCase()==="input"&&(node.type==="checkbox"||node.type==="radio")){nodeData.attributes.checked=node.checked?"true":"false"}}let nodeWasHighlighted=false;if(node.nodeType===Node.ELEMENT_NODE){nodeData.isVisible=isElementVisible(node);if(nodeData.isVisible){nodeData.isTopElement=isTopElement(node);const role=node.getAttribute("role");const isMenuContainer=role==="menu"||role==="menubar"||role==="listbox";if(nodeData.isTopElement||isMenuContainer){nodeData.isInteractive=isInteractiveElement(node);nodeWasHighlighted=handleHighlighting(nodeData,node,parentIframe,isParentHighlighted);nodeData.ref=node;if(nodeData.isInteractive&&Object.keys(nodeData.attributes).length===0){const attributeNames=node.getAttributeNames?.()||[];for(const name of attributeNames){const value=node.getAttribute(name);nodeData.attributes[name]=value}}}}}if(node.tagName){const tagName=node.tagName.toLowerCase();if(tagName==="iframe"){try{const iframeDoc=node.contentDocument||node.contentWindow?.document;if(iframeDoc){for(const child of iframeDoc.childNodes){const domElement=buildDomTree(child,node,false);if(domElement)nodeData.children.push(domElement)}}}catch(e){console.warn("Unable to access iframe:",e)}}else if(node.isContentEditable||node.getAttribute("contenteditable")==="true"||node.id==="tinymce"||node.classList.contains("mce-content-body")||tagName==="body"&&node.getAttribute("data-id")?.startsWith("mce_")){for(const child of node.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}else{if(node.shadowRoot){nodeData.shadowRoot=true;for(const child of node.shadowRoot.childNodes){const domElement=buildDomTree(child,parentIframe,nodeWasHighlighted);if(domElement)nodeData.children.push(domElement)}}for(const child of node.childNodes){const passHighlightStatusToChild=nodeWasHighlighted||isParentHighlighted;const domElement=buildDomTree(child,parentIframe,passHighlightStatusToChild);if(domElement)nodeData.children.push(domElement)}}}if(nodeData.tagName==="a"&&nodeData.children.length===0&&!nodeData.attributes.href){const rect=getCachedBoundingRect(node);const hasSize=rect&&rect.width>0&&rect.height>0||node.offsetWidth>0||node.offsetHeight>0;if(!hasSize){return null}}nodeData.extra=extraData.get(node)||null;const id=`${ID.current++}`;DOM_HASH_MAP[id]=nodeData;return id}__name(buildDomTree,"buildDomTree");const rootId=buildDomTree(document.body);DOM_CACHE.clearCache();return{rootId,map:DOM_HASH_MAP}},"domTree");const DEFAULT_VIEWPORT_EXPANSION=-1;function resolveViewportExpansion(viewportExpansion){return viewportExpansion??DEFAULT_VIEWPORT_EXPANSION}__name(resolveViewportExpansion,"resolveViewportExpansion");const newElementsCache=new WeakMap;function getFlatTree(config){const viewportExpansion=resolveViewportExpansion(config.viewportExpansion);const interactiveBlacklist=[];for(const item of config.interactiveBlacklist||[]){if(typeof item==="function"){interactiveBlacklist.push(item())}else{interactiveBlacklist.push(item)}}const interactiveWhitelist=[];for(const item of config.interactiveWhitelist||[]){if(typeof item==="function"){interactiveWhitelist.push(item())}else{interactiveWhitelist.push(item)}}const elements=domTree({doHighlightElements:true,debugMode:true,focusHighlightIndex:-1,viewportExpansion,interactiveBlacklist,interactiveWhitelist,highlightOpacity:config.highlightOpacity??0,highlightLabelOpacity:config.highlightLabelOpacity??0.1});const currentUrl=window.location.href;for(const nodeId in elements.map){const node=elements.map[nodeId];if(node.isInteractive&&node.ref){const ref=node.ref;if(!newElementsCache.has(ref)){newElementsCache.set(ref,currentUrl);node.isNew=true}}}return elements}__name(getFlatTree,"getFlatTree");const globRegexCache=new Map;function globToRegex(pattern){let regex=globRegexCache.get(pattern);if(!regex){const escaped=pattern.replace(/[.+^${}()|[\\]\\\\]/g,"\\\\$&");regex=new RegExp(`^${escaped.replace(/\\*/g,".*")}$`);globRegexCache.set(pattern,regex)}return regex}__name(globToRegex,"globToRegex");function matchAttributes(attrs,patterns){const result2={};for(const pattern of patterns){if(pattern.includes("*")){const regex=globToRegex(pattern);for(const key of Object.keys(attrs)){if(regex.test(key)&&attrs[key].trim()){result2[key]=attrs[key].trim()}}}else{const value=attrs[pattern];if(value&&value.trim()){result2[pattern]=value.trim()}}}return result2}__name(matchAttributes,"matchAttributes");function flatTreeToString(flatTree,includeAttributes){const DEFAULT_INCLUDE_ATTRIBUTES=["title","type","checked","name","role","value","placeholder","data-date-format","alt","aria-label","aria-expanded","data-state","aria-checked","id","for","target","aria-haspopup","aria-controls","aria-owns","contenteditable"];const includeAttrs=[...includeAttributes||[],...DEFAULT_INCLUDE_ATTRIBUTES];const capTextLength=__name((text,maxLength)=>{if(text.length>maxLength){return text.substring(0,maxLength)+"..."}return text},"capTextLength");const buildTreeNode=__name((nodeId)=>{const node=flatTree.map[nodeId];if(!node)return null;if(node.type==="TEXT_NODE"){const textNode=node;return{type:"text",text:textNode.text,isVisible:textNode.isVisible,parent:null,children:[]}}else{const elementNode=node;const children=[];if(elementNode.children){for(const childId of elementNode.children){const child=buildTreeNode(childId);if(child){child.parent=null;children.push(child)}}}return{type:"element",tagName:elementNode.tagName,attributes:elementNode.attributes??{},isVisible:elementNode.isVisible??false,isInteractive:elementNode.isInteractive??false,isTopElement:elementNode.isTopElement??false,isNew:elementNode.isNew??false,highlightIndex:elementNode.highlightIndex,parent:null,children,extra:elementNode.extra??{}}}},"buildTreeNode");const setParentReferences=__name((node,parent=null)=>{node.parent=parent;for(const child of node.children){setParentReferences(child,node)}},"setParentReferences");const rootNode=buildTreeNode(flatTree.rootId);if(!rootNode)return"";setParentReferences(rootNode);const hasParentWithHighlightIndex=__name((node)=>{let current=node.parent;while(current){if(current.type==="element"&&current.highlightIndex!==undefined){return true}current=current.parent}return false},"hasParentWithHighlightIndex");const processNode=__name((node,depth,result22)=>{let nextDepth=depth;const depthStr="\\t".repeat(depth);if(node.type==="element"){if(node.highlightIndex!==undefined){nextDepth+=1;const text=getAllTextTillNextClickableElement(node);let attributesHtmlStr="";if(includeAttrs.length>0&&node.attributes){const attributesToInclude=matchAttributes(node.attributes,includeAttrs);const keys=Object.keys(attributesToInclude);if(keys.length>1){const keysToRemove=new Set;const seenValues={};for(const key of keys){const value=attributesToInclude[key];if(value.length>5){if(value in seenValues){keysToRemove.add(key)}else{seenValues[value]=key}}}for(const key of keysToRemove){delete attributesToInclude[key]}}if(attributesToInclude.role===node.tagName){delete attributesToInclude.role}const attrsToRemoveIfTextMatches=["aria-label","placeholder","title"];for(const attr of attrsToRemoveIfTextMatches){if(attributesToInclude[attr]&&attributesToInclude[attr].toLowerCase().trim()===text.toLowerCase().trim()){delete attributesToInclude[attr]}}if(Object.keys(attributesToInclude).length>0){attributesHtmlStr=Object.entries(attributesToInclude).map(([key,value])=>`${key}=${capTextLength(value,20)}`).join(" ")}}const highlightIndicator=node.isNew?`*[${node.highlightIndex}]`:`[${node.highlightIndex}]`;let line=`${depthStr}${highlightIndicator}<${node.tagName??""}`;if(attributesHtmlStr){line+=` ${attributesHtmlStr}`}if(node.extra){if(node.extra.scrollable){let scrollDataText="";if(node.extra.scrollData?.left)scrollDataText+=`left=${node.extra.scrollData.left}, `;if(node.extra.scrollData?.top)scrollDataText+=`top=${node.extra.scrollData.top}, `;if(node.extra.scrollData?.right)scrollDataText+=`right=${node.extra.scrollData.right}, `;if(node.extra.scrollData?.bottom)scrollDataText+=`bottom=${node.extra.scrollData.bottom}`;line+=` data-scrollable="${scrollDataText}"`}}if(text){const trimmedText=text.trim();if(!attributesHtmlStr){line+=" "}line+=`>${trimmedText}`}else if(!attributesHtmlStr){line+=" "}line+=" />";result22.push(line)}for(const child of node.children){processNode(child,nextDepth,result22)}}else if(node.type==="text"){if(hasParentWithHighlightIndex(node)){return}if(node.parent&&node.parent.type==="element"&&node.parent.isVisible&&node.parent.isTopElement){result22.push(`${depthStr}${node.text??""}`)}}},"processNode");const result2=[];processNode(rootNode,0,result2);return result2.join(`\n`)}__name(flatTreeToString,"flatTreeToString");const getAllTextTillNextClickableElement=__name((node,maxDepth=-1)=>{const textParts=[];const collectText=__name((currentNode,currentDepth)=>{if(maxDepth!==-1&&currentDepth>maxDepth){return}if(currentNode.type==="element"&&currentNode!==node&&currentNode.highlightIndex!==undefined){return}if(currentNode.type==="text"&&currentNode.text){textParts.push(currentNode.text)}else if(currentNode.type==="element"){for(const child of currentNode.children){collectText(child,currentDepth+1)}}},"collectText");collectText(node,0);return textParts.join(`\n`).trim()},"getAllTextTillNextClickableElement");function getSelectorMap(flatTree){const selectorMap=new Map;const keys=Object.keys(flatTree.map);for(const key of keys){const node=flatTree.map[key];if(node.isInteractive&&typeof node.highlightIndex==="number"){selectorMap.set(node.highlightIndex,node)}}return selectorMap}__name(getSelectorMap,"getSelectorMap");function getElementTextMap(simplifiedHTML){const lines=simplifiedHTML.split(`\n`).map((line)=>line.trim()).filter((line)=>line.length>0);const elementTextMap=new Map;for(const line of lines){const regex=/^\\[(\\d+)\\]<[^>]+>([^<]*)/;const match=regex.exec(line);if(match){const index=parseInt(match[1],10);elementTextMap.set(index,line)}}return elementTextMap}__name(getElementTextMap,"getElementTextMap");function cleanUpHighlights(){const cleanupFunctions=window._highlightCleanupFunctions||[];for(const cleanup of cleanupFunctions){if(typeof cleanup==="function"){cleanup()}}window._highlightCleanupFunctions=[]}__name(cleanUpHighlights,"cleanUpHighlights");window.addEventListener("popstate",()=>{cleanUpHighlights()});window.addEventListener("hashchange",()=>{cleanUpHighlights()});window.addEventListener("beforeunload",()=>{cleanUpHighlights()});const navigation=window.navigation;if(navigation&&typeof navigation.addEventListener==="function"){navigation.addEventListener("navigate",()=>{cleanUpHighlights()})}else{let currentUrl=window.location.href;setInterval(()=>{if(window.location.href!==currentUrl){currentUrl=window.location.href;cleanUpHighlights()}},500)}function getPageInfo(){const viewport_width=window.innerWidth;const viewport_height=window.innerHeight;const page_width=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth||0);const page_height=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight||0);const scroll_x=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0;const scroll_y=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;const pixels_below=Math.max(0,page_height-(window.innerHeight+scroll_y));const pixels_right=Math.max(0,page_width-(window.innerWidth+scroll_x));return{viewport_width,viewport_height,page_width,page_height,scroll_x,scroll_y,pixels_above:scroll_y,pixels_below,pages_above:viewport_height>0?scroll_y/viewport_height:0,pages_below:viewport_height>0?pixels_below/viewport_height:0,total_pages:viewport_height>0?page_height/viewport_height:0,current_page_position:scroll_y/Math.max(1,page_height-viewport_height),pixels_left:scroll_x,pixels_right}}__name(getPageInfo,"getPageInfo");function patchReact(pageController){const reactRootElements=document.querySelectorAll(\'[data-reactroot], [data-reactid], [data-react-checksum], #root, #app, [id^="root-"], [id^="app-"], #adex-wrapper, #adex-root\');for(const element of reactRootElements){element.setAttribute("data-page-agent-not-interactive","true")}}__name(patchReact,"patchReact");const _PageController=class _PageController extends EventTarget{config;flatTree=null;selectorMap=new Map;elementTextMap=new Map;simplifiedHTML="<EMPTY>";lastTimeUpdate=0;isIndexed=false;mask=null;maskReady=null;constructor(config={}){super();this.config=config;patchReact();if(config.enableMask)this.initMask()}initMask(){if(this.maskReady!==null)return;this.maskReady=(async()=>{var SimulatorMask = window.__LiteMask;this.mask=new SimulatorMask})()}async getCurrentUrl(){return window.location.href}async getLastUpdateTime(){return this.lastTimeUpdate}async getBrowserState(){const url=window.location.href;const title=document.title;const pi=getPageInfo();const viewportExpansion=resolveViewportExpansion(this.config.viewportExpansion);await this.updateTree();const content=this.simplifiedHTML;const titleLine=`Current Page: [${title}](${url})`;const pageInfoLine=`Page info: ${pi.viewport_width}x${pi.viewport_height}px viewport, ${pi.page_width}x${pi.page_height}px total page size, ${pi.pages_above.toFixed(1)} pages above, ${pi.pages_below.toFixed(1)} pages below, ${pi.total_pages.toFixed(1)} total pages, at ${(pi.current_page_position*100).toFixed(0)}% of page`;const elementsLabel=viewportExpansion===-1?"Interactive elements from top layer of the current page (full page):":"Interactive elements from top layer of the current page inside the viewport:";const hasContentAbove=pi.pixels_above>4;const scrollHintAbove=hasContentAbove&&viewportExpansion!==-1?`... ${pi.pixels_above} pixels above (${pi.pages_above.toFixed(1)} pages) - scroll to see more ...`:"[Start of page]";const header=`${titleLine}\n${pageInfoLine}\n\n${elementsLabel}\n\n${scrollHintAbove}`;const hasContentBelow=pi.pixels_below>4;const footer=hasContentBelow&&viewportExpansion!==-1?`... ${pi.pixels_below} pixels below (${pi.pages_below.toFixed(1)} pages) - scroll to see more ...`:"[End of page]";return{url,title,header,content,footer}}async updateTree(){this.dispatchEvent(new Event("beforeUpdate"));this.lastTimeUpdate=Date.now();if(this.mask){this.mask.wrapper.style.pointerEvents="none"}cleanUpHighlights();const blacklist=[...this.config.interactiveBlacklist||[],...document.querySelectorAll("[data-page-agent-not-interactive]").values()];this.flatTree=getFlatTree({...this.config,interactiveBlacklist:blacklist});this.simplifiedHTML=flatTreeToString(this.flatTree,this.config.includeAttributes);this.selectorMap.clear();this.selectorMap=getSelectorMap(this.flatTree);this.elementTextMap.clear();this.elementTextMap=getElementTextMap(this.simplifiedHTML);this.isIndexed=true;if(this.mask){this.mask.wrapper.style.pointerEvents="auto"}this.dispatchEvent(new Event("afterUpdate"));return this.simplifiedHTML}async cleanUpHighlights(){cleanUpHighlights()}assertIndexed(){if(!this.isIndexed){throw new Error("DOM tree not indexed yet. Can not perform actions on elements.")}}async clickElement(index){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await clickElement(element);if(isAnchorElement(element)&&element.target==="_blank"){return{success:true,message:`✅ Clicked element (${elemText??index}). ⚠️ Link opened in a new tab.`}}return{success:true,message:`✅ Clicked element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to click element: ${error}`}}}async inputText(index,text){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await inputTextElement(element,text);return{success:true,message:`✅ Input text (${text}) into element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to input text: ${error}`}}}async selectOption(index,optionText){try{this.assertIndexed();const element=getElementByIndex(this.selectorMap,index);const elemText=this.elementTextMap.get(index);await selectOptionElement(element,optionText);return{success:true,message:`✅ Selected option (${optionText}) in element (${elemText??index}).`}}catch(error){return{success:false,message:`❌ Failed to select option: ${error}`}}}async scroll(options){try{const{down,numPages,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels??numPages*(down?1:-1)*window.innerHeight;const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollVertically(down,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll: ${error}`}}}async scrollHorizontally(options){try{const{right,pixels,index}=options;this.assertIndexed();const scrollAmount=pixels*(right?1:-1);const element=index!==undefined?getElementByIndex(this.selectorMap,index):null;const message=await scrollHorizontally(right,scrollAmount,element);return{success:true,message}}catch(error){return{success:false,message:`❌ Failed to scroll horizontally: ${error}`}}}async executeJavascript(script){try{const asyncFunction=eval(`(async () => { ${script} })`);const result=await asyncFunction();return{success:true,message:`✅ Executed JavaScript. Result: ${result}`}}catch(error){return{success:false,message:`❌ Error executing JavaScript: ${error}`}}}async showMask(){await this.maskReady;this.mask?.show()}async hideMask(){await this.maskReady;this.mask?.hide()}dispose(){cleanUpHighlights();this.flatTree=null;this.selectorMap.clear();this.elementTextMap.clear();this.simplifiedHTML="<EMPTY>";this.isIndexed=false;this.mask?.dispose();this.mask=null}};__name(_PageController,"PageController");let PageController=_PageController;window.__PageController=PageController})();\n})();\n\n// --- Signet Page Agent API ---\n(function(){\n var pc = new window.__PageController({ enableMask: false, highlightOpacity: 0, highlightLabelOpacity: 0 });\n \n window.signet = window.signet || {};\n window.signet.pageController = pc;\n \n window.signet.getDomState = async function(){\n try {\n var state = await pc.getBrowserState();\n return { success: true, state: state };\n } catch(e) {\n return { success: false, error: e.message || String(e) };\n }\n };\n \n window.signet.executeAction = async function(action){\n try {\n var result;\n switch(action.type){\n case \'click_element\':\n result = await pc.clickElement(action.index);\n break;\n case \'input_text\':\n result = await pc.inputText(action.index, action.text);\n break;\n case \'select_option\':\n result = await pc.selectOption(action.index, action.text);\n break;\n case \'scroll\':\n result = await pc.scroll({ down: action.direction === \'down\', numPages: action.amount || 1 });\n break;\n default:\n result = { success: false, message: \'Unknown action type: \' + action.type };\n }\n return result;\n } catch(e) {\n return { success: false, message: e.message || String(e) };\n }\n };\n \n window.signet.agentStart = async function(){\n pc.initMask();\n await pc.showMask();\n };\n \n window.signet.agentStop = async function(){\n await pc.hideMask();\n };\n})();',Yt=`
2
2
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
3
3
  html { font-family: 'Geist Mono', 'IBM Plex Mono', monospace; font-size: 13px; line-height: 1.5; color: var(--sig-text); background: var(--sig-bg); -webkit-font-smoothing: antialiased; }
4
4
  body { margin: 0; padding: 8px; min-height: 100%; }