@apteva/apteva-darwin-arm64 0.4.53 → 0.4.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apteva +0 -0
- package/dist/ActivityPage.nx7edj1s.js +3 -0
- package/dist/{ActivityPage.9v5ha2p7.js.map → ActivityPage.nx7edj1s.js.map} +2 -2
- package/dist/ApiDocsPage.rwys8wpd.js +4 -0
- package/dist/{ApiDocsPage.qsehxvkb.js.map → ApiDocsPage.rwys8wpd.js.map} +2 -2
- package/dist/App.2j4tpeys.js +61 -0
- package/dist/{App.anvw0hjc.js.map → App.2j4tpeys.js.map} +3 -3
- package/dist/{App.jdkx6eqd.js → App.8cvz3ngj.js} +2 -2
- package/dist/{App.jdkx6eqd.js.map → App.8cvz3ngj.js.map} +1 -1
- package/dist/App.a2rb0ne3.js +4 -0
- package/dist/{App.sd685nt9.js.map → App.a2rb0ne3.js.map} +2 -2
- package/dist/App.aybz4ae0.js +53 -0
- package/dist/{App.d9vcm6zs.js.map → App.aybz4ae0.js.map} +3 -3
- package/dist/App.bjefj5zs.js +4 -0
- package/dist/{App.aexwv4rk.js.map → App.bjefj5zs.js.map} +2 -2
- package/dist/App.cnbb1872.js +4 -0
- package/dist/{App.x6x8s16g.js.map → App.cnbb1872.js.map} +2 -2
- package/dist/App.cv6e5yds.js +4 -0
- package/dist/App.cv6e5yds.js.map +10 -0
- package/dist/App.eqd061d2.js +4 -0
- package/dist/{App.dmvykj97.js.map → App.eqd061d2.js.map} +3 -3
- package/dist/App.fy5bef1p.js +20 -0
- package/dist/{App.shfd8tp9.js.map → App.fy5bef1p.js.map} +6 -5
- package/dist/App.mxcz65n1.js +4 -0
- package/dist/{App.cjcyr5aj.js.map → App.mxcz65n1.js.map} +2 -2
- package/dist/App.nvpvg5yh.js +13 -0
- package/dist/{App.j4ec9k18.js.map → App.nvpvg5yh.js.map} +2 -2
- package/dist/{App.2j20h2gt.js → App.rvnjekh6.js} +3 -3
- package/dist/{App.2j20h2gt.js.map → App.rvnjekh6.js.map} +2 -2
- package/dist/App.was53rtk.js +4 -0
- package/dist/{App.kz3qyyre.js.map → App.was53rtk.js.map} +2 -2
- package/dist/App.wqjbggrj.js +4 -0
- package/dist/{App.e2kkda2a.js.map → App.wqjbggrj.js.map} +2 -2
- package/dist/App.z92hp4k3.js +221 -0
- package/dist/{App.j0xwtdd7.js.map → App.z92hp4k3.js.map} +11 -11
- package/dist/{App.wghtdzsk.js → App.zn4mw16t.js} +1 -1
- package/dist/ConnectionsPage.qfyks0xm.js +3 -0
- package/dist/McpPage.y6vgt9ej.js +3 -0
- package/dist/SettingsPage.fkw8berr.js +3 -0
- package/dist/SkillsPage.48zztx44.js +3 -0
- package/dist/TasksPage.v930en79.js +3 -0
- package/dist/TelemetryPage.xxebs3s9.js +3 -0
- package/dist/TelemetryPage.xxebs3s9.js.map +9 -0
- package/dist/TestsPage.1xtfmbrg.js +3 -0
- package/dist/ThreadsPage.xazwab60.js +3 -0
- package/dist/ThreadsPage.xazwab60.js.map +9 -0
- package/dist/apteva-kit.css +1 -1
- package/dist/index.html +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/ActivityPage.9v5ha2p7.js +0 -3
- package/dist/ApiDocsPage.qsehxvkb.js +0 -4
- package/dist/App.2md3x3z7.js +0 -4
- package/dist/App.2md3x3z7.js.map +0 -10
- package/dist/App.aexwv4rk.js +0 -4
- package/dist/App.anvw0hjc.js +0 -61
- package/dist/App.cjcyr5aj.js +0 -4
- package/dist/App.d9vcm6zs.js +0 -53
- package/dist/App.dmvykj97.js +0 -4
- package/dist/App.e2kkda2a.js +0 -4
- package/dist/App.j0xwtdd7.js +0 -221
- package/dist/App.j4ec9k18.js +0 -13
- package/dist/App.kz3qyyre.js +0 -4
- package/dist/App.sd685nt9.js +0 -4
- package/dist/App.shfd8tp9.js +0 -20
- package/dist/App.x6x8s16g.js +0 -4
- package/dist/ConnectionsPage.1dyyfqbk.js +0 -3
- package/dist/McpPage.xvr8hk05.js +0 -3
- package/dist/SettingsPage.4r1nbxvp.js +0 -3
- package/dist/SkillsPage.jw7carjq.js +0 -3
- package/dist/TasksPage.r8txe0e9.js +0 -3
- package/dist/TelemetryPage.sqnsfrht.js +0 -3
- package/dist/TelemetryPage.sqnsfrht.js.map +0 -9
- package/dist/TestsPage.pkymr7yt.js +0 -3
- package/dist/ThreadsPage.49tgq4fq.js +0 -3
- package/dist/ThreadsPage.49tgq4fq.js.map +0 -9
- /package/dist/{ConnectionsPage.1dyyfqbk.js.map → ConnectionsPage.qfyks0xm.js.map} +0 -0
- /package/dist/{McpPage.xvr8hk05.js.map → McpPage.y6vgt9ej.js.map} +0 -0
- /package/dist/{SettingsPage.4r1nbxvp.js.map → SettingsPage.fkw8berr.js.map} +0 -0
- /package/dist/{SkillsPage.jw7carjq.js.map → SkillsPage.48zztx44.js.map} +0 -0
- /package/dist/{TasksPage.r8txe0e9.js.map → TasksPage.v930en79.js.map} +0 -0
- /package/dist/{TestsPage.pkymr7yt.js.map → TestsPage.1xtfmbrg.js.map} +0 -0
package/dist/App.j4ec9k18.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{O as Oz,P as Wz}from"./App.e2kkda2a.js";import{U as j}from"./App.sd685nt9.js";import{$ as Qz,X as n,aa as zz,ja as Jz,ma as Kz}from"./App.shfd8tp9.js";var W=n(Qz(),1);var z=n(zz(),1);function Rz(){let{authFetch:K}=Jz(),{projects:Z,currentProjectId:Y}=Kz(),[B,N]=W.useState([]),[y,M]=W.useState(!0),[X,U]=W.useState("installed"),[G,Q]=W.useState(!1),[C,H]=W.useState(!1),[v,T]=W.useState(null),{confirm:f,ConfirmDialog:w}=Oz(),{alert:P,AlertDialog:d}=Wz(),_=Z.length>0,[m,p]=W.useState(""),[h,Xz]=W.useState([]),[c,r]=W.useState(!1),[Yz,o]=W.useState(null),[a,i]=W.useState(""),[R,t]=W.useState([]),[I,u]=W.useState(!1),[V,b]=W.useState(null),[q,l]=W.useState(null),[e,S]=W.useState(null),[x,Zz]=W.useState(Y&&Y!=="unassigned"?Y:null),D=B.filter((J)=>{if(!Y)return!0;if(Y==="unassigned")return J.project_id===null;return J.project_id===null||J.project_id===Y}),F=async()=>{try{let O=await(await K("/api/skills")).json();N(O.skills||[])}catch(J){console.error("Failed to fetch skills:",J)}M(!1)},E=async(J)=>{r(!0);try{let O=J!==void 0?J:m,$=O?`/api/skills/marketplace/search?q=${encodeURIComponent(O)}`:"/api/skills/marketplace/featured",A=await(await K($)).json();Xz(A.skills||[])}catch(O){console.error("Failed to search marketplace:",O)}r(!1)};W.useEffect(()=>{F()},[K]),W.useEffect(()=>{if(X==="marketplace"&&h.length===0)E("")},[X]);let _z=async(J)=>{try{await K(`/api/skills/${J}/toggle`,{method:"POST"}),F()}catch(O){console.error("Failed to toggle skill:",O)}},$z=async(J)=>{if(!await f("Delete this skill?",{confirmText:"Delete",title:"Delete Skill"}))return;try{if(await K(`/api/skills/${J}`,{method:"DELETE"}),v?.id===J)T(null);F()}catch($){console.error("Failed to delete skill:",$)}},Bz=async(J)=>{o(J.id);try{let O=await K(`/api/skills/marketplace/${J.id}/install`,{method:"POST"}),$=await O.json();if(O.ok)await P(`Installed "${J.name}" successfully!`,{title:"Skill Installed"}),F(),U("installed");else await P($.error||"Failed to install skill",{title:"Installation Failed"})}catch(O){console.error("Failed to install skill:",O),await P("Failed to install skill",{title:"Error"})}o(null)},g=(J)=>B.some((O)=>O.name===J),s=async(J)=>{let O=J||a;if(!O.trim())return;let $="",L="";if(O.includes("github.com")){let A=O.match(/github\.com\/([^/]+)\/([^/]+)/);if(A)$=A[1],L=A[2].replace(/\.git$/,"")}else if(O.includes("/")){let A=O.split("/");$=A[0],L=A[1]}if(!$||!L){b("Invalid repo format. Use 'owner/repo' or GitHub URL");return}u(!0),b(null),t([]),l(null);try{let A=await K(`/api/skills/github/${$}/${L}`),k=await A.json();if(!A.ok){b(k.error||"Failed to fetch repository"),u(!1);return}t(k.skills||[]),l(k.repo||null)}catch(A){b("Failed to fetch repository")}u(!1)},Nz=async(J)=>{if(!q)return;S(J.name);try{let O=await K("/api/skills/github/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:q.owner,repo:q.repo,skillName:J.name,downloadUrl:J.downloadUrl,projectId:x})}),$=await O.json();if(O.ok)await P(`Installed "${J.name}" successfully!`,{title:"Skill Installed"}),F();else await P($.error||"Failed to install skill",{title:"Installation Failed",variant:"error"})}catch(O){await P("Failed to install skill",{title:"Error",variant:"error"})}S(null)},Uz=async()=>{if(!q||R.length===0)return;let J=R.filter((L)=>!g(L.name));if(J.length===0){await P("All skills are already installed",{title:"Info"});return}if(!await f(`Install ${J.length} skill(s) from ${q.owner}/${q.repo}?`,{confirmText:"Install All",title:"Install Skills"}))return;let $=0;for(let L of J){S(L.name);try{if((await K("/api/skills/github/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:q.owner,repo:q.repo,skillName:L.name,downloadUrl:L.downloadUrl,projectId:x})})).ok)$++}catch(A){}}S(null),F(),await P(`Installed ${$} of ${J.length} skills`,{title:"Installation Complete"})};return z.jsxDEV(z.Fragment,{children:[w,d,z.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:z.jsxDEV("div",{className:"max-w-6xl",children:[z.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[z.jsxDEV("div",{children:[z.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Skills"},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:"Manage agent skills - instructions that teach agents how to perform tasks."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X==="installed"&&z.jsxDEV("div",{className:"flex gap-2",children:[z.jsxDEV("button",{onClick:()=>H(!0),className:"bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] text-white px-4 py-2 rounded font-medium transition border border-[var(--color-border-light)]",children:"Import"},void 0,!1,void 0,this),z.jsxDEV("button",{onClick:()=>Q(!0),className:"bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] text-black px-4 py-2 rounded font-medium transition",children:"+ Create Skill"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"flex gap-1 mb-6 bg-[var(--color-surface)] card p-1 w-fit",children:[z.jsxDEV("button",{onClick:()=>U("installed"),className:`px-4 py-2 rounded text-sm font-medium transition ${X==="installed"?"bg-[var(--color-surface-raised)] text-white":"text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"}`,children:["Installed (",D.length,")"]},void 0,!0,void 0,this),z.jsxDEV("button",{onClick:()=>U("github"),className:`px-4 py-2 rounded text-sm font-medium transition ${X==="github"?"bg-[var(--color-surface-raised)] text-white":"text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"}`,children:"Browse GitHub"},void 0,!1,void 0,this),z.jsxDEV("button",{onClick:()=>U("marketplace"),className:`px-4 py-2 rounded text-sm font-medium transition ${X==="marketplace"?"bg-[var(--color-surface-raised)] text-white":"text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"}`,children:"Marketplace"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X==="installed"&&z.jsxDEV(z.Fragment,{children:y?z.jsxDEV("div",{className:"text-[var(--color-text-muted)]",children:"Loading skills..."},void 0,!1,void 0,this):B.length===0?z.jsxDEV("div",{className:"text-center py-20 text-[var(--color-text-muted)]",children:[z.jsxDEV("p",{className:"text-lg",children:"No skills installed"},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-sm mt-1",children:"Create a skill or browse the marketplace"},void 0,!1,void 0,this),z.jsxDEV("button",{onClick:()=>U("marketplace"),className:"mt-4 bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] text-black px-4 py-2 rounded font-medium transition",children:"Browse Marketplace"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):D.length===0?z.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-6 text-center",children:z.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:"No skills match this filter."},void 0,!1,void 0,this)},void 0,!1,void 0,this):z.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:D.map((J)=>{let O=_&&J.project_id?Z.find(($)=>$.id===J.project_id):null;return z.jsxDEV(Hz,{skill:J,project:O,onToggle:()=>_z(J.id),onDelete:()=>$z(J.id),onView:()=>T(J)},J.id,!1,void 0,this)})},void 0,!1,void 0,this)},void 0,!1,void 0,this),X==="github"&&z.jsxDEV("div",{className:"space-y-6",children:[z.jsxDEV("form",{onSubmit:(J)=>{J.preventDefault(),s()},className:"flex gap-2",children:[z.jsxDEV("input",{type:"text",value:a,onChange:(J)=>i(J.target.value),placeholder:"Enter GitHub repo (e.g., WordPress/agent-skills)",className:"flex-1 bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg px-4 py-3 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this),z.jsxDEV("button",{type:"submit",disabled:I,className:"bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] disabled:opacity-50 text-black px-6 py-3 rounded-lg font-medium transition",children:I?"...":"Browse"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),_&&R.length>0&&z.jsxDEV("div",{className:"flex items-center gap-3 p-3 bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded-lg",children:[z.jsxDEV("span",{className:"text-sm text-[var(--color-text-muted)]",children:"Install to:"},void 0,!1,void 0,this),z.jsxDEV(j,{value:x||"",onChange:(J)=>Zz(J||null),options:[{value:"",label:"Global (all projects)"},...Z.map((J)=>({value:J.id,label:J.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),V&&z.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg",children:V},void 0,!1,void 0,this),q&&R.length>0&&z.jsxDEV("div",{className:"flex items-center justify-between",children:[z.jsxDEV("div",{className:"flex items-center gap-3",children:[z.jsxDEV("a",{href:q.url,target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-accent)] hover:underline font-medium",children:[q.owner,"/",q.repo]},void 0,!0,void 0,this),z.jsxDEV("span",{className:"text-sm text-[var(--color-text-muted)]",children:[R.length," skill",R.length!==1?"s":""," found"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),R.some((J)=>!g(J.name))&&z.jsxDEV("button",{onClick:Uz,disabled:!!e,className:"text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] hover:border-[var(--color-accent)] px-4 py-2 rounded transition disabled:opacity-50",children:"Install All"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),I&&z.jsxDEV("div",{className:"text-center py-8 text-[var(--color-text-muted)]",children:"Fetching skills from repository..."},void 0,!1,void 0,this),!I&&!q&&!V&&z.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-8 text-center",children:[z.jsxDEV("div",{className:"text-4xl mb-4",children:"\uD83D\uDCE6"},void 0,!1,void 0,this),z.jsxDEV("h3",{className:"text-lg font-medium mb-2",children:"Browse Skills from GitHub"},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-[var(--color-text-muted)] mb-6 max-w-md mx-auto",children:"Enter a GitHub repository to browse and install skills. Skills are markdown files with instructions that teach agents how to perform specific tasks."},void 0,!1,void 0,this),z.jsxDEV("div",{className:"flex flex-wrap gap-2 justify-center",children:[{label:"WordPress Skills",repo:"WordPress/agent-skills"}].map(({label:J,repo:O})=>z.jsxDEV("button",{onClick:()=>{i(O),s(O)},className:"text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] hover:border-[var(--color-accent)] px-3 py-1.5 rounded transition",children:J},O,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!I&&q&&R.length===0&&z.jsxDEV("div",{className:"text-center py-8 text-[var(--color-text-muted)]",children:"No skills found in this repository. Skills should be in subdirectories with a SKILL.md file."},void 0,!1,void 0,this),R.length>0&&z.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2",children:R.map((J)=>{let O=g(J.name),$=e===J.name;return z.jsxDEV("div",{className:`bg-[var(--color-surface)] border rounded-lg p-4 transition ${O?"border-green-500/30":"border-[var(--color-border)] hover:border-[var(--color-border-light)]"}`,children:z.jsxDEV("div",{className:"flex items-start justify-between gap-3",children:[z.jsxDEV("div",{className:"flex-1 min-w-0",children:[z.jsxDEV("div",{className:"flex items-center gap-2",children:[z.jsxDEV("h3",{className:"font-medium truncate",children:J.name},void 0,!1,void 0,this),O&&z.jsxDEV("span",{className:"text-xs text-green-400",children:"✓ Installed"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)] mt-1 line-clamp-2",children:J.description||"No description"},void 0,!1,void 0,this),z.jsxDEV("div",{className:"flex items-center gap-2 mt-2 text-xs text-[var(--color-text-faint)]",children:[z.jsxDEV("span",{children:[(J.size/1024).toFixed(1),"KB"]},void 0,!0,void 0,this),z.jsxDEV("span",{className:"px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400",children:"GitHub"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"flex-shrink-0",children:O?z.jsxDEV("span",{className:"text-xs text-[var(--color-text-faint)] px-3 py-1.5",children:"Added"},void 0,!1,void 0,this):z.jsxDEV("button",{onClick:()=>Nz(J),disabled:$,className:"text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] hover:border-[var(--color-accent)] px-3 py-1.5 rounded transition disabled:opacity-50",children:$?"Installing...":"Install"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},J.name,!1,void 0,this)})},void 0,!1,void 0,this),z.jsxDEV("div",{className:"p-4 bg-[var(--color-surface)] card text-sm text-[var(--color-text-muted)]",children:z.jsxDEV("p",{children:["Skills are sourced from GitHub repositories. Each skill should be in its own directory with a"," ",z.jsxDEV("code",{className:"text-[var(--color-text-secondary)] bg-[var(--color-bg)] px-1 rounded",children:"SKILL.md"},void 0,!1,void 0,this)," file containing instructions."]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X==="marketplace"&&z.jsxDEV(z.Fragment,{children:[z.jsxDEV("div",{className:"mb-6",children:z.jsxDEV("div",{className:"flex gap-2",children:[z.jsxDEV("input",{type:"text",value:m,onChange:(J)=>p(J.target.value),onKeyDown:(J)=>J.key==="Enter"&&E(),placeholder:"Search skills...",className:"flex-1 bg-[var(--color-surface)] border border-[var(--color-border)] rounded px-4 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this),z.jsxDEV("button",{onClick:()=>E(),disabled:c,className:"bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] text-white px-4 py-2 rounded font-medium transition border border-[var(--color-border-light)]",children:c?"...":"Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),c?z.jsxDEV("div",{className:"text-[var(--color-text-muted)]",children:"Loading..."},void 0,!1,void 0,this):h.length===0?z.jsxDEV("div",{className:"text-center py-20 text-[var(--color-text-muted)]",children:[z.jsxDEV("p",{className:"text-lg",children:"No skills found"},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-sm mt-1",children:"Try a different search term"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):z.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:h.map((J)=>z.jsxDEV(qz,{skill:J,installed:g(J.name),installing:Yz===J.id,onInstall:()=>Bz(J)},J.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),G&&z.jsxDEV(Az,{authFetch:K,onClose:()=>Q(!1),onCreated:()=>{Q(!1),F()},projects:_?Z:void 0,defaultProjectId:Y&&Y!=="unassigned"?Y:null},void 0,!1,void 0,this),C&&z.jsxDEV(yz,{authFetch:K,onClose:()=>H(!1),onImported:()=>{H(!1),F()}},void 0,!1,void 0,this),v&&z.jsxDEV(Mz,{skill:v,authFetch:K,onClose:()=>T(null),onUpdated:()=>{T(null),F()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Hz({skill:K,project:Z,onToggle:Y,onDelete:B,onView:N}){let y={local:"Local",skillsmp:"SkillsMP",github:"GitHub",import:"Imported"}[K.source],M=()=>{if(Z)return z.jsxDEV("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:`${Z.color}20`,color:Z.color},children:Z.name},void 0,!1,void 0,this);if(K.project_id===null)return z.jsxDEV("span",{className:"text-xs text-[var(--color-text-muted)] bg-[var(--color-surface-raised)] px-1.5 py-0.5 rounded",children:"Global"},void 0,!1,void 0,this);return null};return z.jsxDEV("div",{className:`bg-[var(--color-surface)] rounded-lg p-5 border transition cursor-pointer ${K.enabled?"border-[var(--color-border)]":"border-[var(--color-border)] opacity-60"} hover:border-[var(--color-border-light)]`,onClick:N,children:[z.jsxDEV("div",{className:"flex items-start justify-between mb-3",children:[z.jsxDEV("div",{className:"flex-1 min-w-0",children:[z.jsxDEV("div",{className:"flex items-center gap-2",children:[z.jsxDEV("h3",{className:"font-semibold text-lg truncate",children:K.name},void 0,!1,void 0,this),M()]},void 0,!0,void 0,this),z.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)] flex items-center gap-2 mt-0.5",children:[z.jsxDEV("span",{className:`px-1.5 py-0.5 rounded text-[10px] ${K.source==="skillsmp"?"bg-purple-500/20 text-purple-400":K.source==="github"?"bg-blue-500/20 text-blue-400":"bg-[var(--color-surface-raised)] text-[var(--color-text-secondary)]"}`,children:y},void 0,!1,void 0,this),K.metadata?.version&&z.jsxDEV("span",{children:["v",K.metadata.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("button",{onClick:(X)=>{X.stopPropagation(),Y()},className:`w-10 h-5 rounded-full transition-colors relative ${K.enabled?"bg-[var(--color-accent)]":"bg-[var(--color-surface-raised)]"}`,children:z.jsxDEV("span",{className:`absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform ${K.enabled?"left-5":"left-0.5"}`},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("p",{className:"text-sm text-[var(--color-text-secondary)] line-clamp-2 mb-4",children:K.description},void 0,!1,void 0,this),z.jsxDEV("div",{className:"flex items-center justify-between",children:[z.jsxDEV("div",{className:"flex gap-1 flex-wrap",children:[K.allowed_tools.slice(0,2).map((X)=>z.jsxDEV("span",{className:"text-xs bg-[var(--color-surface-raised)] px-2 py-0.5 rounded text-[var(--color-text-muted)]",children:X},X,!1,void 0,this)),K.allowed_tools.length>2&&z.jsxDEV("span",{className:"text-xs text-[var(--color-text-muted)]",children:["+",K.allowed_tools.length-2]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("button",{onClick:(X)=>{X.stopPropagation(),B()},className:"text-red-400 hover:text-red-300 text-sm",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function qz({skill:K,installed:Z,installing:Y,onInstall:B}){return z.jsxDEV("div",{className:"bg-[var(--color-surface)] rounded-lg p-5 border border-[var(--color-border)] hover:border-[var(--color-border-light)] transition",children:[z.jsxDEV("div",{className:"flex items-start justify-between mb-3",children:[z.jsxDEV("div",{className:"flex-1 min-w-0",children:[z.jsxDEV("h3",{className:"font-semibold text-lg truncate",children:K.name},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:["by ",K.author," · v",K.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"flex items-center gap-1 text-yellow-500 text-sm",children:["★ ",K.rating.toFixed(1)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("p",{className:"text-sm text-[var(--color-text-secondary)] line-clamp-2 mb-4",children:K.description},void 0,!1,void 0,this),z.jsxDEV("div",{className:"flex items-center justify-between",children:[z.jsxDEV("div",{className:"flex gap-1 flex-wrap",children:K.tags.slice(0,3).map((N)=>z.jsxDEV("span",{className:"text-xs bg-[var(--color-surface-raised)] px-2 py-0.5 rounded text-[var(--color-text-muted)]",children:N},N,!1,void 0,this))},void 0,!1,void 0,this),Z?z.jsxDEV("span",{className:"text-green-400 text-sm",children:"✓ Installed"},void 0,!1,void 0,this):z.jsxDEV("button",{onClick:B,disabled:Y,className:"bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] disabled:opacity-50 text-black px-3 py-1 rounded text-sm font-medium transition",children:Y?"Installing...":"Install"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"mt-3 text-xs text-[var(--color-text-faint)]",children:[K.downloads.toLocaleString()," downloads"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Az({authFetch:K,onClose:Z,onCreated:Y,projects:B,defaultProjectId:N}){let[y,M]=W.useState(""),[X,U]=W.useState(""),[G,Q]=W.useState(""),[C,H]=W.useState(N||null),[v,T]=W.useState(!1),[f,w]=W.useState(null),P=B&&B.length>0,d=async()=>{if(!y||!X||!G){w("All fields are required");return}T(!0),w(null);try{let _={name:y,description:X,content:G,source:"local"};if(C)_.project_id=C;let m=await K("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)}),p=await m.json();if(!m.ok){w(p.error||"Failed to create skill"),T(!1);return}Y()}catch(_){w("Failed to create skill"),T(!1)}};return z.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:Z,children:z.jsxDEV("div",{className:"bg-[var(--color-surface)] card w-full max-w-2xl max-h-[90vh] overflow-auto",onClick:(_)=>_.stopPropagation(),children:[z.jsxDEV("div",{className:"p-6 border-b border-[var(--color-border)]",children:z.jsxDEV("h2",{className:"text-xl font-semibold",children:"Create Skill"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV("div",{className:"p-6 space-y-4",children:[f&&z.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded p-3 text-red-400 text-sm",children:f},void 0,!1,void 0,this),z.jsxDEV("div",{children:[z.jsxDEV("label",{className:"block text-sm text-[var(--color-text-secondary)] mb-1",children:"Name"},void 0,!1,void 0,this),z.jsxDEV("input",{type:"text",value:y,onChange:(_)=>M(_.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"-")),placeholder:"my-skill-name",className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-xs text-[var(--color-text-faint)] mt-1",children:"Lowercase letters, numbers, and hyphens only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{children:[z.jsxDEV("label",{className:"block text-sm text-[var(--color-text-secondary)] mb-1",children:"Description"},void 0,!1,void 0,this),z.jsxDEV("input",{type:"text",value:X,onChange:(_)=>U(_.target.value),placeholder:"What this skill does and when to use it...",className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),P&&z.jsxDEV("div",{children:[z.jsxDEV("label",{className:"block text-sm text-[var(--color-text-secondary)] mb-1",children:"Scope"},void 0,!1,void 0,this),z.jsxDEV(j,{value:C||"",onChange:(_)=>H(_||null),options:[{value:"",label:"Global (all projects)"},...B.map((_)=>({value:_.id,label:_.name}))],placeholder:"Select scope..."},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-xs text-[var(--color-text-faint)] mt-1",children:"Global skills are available to all agents. Project-scoped skills are only available to agents in that project."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{children:[z.jsxDEV("label",{className:"block text-sm text-[var(--color-text-secondary)] mb-1",children:"Instructions (Markdown)"},void 0,!1,void 0,this),z.jsxDEV("textarea",{value:G,onChange:(_)=>Q(_.target.value),placeholder:`# Skill Instructions
|
|
2
|
-
|
|
3
|
-
Write detailed instructions here...`,rows:12,className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)] font-mono text-sm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"p-6 border-t border-[var(--color-border)] flex justify-end gap-3",children:[z.jsxDEV("button",{onClick:Z,className:"px-4 py-2 text-[var(--color-text-secondary)] hover:text-white transition",children:"Cancel"},void 0,!1,void 0,this),z.jsxDEV("button",{onClick:d,disabled:v,className:"bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:v?"Creating...":"Create Skill"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function yz({authFetch:K,onClose:Z,onImported:Y}){let[B,N]=W.useState(""),[y,M]=W.useState(!1),[X,U]=W.useState(null);return z.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:Z,children:z.jsxDEV("div",{className:"bg-[var(--color-surface)] card w-full max-w-2xl max-h-[90vh] overflow-auto",onClick:(Q)=>Q.stopPropagation(),children:[z.jsxDEV("div",{className:"p-6 border-b border-[var(--color-border)]",children:[z.jsxDEV("h2",{className:"text-xl font-semibold",children:"Import Skill"},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:"Paste the contents of a SKILL.md file"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"p-6 space-y-4",children:[X&&z.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded p-3 text-red-400 text-sm",children:X},void 0,!1,void 0,this),z.jsxDEV("textarea",{value:B,onChange:(Q)=>N(Q.target.value),placeholder:`---
|
|
4
|
-
name: skill-name
|
|
5
|
-
description: What this skill does...
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Instructions
|
|
9
|
-
|
|
10
|
-
Your skill instructions here...`,rows:16,className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)] font-mono text-sm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"p-6 border-t border-[var(--color-border)] flex justify-end gap-3",children:[z.jsxDEV("button",{onClick:Z,className:"px-4 py-2 text-[var(--color-text-secondary)] hover:text-white transition",children:"Cancel"},void 0,!1,void 0,this),z.jsxDEV("button",{onClick:async()=>{if(!B.trim()){U("Paste SKILL.md content");return}M(!0),U(null);try{let Q=await K("/api/skills/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:B})}),C=await Q.json();if(!Q.ok){U(C.error||"Failed to import skill"),M(!1);return}Y()}catch(Q){U("Failed to import skill"),M(!1)}},disabled:y,className:"bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:y?"Importing...":"Import Skill"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function Mz({skill:K,authFetch:Z,onClose:Y,onUpdated:B}){let[N,y]=W.useState(!1),[M,X]=W.useState(K.content),[U,G]=W.useState(!1),Q=async()=>{G(!0);try{await Z(`/api/skills/${K.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:M})}),B()}catch(H){console.error("Failed to save:",H)}G(!1)},C=async()=>{try{let v=await(await Z(`/api/skills/${K.id}/export`)).text(),T=new Blob([v],{type:"text/markdown"}),f=URL.createObjectURL(T),w=document.createElement("a");w.href=f,w.download=`${K.name}-SKILL.md`,w.click(),URL.revokeObjectURL(f)}catch(H){console.error("Failed to export:",H)}};return z.jsxDEV("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50 p-4",onClick:Y,children:z.jsxDEV("div",{className:"bg-[var(--color-surface)] card w-full max-w-3xl max-h-[90vh] overflow-auto",onClick:(H)=>H.stopPropagation(),children:[z.jsxDEV("div",{className:"p-6 border-b border-[var(--color-border)] flex items-center justify-between",children:[z.jsxDEV("div",{children:[z.jsxDEV("h2",{className:"text-xl font-semibold",children:K.name},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)] mt-0.5",children:K.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"flex gap-2",children:[z.jsxDEV("button",{onClick:C,className:"text-sm text-[var(--color-text-secondary)] hover:text-white transition px-3 py-1 rounded border border-[var(--color-border-light)]",children:"Export"},void 0,!1,void 0,this),z.jsxDEV("button",{onClick:()=>y(!N),className:"text-sm text-[var(--color-text-secondary)] hover:text-white transition px-3 py-1 rounded border border-[var(--color-border-light)]",children:N?"View":"Edit"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"p-6",children:N?z.jsxDEV("textarea",{value:M,onChange:(H)=>X(H.target.value),rows:20,className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)] font-mono text-sm"},void 0,!1,void 0,this):z.jsxDEV("pre",{className:"bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded p-4 font-mono text-sm overflow-auto max-h-[60vh] whitespace-pre-wrap",children:K.content},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV("div",{className:"p-6 border-t border-[var(--color-border)] flex justify-between",children:[z.jsxDEV("div",{className:"text-xs text-[var(--color-text-faint)]",children:K.source!=="local"&&K.source_url&&z.jsxDEV("a",{href:K.source_url,target:"_blank",rel:"noopener noreferrer",className:"text-[var(--color-accent)] hover:underline",children:"View source →"},void 0,!1,void 0,this)},void 0,!1,void 0,this),z.jsxDEV("div",{className:"flex gap-3",children:[z.jsxDEV("button",{onClick:Y,className:"px-4 py-2 text-[var(--color-text-secondary)] hover:text-white transition",children:"Close"},void 0,!1,void 0,this),N&&z.jsxDEV("button",{onClick:Q,disabled:U,className:"bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:U?"Saving...":"Save Changes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}
|
|
11
|
-
export{Rz as L};
|
|
12
|
-
|
|
13
|
-
//# debugId=F89C130753CEA5A864756E2164756E21
|
package/dist/App.kz3qyyre.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{$ as Rq,X as c,aa as Gq,ja as Jq}from"./App.shfd8tp9.js";var Q=c(Rq(),1);var q=c(Gq(),1);function C(H){return H.authSchemes.some((J)=>J.toUpperCase()==="API_KEY")}function Qq(H){return H.authSchemes.some((J)=>J.toUpperCase()==="OAUTH2")}function Lq(H){return C(H)&&Qq(H)}function wq({providerId:H="composio",projectId:J,onConnectionComplete:U,onBrowseTriggers:F,hideMcpConfig:y}){let{authFetch:Z}=Jq(),[A,I]=Q.useState([]),[k,P]=Q.useState([]),[S,h]=Q.useState(!0),[R,Wq]=Q.useState(""),[g,O]=Q.useState(null),[b,D]=Q.useState(null),[s,_]=Q.useState(null),[L,M]=Q.useState(null),[X,w]=Q.useState(null),[f,u]=Q.useState(""),[V,x]=Q.useState({}),[T,E]=Q.useState(null),[v,n]=Q.useState(""),[o,l]=Q.useState(!1),[t,j]=Q.useState(null),[r,i]=Q.useState(null),N=Q.useCallback(async()=>{h(!0),_(null);let z=J&&J!=="unassigned"?`?project_id=${J}`:"";try{let[G,W]=await Promise.all([Z(`/api/integrations/${H}/apps${z}`),Z(`/api/integrations/${H}/connected${z}`)]),Y=await G.json(),$=await W.json();I(Y.apps||[]),P($.accounts||[])}catch(G){console.error("Failed to fetch integrations:",G),_("Failed to load integrations")}h(!1)},[Z,H,J]);Q.useEffect(()=>{N()},[N]),Q.useEffect(()=>{if(new URLSearchParams(window.location.search).get("connected"))window.history.replaceState({},"",window.location.pathname),N(),U?.()},[N,U]),Q.useEffect(()=>{if(!b?.connectionId)return;let z=J&&J!=="unassigned"?`?project_id=${J}`:"",G=setInterval(async()=>{try{let Y=await(await Z(`/api/integrations/${H}/connection/${b.connectionId}${z}`)).json();if(Y.connection?.status==="active")D(null),O(null),N(),U?.();else if(Y.connection?.status==="failed")D(null),O(null),_(`Connection to ${b.appSlug} failed`)}catch(W){}},2000);return()=>clearInterval(G)},[b,Z,H,J,N,U]);let m=async(z,G,W,Y)=>{if(Lq(z)&&!G&&!Y&&!W){M({app:z});return}if(C(z)&&!G&&!Y&&!W){w({app:z}),u(""),x({});return}O(z.slug),_(null);try{let $={appSlug:z.slug};if(Y&&Object.keys(Y).length>0)$.credentials={authScheme:"API_KEY",fields:Y};else if(G)$.credentials={authScheme:"API_KEY",apiKey:G};let kq=J&&J!=="unassigned"?`?project_id=${J}`:"",qq=await Z(`/api/integrations/${H}/connect${kq}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)}),B=await qq.json();if(!qq.ok){_(B.error||"Failed to initiate connection"),O(null),w(null);return}if(B.status==="active"||!B.redirectUrl){O(null),w(null),N(),U?.();return}if(B.redirectUrl){D({appSlug:z.slug,connectionId:B.connectionId});let zq=window.open(B.redirectUrl,`connect-${z.slug}`,"width=600,height=700,left=200,top=100");if(!zq||zq.closed)window.location.href=B.redirectUrl}}catch($){_(`Failed to connect: ${$}`),O(null),w(null)}},Xq=(z)=>{if(z.preventDefault(),!X)return;if(X.app.credentialFields&&X.app.credentialFields.length>0){if(!X.app.credentialFields.filter(($)=>$.required!==!1).every(($)=>V[$.name]?.trim()))return;m(X.app,void 0,!1,V)}else{if(!f.trim())return;m(X.app,f.trim())}},Yq=async(z)=>{let G=J&&J!=="unassigned"?`?project_id=${J}`:"";try{let W=await Z(`/api/integrations/${H}/connection/${z.id}${G}`,{method:"DELETE"});if(W.ok)N();else{let Y=await W.json();_(Y.error||"Failed to disconnect")}}catch(W){_(`Failed to disconnect: ${W}`)}},Zq=(z)=>{E({app:z}),n(`${z.name} MCP`),j(null)},_q=async()=>{if(!T||!v.trim())return;l(!0),_(null);try{let z=J&&J!=="unassigned"?`?project_id=${J}`:"",G=await Z(`/api/integrations/${H}/configs${z}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v.replace(/[^a-zA-Z0-9\s-]/g,"").substring(0,30),toolkitSlug:T.app.slug})}),W=await G.json();if(!G.ok){_(W.error||"Failed to create MCP config"),l(!1);return}let Y=!1;if(W.config?.id)try{Y=(await Z(`/api/integrations/${H}/configs/${W.config.id}/add${z}`,{method:"POST"})).ok}catch{}j(v),U?.()}catch(z){_(`Failed to create MCP config: ${z}`)}finally{l(!1)}},$q=(z)=>{i({message:`Disconnect ${z.appName}?`,onConfirm:()=>{Yq(z),i(null)}})},a=(z)=>{return k.some((G)=>G.status==="active"&&(G.appId===z.slug||z.providerSlug&&G.appId===z.providerSlug))},p=(z)=>{return k.find((G)=>G.appId===z.slug&&G.status==="active")||z.providerSlug&&k.find((G)=>G.appId===z.providerSlug&&G.status==="active")||k.find((G)=>G.appId===z.slug)||z.providerSlug&&k.find((G)=>G.appId===z.providerSlug)||void 0},e=A.filter((z)=>{if(!R)return!0;let G=R.toLowerCase();return z.name.toLowerCase().includes(G)||z.slug.toLowerCase().includes(G)||z.description?.toLowerCase().includes(G)||z.categories.some((W)=>W.toLowerCase().includes(G))}),d=e.filter((z)=>a(z)),K=e.filter((z)=>!a(z));if(S)return q.jsxDEV("div",{className:"text-center py-8 text-[var(--color-text-muted)]",children:"Loading apps..."},void 0,!1,void 0,this);return q.jsxDEV("div",{className:"space-y-6",children:[L&&q.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg p-6 w-full max-w-md mx-4",children:[q.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[L.app.logo&&q.jsxDEV("img",{src:L.app.logo,alt:L.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("h3",{className:"font-medium",children:["Connect ",L.app.name]},void 0,!0,void 0,this),q.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)]",children:"Choose how to authenticate"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"space-y-3",children:[q.jsxDEV("button",{onClick:()=>{M(null),w({app:L.app}),u(""),x({})},className:"w-full text-left p-3 bg-[var(--color-bg)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] hover:border-[var(--color-accent)] rounded-lg transition",children:[q.jsxDEV("div",{className:"font-medium text-sm",children:"API Key"},void 0,!1,void 0,this),q.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:["Enter your ",L.app.name," API key directly"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:()=>{M(null),m(L.app,void 0,!0)},className:"w-full text-left p-3 bg-[var(--color-bg)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] hover:border-[var(--color-accent)] rounded-lg transition",children:[q.jsxDEV("div",{className:"font-medium text-sm",children:"OAuth"},void 0,!1,void 0,this),q.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:["Sign in with your ",L.app.name," account"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:()=>M(null),className:"w-full text-sm text-[var(--color-text-muted)] hover:text-white mt-4 py-2 transition",children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),X&&q.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg p-6 w-full max-w-md mx-4",children:[q.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[X.app.logo&&q.jsxDEV("img",{src:X.app.logo,alt:X.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("h3",{className:"font-medium",children:["Connect ",X.app.name]},void 0,!0,void 0,this),q.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)]",children:X.app.credentialFields?.length?"Enter your credentials to connect":"Enter your API key to connect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("form",{onSubmit:Xq,children:[X.app.credentialFields&&X.app.credentialFields.length>0?q.jsxDEV("div",{className:"space-y-3 mb-4",children:X.app.credentialFields.map((z,G)=>q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1",children:[z.name.replace(/([A-Z])/g," $1").replace(/[-_]/g," ").replace(/\b\w/g,(W)=>W.toUpperCase()).trim(),z.required!==!1&&q.jsxDEV("span",{className:"text-red-400 ml-0.5",children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.description&&q.jsxDEV("p",{className:"text-[10px] text-[var(--color-text-faint)] mb-1",children:z.description},void 0,!1,void 0,this),q.jsxDEV("input",{type:"password",value:V[z.name]||"",onChange:(W)=>x((Y)=>({...Y,[z.name]:W.target.value})),placeholder:`Enter ${z.name}...`,className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded-lg px-4 py-2 focus:outline-none focus:border-[var(--color-accent)]",autoFocus:G===0},void 0,!1,void 0,this)]},z.name,!0,void 0,this))},void 0,!1,void 0,this):q.jsxDEV("input",{type:"password",value:f,onChange:(z)=>u(z.target.value),placeholder:"Enter API Key...",className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded-lg px-4 py-2 mb-4 focus:outline-none focus:border-[var(--color-accent)]",autoFocus:!0},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex gap-2",children:[q.jsxDEV("button",{type:"button",onClick:()=>w(null),className:"flex-1 text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),q.jsxDEV("button",{type:"submit",disabled:g===X.app.slug||(X.app.credentialFields?.length?!X.app.credentialFields.filter((z)=>z.required!==!1).every((z)=>V[z.name]?.trim()):!f.trim()),className:"flex-1 text-sm bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] text-white px-4 py-2 rounded transition disabled:opacity-50",children:g===X.app.slug?"Connecting...":"Connect"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),T&&q.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg p-6 w-full max-w-md mx-4",children:t?q.jsxDEV(q.Fragment,{children:[q.jsxDEV("div",{className:"text-center mb-4",children:[q.jsxDEV("div",{className:"w-12 h-12 bg-green-500/20 rounded-full flex items-center justify-center mx-auto mb-3",children:q.jsxDEV("span",{className:"text-green-400 text-2xl",children:"✓"},void 0,!1,void 0,this)},void 0,!1,void 0,this),q.jsxDEV("h3",{className:"font-medium text-lg",children:"MCP Config Created!"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-secondary)] mt-2",children:['"',t,'" has been created and added to your servers.']},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:()=>{E(null),j(null)},className:"w-full text-sm bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] text-white px-4 py-2 rounded transition",children:"Done"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV(q.Fragment,{children:[q.jsxDEV("div",{className:"flex items-center gap-3 mb-4",children:[T.app.logo&&q.jsxDEV("img",{src:T.app.logo,alt:T.app.name,className:"w-10 h-10 object-contain"},void 0,!1,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("h3",{className:"font-medium",children:"Create MCP Config"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)]",children:["Create an MCP config for ",T.app.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("form",{onSubmit:(z)=>{z.preventDefault(),_q()},children:[q.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1",children:"Config Name"},void 0,!1,void 0,this),q.jsxDEV("input",{type:"text",value:v,onChange:(z)=>n(z.target.value),placeholder:"Enter config name...",className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded-lg px-4 py-2 mb-4 focus:outline-none focus:border-[var(--color-accent)]",autoFocus:!0,maxLength:30},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex gap-2",children:[q.jsxDEV("button",{type:"button",onClick:()=>E(null),className:"flex-1 text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),q.jsxDEV("button",{type:"submit",disabled:!v.trim()||o,className:"flex-1 text-sm bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] text-white px-4 py-2 rounded transition disabled:opacity-50",children:o?"Creating...":"Create Config"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),r&&q.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg p-6 w-full max-w-sm mx-4",children:[q.jsxDEV("p",{className:"text-center mb-4",children:r.message},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex gap-2",children:[q.jsxDEV("button",{onClick:()=>i(null),className:"flex-1 text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:r.onConfirm,className:"flex-1 text-sm bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded transition",children:"Confirm"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),s&&q.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg flex items-center justify-between",children:[q.jsxDEV("span",{children:s},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:()=>_(null),className:"text-red-400 hover:text-red-300",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&q.jsxDEV("div",{className:"text-yellow-400 text-sm p-3 bg-yellow-500/10 border border-yellow-500/20 rounded-lg flex items-center gap-2",children:[q.jsxDEV("span",{className:"animate-spin",children:"⟳"},void 0,!1,void 0,this),q.jsxDEV("span",{children:["Waiting for ",b.appSlug," authorization..."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:q.jsxDEV("input",{type:"text",value:R,onChange:(z)=>Wq(z.target.value),placeholder:"Search apps...",className:"w-full bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg px-4 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this)},void 0,!1,void 0,this),d.length>0&&q.jsxDEV("div",{children:[q.jsxDEV("h3",{className:"text-sm font-medium text-[var(--color-text-secondary)] mb-3",children:["Connected (",d.length,")"]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:d.map((z)=>q.jsxDEV(Hq,{app:z,connection:p(z),onConnect:()=>m(z),onDisconnect:()=>{let G=p(z);if(G)$q(G)},onCreateMcpConfig:y?void 0:()=>Zq(z),onBrowseTriggers:F?()=>F(z.slug):void 0,onUpdateKey:C(z)?()=>{w({app:z}),u(""),x({})}:void 0,connecting:g===z.slug},z.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("h3",{className:"text-sm font-medium text-[var(--color-text-secondary)] mb-3",children:["Available Apps (",K.length,")"]},void 0,!0,void 0,this),K.length===0?q.jsxDEV("p",{className:"text-[var(--color-text-muted)] text-sm",children:R?"No apps match your search":"No apps available"},void 0,!1,void 0,this):q.jsxDEV("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:K.slice(0,50).map((z)=>q.jsxDEV(Hq,{app:z,onConnect:()=>m(z),connecting:g===z.slug},z.id,!1,void 0,this))},void 0,!1,void 0,this),K.length>50&&q.jsxDEV("p",{className:"text-xs text-[var(--color-text-faint)] mt-3 text-center",children:["Showing first 50 of ",K.length," apps. Use search to find more."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Hq({app:H,connection:J,onConnect:U,onDisconnect:F,onCreateMcpConfig:y,onBrowseTriggers:Z,onUpdateKey:A,connecting:I}){let k=J?.status==="active",P=C(H),S=Qq(H),h=P&&S;return q.jsxDEV("div",{className:`bg-[var(--color-surface)] border rounded-lg p-3 transition ${k?"border-green-500/30":"border-[var(--color-border)] hover:border-[var(--color-border-light)]"}`,children:[q.jsxDEV("div",{className:"flex items-start gap-3",children:[q.jsxDEV("div",{className:"w-10 h-10 rounded bg-[var(--color-surface-raised)] flex items-center justify-center flex-shrink-0 overflow-hidden",children:H.logo?q.jsxDEV("img",{src:H.logo,alt:H.name,className:"w-8 h-8 object-contain",onError:(R)=>{R.target.style.display="none"}},void 0,!1,void 0,this):q.jsxDEV("span",{className:"text-lg",children:H.name[0]?.toUpperCase()},void 0,!1,void 0,this)},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex-1 min-w-0",children:[q.jsxDEV("div",{className:"flex items-center gap-2",children:[q.jsxDEV("h4",{className:"font-medium text-sm truncate",children:H.name},void 0,!1,void 0,this),k&&q.jsxDEV("span",{className:"text-xs text-green-400",children:"✓"},void 0,!1,void 0,this),!k&&P&&!S&&q.jsxDEV("span",{className:"text-[10px] bg-[var(--color-surface-raised)] text-[var(--color-text-secondary)] px-1.5 py-0.5 rounded",title:"Requires API Key",children:"API Key"},void 0,!1,void 0,this),!k&&h&&q.jsxDEV("span",{className:"text-[10px] bg-[#1a2a1a] text-[#6a6] px-1.5 py-0.5 rounded",title:"Supports API Key or OAuth",children:"API Key / OAuth"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.description&&q.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)] line-clamp-2 mt-0.5",children:H.description},void 0,!1,void 0,this),H.categories.length>0&&q.jsxDEV("div",{className:"flex flex-wrap gap-1 mt-1",children:H.categories.slice(0,2).map((R)=>q.jsxDEV("span",{className:"text-[10px] bg-[var(--color-surface-raised)] text-[var(--color-text-faint)] px-1.5 py-0.5 rounded",children:R},R,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"mt-3 flex gap-2",children:k?q.jsxDEV(q.Fragment,{children:[y&&q.jsxDEV("button",{onClick:y,className:"flex-1 text-xs bg-[#1a2a1a] hover:bg-[#1a3a1a] border border-green-500/30 hover:border-green-500/50 text-green-400 px-3 py-1.5 rounded transition",children:"Create MCP Config"},void 0,!1,void 0,this),Z&&q.jsxDEV("button",{onClick:Z,className:"flex-1 text-xs bg-[#1a1a2a] hover:bg-[#1a1a3a] border border-blue-500/30 hover:border-blue-500/50 text-blue-400 px-3 py-1.5 rounded transition",children:"Browse Triggers"},void 0,!1,void 0,this),A&&q.jsxDEV("button",{onClick:A,className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-accent)] transition px-2",title:"Update API Key",children:"Key"},void 0,!1,void 0,this),F&&q.jsxDEV("button",{onClick:F,className:"text-xs text-[var(--color-text-muted)] hover:text-red-400 transition px-2",title:"Disconnect",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("button",{onClick:U,disabled:I,className:"w-full text-xs bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] hover:border-[var(--color-accent)] px-3 py-1.5 rounded transition disabled:opacity-50",children:I?"Connecting...":P&&!S?"Enter API Key":"Connect"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
|
|
2
|
-
export{wq as j};
|
|
3
|
-
|
|
4
|
-
//# debugId=5A2FB95F167B84D164756E2164756E21
|
package/dist/App.sd685nt9.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{$ as b,X as s,aa as d}from"./App.shfd8tp9.js";var r=s(b(),1),e=s(d(),1);function h({value:o,options:i,onChange:v,placeholder:m="Select...",compact:u}){let[a,l]=r.useState(!1),c=r.useRef(null),n=i.find((t)=>t.value===o);return r.useEffect(()=>{function t(f){if(c.current&&!c.current.contains(f.target))l(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]),e.jsxDEV("div",{ref:c,className:"relative",children:[e.jsxDEV("button",{type:"button",onClick:()=>l(!a),className:`w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] btn ${u?"px-2.5 py-1.5 text-sm":"px-3 py-2"} text-left flex items-center justify-between focus:outline-none focus:border-[var(--color-accent)] text-[var(--color-text)] hover:border-[var(--color-border-light)] transition`,children:[e.jsxDEV("span",{className:n?"text-[var(--color-text)]":"text-[var(--color-text-muted)]",children:n?e.jsxDEV(e.Fragment,{children:[n.label,n.recommended&&e.jsxDEV("span",{className:"text-[var(--color-accent)] text-xs ml-2",children:"(Recommended)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):m},void 0,!1,void 0,this),e.jsxDEV(p,{isOpen:a},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a&&e.jsxDEV("div",{className:"absolute z-50 w-full min-w-max mt-1 bg-[var(--color-surface)] border border-[var(--color-border-light)] shadow-lg max-h-60 overflow-y-auto scrollbar-hide",style:{borderRadius:"var(--radius-button)"},children:i.map((t)=>e.jsxDEV("button",{type:"button",onClick:()=>{v(t.value),l(!1)},className:`w-full ${u?"px-2.5 py-1.5 text-sm":"px-3 py-2"} text-left flex items-center justify-between hover:bg-[var(--color-surface-raised)] transition ${t.value===o?"bg-[var(--color-surface-raised)] text-[var(--color-accent)]":"text-[var(--color-text)]"}`,children:[e.jsxDEV("span",{children:[t.label,t.recommended&&e.jsxDEV("span",{className:"text-[var(--color-accent)] text-xs ml-2",children:"(Recommended)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t.value===o&&e.jsxDEV("svg",{className:"w-4 h-4 text-[var(--color-accent)]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},t.value,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function p({isOpen:o}){return e.jsxDEV("svg",{className:`w-4 h-4 text-[var(--color-text-muted)] transition-transform ${o?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}
|
|
2
|
-
export{h as U};
|
|
3
|
-
|
|
4
|
-
//# debugId=A830E20FD61DEFBB64756E2164756E21
|
package/dist/App.shfd8tp9.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var GZ=Object.create;var{getPrototypeOf:HZ,defineProperty:xW,getOwnPropertyNames:BZ}=Object;var zZ=Object.prototype.hasOwnProperty;function QZ(H){return this[H]}var YZ,$Z,n=(H,$,U)=>{var M=H!=null&&typeof H==="object";if(M){var I=$?YZ??=new WeakMap:$Z??=new WeakMap,P=I.get(H);if(P)return P}U=H!=null?GZ(HZ(H)):{};let V=$||!H||!H.__esModule?xW(U,"default",{value:H,enumerable:!0}):U;for(let K of BZ(H))if(!zZ.call(V,K))xW(V,K,{get:QZ.bind(H,K),enumerable:!0});if(M)I.set(H,V);return V};var yW=(H,$)=>()=>($||H(($={exports:{}}).exports,$),$.exports);var UZ=(H)=>H;function MZ(H,$){this[H]=UZ.bind(null,$)}var vZ=(H,$)=>{for(var U in $)xW(H,U,{get:$[U],enumerable:!0,configurable:!0,set:MZ.bind($,U)})};var CZ=((H)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(H,{get:($,U)=>(typeof require<"u"?require:$)[U]}):H)(function(H){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+H+'" is not supported')});var UW=yW((OZ,KW)=>{(function(){function H(W,Z){Object.defineProperty(M.prototype,W,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",Z[0],Z[1])}})}function $(W){if(W===null||typeof W!=="object")return null;return W=EW&&W[EW]||W["@@iterator"],typeof W==="function"?W:null}function U(W,Z){W=(W=W.constructor)&&(W.displayName||W.name)||"ReactClass";var G=W+"."+Z;IW[G]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",Z,W),IW[G]=!0)}function M(W,Z,G){this.props=W,this.context=Z,this.refs=NW,this.updater=G||AW}function I(){}function P(W,Z,G){this.props=W,this.context=Z,this.refs=NW,this.updater=G||AW}function V(){}function K(W){return""+W}function C(W){try{K(W);var Z=!1}catch(Q){Z=!0}if(Z){Z=console;var G=Z.error,B=typeof Symbol==="function"&&Symbol.toStringTag&&W[Symbol.toStringTag]||W.constructor.name||"Object";return G.call(Z,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",B),K(W)}}function b(W){if(W==null)return null;if(typeof W==="function")return W.$$typeof===tW?null:W.displayName||W.name||null;if(typeof W==="string")return W;switch(W){case QW:return"Fragment";case L:return"Profiler";case X:return"StrictMode";case YW:return"Suspense";case k:return"SuspenseList";case LW:return"Activity"}if(typeof W==="object")switch(typeof W.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),W.$$typeof){case JW:return"Portal";case u:return W.displayName||"Context";case T:return(W._context.displayName||"Context")+".Consumer";case t:var Z=W.render;return W=W.displayName,W||(W=Z.displayName||Z.name||"",W=W!==""?"ForwardRef("+W+")":"ForwardRef"),W;case e:return Z=W.displayName||null,Z!==null?Z:b(W.type)||"Memo";case WW:Z=W._payload,W=W._init;try{return b(W(Z))}catch(G){}}return null}function o(W){if(W===QW)return"<>";if(typeof W==="object"&&W!==null&&W.$$typeof===WW)return"<...>";try{var Z=b(W);return Z?"<"+Z+">":"<...>"}catch(G){return"<...>"}}function w(){var W=q.A;return W===null?null:W.getOwner()}function m(){return Error("react-stack-top-frame")}function d(W){if(qW.call(W,"key")){var Z=Object.getOwnPropertyDescriptor(W,"key").get;if(Z&&Z.isReactWarning)return!1}return W.key!==void 0}function i(W,Z){function G(){CW||(CW=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Z))}G.isReactWarning=!0,Object.defineProperty(W,"key",{get:G,configurable:!0})}function f(){var W=b(this.type);return gW[W]||(gW[W]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),W=this.props.ref,W!==void 0?W:null}function x(W,Z,G,B,Q,D){var J=G.ref;return W={$$typeof:MW,type:W,key:Z,props:G,_owner:B},(J!==void 0?J:null)!==null?Object.defineProperty(W,"ref",{enumerable:!1,get:f}):Object.defineProperty(W,"ref",{enumerable:!1,value:null}),W._store={},Object.defineProperty(W._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(W,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(W,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(W,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:D}),Object.freeze&&(Object.freeze(W.props),Object.freeze(W)),W}function y(W,Z){return Z=x(W.type,Z,W.props,W._owner,W._debugStack,W._debugTask),W._store&&(Z._store.validated=W._store.validated),Z}function c(W){p(W)?W._store&&(W._store.validated=1):typeof W==="object"&&W!==null&&W.$$typeof===WW&&(W._payload.status==="fulfilled"?p(W._payload.value)&&W._payload.value._store&&(W._payload.value._store.validated=1):W._store&&(W._store.validated=1))}function p(W){return typeof W==="object"&&W!==null&&W.$$typeof===MW}function l(W){var Z={"=":"=0",":":"=2"};return"$"+W.replace(/[=:]/g,function(G){return Z[G]})}function S(W,Z){return typeof W==="object"&&W!==null&&W.key!=null?(C(W.key),l(""+W.key)):Z.toString(36)}function g(W){switch(W.status){case"fulfilled":return W.value;case"rejected":throw W.reason;default:switch(typeof W.status==="string"?W.then(V,V):(W.status="pending",W.then(function(Z){W.status==="pending"&&(W.status="fulfilled",W.value=Z)},function(Z){W.status==="pending"&&(W.status="rejected",W.reason=Z)})),W.status){case"fulfilled":return W.value;case"rejected":throw W.reason}}throw W}function A(W,Z,G,B,Q){var D=typeof W;if(D==="undefined"||D==="boolean")W=null;var J=!1;if(W===null)J=!0;else switch(D){case"bigint":case"string":case"number":J=!0;break;case"object":switch(W.$$typeof){case MW:case JW:J=!0;break;case WW:return J=W._init,A(J(W._payload),Z,G,B,Q)}}if(J){J=W,Q=Q(J);var _=B===""?"."+S(J,0):B;return TW(Q)?(G="",_!=null&&(G=_.replace(bW,"$&/")+"/"),A(Q,Z,G,"",function(GW){return GW})):Q!=null&&(p(Q)&&(Q.key!=null&&(J&&J.key===Q.key||C(Q.key)),G=y(Q,G+(Q.key==null||J&&J.key===Q.key?"":(""+Q.key).replace(bW,"$&/")+"/")+_),B!==""&&J!=null&&p(J)&&J.key==null&&J._store&&!J._store.validated&&(G._store.validated=2),Q=G),Z.push(Q)),1}if(J=0,_=B===""?".":B+":",TW(W))for(var R=0;R<W.length;R++)B=W[R],D=_+S(B,R),J+=A(B,Z,G,D,Q);else if(R=$(W),typeof R==="function")for(R===W.entries&&(kW||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),kW=!0),W=R.call(W),R=0;!(B=W.next()).done;)B=B.value,D=_+S(B,R++),J+=A(B,Z,G,D,Q);else if(D==="object"){if(typeof W.then==="function")return A(g(W),Z,G,B,Q);throw Z=String(W),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(W).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return J}function z(W,Z,G){if(W==null)return W;var B=[],Q=0;return A(W,B,"","",function(D){return Z.call(G,D,Q++)}),B}function F(W){if(W._status===-1){var Z=W._ioInfo;Z!=null&&(Z.start=Z.end=performance.now()),Z=W._result;var G=Z();if(G.then(function(Q){if(W._status===0||W._status===-1){W._status=1,W._result=Q;var D=W._ioInfo;D!=null&&(D.end=performance.now()),G.status===void 0&&(G.status="fulfilled",G.value=Q)}},function(Q){if(W._status===0||W._status===-1){W._status=2,W._result=Q;var D=W._ioInfo;D!=null&&(D.end=performance.now()),G.status===void 0&&(G.status="rejected",G.reason=Q)}}),Z=W._ioInfo,Z!=null){Z.value=G;var B=G.displayName;typeof B==="string"&&(Z.name=B)}W._status===-1&&(W._status=0,W._result=G)}if(W._status===1)return Z=W._result,Z===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
|
-
|
|
3
|
-
Your code should look like:
|
|
4
|
-
const MyComponent = lazy(() => import('./MyComponent'))
|
|
5
|
-
|
|
6
|
-
Did you accidentally put curly braces around the import?`,Z),"default"in Z||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
7
|
-
|
|
8
|
-
Your code should look like:
|
|
9
|
-
const MyComponent = lazy(() => import('./MyComponent'))`,Z),Z.default;throw W._result}function Y(){var W=q.H;return W===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
10
|
-
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
|
-
2. You might be breaking the Rules of Hooks
|
|
12
|
-
3. You might have more than one copy of React in the same app
|
|
13
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),W}function O(){q.asyncTransitions--}function j(W){if(DW===null)try{var Z=("require"+Math.random()).slice(0,7);DW=(KW&&KW[Z]).call(KW,"timers").setImmediate}catch(G){DW=function(B){fW===!1&&(fW=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var Q=new MessageChannel;Q.port1.onmessage=B,Q.port2.postMessage(void 0)}}return DW(W)}function h(W){return 1<W.length&&typeof AggregateError==="function"?AggregateError(W):W[0]}function a(W,Z){Z!==RW-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),RW=Z}function XW(W,Z,G){var B=q.actQueue;if(B!==null)if(B.length!==0)try{zW(B),j(function(){return XW(W,Z,G)});return}catch(Q){q.thrownErrors.push(Q)}else q.actQueue=null;0<q.thrownErrors.length?(B=h(q.thrownErrors),q.thrownErrors.length=0,G(B)):Z(W)}function zW(W){if(!PW){PW=!0;var Z=0;try{for(;Z<W.length;Z++){var G=W[Z];do{q.didUsePromise=!1;var B=G(!1);if(B!==null){if(q.didUsePromise){W[Z]=G,W.splice(0,Z);return}G=B}else break}while(1)}W.length=0}catch(Q){W.splice(0,Z+1),q.thrownErrors.push(Q)}finally{PW=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var MW=Symbol.for("react.transitional.element"),JW=Symbol.for("react.portal"),QW=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),u=Symbol.for("react.context"),t=Symbol.for("react.forward_ref"),YW=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),e=Symbol.for("react.memo"),WW=Symbol.for("react.lazy"),LW=Symbol.for("react.activity"),EW=Symbol.iterator,IW={},AW={isMounted:function(){return!1},enqueueForceUpdate:function(W){U(W,"forceUpdate")},enqueueReplaceState:function(W){U(W,"replaceState")},enqueueSetState:function(W){U(W,"setState")}},jW=Object.assign,NW={};Object.freeze(NW),M.prototype.isReactComponent={},M.prototype.setState=function(W,Z){if(typeof W!=="object"&&typeof W!=="function"&&W!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,Z,"setState")},M.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};var r={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(OW in r)r.hasOwnProperty(OW)&&H(OW,r[OW]);I.prototype=M.prototype,r=P.prototype=new I,r.constructor=P,jW(r,M.prototype),r.isPureReactComponent=!0;var TW=Array.isArray,tW=Symbol.for("react.client.reference"),q={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},qW=Object.prototype.hasOwnProperty,vW=console.createTask?console.createTask:function(){return null};r={react_stack_bottom_frame:function(W){return W()}};var CW,SW,gW={},eW=r.react_stack_bottom_frame.bind(r,m)(),WZ=vW(o(m)),kW=!1,bW=/\/+/g,mW=typeof reportError==="function"?reportError:function(W){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof W==="object"&&W!==null&&typeof W.message==="string"?String(W.message):String(W),error:W});if(!window.dispatchEvent(Z))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",W);return}console.error(W)},fW=!1,DW=null,RW=0,wW=!1,PW=!1,hW=typeof queueMicrotask==="function"?function(W){queueMicrotask(function(){return queueMicrotask(W)})}:j;r=Object.freeze({__proto__:null,c:function(W){return Y().useMemoCache(W)}});var OW={map:z,forEach:function(W,Z,G){z(W,function(){Z.apply(this,arguments)},G)},count:function(W){var Z=0;return z(W,function(){Z++}),Z},toArray:function(W){return z(W,function(Z){return Z})||[]},only:function(W){if(!p(W))throw Error("React.Children.only expected to receive a single React element child.");return W}};OZ.Activity=LW,OZ.Children=OW,OZ.Component=M,OZ.Fragment=QW,OZ.Profiler=L,OZ.PureComponent=P,OZ.StrictMode=X,OZ.Suspense=YW,OZ.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,OZ.__COMPILER_RUNTIME=r,OZ.act=function(W){var Z=q.actQueue,G=RW;RW++;var B=q.actQueue=Z!==null?Z:[],Q=!1;try{var D=W()}catch(R){q.thrownErrors.push(R)}if(0<q.thrownErrors.length)throw a(Z,G),W=h(q.thrownErrors),q.thrownErrors.length=0,W;if(D!==null&&typeof D==="object"&&typeof D.then==="function"){var J=D;return hW(function(){Q||wW||(wW=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(R,GW){Q=!0,J.then(function($W){if(a(Z,G),G===0){try{zW(B),j(function(){return XW($W,R,GW)})}catch(XZ){q.thrownErrors.push(XZ)}if(0<q.thrownErrors.length){var ZZ=h(q.thrownErrors);q.thrownErrors.length=0,GW(ZZ)}}else R($W)},function($W){a(Z,G),0<q.thrownErrors.length?($W=h(q.thrownErrors),q.thrownErrors.length=0,GW($W)):GW($W)})}}}var _=D;if(a(Z,G),G===0&&(zW(B),B.length!==0&&hW(function(){Q||wW||(wW=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),q.actQueue=null),0<q.thrownErrors.length)throw W=h(q.thrownErrors),q.thrownErrors.length=0,W;return{then:function(R,GW){Q=!0,G===0?(q.actQueue=B,j(function(){return XW(_,R,GW)})):R(_)}}},OZ.cache=function(W){return function(){return W.apply(null,arguments)}},OZ.cacheSignal=function(){return null},OZ.captureOwnerStack=function(){var W=q.getCurrentStack;return W===null?null:W()},OZ.cloneElement=function(W,Z,G){if(W===null||W===void 0)throw Error("The argument must be a React element, but you passed "+W+".");var B=jW({},W.props),Q=W.key,D=W._owner;if(Z!=null){var J;W:{if(qW.call(Z,"ref")&&(J=Object.getOwnPropertyDescriptor(Z,"ref").get)&&J.isReactWarning){J=!1;break W}J=Z.ref!==void 0}J&&(D=w()),d(Z)&&(C(Z.key),Q=""+Z.key);for(_ in Z)!qW.call(Z,_)||_==="key"||_==="__self"||_==="__source"||_==="ref"&&Z.ref===void 0||(B[_]=Z[_])}var _=arguments.length-2;if(_===1)B.children=G;else if(1<_){J=Array(_);for(var R=0;R<_;R++)J[R]=arguments[R+2];B.children=J}B=x(W.type,Q,B,D,W._debugStack,W._debugTask);for(Q=2;Q<arguments.length;Q++)c(arguments[Q]);return B},OZ.createContext=function(W){return W={$$typeof:u,_currentValue:W,_currentValue2:W,_threadCount:0,Provider:null,Consumer:null},W.Provider=W,W.Consumer={$$typeof:T,_context:W},W._currentRenderer=null,W._currentRenderer2=null,W},OZ.createElement=function(W,Z,G){for(var B=2;B<arguments.length;B++)c(arguments[B]);B={};var Q=null;if(Z!=null)for(R in SW||!("__self"in Z)||"key"in Z||(SW=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),d(Z)&&(C(Z.key),Q=""+Z.key),Z)qW.call(Z,R)&&R!=="key"&&R!=="__self"&&R!=="__source"&&(B[R]=Z[R]);var D=arguments.length-2;if(D===1)B.children=G;else if(1<D){for(var J=Array(D),_=0;_<D;_++)J[_]=arguments[_+2];Object.freeze&&Object.freeze(J),B.children=J}if(W&&W.defaultProps)for(R in D=W.defaultProps,D)B[R]===void 0&&(B[R]=D[R]);Q&&i(B,typeof W==="function"?W.displayName||W.name||"Unknown":W);var R=1e4>q.recentlyCreatedOwnerStacks++;return x(W,Q,B,w(),R?Error("react-stack-top-frame"):eW,R?vW(o(W)):WZ)},OZ.createRef=function(){var W={current:null};return Object.seal(W),W},OZ.forwardRef=function(W){W!=null&&W.$$typeof===e?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof W!=="function"?console.error("forwardRef requires a render function but was given %s.",W===null?"null":typeof W):W.length!==0&&W.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",W.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),W!=null&&W.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var Z={$$typeof:t,render:W},G;return Object.defineProperty(Z,"displayName",{enumerable:!1,configurable:!0,get:function(){return G},set:function(B){G=B,W.name||W.displayName||(Object.defineProperty(W,"name",{value:B}),W.displayName=B)}}),Z},OZ.isValidElement=p,OZ.lazy=function(W){W={_status:-1,_result:W};var Z={$$typeof:WW,_payload:W,_init:F},G={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return W._ioInfo=G,Z._debugInfo=[{awaited:G}],Z},OZ.memo=function(W,Z){W==null&&console.error("memo: The first argument must be a component. Instead received: %s",W===null?"null":typeof W),Z={$$typeof:e,type:W,compare:Z===void 0?null:Z};var G;return Object.defineProperty(Z,"displayName",{enumerable:!1,configurable:!0,get:function(){return G},set:function(B){G=B,W.name||W.displayName||(Object.defineProperty(W,"name",{value:B}),W.displayName=B)}}),Z},OZ.startTransition=function(W){var Z=q.T,G={};G._updatedFibers=new Set,q.T=G;try{var B=W(),Q=q.S;Q!==null&&Q(G,B),typeof B==="object"&&B!==null&&typeof B.then==="function"&&(q.asyncTransitions++,B.then(O,O),B.then(V,mW))}catch(D){mW(D)}finally{Z===null&&G._updatedFibers&&(W=G._updatedFibers.size,G._updatedFibers.clear(),10<W&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),Z!==null&&G.types!==null&&(Z.types!==null&&Z.types!==G.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),Z.types=G.types),q.T=Z}},OZ.unstable_useCacheRefresh=function(){return Y().useCacheRefresh()},OZ.use=function(W){return Y().use(W)},OZ.useActionState=function(W,Z,G){return Y().useActionState(W,Z,G)},OZ.useCallback=function(W,Z){return Y().useCallback(W,Z)},OZ.useContext=function(W){var Z=Y();return W.$$typeof===T&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),Z.useContext(W)},OZ.useDebugValue=function(W,Z){return Y().useDebugValue(W,Z)},OZ.useDeferredValue=function(W,Z){return Y().useDeferredValue(W,Z)},OZ.useEffect=function(W,Z){return W==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),Y().useEffect(W,Z)},OZ.useEffectEvent=function(W){return Y().useEffectEvent(W)},OZ.useId=function(){return Y().useId()},OZ.useImperativeHandle=function(W,Z,G){return Y().useImperativeHandle(W,Z,G)},OZ.useInsertionEffect=function(W,Z){return W==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),Y().useInsertionEffect(W,Z)},OZ.useLayoutEffect=function(W,Z){return W==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),Y().useLayoutEffect(W,Z)},OZ.useMemo=function(W,Z){return Y().useMemo(W,Z)},OZ.useOptimistic=function(W,Z){return Y().useOptimistic(W,Z)},OZ.useReducer=function(W,Z,G){return Y().useReducer(W,Z,G)},OZ.useRef=function(W){return Y().useRef(W)},OZ.useState=function(W){return Y().useState(W)},OZ.useSyncExternalStore=function(W,Z,G){return Y().useSyncExternalStore(W,Z,G)},OZ.useTransition=function(){return Y().useTransition()},OZ.version="19.2.4",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var ZW=yW((JZ)=>{var HW=n(UW());(function(){function H(X){if(X==null)return null;if(typeof X==="function")return X.$$typeof===Y?null:X.displayName||X.name||null;if(typeof X==="string")return X;switch(X){case f:return"Fragment";case y:return"Profiler";case x:return"StrictMode";case S:return"Suspense";case g:return"SuspenseList";case F:return"Activity"}if(typeof X==="object")switch(typeof X.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),X.$$typeof){case i:return"Portal";case p:return X.displayName||"Context";case c:return(X._context.displayName||"Context")+".Consumer";case l:var L=X.render;return X=X.displayName,X||(X=L.displayName||L.name||"",X=X!==""?"ForwardRef("+X+")":"ForwardRef"),X;case A:return L=X.displayName||null,L!==null?L:H(X.type)||"Memo";case z:L=X._payload,X=X._init;try{return H(X(L))}catch(T){}}return null}function $(X){return""+X}function U(X){try{$(X);var L=!1}catch(t){L=!0}if(L){L=console;var T=L.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&X[Symbol.toStringTag]||X.constructor.name||"Object";return T.call(L,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),$(X)}}function M(X){if(X===f)return"<>";if(typeof X==="object"&&X!==null&&X.$$typeof===z)return"<...>";try{var L=H(X);return L?"<"+L+">":"<...>"}catch(T){return"<...>"}}function I(){var X=O.A;return X===null?null:X.getOwner()}function P(){return Error("react-stack-top-frame")}function V(X){if(j.call(X,"key")){var L=Object.getOwnPropertyDescriptor(X,"key").get;if(L&&L.isReactWarning)return!1}return X.key!==void 0}function K(X,L){function T(){XW||(XW=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",L))}T.isReactWarning=!0,Object.defineProperty(X,"key",{get:T,configurable:!0})}function C(){var X=H(this.type);return zW[X]||(zW[X]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),X=this.props.ref,X!==void 0?X:null}function b(X,L,T,u,t,YW){var k=T.ref;return X={$$typeof:d,type:X,key:L,props:T,_owner:u},(k!==void 0?k:null)!==null?Object.defineProperty(X,"ref",{enumerable:!1,get:C}):Object.defineProperty(X,"ref",{enumerable:!1,value:null}),X._store={},Object.defineProperty(X._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(X,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(X,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.defineProperty(X,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:YW}),Object.freeze&&(Object.freeze(X.props),Object.freeze(X)),X}function o(X,L,T,u,t,YW){var k=L.children;if(k!==void 0)if(u)if(h(k)){for(u=0;u<k.length;u++)w(k[u]);Object.freeze&&Object.freeze(k)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else w(k);if(j.call(L,"key")){k=H(X);var e=Object.keys(L).filter(function(LW){return LW!=="key"});u=0<e.length?"{key: someKey, "+e.join(": ..., ")+": ...}":"{key: someKey}",QW[k+u]||(e=0<e.length?"{"+e.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
14
|
-
let props = %s;
|
|
15
|
-
<%s {...props} />
|
|
16
|
-
React keys must be passed directly to JSX without using spread:
|
|
17
|
-
let props = %s;
|
|
18
|
-
<%s key={someKey} {...props} />`,u,k,e,k),QW[k+u]=!0)}if(k=null,T!==void 0&&(U(T),k=""+T),V(L)&&(U(L.key),k=""+L.key),"key"in L){T={};for(var WW in L)WW!=="key"&&(T[WW]=L[WW])}else T=L;return k&&K(T,typeof X==="function"?X.displayName||X.name||"Unknown":X),b(X,k,T,I(),t,YW)}function w(X){m(X)?X._store&&(X._store.validated=1):typeof X==="object"&&X!==null&&X.$$typeof===z&&(X._payload.status==="fulfilled"?m(X._payload.value)&&X._payload.value._store&&(X._payload.value._store.validated=1):X._store&&(X._store.validated=1))}function m(X){return typeof X==="object"&&X!==null&&X.$$typeof===d}var d=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),p=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),Y=Symbol.for("react.client.reference"),O=HW.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,h=Array.isArray,a=console.createTask?console.createTask:function(){return null};HW={react_stack_bottom_frame:function(X){return X()}};var XW,zW={},MW=HW.react_stack_bottom_frame.bind(HW,P)(),JW=a(M(P)),QW={};JZ.Fragment=f,JZ.jsxDEV=function(X,L,T,u){var t=1e4>O.recentlyCreatedOwnerStacks++;return o(X,L,T,u,t?Error("react-stack-top-frame"):MW,t?a(M(X)):JW)}})()});var E=n(UW(),1),dW=n(ZW(),1),uW=E.createContext(null),LZ=200;function qZ({children:H}){let[$,U]=E.useState(!1),[M,I]=E.useState([]),[P,V]=E.useState({}),[K,C]=E.useState({}),[b,o]=E.useState(0),[w,m]=E.useState(0),[d,i]=E.useState(0),f=E.useRef(null),x=E.useRef(null);E.useEffect(()=>{let S=setInterval(()=>{let g=Date.now();C((A)=>{let z={};for(let[F,Y]of Object.entries(A))if(Y.expiresAt>g)z[F]=Y;return z})},500);return()=>clearInterval(S)},[]);let y=E.useCallback(()=>{if(f.current)f.current.close(),f.current=null;try{let S=new EventSource("/api/telemetry/stream");f.current=S,S.onopen=()=>{U(!0)},S.onmessage=(g)=>{if(!g.data||g.data.trim()==="")return;try{let A=JSON.parse(g.data);if(A.connected){U(!0);return}if(Array.isArray(A)){if(I((z)=>{return[...A,...z].slice(0,LZ)}),V((z)=>{let F={...z};for(let Y of A){let O=F[Y.agent_id];if(!O||new Date(Y.timestamp)>new Date(O.timestamp))F[Y.agent_id]={timestamp:Y.timestamp,category:Y.category,type:Y.type}}return F}),C((z)=>{let F={...z},Y=Date.now()+3000;for(let O of A)F[O.agent_id]={type:O.type,expiresAt:Y};return F}),A.some((z)=>z.category==="system"&&(z.type==="agent_started"||z.type==="agent_stopped")))o((z)=>z+1);if(A.some((z)=>z.category==="TASK"&&(z.type==="task_created"||z.type==="task_updated"||z.type==="task_deleted")))m((z)=>z+1);if(A.some((z)=>z.level==="error"||z.category==="ERROR"||z.category==="system"&&z.type==="agent_stopped"))i((z)=>z+1)}}catch{}},S.onerror=()=>{if(U(!1),S.close(),f.current=null,x.current)clearTimeout(x.current);x.current=setTimeout(y,2000)}}catch{if(U(!1),x.current)clearTimeout(x.current);x.current=setTimeout(y,2000)}},[]);E.useEffect(()=>{return y(),()=>{if(f.current)f.current.close();if(x.current)clearTimeout(x.current)}},[y]);let c=E.useCallback(()=>{I([])},[]),p=E.useCallback(()=>{o((S)=>S+1),m((S)=>S+1)},[]),l=E.default.useMemo(()=>({connected:$,events:M,lastActivityByAgent:P,activeAgents:K,statusChangeCounter:b,taskChangeCounter:w,notificationCounter:d,clearEvents:c,triggerRefresh:p}),[$,M,P,K,b,w,d,c,p]);return dW.jsxDEV(uW.Provider,{value:l,children:H},void 0,!1,void 0,this)}function BW(){let H=E.useContext(uW);if(!H)throw Error("useTelemetryContext must be used within TelemetryProvider");return H}function DZ(H){let{connected:$,events:U,lastActivityByAgent:M}=BW(),I=E.default.useMemo(()=>{let K=U;if(H?.agent_id)K=K.filter((C)=>C.agent_id===H.agent_id);if(H?.category)K=K.filter((C)=>C.category===H.category);if(H?.limit)K=K.slice(0,H.limit);return K},[U,H?.agent_id,H?.category,H?.limit]),P=H?.agent_id?M[H.agent_id]:void 0,V=E.default.useMemo(()=>{if(!P)return!1;let K=new Date(P.timestamp).getTime();return Date.now()-K<1e4},[P]);return{connected:$,events:I,lastActivity:P,isActive:V}}function RZ(H){switch(H){case"llm_request":return"Thinking";case"tool_invocation":return"Using tools";case"tool_result":return"Using tools";case"thread_activity":return"Working";case"agent_started":return"Starting";case"agent_stopped":return"Stopped";default:return"Working"}}function wZ(H){let{activeAgents:$}=BW(),U=$[H],M=!!U,I=U?.type;return E.default.useMemo(()=>({isActive:M,type:I,label:M?RZ(I):void 0}),[M,I])}function KZ(){let{statusChangeCounter:H}=BW();return H}function FZ(){let{taskChangeCounter:H}=BW();return H}function VZ(){let{notificationCounter:H}=BW();return H}function NZ(){let{triggerRefresh:H}=BW();return H}var N=n(UW(),1),sW=n(ZW(),1),pW=N.createContext(null);function FW(){let H=N.useContext(pW);if(!H)throw Error("useAuth must be used within an AuthProvider");return H}function PZ({children:H}){let[$,U]=N.useState(null),[M,I]=N.useState(null),[P,V]=N.useState(!0),[K,C]=N.useState(null),[b,o]=N.useState(!1),[w,m]=N.useState(null),d=N.useRef(null),i=N.useRef(!1),f=N.useRef(!1),x=N.useCallback((z)=>{d.current=z,I(z)},[]),y=N.useCallback(async()=>{if(i.current)return!1;i.current=!0;try{let z=await fetch("/api/auth/refresh",{method:"POST",credentials:"include"});if(!z.ok)return!1;let F=await z.json();if(x(F.accessToken),F.user)U(F.user);if(F.onboarding)m(F.onboarding.completed||F.onboarding.has_any_keys);return!!F.user}catch(z){return console.error("Token refresh failed:",z),!1}finally{i.current=!1}},[x]),c=N.useCallback(async()=>{try{let z=d.current,Y=await(await fetch("/api/auth/check",{headers:z?{Authorization:`Bearer ${z}`}:{}})).json();if(C(Y.hasUsers),o(Y.isDev??!1),Y.onboarding)m(Y.onboarding.completed||Y.onboarding.has_any_keys);if(Y.authenticated&&Y.user)U(Y.user);else if(U(null),Y.hasUsers){if(!await y())x(null)}}catch(z){console.error("Auth check failed:",z),U(null),x(null)}finally{V(!1)}},[y,x]),p=N.useCallback(async(z,F)=>{try{let Y=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:z,password:F})}),O=await Y.json();if(!Y.ok)return{success:!1,error:O.error||"Login failed"};return x(O.accessToken),U(O.user),C(!0),{success:!0}}catch(Y){return console.error("Login failed:",Y),{success:!1,error:"Login failed"}}},[x]),l=N.useCallback(async()=>{try{let z=d.current;await fetch("/api/auth/logout",{method:"POST",credentials:"include",headers:z?{Authorization:`Bearer ${z}`}:{}})}catch(z){console.error("Logout failed:",z)}finally{U(null),x(null)}},[x]),S=N.useCallback(async(z,F={})=>{let Y=new Headers(F.headers),O=d.current;if(O)Y.set("Authorization",`Bearer ${O}`);return fetch(z,{...F,headers:Y})},[]),g=N.useCallback(async()=>{return y()},[y]);N.useEffect(()=>{if(f.current)return;f.current=!0,c()},[c]),N.useEffect(()=>{if(!M)return;let z=setInterval(()=>{y()},840000);return()=>clearInterval(z)},[M,y]);let A=N.useMemo(()=>({user:$,isAuthenticated:!!$,isLoading:P,hasUsers:K,isDev:b,accessToken:M,onboardingComplete:w,setOnboardingComplete:m,login:p,logout:l,refreshToken:g,checkAuth:c,authFetch:S}),[$,P,K,b,M,w,m,p,l,g,c,S]);return sW.jsxDEV(pW.Provider,{value:A,children:H},void 0,!1,void 0,this)}function xZ(){let{accessToken:H}=FW();return H?{Authorization:`Bearer ${H}`}:{}}var v=n(UW(),1);var cW=n(ZW(),1),iW=v.createContext(null);function _Z(){let H=v.useContext(iW);if(!H)throw Error("useProjects must be used within a ProjectProvider");return H}var _W="apteva_current_project";function EZ({children:H}){let{authFetch:$,isAuthenticated:U,isLoading:M}=FW(),[I,P]=v.useState([]),[V,K]=v.useState(()=>{if(typeof window<"u")return localStorage.getItem(_W);return null}),[C,b]=v.useState(!0),[o,w]=v.useState(null),[m,d]=v.useState(0),[i,f]=v.useState(!1),[x,y]=v.useState(!1),[c,p]=v.useState(!0);v.useEffect(()=>{fetch("/api/features").then((O)=>O.json()).then((O)=>{f(O.projects===!0),y(O.metaAgent===!0),p(O.costTracking!==!1)}).catch(()=>{f(!1),y(!1),p(!0)})},[]);let l=v.useCallback((O)=>{if(K(O),typeof window<"u")if(O===null)localStorage.removeItem(_W);else localStorage.setItem(_W,O)},[]),S=I.find((O)=>O.id===V)||null,g=v.useCallback(async()=>{if(!i){P([]),b(!1);return}if(!U&&!M){P([]),b(!1);return}try{w(null);let O=await $("/api/projects");if(!O.ok)throw Error("Failed to fetch projects");let j=await O.json();if(P(j.projects||[]),d(j.unassignedCount||0),V&&V!=="unassigned"&&!j.projects.find((h)=>h.id===V))l(null)}catch(O){console.error("Failed to fetch projects:",O),w("Failed to load projects")}finally{b(!1)}},[$,U,M,V,l,i]),A=v.useCallback(async(O)=>{try{let j=await $("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)});if(!j.ok){let a=await j.json();throw Error(a.error||"Failed to create project")}let h=await j.json();return await g(),h.project}catch(j){return console.error("Failed to create project:",j),null}},[$,g]),z=v.useCallback(async(O,j)=>{try{let h=await $(`/api/projects/${O}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)});if(!h.ok){let XW=await h.json();throw Error(XW.error||"Failed to update project")}let a=await h.json();return await g(),a.project}catch(h){return console.error("Failed to update project:",h),null}},[$,g]),F=v.useCallback(async(O)=>{try{let j=await $(`/api/projects/${O}`,{method:"DELETE"});if(!j.ok){let h=await j.json();throw Error(h.error||"Failed to delete project")}if(V===O)l(null);return await g(),!0}catch(j){return console.error("Failed to delete project:",j),!1}},[$,V,l,g]);v.useEffect(()=>{if(!M&&i)g()},[M,i,g]);let Y=v.useMemo(()=>({projects:I,currentProjectId:V,currentProject:S,isLoading:C,error:o,unassignedCount:m,projectsEnabled:i,metaAgentEnabled:x,costTrackingEnabled:c,setCurrentProjectId:l,createProject:A,updateProject:z,deleteProject:F,refreshProjects:g}),[I,V,S,C,o,m,i,x,c,l,A,z,F,g]);return cW.jsxDEV(iW.Provider,{value:Y,children:H},void 0,!1,void 0,this)}var s=n(UW(),1);var VW={dark:{id:"dark",name:"Dark",colors:{"--color-bg":"#0a0a0a","--color-bg-secondary":"#0f0f0f","--color-surface":"#111111","--color-surface-hover":"#0a0a0a","--color-surface-raised":"#1a1a1a","--color-border":"#1a1a1a","--color-border-light":"#222222","--color-text":"#e0e0e0","--color-text-secondary":"#888888","--color-text-muted":"#666666","--color-text-faint":"#555555","--color-accent":"#f97316","--color-accent-hover":"#ea580c","--color-accent-5":"rgba(249, 115, 22, 0.05)","--color-accent-10":"rgba(249, 115, 22, 0.1)","--color-accent-15":"rgba(249, 115, 22, 0.15)","--color-accent-20":"rgba(249, 115, 22, 0.2)","--color-accent-30":"rgba(249, 115, 22, 0.3)","--color-accent-70":"rgba(249, 115, 22, 0.7)","--color-selection-bg":"#f97316","--color-selection-text":"#0a0a0a","--color-scrollbar":"#222222","--color-scrollbar-hover":"#444444"}},light:{id:"light",name:"Light",colors:{"--color-bg":"#ffffff","--color-bg-secondary":"#f7f7f7","--color-surface":"#ffffff","--color-surface-hover":"#f5f5f5","--color-surface-raised":"#f0f0f0","--color-border":"#e0e0e0","--color-border-light":"#e8e8e8","--color-text":"#1a1a1a","--color-text-secondary":"#555555","--color-text-muted":"#777777","--color-text-faint":"#999999","--color-accent":"#ea580c","--color-accent-hover":"#c2410c","--color-accent-5":"rgba(234, 88, 12, 0.05)","--color-accent-10":"rgba(234, 88, 12, 0.1)","--color-accent-15":"rgba(234, 88, 12, 0.15)","--color-accent-20":"rgba(234, 88, 12, 0.2)","--color-accent-30":"rgba(234, 88, 12, 0.3)","--color-accent-70":"rgba(234, 88, 12, 0.7)","--color-selection-bg":"#ea580c","--color-selection-text":"#ffffff","--color-scrollbar":"#cccccc","--color-scrollbar-hover":"#aaaaaa"}},"professional-dark":{id:"professional-dark",name:"Professional Dark",colors:{"--color-bg":"#0f1117","--color-bg-secondary":"#131520","--color-surface":"#181a24","--color-surface-hover":"#1e2030","--color-surface-raised":"#232636","--color-border":"#252838","--color-border-light":"#2d3044","--color-text":"#d4d7e0","--color-text-secondary":"#8b8fa3","--color-text-muted":"#6b6f83","--color-text-faint":"#4e5266","--color-accent":"#7c3aed","--color-accent-hover":"#6d28d9","--color-accent-5":"rgba(124, 58, 237, 0.05)","--color-accent-10":"rgba(124, 58, 237, 0.1)","--color-accent-15":"rgba(124, 58, 237, 0.15)","--color-accent-20":"rgba(124, 58, 237, 0.2)","--color-accent-30":"rgba(124, 58, 237, 0.3)","--color-accent-70":"rgba(124, 58, 237, 0.7)","--color-selection-bg":"#7c3aed","--color-selection-text":"#ffffff","--color-scrollbar":"#2d3044","--color-scrollbar-hover":"#3d4058"}},"professional-light":{id:"professional-light",name:"Professional Light",colors:{"--color-bg":"#f8f9fb","--color-bg-secondary":"#f0f2f5","--color-surface":"#ffffff","--color-surface-hover":"#f5f6f8","--color-surface-raised":"#eef0f4","--color-border":"#e2e4ea","--color-border-light":"#e8eaef","--color-text":"#1a1d2b","--color-text-secondary":"#4b5066","--color-text-muted":"#6b7088","--color-text-faint":"#9298ac","--color-accent":"#6d28d9","--color-accent-hover":"#5b21b6","--color-accent-5":"rgba(109, 40, 217, 0.05)","--color-accent-10":"rgba(109, 40, 217, 0.1)","--color-accent-15":"rgba(109, 40, 217, 0.15)","--color-accent-20":"rgba(109, 40, 217, 0.2)","--color-accent-30":"rgba(109, 40, 217, 0.3)","--color-accent-70":"rgba(109, 40, 217, 0.7)","--color-selection-bg":"#6d28d9","--color-selection-text":"#ffffff","--color-scrollbar":"#cdd0d8","--color-scrollbar-hover":"#b0b4c0"}}};function lW(H,$,U){let M=H==="auto"?U:H==="dark";if($==="professional")return M?VW["professional-dark"]:VW["professional-light"];return M?VW.dark:VW.light}var aW=n(ZW(),1),rW=s.createContext(null);function IZ(){let H=s.useContext(rW);if(!H)throw Error("useTheme must be used within a ThemeProvider");return H}var oW="apteva_theme_mode",nW="apteva_theme_style";function AZ(){if(typeof window>"u")return!0;return window.matchMedia("(prefers-color-scheme: dark)").matches}function jZ(H,$){let U=document.documentElement;for(let[M,I]of Object.entries(H.colors))U.style.setProperty(M,I);U.setAttribute("data-theme",H.id),U.setAttribute("data-style",$),document.body.style.fontFamily=$==="professional"?"'Inter', system-ui, -apple-system, sans-serif":"'JetBrains Mono', monospace"}function TZ({children:H}){let[$,U]=s.useState(()=>{if(typeof window<"u"){let w=localStorage.getItem(oW);if(w==="dark"||w==="light"||w==="auto")return w}return"auto"}),[M,I]=s.useState(()=>{if(typeof window<"u"){let w=localStorage.getItem(nW);if(w==="classic"||w==="professional")return w}return"classic"}),[P,V]=s.useState(AZ);s.useEffect(()=>{let w=window.matchMedia("(prefers-color-scheme: dark)"),m=(d)=>V(d.matches);return w.addEventListener("change",m),()=>w.removeEventListener("change",m)},[]);let K=s.useMemo(()=>lW($,M,P),[$,M,P]);s.useEffect(()=>{jZ(K,M)},[K,M]);let C=s.useCallback((w)=>{U(w),localStorage.setItem(oW,w)},[]),b=s.useCallback((w)=>{I(w),localStorage.setItem(nW,w)},[]),o=s.useMemo(()=>({mode:$,style:M,theme:K,setMode:C,setStyle:b}),[$,M,K,C,b]);return aW.jsxDEV(rW.Provider,{value:o,children:H},void 0,!1,void 0,this)}export{n as X,yW as Y,vZ as Z,CZ as _,UW as $,ZW as aa,qZ as ba,BW as ca,DZ as da,wZ as ea,KZ as fa,FZ as ga,VZ as ha,NZ as ia,FW as ja,PZ as ka,xZ as la,_Z as ma,EZ as na,IZ as oa,TZ as pa};
|
|
19
|
-
|
|
20
|
-
//# debugId=209114976F9FCF5B64756E2164756E21
|
package/dist/App.x6x8s16g.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{j as fN}from"./App.kz3qyyre.js";import{U as x}from"./App.sd685nt9.js";import{$ as Xv,X as O,aa as I,ja as g,ma as j}from"./App.shfd8tp9.js";var $N=O(Xv(),1);var D=O(Xv(),1);var U=O(I(),1);function NN(){let{authFetch:R}=g(),{currentProjectId:H}=j(),[J,F]=D.useState([]),[Q,c]=D.useState([]),[W,a]=D.useState(!0);if(D.useEffect(()=>{(async()=>{a(!0);let A=H&&H!=="unassigned"?`?project_id=${H}`:"";try{let[l,S]=await Promise.all([R(`/api/subscriptions${A}`).catch(()=>null),R("/api/agents").catch(()=>null)]);if(l?.ok){let G=await l.json();F(G.subscriptions||[])}if(S?.ok){let G=await S.json();c(G.agents||[])}}catch(l){console.error("Failed to fetch overview data:",l)}a(!1)})()},[R,H]),W)return U.jsxDEV("div",{className:"text-center py-12 text-[var(--color-text-muted)]",children:"Loading..."},void 0,!1,void 0,this);let y=J.filter((Y)=>Y.enabled),T=J.filter((Y)=>!Y.enabled),P=new Map(Q.map((Y)=>[Y.id,Y]));return U.jsxDEV("div",{className:"space-y-6",children:[U.jsxDEV("div",{className:"grid grid-cols-3 gap-4",children:[U.jsxDEV(bv,{label:"Active",value:y.length},void 0,!1,void 0,this),U.jsxDEV(bv,{label:"Disabled",value:T.length},void 0,!1,void 0,this),U.jsxDEV(bv,{label:"Total",value:J.length},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U.jsxDEV("section",{children:[U.jsxDEV("h3",{className:"text-sm font-medium text-[var(--color-text-secondary)] mb-3",children:["Subscriptions (",J.length,")"]},void 0,!0,void 0,this),J.length===0?U.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-6 text-center text-[var(--color-text-muted)] text-sm",children:"No subscriptions yet. Go to the Triggers tab to create one."},void 0,!1,void 0,this):U.jsxDEV("div",{className:"space-y-2",children:J.map((Y)=>{let A=P.get(Y.agent_id);return U.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-3 flex items-center gap-3",children:[U.jsxDEV("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${Y.enabled?"bg-green-400":"bg-[var(--color-text-faint)]"}`},void 0,!1,void 0,this),U.jsxDEV("div",{className:"flex-1 min-w-0",children:[U.jsxDEV("div",{className:"text-sm font-medium truncate",children:Y.trigger_slug.replace(/_/g," ").replace(/-/g," ")},void 0,!1,void 0,this),U.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)]",children:Y.trigger_instance_id?`ID: ${Y.trigger_instance_id.slice(0,12)}...`:"All instances"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U.jsxDEV("div",{className:"text-xs text-[var(--color-text-secondary)] flex-shrink-0",children:[U.jsxDEV("span",{className:"text-[var(--color-text-faint)]",children:"→"},void 0,!1,void 0,this)," ",U.jsxDEV("span",{className:"text-[var(--color-accent)]",children:A?.name||"Unknown Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U.jsxDEV("span",{className:`text-xs px-2 py-0.5 rounded flex-shrink-0 ${Y.enabled?"bg-green-500/10 text-green-400":"bg-[var(--color-surface-raised)] text-[var(--color-text-faint)]"}`,children:Y.enabled?"active":"disabled"},void 0,!1,void 0,this)]},Y.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function bv({label:R,value:H,valueColor:J}){return U.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-4",children:[U.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)] mb-1",children:R},void 0,!1,void 0,this),U.jsxDEV("div",{className:`text-2xl font-bold ${J||"text-[var(--color-text)]"}`,children:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var $=O(Xv(),1);var i=O(I(),1);function lN({message:R="Loading...",fullScreen:H=!1}){let J=i.jsxDEV("div",{className:"flex items-center gap-3 text-[var(--color-text-muted)]",children:[i.jsxDEV("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24",children:[i.jsxDEV("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"},void 0,!1,void 0,this),i.jsxDEV("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),i.jsxDEV("span",{children:R},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(H)return i.jsxDEV("div",{className:"min-h-screen bg-[var(--color-bg)] text-[var(--color-text)] flex items-center justify-center",children:J},void 0,!1,void 0,this);return i.jsxDEV("div",{className:"flex items-center justify-center py-20",children:J},void 0,!1,void 0,this)}var N=O(I(),1);function mN(){let{authFetch:R}=g(),{currentProjectId:H}=j(),[J,F]=$.useState([]),[Q,c]=$.useState(""),[W,a]=$.useState([]),[y,T]=$.useState(!0),[P,Y]=$.useState([]),[A,l]=$.useState([]),[S,G]=$.useState(!1),[w,k]=$.useState(""),[o,Fv]=$.useState(""),[RN,mv]=$.useState(!1),[B,fv]=$.useState(null),[_v,zN]=$.useState([]),[$v,lv]=$.useState(""),[Yv,Rv]=$.useState(!1),[r,Iv]=$.useState(""),[Zv,nv]=$.useState({}),[Pv,GN]=$.useState(""),[HN,qv]=$.useState(!1),[p,JN]=$.useState([]),[KN,kv]=$.useState(!1),[yv,UN]=$.useState([]),[Qv,XN]=$.useState([]),[s,Av]=$.useState(""),[t,Wv]=$.useState(""),[e,hv]=$.useState(""),[iv,av]=$.useState(!1),[Bv,zv]=$.useState({}),[Tv,YN]=$.useState(""),[Sv,Gv]=$.useState(!1),[Mv,pv]=$.useState(""),[uv,Hv]=$.useState(!1),[Ov,xv]=$.useState(""),[ZN,Jv]=$.useState(!1),[V,Lv]=$.useState(""),[Kv,wv]=$.useState(""),[cv,Vv]=$.useState(!1),[h,qN]=$.useState([]),[dv,Z]=$.useState(null),X=H&&H!=="unassigned"?`?project_id=${H}`:"",Ev=$.useCallback(async()=>{try{let v=await R(`/api/triggers/providers${X}`);if(v.ok){let f=((await v.json()).providers||[]).filter((_)=>_.connected);if(F(f),f.length>0)c((_)=>{if(!_||!f.find((K)=>K.id===_))return f[0].id;return _})}}catch(v){console.error("Failed to fetch providers:",v)}},[R]),u=$.useCallback(async()=>{T(!0);try{let v=`provider=${Q}`,m=X?"&":"?",f=X?`/api/triggers${X}&${v}`:`/api/triggers?${v}`,_=await R(f);if(_.ok){let K=await _.json();a(K.triggers||[])}}catch(v){console.error("Failed to fetch triggers:",v)}T(!1)},[R,X,Q]),vv=$.useCallback(async()=>{try{let v=await R(`/api/subscriptions${X}`);if(v.ok){let m=await v.json();Y(m.subscriptions||[])}}catch(v){console.error("Failed to fetch subscriptions:",v)}},[R,X]),Dv=$.useCallback(async()=>{try{let v=await R(`/api/agents${X}`);if(v.ok){let m=await v.json();qN(m.agents||[])}}catch(v){}},[R,X]);$.useEffect(()=>{Ev(),u(),vv(),Dv()},[Ev,u,vv,Dv]);let QN=async(v)=>{G(!0);try{let m=`/api/triggers/types?provider=${Q}`;if(v)m+=`&toolkit_slugs=${v}`;if(H&&H!=="unassigned")m+=`&project_id=${H}`;let f=await R(m);if(f.ok){let _=await f.json();l(_.types||[])}else{let _=await f.json();Z(_.error||"Failed to fetch trigger types")}}catch(m){Z("Failed to fetch trigger types")}G(!1)},WN=async()=>{try{let v=await R(`/api/integrations/${Q}/connected${X}`);if(v.ok){let m=await v.json();zN((m.accounts||[]).filter((f)=>f.status==="active"))}}catch(v){}},BN=(v)=>{fv(v),lv(""),Iv(""),nv({}),GN(""),mv(!0),WN()},b=Q==="agentdojo",MN=async()=>{qv(!0),Wv(""),Av(""),hv(""),zv({}),YN("");let v=async()=>{if(p.length>0)return;kv(!0);try{let _="/api/triggers/types?provider=agentdojo";if(H&&H!=="unassigned")_+=`&project_id=${H}`;let L=await(await R(_)).json();JN(L.types||[])}catch(_){console.error("Failed to load trigger types:",_)}kv(!1)},m=async()=>{try{let _=`/api/integrations/agentdojo/connected${X}`,q=((await(await R(_)).json()).accounts||[]).filter((E)=>E.status==="active");UN(q)}catch(_){console.error("Failed to load connected accounts:",_)}},f=async()=>{if(Qv.length>0)return;try{let _=`/api/integrations/agentdojo/apps${X}`,L=await(await R(_)).json();XN((L.apps||[]).map((q)=>({id:q.id,name:q.name,slug:q.slug,logo:q.logo})))}catch(_){console.error("Failed to load apps:",_)}};await Promise.all([v(),m(),f()])},ON=async()=>{let v=p.find((f)=>f.slug===t),m=Uv;if(!v||!e||!m)return;av(!0),Z(null);try{let f=h.find((FN)=>FN.id===e),_="provider=agentdojo",K=X?`/api/triggers${X}&provider=agentdojo`:"/api/triggers?provider=agentdojo",L={callback_url:`${window.location.origin}/api/webhooks/agentdojo`,title:`${v.name} → ${f?.name||"Agent"}`,server:v.toolkit_slug,agent_id:e,...Bv},q=await R(K,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:v.slug,connectedAccountId:m.id,config:L})}),E=await q.json();if(!q.ok)Z(E.error||"Failed to create subscription");else qv(!1),u()}catch(f){Z(f.message||"Failed to create subscription")}av(!1)},LN=async()=>{if(!B)return;if(b){if(!r||!Nv)return;Rv(!0),Z(null);try{let v=h.find((q)=>q.id===r),m=window.location.origin,f=`provider=${Q}`,_=X?`/api/triggers${X}&${f}`:`/api/triggers?${f}`,K=await R(_,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:B.slug,connectedAccountId:Nv.id,config:{callback_url:`${m}/api/webhooks/agentdojo`,title:`${B.name} → ${v?.name||"Agent"}`,server:B.toolkit_slug,agent_id:r,...Zv}})}),L=await K.json();if(!K.ok)Z(L.error||"Failed to create subscription");else mv(!1),fv(null),u()}catch(v){Z(v.message||"Failed to create subscription")}Rv(!1);return}if(!$v)return;Rv(!0),Z(null);try{let v=`provider=${Q}`,m=X?`/api/triggers${X}&${v}`:`/api/triggers?${v}`,f=await R(m,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:B.slug,connectedAccountId:$v})}),_=await f.json();if(!f.ok)Z(_.error||"Failed to create trigger");else mv(!1),fv(null),u()}catch(v){Z(v.message||"Failed to create trigger")}Rv(!1)},gv=async(v,m)=>{let f=m==="active"?"disable":"enable";try{let _=X?`&provider=${Q}`:`?provider=${Q}`,K=await R(`/api/triggers/${v}/${f}${X}${_}`,{method:"POST"});if(K.ok)u();else{let L=await K.json();Z(L.error||`Failed to ${f} trigger`)}}catch(_){Z(`Failed to ${f} trigger`)}},jv=async(v)=>{try{let m=X?`&provider=${Q}`:`?provider=${Q}`,f=await R(`/api/triggers/${v}${X}${m}`,{method:"DELETE"});if(f.ok)u();else{let _=await f.json();Z(_.error||"Failed to delete trigger")}}catch(m){Z("Failed to delete trigger")}},wN=async()=>{if(!V||!Kv)return;let v=W.find((m)=>m.id===V);if(!v)return;Vv(!0),Z(null);try{let m=await R("/api/subscriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({trigger_slug:v.trigger_slug,trigger_instance_id:v.id,agent_id:Kv,provider:Q,project_id:H&&H!=="unassigned"?H:null,public_url:window.location.origin})}),f=await m.json();if(!m.ok)Z(f.error||"Failed to create subscription");else Jv(!1),Lv(""),wv(""),vv()}catch(m){Z(m.message||"Failed to create subscription")}Vv(!1)},CN=async(v)=>{let m=v.enabled?"disable":"enable";try{if((await R(`/api/subscriptions/${v.id}/${m}`,{method:"POST"})).ok)vv()}catch(f){Z(`Failed to ${m} subscription`)}},bN=async(v)=>{try{if((await R(`/api/subscriptions/${v}`,{method:"DELETE"})).ok)vv()}catch(m){Z("Failed to delete subscription")}},Cv=A.filter((v)=>{if(!o)return!0;let m=o.toLowerCase();return v.name.toLowerCase().includes(m)||v.slug.toLowerCase().includes(m)||v.description.toLowerCase().includes(m)}),ov=(v,m)=>{if(!m||v.length===0)return null;let f=m.toLowerCase().replace(/[-_]/g," "),_=v.find((q)=>q.appId?.toLowerCase()===m.toLowerCase()||q.appName?.toLowerCase()===m.toLowerCase());if(_)return _;let K=v.find((q)=>q.appId?.toLowerCase().includes(f)||q.appName?.toLowerCase().replace(/[-_]/g," ").includes(f)||f.includes(q.appId?.toLowerCase()||"")||f.includes(q.appName?.toLowerCase().replace(/[-_]/g," ")||""));if(K)return K;let L=f.split(/\s+/);return v.find((q)=>{let E=(q.appName||"").toLowerCase().replace(/[-_]/g," ").split(/\s+/);return L[0]&&E[0]&&L[0]===E[0]})||null},M=p.find((v)=>v.slug===t),rv=M?ov(yv,M.toolkit_slug):null,Uv=Tv?yv.find((v)=>v.id===Tv)||rv:rv,sv=B&&b?ov(_v,B.toolkit_slug):null,Nv=Pv?_v.find((v)=>v.id===Pv)||sv:sv,tv=$.default.useMemo(()=>{let v=new Map;for(let f of Qv)if(f.logo)v.set(f.slug,f.logo);let m=new Map;for(let f of p){let _=m.get(f.toolkit_slug);if(_)_.count++;else{let K=v.get(f.toolkit_slug)||f.logo||null;m.set(f.toolkit_slug,{slug:f.toolkit_slug,name:f.toolkit_name,logo:K,count:1})}}return Array.from(m.values()).sort((f,_)=>f.name.localeCompare(_.name))},[p,Qv]),ev=s?p.filter((v)=>v.toolkit_slug===s):[],d=tv.find((v)=>v.slug===s),vN=new Map(h.map((v)=>[v.id,v]));if(J.length===0&&!y)return N.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-8 text-center",children:[N.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:"No trigger providers configured."},void 0,!1,void 0,this),N.jsxDEV("p",{className:"text-sm text-[var(--color-text-faint)] mt-1",children:"Add API keys for Composio or AgentDojo in Settings to enable triggers."},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return N.jsxDEV("div",{className:"space-y-6",children:[dv&&N.jsxDEV("div",{className:"text-red-400 text-sm p-3 bg-red-500/10 border border-red-500/20 rounded-lg flex items-center justify-between",children:[N.jsxDEV("span",{children:dv},void 0,!1,void 0,this),N.jsxDEV("button",{onClick:()=>Z(null),className:"text-red-400 hover:text-red-300",children:"x"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J.length>1&&N.jsxDEV("div",{className:"flex items-center gap-2",children:[N.jsxDEV("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Provider:"},void 0,!1,void 0,this),N.jsxDEV("div",{className:"flex gap-1 bg-[var(--color-surface)] card p-0.5",children:J.map((v)=>N.jsxDEV("button",{onClick:()=>{c(v.id),l([]),k(""),Fv("")},className:`px-3 py-1 rounded text-xs font-medium transition ${Q===v.id?"bg-[var(--color-surface-raised)] text-white":"text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"}`,children:v.name},v.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!b&&N.jsxDEV("section",{children:[N.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[N.jsxDEV("h3",{className:"text-sm font-medium text-[var(--color-text-secondary)]",children:["Subscriptions (",P.length,")"]},void 0,!0,void 0,this),N.jsxDEV("button",{onClick:()=>Jv(!0),className:"text-xs bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] hover:border-[var(--color-accent)] px-3 py-1.5 rounded transition",children:"+ Add Subscription"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),P.length===0?N.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-6 text-center text-[var(--color-text-muted)] text-sm",children:"No subscriptions yet. Add one to route trigger events to an agent."},void 0,!1,void 0,this):N.jsxDEV("div",{className:"space-y-2",children:P.map((v)=>{let m=vN.get(v.agent_id);return N.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-3 flex items-center gap-3",children:[N.jsxDEV("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${v.enabled?"bg-green-400":"bg-[var(--color-text-muted)]"}`},void 0,!1,void 0,this),N.jsxDEV("div",{className:"flex-1 min-w-0",children:[N.jsxDEV("div",{className:"text-sm font-medium truncate",children:[v.trigger_slug.replace(/_/g," "),N.jsxDEV("span",{className:"text-[var(--color-text-faint)] mx-1.5",children:"→"},void 0,!1,void 0,this),N.jsxDEV("span",{className:"text-[var(--color-accent)]",children:m?.name||"Unknown Agent"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)]",children:v.trigger_instance_id?`Instance: ${v.trigger_instance_id.slice(0,12)}...`:"All instances"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("div",{className:"flex items-center gap-2 flex-shrink-0",children:[N.jsxDEV("button",{onClick:()=>CN(v),className:`text-xs px-3 py-1 rounded transition ${v.enabled?"bg-yellow-500/10 text-yellow-400 hover:bg-yellow-500/20":"bg-green-500/10 text-green-400 hover:bg-green-500/20"}`,children:v.enabled?"Disable":"Enable"},void 0,!1,void 0,this),N.jsxDEV("button",{onClick:()=>bN(v.id),className:"text-xs text-[var(--color-text-muted)] hover:text-red-400 transition px-2",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},v.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!b&&N.jsxDEV("section",{children:[N.jsxDEV("h3",{className:"text-sm font-medium text-[var(--color-text-secondary)] mb-3",children:["Trigger Instances (",W.length,")"]},void 0,!0,void 0,this),y?N.jsxDEV("div",{className:"text-center py-6 text-[var(--color-text-muted)] text-sm",children:"Loading triggers..."},void 0,!1,void 0,this):W.length===0?N.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-6 text-center text-[var(--color-text-muted)] text-sm",children:"No trigger instances. Browse trigger types below to create one."},void 0,!1,void 0,this):N.jsxDEV("div",{className:"space-y-2",children:W.map((v)=>N.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-3 flex items-center gap-3",children:[N.jsxDEV("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${v.status==="active"?"bg-green-400":"bg-[var(--color-text-muted)]"}`},void 0,!1,void 0,this),N.jsxDEV("div",{className:"flex-1 min-w-0",children:[N.jsxDEV("div",{className:"text-sm font-medium truncate",children:v.trigger_slug.replace(/_/g," ")},void 0,!1,void 0,this),N.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)]",children:["ID: ",v.id.slice(0,12),"... | Created: ",new Date(v.created_at).toLocaleDateString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("div",{className:"flex items-center gap-2 flex-shrink-0",children:[N.jsxDEV("button",{onClick:()=>gv(v.id,v.status),className:`text-xs px-3 py-1 rounded transition ${v.status==="active"?"bg-yellow-500/10 text-yellow-400 hover:bg-yellow-500/20":"bg-green-500/10 text-green-400 hover:bg-green-500/20"}`,children:v.status==="active"?"Disable":"Enable"},void 0,!1,void 0,this),N.jsxDEV("button",{onClick:()=>jv(v.id),className:"text-xs text-[var(--color-text-muted)] hover:text-red-400 transition px-2",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},v.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&N.jsxDEV("section",{children:[N.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[N.jsxDEV("h3",{className:"text-sm font-medium text-[var(--color-text-secondary)]",children:["Active Subscriptions (",W.length,")"]},void 0,!0,void 0,this),N.jsxDEV("button",{onClick:MN,className:"text-xs bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] hover:border-[var(--color-accent)] px-3 py-1.5 rounded transition",children:"+ Add Subscription"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),y?N.jsxDEV("div",{className:"text-center py-6 text-[var(--color-text-muted)] text-sm",children:"Loading subscriptions..."},void 0,!1,void 0,this):W.length===0?N.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-6 text-center text-[var(--color-text-muted)] text-sm",children:"No active subscriptions. Browse trigger types below to create one."},void 0,!1,void 0,this):N.jsxDEV("div",{className:"space-y-2",children:W.map((v)=>{let m=P.find((_)=>_.trigger_instance_id===v.id),f=m?vN.get(m.agent_id):null;return N.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-3 flex items-center gap-3",children:[N.jsxDEV("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${v.status==="active"?"bg-green-400":"bg-[var(--color-text-muted)]"}`},void 0,!1,void 0,this),N.jsxDEV("div",{className:"flex-1 min-w-0",children:[N.jsxDEV("div",{className:"text-sm font-medium truncate",children:[v.config?.title||v.trigger_slug.replace(/_/g," "),f&&N.jsxDEV(N.Fragment,{children:[N.jsxDEV("span",{className:"text-[var(--color-text-faint)] mx-1.5",children:"→"},void 0,!1,void 0,this),N.jsxDEV("span",{className:"text-[var(--color-accent)]",children:f.name},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)]",children:[v.config?.server&&N.jsxDEV("span",{children:[String(v.config.server)," | "]},void 0,!0,void 0,this),"ID: ",String(v.id).slice(0,8)," | Created: ",new Date(v.created_at).toLocaleDateString()]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("div",{className:"flex items-center gap-2 flex-shrink-0",children:[N.jsxDEV("button",{onClick:()=>gv(v.id,v.status),className:`text-xs px-3 py-1 rounded transition ${v.status==="active"?"bg-yellow-500/10 text-yellow-400 hover:bg-yellow-500/20":"bg-green-500/10 text-green-400 hover:bg-green-500/20"}`,children:v.status==="active"?"Disable":"Enable"},void 0,!1,void 0,this),N.jsxDEV("button",{onClick:()=>jv(v.id),className:"text-xs text-[var(--color-text-muted)] hover:text-red-400 transition px-2",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},v.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("section",{children:[N.jsxDEV("h3",{className:"text-sm font-medium text-[var(--color-text-secondary)] mb-3",children:"Browse Trigger Types"},void 0,!1,void 0,this),N.jsxDEV("div",{className:"flex gap-2 mb-3",children:[N.jsxDEV("input",{type:"text",value:w,onChange:(v)=>k(v.target.value),placeholder:"Toolkit filter (e.g. github, gmail, slack)",className:"flex-1 bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded px-3 py-2 text-sm focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this),N.jsxDEV("button",{onClick:()=>QN(w||void 0),disabled:S,className:"text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] hover:border-[var(--color-accent)] px-4 py-2 rounded transition disabled:opacity-50",children:S?"Loading...":"Browse"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A.length>0&&N.jsxDEV(N.Fragment,{children:[N.jsxDEV("input",{type:"text",value:o,onChange:(v)=>Fv(v.target.value),placeholder:"Search trigger types...",className:"w-full bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded px-3 py-2 text-sm mb-3 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this),N.jsxDEV("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:Cv.slice(0,30).map((v)=>N.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] hover:border-[var(--color-border-light)] rounded-lg p-3 transition",children:[N.jsxDEV("div",{className:"flex items-start gap-3",children:[v.logo?N.jsxDEV("img",{src:v.logo,alt:v.toolkit_name,className:"w-8 h-8 rounded object-contain flex-shrink-0"},void 0,!1,void 0,this):N.jsxDEV("div",{className:"w-8 h-8 rounded bg-[var(--color-surface-raised)] flex items-center justify-center text-xs flex-shrink-0",children:v.toolkit_name?.[0]?.toUpperCase()||"?"},void 0,!1,void 0,this),N.jsxDEV("div",{className:"flex-1 min-w-0",children:[N.jsxDEV("div",{className:"text-sm font-medium truncate",children:v.name},void 0,!1,void 0,this),N.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)]",children:v.toolkit_name},void 0,!1,void 0,this),N.jsxDEV("div",{className:"text-xs text-[var(--color-text-faint)] mt-1 line-clamp-2",children:v.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("button",{onClick:()=>BN(v),className:"w-full mt-3 text-xs bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] hover:border-[var(--color-accent)] px-3 py-1.5 rounded transition",children:b?"Subscribe":"Create Trigger"},void 0,!1,void 0,this)]},v.slug,!0,void 0,this))},void 0,!1,void 0,this),Cv.length>30&&N.jsxDEV("p",{className:"text-xs text-[var(--color-text-faint)] mt-3 text-center",children:["Showing first 30 of ",Cv.length," types. Use search to filter."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),RN&&B&&N.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:N.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg p-6 w-full max-w-md mx-4",children:[N.jsxDEV("h3",{className:"font-medium mb-1",children:b?"Create Subscription":"Create Trigger"},void 0,!1,void 0,this),N.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)] mb-4",children:[B.name,B.toolkit_name&&N.jsxDEV("span",{className:"text-[var(--color-text-faint)]",children:[" (",B.toolkit_name,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("div",{className:"space-y-4",children:[!b&&N.jsxDEV("div",{children:[N.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1.5",children:"Connected Account"},void 0,!1,void 0,this),_v.length===0?N.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)] bg-[var(--color-bg)] rounded p-3",children:"No connected accounts available. Connect an app first in the Integrations tab."},void 0,!1,void 0,this):N.jsxDEV(x,{value:$v,onChange:lv,placeholder:"Select account...",options:_v.map((v)=>({value:v.id,label:`${v.appName} (${v.id.slice(0,8)}...)`}))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&N.jsxDEV("div",{children:[N.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1.5",children:"Route to Agent"},void 0,!1,void 0,this),h.length===0?N.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)] bg-[var(--color-bg)] rounded p-3",children:"No agents available. Create an agent first."},void 0,!1,void 0,this):N.jsxDEV(x,{value:r,onChange:Iv,placeholder:"Select agent...",options:h.map((v)=>({value:v.id,label:`${v.name} (${v.status})`}))},void 0,!1,void 0,this),N.jsxDEV("div",{className:"mt-3",children:[N.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1.5",children:"Connected Account"},void 0,!1,void 0,this),Nv?N.jsxDEV("div",{className:"text-xs text-green-400 bg-green-500/10 border border-green-500/20 rounded p-3",children:["Connected: ",Nv.appName]},void 0,!0,void 0,this):N.jsxDEV("div",{className:"text-xs text-yellow-400 bg-yellow-500/10 border border-yellow-500/20 rounded p-3",children:["No connected account for ",B?.toolkit_name||"this app",". Connect it first in the Integrations tab."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),B.config_schema&&Object.keys(B.config_schema.properties||{}).length>0&&N.jsxDEV("div",{className:"mt-3",children:[N.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1.5",children:"Configuration"},void 0,!1,void 0,this),N.jsxDEV("div",{className:"space-y-2",children:Object.entries(B.config_schema.properties||{}).map(([v,m])=>{let f=(B.config_schema.required||[]).includes(v);return N.jsxDEV("div",{children:[N.jsxDEV("label",{className:"block text-[11px] text-[var(--color-text-secondary)] mb-1",children:[m.title||v,f&&N.jsxDEV("span",{className:"text-red-400 ml-0.5",children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("input",{type:"text",value:Zv[v]||"",onChange:(_)=>nv((K)=>({...K,[v]:_.target.value})),placeholder:m.description||`Enter ${m.title||v}...`,className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 text-sm focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this)]},v,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("div",{className:"flex gap-2 mt-4",children:[N.jsxDEV("button",{onClick:()=>{mv(!1),fv(null)},className:"flex-1 text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),N.jsxDEV("button",{onClick:LN,disabled:b?!r||!Nv||Yv||B?.config_schema&&(B.config_schema.required||[]).some((v)=>!Zv[v]?.trim()):!$v||Yv,className:"flex-1 text-sm bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] text-white px-4 py-2 rounded transition disabled:opacity-50",children:Yv?"Creating...":b?"Subscribe":"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),ZN&&N.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:N.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg p-6 w-full max-w-md mx-4",children:[N.jsxDEV("h3",{className:"font-medium mb-1",children:"Route Trigger to Agent"},void 0,!1,void 0,this),N.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)] mb-4",children:W.length===0?"No trigger instances yet. Create one first from the Browse section below.":"Select a trigger instance and the agent that should handle its events."},void 0,!1,void 0,this),W.length>0?N.jsxDEV(N.Fragment,{children:[N.jsxDEV("div",{className:"space-y-4",children:[N.jsxDEV("div",{children:[N.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1.5",children:"Trigger Instance"},void 0,!1,void 0,this),N.jsxDEV(x,{value:V,onChange:Lv,placeholder:"Select trigger...",options:W.map((v)=>({value:v.id,label:`${v.trigger_slug.replace(/_/g," ")}`}))},void 0,!1,void 0,this),V&&N.jsxDEV("div",{className:"text-xs text-[var(--color-text-faint)] mt-1 font-mono",children:["ID: ",V.slice(0,16),"..."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("div",{children:[N.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1.5",children:"Target Agent"},void 0,!1,void 0,this),N.jsxDEV(x,{value:Kv,onChange:wv,placeholder:"Select agent...",options:h.map((v)=>({value:v.id,label:`${v.name} (${v.status})`}))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("div",{className:"flex gap-2 mt-5",children:[N.jsxDEV("button",{onClick:()=>{Jv(!1),Lv(""),wv("")},className:"flex-1 text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),N.jsxDEV("button",{onClick:wN,disabled:!V||!Kv||cv,className:"flex-1 text-sm bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] text-white px-4 py-2 rounded transition disabled:opacity-50",children:cv?"Adding...":"Add"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):N.jsxDEV("div",{className:"flex gap-2 mt-4",children:N.jsxDEV("button",{onClick:()=>Jv(!1),className:"flex-1 text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] px-4 py-2 rounded transition",children:"Close"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),HN&&N.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:N.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg p-6 w-full max-w-lg mx-4",children:[N.jsxDEV("h3",{className:"font-medium mb-1",children:"Add Subscription"},void 0,!1,void 0,this),N.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)] mb-4",children:"Select an app and trigger, then route it to an agent."},void 0,!1,void 0,this),KN?N.jsxDEV("div",{className:"text-center py-8 text-[var(--color-text-muted)] text-sm",children:"Loading..."},void 0,!1,void 0,this):p.length===0?N.jsxDEV("div",{className:"text-center py-8 text-[var(--color-text-muted)] text-sm",children:"No triggers available. Connect an app first in the Integrations tab."},void 0,!1,void 0,this):N.jsxDEV("div",{className:"space-y-4",children:[N.jsxDEV("div",{children:[N.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1.5",children:"App"},void 0,!1,void 0,this),N.jsxDEV("div",{className:"relative",children:[N.jsxDEV("button",{onClick:()=>{Gv(!Sv),Hv(!1),pv("")},className:"w-full flex items-center gap-2 bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 text-sm text-left hover:border-[var(--color-text-faint)] transition",children:[d?N.jsxDEV(N.Fragment,{children:[d.logo?N.jsxDEV("img",{src:d.logo,alt:"",className:"w-5 h-5 rounded object-contain flex-shrink-0"},void 0,!1,void 0,this):N.jsxDEV("div",{className:"w-5 h-5 rounded bg-[var(--color-surface-raised)] flex items-center justify-center text-[10px] flex-shrink-0",children:d.name?.[0]?.toUpperCase()||"?"},void 0,!1,void 0,this),N.jsxDEV("span",{className:"flex-1 truncate",children:d.name},void 0,!1,void 0,this),N.jsxDEV("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:[d.count," triggers"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):N.jsxDEV("span",{className:"text-[var(--color-text-muted)] flex-1",children:"Select app..."},void 0,!1,void 0,this),N.jsxDEV("span",{className:"text-[var(--color-text-muted)] text-xs ml-1",children:"▾"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Sv&&N.jsxDEV(N.Fragment,{children:[N.jsxDEV("div",{className:"fixed inset-0 z-10",onClick:()=>Gv(!1)},void 0,!1,void 0,this),N.jsxDEV("div",{className:"absolute left-0 right-0 top-full mt-1 bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded-lg shadow-xl z-20 max-h-64 flex flex-col",children:[N.jsxDEV("div",{className:"p-2 border-b border-[var(--color-border)] flex-shrink-0",children:N.jsxDEV("input",{type:"text",value:Mv,onChange:(v)=>pv(v.target.value),placeholder:"Search apps...",className:"w-full bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded px-2 py-1.5 text-sm focus:outline-none focus:border-[var(--color-accent)]",autoFocus:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),N.jsxDEV("div",{className:"overflow-y-auto flex-1",children:tv.filter((v)=>{if(!Mv)return!0;let m=Mv.toLowerCase();return v.name.toLowerCase().includes(m)||v.slug.toLowerCase().includes(m)}).map((v)=>N.jsxDEV("button",{onClick:()=>{Av(v.slug),Wv(""),zv({}),Gv(!1)},className:`w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition hover:bg-[var(--color-surface-raised)] ${s===v.slug?"bg-[var(--color-surface-raised)] text-[var(--color-accent)]":""}`,children:[v.logo?N.jsxDEV("img",{src:v.logo,alt:"",className:"w-5 h-5 rounded object-contain flex-shrink-0"},void 0,!1,void 0,this):N.jsxDEV("div",{className:"w-5 h-5 rounded bg-[var(--color-surface-raised)] flex items-center justify-center text-[10px] flex-shrink-0",children:v.name?.[0]?.toUpperCase()||"?"},void 0,!1,void 0,this),N.jsxDEV("span",{className:"flex-1 truncate",children:v.name},void 0,!1,void 0,this),N.jsxDEV("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:v.count},void 0,!1,void 0,this)]},v.slug,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s&&N.jsxDEV("div",{children:[N.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1.5",children:"Trigger"},void 0,!1,void 0,this),N.jsxDEV("div",{className:"relative",children:[N.jsxDEV("button",{onClick:()=>{Hv(!uv),Gv(!1),xv("")},className:"w-full flex items-center gap-2 bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 text-sm text-left hover:border-[var(--color-text-faint)] transition",children:[M?N.jsxDEV(N.Fragment,{children:[N.jsxDEV("span",{className:"flex-1 truncate",children:M.name},void 0,!1,void 0,this),N.jsxDEV("span",{className:`text-[10px] px-1.5 py-0.5 rounded flex-shrink-0 ${M.type==="webhook"?"bg-blue-500/10 text-blue-400":"bg-yellow-500/10 text-yellow-400"}`,children:M.type},void 0,!1,void 0,this)]},void 0,!0,void 0,this):N.jsxDEV("span",{className:"text-[var(--color-text-muted)] flex-1",children:"Select trigger..."},void 0,!1,void 0,this),N.jsxDEV("span",{className:"text-[var(--color-text-muted)] text-xs ml-1",children:"▾"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),uv&&N.jsxDEV(N.Fragment,{children:[N.jsxDEV("div",{className:"fixed inset-0 z-10",onClick:()=>Hv(!1)},void 0,!1,void 0,this),N.jsxDEV("div",{className:"absolute left-0 right-0 top-full mt-1 bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded-lg shadow-xl z-20 max-h-64 flex flex-col",children:[ev.length>3&&N.jsxDEV("div",{className:"p-2 border-b border-[var(--color-border)] flex-shrink-0",children:N.jsxDEV("input",{type:"text",value:Ov,onChange:(v)=>xv(v.target.value),placeholder:"Search triggers...",className:"w-full bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded px-2 py-1.5 text-sm focus:outline-none focus:border-[var(--color-accent)]",autoFocus:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this),N.jsxDEV("div",{className:"overflow-y-auto flex-1",children:ev.filter((v)=>{if(!Ov)return!0;let m=Ov.toLowerCase();return v.name.toLowerCase().includes(m)||v.slug.toLowerCase().includes(m)||v.description.toLowerCase().includes(m)}).map((v)=>N.jsxDEV("button",{onClick:()=>{Wv(v.slug),zv({}),Hv(!1)},className:`w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition hover:bg-[var(--color-surface-raised)] ${t===v.slug?"bg-[var(--color-surface-raised)] text-[var(--color-accent)]":""}`,children:[N.jsxDEV("div",{className:"flex-1 min-w-0",children:[N.jsxDEV("div",{className:"truncate",children:v.name},void 0,!1,void 0,this),N.jsxDEV("div",{className:"text-[10px] text-[var(--color-text-muted)] truncate",children:v.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("span",{className:`text-[10px] px-1.5 py-0.5 rounded flex-shrink-0 ${v.type==="webhook"?"bg-blue-500/10 text-blue-400":"bg-yellow-500/10 text-yellow-400"}`,children:v.type},void 0,!1,void 0,this)]},v.slug,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),t&&N.jsxDEV("div",{children:[N.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1.5",children:"Connected Account"},void 0,!1,void 0,this),Uv?N.jsxDEV("div",{className:"text-xs text-green-400 bg-green-500/10 border border-green-500/20 rounded p-3",children:["Connected: ",Uv.appName]},void 0,!0,void 0,this):N.jsxDEV("div",{className:"text-xs text-yellow-400 bg-yellow-500/10 border border-yellow-500/20 rounded p-3",children:["No connected account for ",M?.toolkit_name||"this app",". Connect it first in the Integrations tab."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),M&&M.config_schema&&Object.keys(M.config_schema.properties||{}).length>0&&N.jsxDEV("div",{children:[N.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1.5",children:"Configuration"},void 0,!1,void 0,this),N.jsxDEV("div",{className:"space-y-2",children:Object.entries(M.config_schema.properties||{}).map(([v,m])=>{let f=(M.config_schema.required||[]).includes(v);return N.jsxDEV("div",{children:[N.jsxDEV("label",{className:"block text-[11px] text-[var(--color-text-secondary)] mb-1",children:[m.title||v,f&&N.jsxDEV("span",{className:"text-red-400 ml-0.5",children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("input",{type:"text",value:Bv[v]||"",onChange:(_)=>zv((K)=>({...K,[v]:_.target.value})),placeholder:m.description||`Enter ${m.title||v}...`,className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 text-sm focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this)]},v,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("div",{children:[N.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1.5",children:"Target Agent"},void 0,!1,void 0,this),h.length===0?N.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)] bg-[var(--color-bg)] rounded p-3",children:"No agents available. Create an agent first."},void 0,!1,void 0,this):N.jsxDEV(x,{value:e,onChange:hv,placeholder:"Select agent...",options:h.map((v)=>({value:v.id,label:`${v.name} (${v.status})`}))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),N.jsxDEV("div",{className:"flex gap-2 mt-5",children:[N.jsxDEV("button",{onClick:()=>qv(!1),className:"flex-1 text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] px-4 py-2 rounded transition",children:"Cancel"},void 0,!1,void 0,this),N.jsxDEV("button",{onClick:ON,disabled:!t||!e||!Uv||iv||M?.config_schema&&(M.config_schema.required||[]).some((v)=>!Bv[v]?.trim()),className:"flex-1 text-sm bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] text-white px-4 py-2 rounded transition disabled:opacity-50",children:iv?"Creating...":"Subscribe"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var n=O(Xv(),1);var z=O(I(),1);function _N(){let{authFetch:R}=g(),{currentProjectId:H}=j(),J=H&&H!=="unassigned"?H:null,F=J?`?project_id=${J}`:"",[Q,c]=n.useState([]),[W,a]=n.useState("");n.useEffect(()=>{R(`/api/triggers/providers${F}`).then((G)=>G.json()).then((G)=>{let w=(G.providers||[]).filter((k)=>k.connected);if(c(w),w.length>0&&!w.find((k)=>k.id===W))a(w[0].id)}).catch(()=>{})},[R]);let[y,T]=n.useState(null),[P,Y]=n.useState([]),[A,l]=n.useState(!1),S=n.useCallback(async(G)=>{T(G),l(!0);try{let w=`/api/triggers/types?provider=${W}&toolkit_slugs=${G}`;if(J)w+=`&project_id=${J}`;let k=await R(w);if(k.ok){let o=await k.json();Y(o.types||[])}}catch(w){console.error("Failed to fetch trigger types:",w)}l(!1)},[R,J,W]);return z.jsxDEV("div",{children:[z.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)] mb-4",children:"Connect external apps via OAuth or API Key. Connected apps can be used for triggers and MCP integrations."},void 0,!1,void 0,this),Q.length>1&&z.jsxDEV("div",{className:"flex items-center gap-2 mb-4",children:[z.jsxDEV("span",{className:"text-xs text-[var(--color-text-muted)]",children:"Provider:"},void 0,!1,void 0,this),z.jsxDEV("div",{className:"flex gap-1 bg-[var(--color-surface)] card p-0.5",children:Q.map((G)=>z.jsxDEV("button",{onClick:()=>a(G.id),className:`px-3 py-1 rounded text-xs font-medium transition ${W===G.id?"bg-[var(--color-surface-raised)] text-white":"text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"}`,children:G.name},G.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Q.length===0?z.jsxDEV("div",{className:"bg-[var(--color-surface)] card p-8 text-center",children:[z.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:"No integration providers configured."},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-sm text-[var(--color-text-faint)] mt-1",children:"Add API keys for Composio or AgentDojo in Settings."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):z.jsxDEV(fN,{providerId:W,projectId:J,hideMcpConfig:!0,onBrowseTriggers:S},void 0,!1,void 0,this),y&&z.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:z.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg w-full max-w-2xl mx-4 max-h-[80vh] flex flex-col",children:[z.jsxDEV("div",{className:"p-4 border-b border-[var(--color-border)] flex items-center justify-between",children:[z.jsxDEV("div",{children:[z.jsxDEV("h3",{className:"font-medium",children:"Trigger Types"},void 0,!1,void 0,this),z.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)]",children:y},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("button",{onClick:()=>{T(null),Y([])},className:"text-[var(--color-text-muted)] hover:text-white transition text-lg px-2",children:"x"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{className:"flex-1 overflow-auto p-4",children:A?z.jsxDEV("div",{className:"text-center py-8 text-[var(--color-text-muted)]",children:"Loading trigger types..."},void 0,!1,void 0,this):P.length===0?z.jsxDEV("div",{className:"text-center py-8 text-[var(--color-text-muted)]",children:"No trigger types available for this app."},void 0,!1,void 0,this):z.jsxDEV("div",{className:"space-y-2",children:P.map((G)=>z.jsxDEV("div",{className:"bg-[var(--color-bg)] card p-3",children:z.jsxDEV("div",{className:"flex items-start gap-3",children:[G.logo?z.jsxDEV("img",{src:G.logo,alt:G.toolkit_name,className:"w-6 h-6 rounded object-contain flex-shrink-0 mt-0.5"},void 0,!1,void 0,this):z.jsxDEV("div",{className:"w-6 h-6 rounded bg-[var(--color-surface-raised)] flex items-center justify-center text-[10px] flex-shrink-0 mt-0.5",children:G.toolkit_name?.[0]?.toUpperCase()||"?"},void 0,!1,void 0,this),z.jsxDEV("div",{className:"flex-1 min-w-0",children:[z.jsxDEV("div",{className:"text-sm font-medium",children:G.name},void 0,!1,void 0,this),z.jsxDEV("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:G.description},void 0,!1,void 0,this),z.jsxDEV("div",{className:"flex items-center gap-2 mt-1.5",children:[z.jsxDEV("span",{className:"text-[10px] bg-[var(--color-surface-raised)] text-[var(--color-text-faint)] px-1.5 py-0.5 rounded font-mono",children:G.slug},void 0,!1,void 0,this),z.jsxDEV("span",{className:`text-[10px] px-1.5 py-0.5 rounded ${G.type==="webhook"?"bg-blue-500/10 text-blue-400":"bg-yellow-500/10 text-yellow-400"}`,children:G.type},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},G.slug,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var C=O(I(),1);function J0(){let[R,H]=$N.useState("overview");return C.jsxDEV("div",{className:"flex-1 overflow-auto p-6",children:C.jsxDEV("div",{className:"max-w-6xl",children:[C.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:C.jsxDEV("div",{children:[C.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Connections"},void 0,!1,void 0,this),C.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:"Manage external app connections, triggers, and webhooks."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),C.jsxDEV("div",{className:"flex gap-1 mb-6 bg-[var(--color-surface)] card p-1 w-fit",children:[{id:"overview",label:"Overview"},{id:"triggers",label:"Triggers"},{id:"integrations",label:"Integrations"}].map((F)=>C.jsxDEV("button",{onClick:()=>H(F.id),className:`px-4 py-2 rounded text-sm font-medium transition ${R===F.id?"bg-[var(--color-surface-raised)] text-white":"text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"}`,children:F.label},F.id,!1,void 0,this))},void 0,!1,void 0,this),R==="overview"&&C.jsxDEV(NN,{},void 0,!1,void 0,this),R==="triggers"&&C.jsxDEV(mN,{},void 0,!1,void 0,this),R==="integrations"&&C.jsxDEV(_N,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}
|
|
2
|
-
export{lN as a,J0 as b};
|
|
3
|
-
|
|
4
|
-
//# debugId=45AC14297BEFA8DD64756E2164756E21
|
package/dist/McpPage.xvr8hk05.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{d as a,e as b,f as c,g as d,h as e}from"./App.cjcyr5aj.js";import"./App.jdkx6eqd.js";import"./App.e2kkda2a.js";import"./App.sd685nt9.js";import"./App.shfd8tp9.js";export{e as formatRelativeTime,d as formatCron,c as TrajectoryView,a as TasksPage,b as TaskDetailPanel};
|
|
2
|
-
|
|
3
|
-
//# debugId=C2CFA2705D3D8A1B64756E2164756E21
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|