import"./chunk-B5Qt9EMX.js";import{a,j as e,R as p}from"./chunk-D70STq7i.js";import{R as m}from"./chunk-wdxSLViu.js";const o=[{name:"ChatGPT",url:"https://chatgpt.com"},{name:"Claude",url:"https://claude.ai"},{name:"Gemini",url:"https://gemini.google.com"},{name:"Copilot",url:"https://copilot.microsoft.com"},{name:"Grok",url:"https://grok.com"},{name:"Poe",url:"https://poe.com"}],u=()=>{const[n,r]=a.useState(null);a.useEffect(()=>{chrome.tabs.query({active:!0,currentWindow:!0},t=>{const s=t[0]?.url;if(s)try{r(new URL(s).hostname.replace(/^www\./,""))}catch{}})},[]);const l=n?o.some(({url:t})=>new URL(t).hostname.replace(/^www\./,"")===n):!1,c=a.useCallback(t=>{chrome.tabs.create({url:t})},[]),i=a.useCallback(()=>{chrome.runtime.openOptionsPage()},[]);return e.jsxs("main",{className:"sidepanel",children:[e.jsx("h1",{className:"sidepanel__title",children:"Agent Wielder"}),e.jsx("p",{className:"sidepanel__lede",children:"Compose prompts from reusable parts, expand them across variables, and run agent sequences — on the AI site you are already using."}),e.jsx("p",{className:"sidepanel__status",children:l?`Agent Wielder is running on ${n}. Open it from the orb on the page.`:"Open a supported site to use Agent Wielder there."}),e.jsx("ul",{className:"sidepanel__platforms",children:o.map(({name:t,url:s})=>e.jsx("li",{children:e.jsx("button",{type:"button",className:"sidepanel__platform",onClick:()=>c(s),children:t})},s))}),e.jsx("button",{type:"button",className:"sidepanel__settings",onClick:i,children:"Settings"})]})};m.createRoot(document.getElementById("app")).render(e.jsx(p.StrictMode,{children:e.jsx(u,{})}));
