skill-creator 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/cli.js +35809 -12291
  3. package/dist/cli.js.map +4 -4
  4. package/dist/daemon.js +23461 -2818
  5. package/dist/daemon.js.map +4 -4
  6. package/dist/package.json +1 -1
  7. package/dist/webui/_app/immutable/assets/0.B4ZC2KQW.css +2 -0
  8. package/dist/webui/_app/immutable/assets/SettingsPage.DclbL_Wf.css +1 -0
  9. package/dist/webui/_app/immutable/chunks/{8hp3I3ac.js → B0stYqX9.js} +1 -1
  10. package/dist/webui/_app/immutable/chunks/{DiaaOubc.js → BTuMeN4z.js} +1 -1
  11. package/dist/webui/_app/immutable/chunks/B_gnhZ39.js +1 -0
  12. package/dist/webui/_app/immutable/chunks/{DKepoBN5.js → BcvferwH.js} +1 -1
  13. package/dist/webui/_app/immutable/chunks/{j76fpbnQ.js → Bd1_Ly7G.js} +1 -1
  14. package/dist/webui/_app/immutable/chunks/{D3qCeXbe.js → BgJCuTDs.js} +1 -1
  15. package/dist/webui/_app/immutable/chunks/C67g-p2T.js +1 -0
  16. package/dist/webui/_app/immutable/chunks/{ByW1yjUW.js → CBFLFfGb.js} +1 -1
  17. package/dist/webui/_app/immutable/chunks/CD-NpLjk.js +6 -0
  18. package/dist/webui/_app/immutable/chunks/{DwIX6ZFE.js → CIxXWvxF.js} +1 -1
  19. package/dist/webui/_app/immutable/chunks/COXgCOd9.js +2 -0
  20. package/dist/webui/_app/immutable/chunks/Ccj5eiVa.js +1 -0
  21. package/dist/webui/_app/immutable/chunks/{BOPkZ98B.js → CdjBDc_u.js} +1 -1
  22. package/dist/webui/_app/immutable/chunks/Cp0lquqA.js +1 -0
  23. package/dist/webui/_app/immutable/chunks/Crg8KRap.js +5 -0
  24. package/dist/webui/_app/immutable/chunks/{B0-OMyfG.js → CvO5eq4f.js} +1 -1
  25. package/dist/webui/_app/immutable/chunks/{Cr5YUwJg.js → D6s79OPW.js} +1 -1
  26. package/dist/webui/_app/immutable/chunks/{oxP0dM6z.js → D7DTLcps.js} +1 -1
  27. package/dist/webui/_app/immutable/chunks/{C5MrAfWf.js → DGJ9QIPN.js} +1 -1
  28. package/dist/webui/_app/immutable/chunks/Dcf0klrH.js +5 -0
  29. package/dist/webui/_app/immutable/chunks/{CPbfZBJo.js → DlsPNMHX.js} +4 -4
  30. package/dist/webui/_app/immutable/chunks/Do_MDwCJ.js +1 -0
  31. package/dist/webui/_app/immutable/chunks/DovL68qD.js +1 -0
  32. package/dist/webui/_app/immutable/chunks/{CgxChsUX.js → Du6-3Tbt.js} +1 -1
  33. package/dist/webui/_app/immutable/chunks/M-b0y9AQ.js +1 -0
  34. package/dist/webui/_app/immutable/chunks/hIGXQE4_.js +1 -0
  35. package/dist/webui/_app/immutable/chunks/oJ4aK8PG.js +1 -0
  36. package/dist/webui/_app/immutable/chunks/vry1W47_.js +7 -0
  37. package/dist/webui/_app/immutable/entry/{app.BQ4neDVJ.js → app.SX0t6ojk.js} +2 -2
  38. package/dist/webui/_app/immutable/entry/start.gejSBBnR.js +1 -0
  39. package/dist/webui/_app/immutable/nodes/0.BTXc1wYu.js +229 -0
  40. package/dist/webui/_app/immutable/nodes/{1.BhX-6aiQ.js → 1.BY0DmHLP.js} +1 -1
  41. package/dist/webui/_app/immutable/nodes/{2.C7Br-rQ1.js → 2._osi8D6m.js} +1 -1
  42. package/dist/webui/_app/version.json +1 -1
  43. package/dist/webui/index.html +24 -21
  44. package/package.json +7 -5
  45. package/skills/skill-creator-v2/SKILL.md +50 -0
  46. package/skills/skill-creator-v2/references/tools.md +161 -0
  47. package/dist/webui/_app/immutable/assets/0.Dbnkcm0y.css +0 -2
  48. package/dist/webui/_app/immutable/chunks/B5sWuF6v.js +0 -1
  49. package/dist/webui/_app/immutable/chunks/BdXWsCWd.js +0 -3
  50. package/dist/webui/_app/immutable/chunks/BkjUgGsE.js +0 -1
  51. package/dist/webui/_app/immutable/chunks/CQD9uzpA.js +0 -1
  52. package/dist/webui/_app/immutable/chunks/DXKynIUR.js +0 -1
  53. package/dist/webui/_app/immutable/chunks/E8LHILEh.js +0 -1
  54. package/dist/webui/_app/immutable/chunks/myIHotqu.js +0 -2
  55. package/dist/webui/_app/immutable/chunks/p_ObVaZi.js +0 -5
  56. package/dist/webui/_app/immutable/entry/start.BqwTCU7F.js +0 -1
  57. package/dist/webui/_app/immutable/nodes/0.uOFdFHyI.js +0 -234
@@ -0,0 +1 @@
1
+ import{ut as e}from"./CmCJ0SKP.js";import{A as t,C as n,D as r,M as i,S as a,T as o,a as s,d as ee,h as te,j as ne,m as c,o as l,s as u,t as d}from"./DlsPNMHX.js";import{n as f}from"./1aUphu7Y.js";var p=`sc.composer.busyEnter`,m=`sc.composer.draft.`;function re(){try{return localStorage.getItem(p)===`steer`?`steer`:`queue`}catch{return`queue`}}var h=e({mode:re()});function ie(){return h.mode}function ae(e){h.mode=e;try{localStorage.setItem(p,e)}catch{}}function oe(e,t){return e?t===`queue`?`steer`:`queue`:t}var g=e({items:[]}),_=0;function se(e){_+=1,g.items=[...g.items,{id:_,text:e}]}function v(e){let t=g.items.findIndex(t=>t.text===e);t>=0&&(g.items=g.items.filter((e,n)=>n!==t))}function ce(){g.items=[]}function y(e,t){try{t.length===0?localStorage.removeItem(m+e):localStorage.setItem(m+e,t)}catch{}}function le(e){try{return localStorage.getItem(m+e)??``}catch{return``}}var b=`__new__`,x=e({text:``,images:[],files:[],references:[],editing:null}),S=new Map,C=b,w=0;function ue(){return{text:``,images:[],files:[],references:[],editing:null}}function de(){return{text:x.text,images:[...x.images],files:[...x.files],references:[...x.references],editing:x.editing}}function T(e){x.text=e.text,x.images=e.images,x.files=e.files,x.references=e.references,x.editing=e.editing}function fe(e){w+=1;let t=w;return x.references=[...x.references,{...e,uid:t}],t}function pe(e){x.references=x.references.filter(t=>t.uid!==e)}function me(e){if(e===C)return;y(C,de().text),S.set(C,de());let t=S.get(e)??ue();S.delete(e),C=e,t.text.length===0&&(t.text=le(e)),T(t)}function he(e){S.delete(e),y(e,``),e===C&&T(ue())}function ge(e,t){if(e===t)return;let n=S.get(e);n!==void 0&&(S.delete(e),y(e,``),y(t,n.text),C===t?T(n):S.has(t)||S.set(t,n))}function _e(e){x.editing=e,x.text=e}function ve(){x.editing=null}var ye={"image/png":!0,"image/jpeg":!0,"image/webp":!0,"image/gif":!0},E={maxCount:4,maxSizeBytes:4194304},D={maxCount:2,maxSizeBytes:524288};function O(e,t){let n={tooMany:`Too many attachments: ${t}. Nothing was added.`,fileTooLarge:`"${t}" exceeds its size limit. Nothing was added.`,unsupportedType:`Unsupported attachment type: ${t}. Nothing was added.`};f(n[e])}var k=e({pending:0});function A(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=String(r.result??``);t(e.slice(e.indexOf(`,`)+1))},r.onerror=()=>n(r.error),r.readAsDataURL(e)})}async function j(e){let t=[...e].filter(e=>!e.type.startsWith(`image/`));if(t.length===0)return;if(x.files.length+t.length>D.maxCount){O(`tooMany`,`at most ${D.maxCount} file attachments`);return}let n=t.find(e=>e.size>D.maxSizeBytes);if(n){O(`fileTooLarge`,n.name);return}k.pending+=1;try{let e=await Promise.all(t.map(async e=>({name:e.name,data:await A(e)})));x.files=[...x.files,...e]}finally{--k.pending}}async function M(e){let t=[...e];if(t.length===0)return;let n=t.find(e=>!(e.type in ye));if(n){O(`unsupportedType`,n.type||`unknown`);return}if(x.images.length+t.length>E.maxCount){O(`tooMany`,`at most ${E.maxCount} images`);return}let r=t.find(e=>e.size>E.maxSizeBytes);if(r){O(`fileTooLarge`,r.name);return}k.pending+=1;try{let e=await Promise.all(t.map(async e=>{let t=await A(e);return{mediaType:e.type,data:t,...e.name?{name:e.name}:{},preview:`data:${e.type};base64,${t}`}}));x.images=[...x.images,...e]}finally{--k.pending}}function be(e){let t=[...e.dataTransfer?.files??[]],n=t.filter(e=>e.type.startsWith(`image/`)),r=t.filter(e=>!e.type.startsWith(`image/`));t.length>0&&e.preventDefault(),n.length>0&&M(n),r.length>0&&j(r)}function xe(e){if(e.length!==0){if(x.images.length+e.length>E.maxCount){O(`tooMany`,`at most ${E.maxCount} images`);return}x.images=[...x.images,...e.map(e=>({path:e.path,name:e.name,...e.preview===void 0?{}:{preview:e.preview}}))]}}function Se(e){if(e.length!==0){if(x.files.length+e.length>D.maxCount){O(`tooMany`,`at most ${D.maxCount} file attachments`);return}x.files=[...x.files,...e.map(e=>({name:e.name,path:e.path}))]}}var Ce=d(s),we=d(s),Te=d(s),Ee=d(s),De=d(s),Oe=d(s),ke=d(s),Ae=d(s),N=d(s),je=d(s),Me=d(s),P=`skill-creator.agentPanelWidth.v1`;function F(e){return Number.isFinite(e)?Math.min(720,Math.max(320,Math.round(e))):440}function Ne(){try{let e=sessionStorage.getItem(P);return e===null?440:F(Number(e))}catch{return 440}}var I=e({open:!1,seed:null,width:Ne()}),L=null,R=e({sessionId:null,status:`idle`,mode:null,pendingMode:`free`,items:[],todos:[],turnStartedAt:null,cursor:0,sending:!1,error:null,promptError:null,lastUsage:null}),z=e({loaded:!1,loading:!1,sessions:[],error:null}),B=e({items:[]}),V=e({view:null,loading:!1,updating:!1,error:null}),H=null,U=[],W=null,G=new Map;function Pe(e){I.open=e,e&&!z.loaded&&!z.loading&&q(),e&&R.sessionId&&X(),e||Z()}function Fe(e){I.width=F(e);try{sessionStorage.setItem(P,String(I.width))}catch{}}var K=0;async function q(){if(l()===null){if(K>=25)return;K+=1,setTimeout(()=>void q(),300);return}K=0;let e=Ce.issue();z.loading=!0;try{let t=await u().agent.sessions.list({});if(!e.isCurrent())return;z.sessions=t.sessions,z.loaded=!0,z.error=null}catch(t){if(!e.isCurrent())return;z.error=t instanceof Error?t.message:String(t)}finally{e.isCurrent()&&(z.loading=!1)}}async function Ie(e){let t=je.issue();try{let n=await u().agent.sessions.cleanup(e);if(!t.isCurrent())return null;if(n.kind===`summary`&&R.sessionId!==null){let e=R.sessionId;(n.deletedIds??[]).includes(e)?J():n.deletedIdsTruncated===!0&&(await q(),t.isCurrent()&&!z.sessions.some(t=>t.sessionId===e&&t.hasTranscript!==!1)&&J())}return z.loaded=!1,q(),n}catch(e){return t.isCurrent()?{error:e instanceof Error?e.message:String(e)}:null}}async function Le(e,t,n){let r=we.issue();R.sending=!0;try{let i=await u().agent.session.create({...e?{prompt:e}:{},...t?{mode:t}:{},...n?{metadata:n}:{}});if(!r.isCurrent())return;n!==void 0&&(L=null),He(i.session.sessionId,i.session.status,i.session.mode),z.loaded=!1,q(),X()}catch(e){if(!r.isCurrent())return;R.error=e instanceof Error?e.message:String(e)}finally{r.isCurrent()&&(R.sending=!1)}}function Re(e,t){ze(t),J(),I.open=!0,R.pendingMode=e}function ze(e){L=null,e!==void 0&&(I.seed={text:e})}function Be(e){J(),I.open=!0;let t={kind:`test-run`,workspaceId:e.skill.workspaceId,providerId:e.skill.providerId,skillId:e.skill.skillId,revision:e.revision,templateId:e.templateId,templateVersion:e.templateVersion};I.seed={text:e.text,reference:{kind:`skill`,token:`$${e.skillName}`,target:e.skill.skillId,label:e.skillName,skill:e.skill},metadata:t},L=t,R.pendingMode=`free`}function J(){L=null,Z(),R.sessionId=null,R.status=`idle`,R.mode=null,R.pendingMode=`free`,R.items=[],R.todos=[],R.turnStartedAt=null,R.cursor=0,R.error=null,R.promptError=null,R.lastUsage=null,U=[],W=null,G=new Map,me(b),he(b)}function Ve(e){R.sessionId!==e&&(He(e,`idle`,z.sessions.find(t=>t.sessionId===e)?.mode??`free`),X())}function He(e,t,n){R.sessionId=e,R.status=t,R.mode=n,R.items=[],R.todos=[],R.turnStartedAt=null,R.cursor=0,R.error=null,R.lastUsage=null,U=[],W=null,G=new Map,ce(),B.items=[],Y(),me(e)}async function Ue(e){let t=R.sessionId;if(!t||R.mode===e)return!1;if(R.status===`running`)return R.error=`Switch modes after the current turn ends.`,!1;let n=Ae.issue();try{let r=await u().agent.session.setMode({sessionId:t,mode:e});return!n.isCurrent()||R.sessionId!==t?!1:(R.mode=r.session.mode,R.status=r.session.status,R.error=null,z.loaded=!1,q(),X(),!0)}catch(e){return n.isCurrent()&&(R.error=e instanceof Error?e.message:String(e)),!1}}async function We(e,t=[],n=[],r=`queue`,i=[]){if(e.trim().length===0&&t.length===0&&n.length===0)return;if(r===`queue`&&R.status===`running`&&se(e),!R.sessionId){if(await Le(void 0,R.pendingMode,L??void 0),!R.sessionId)return;ge(b,R.sessionId)}let a=R.sessionId,o=Ee.issue();R.sending=!0;let s=t.filter(e=>e.preview===void 0).map(e=>e.name??`image`);R.items.push({kind:`user`,seq:-Date.now(),text:e,...t.some(e=>e.preview!==void 0)?{images:t.flatMap(e=>e.preview===void 0?[]:[e.preview])}:{},...n.length>0||s.length>0?{files:[...n.map(e=>e.name??`file`),...s]}:{}}),U.push(e);try{if(await u().agent.session.prompt({sessionId:a,text:e,mode:r,images:t.map(e=>{if(e.path!==void 0)return{path:e.path,...e.name?{name:e.name}:{}};if(e.mediaType===void 0||e.data===void 0)throw Error(`image attachment needs either path or mediaType+data`);return{mediaType:e.mediaType,data:e.data,...e.name?{name:e.name}:{}}}),files:n.map(e=>{if(e.path!==void 0)return{path:e.path};if(e.name===void 0||e.data===void 0)throw Error(`file attachment needs either path or name+data`);return{name:e.name,data:e.data}}),references:i.map(e=>e.kind===`file`?{kind:`file`,path:e.target}:e.kind===`skill`?{kind:`skill`,workspaceId:e.skill.workspaceId,providerId:e.skill.providerId,skillId:e.skill.skillId}:{kind:`session`,sessionId:e.target})}),!o.isCurrent())return;R.promptError=null,he(a),r===`queue`&&Y()}catch(t){if(!o.isCurrent())return;R.promptError=t instanceof Error?t.message:String(t),v(e);let n=U.indexOf(e);n>=0&&U.splice(n,1)}finally{o.isCurrent()&&(R.sending=!1)}X()}async function Ge(){let e=R.sessionId;if(e){try{await u().agent.session.cancel({sessionId:e})}catch(e){R.error=e instanceof Error?e.message:String(e)}X()}}async function Y(){let e=R.sessionId;if(!e){B.items=[];return}let t=Me.issue();try{let n=await u().agent.queue.list({sessionId:e});if(!t.isCurrent()||R.sessionId!==e)return;B.items=n.items}catch{}}async function Ke(e){let t=R.sessionId;if(!t)return null;let n=e.action===`edit`?{sessionId:t,messageId:e.messageId,action:`edit`,text:e.text}:e.action===`remove`?{sessionId:t,messageId:e.messageId,action:`remove`}:{sessionId:t,messageId:e.messageId,action:`steer`};try{return await u().agent.queue.update(n),await Y(),{updated:!0}}catch(e){return Y(),{error:e instanceof Error?e.message:String(e)}}}async function qe(e,t){let n=R.sessionId;if(!n)return;let r=De.issue();try{if(await u().agent.session.answer({sessionId:n,requestSeq:e,answers:t}),!r.isCurrent())return;for(let t of R.items)t.kind===`approval`&&t.seq===e&&(t.resolved=!0)}catch(e){if(!r.isCurrent())return;R.error=e instanceof Error?e.message:String(e)}X()}async function X(){let e=R.sessionId;if(!e)return;let t=Te.issue();try{let n=await u().agent.session.stream({sessionId:e,afterSeq:R.cursor,limit:100});if(!t.isCurrent()||R.sessionId!==e)return;R.status=n.status;for(let e of n.frames)ot(e),R.cursor=Math.max(R.cursor,e.seq);R.error=null}catch(e){if(!t.isCurrent())return;R.error=e instanceof Error?e.message:String(e),Z();return}Je()}function Je(){Z();let e=R.items.some(e=>e.kind===`approval`&&!e.resolved);if(R.status===`running`||e){R.sessionId;let e=R.status===`running`?450:1200;H=setTimeout(()=>{X()},e)}}function Z(){H!==null&&(clearTimeout(H),H=null)}function Ye(e,t,n){for(let t=R.items.length-1;t>=0;t--){let r=R.items[t];if(r.kind===`turn`)break;if(r.kind===e){r.streaming&&=(r.text=n,!1);return}}R.items.push({kind:e,seq:t,text:n,streaming:!1})}function Xe(e){let t=e?.usage;if(!t)return null;let n=t.inputTokens??t.promptTokens??t.input_tokens??0,r=t.outputTokens??t.completionTokens??t.output_tokens??0;return n>0||r>0?{inputTokens:n,outputTokens:r}:null}function Q(e,t){for(let n=R.items.length-1;n>=0;n--){let r=R.items[n];if(r.kind===`turn`)return null;if(r.kind===`tool`&&r.result===void 0){if(e!==void 0){if(r.toolCallId===e)return r;continue}if(r.toolName===t)return r}}return null}var Ze=r({isError:o(!0).optional(),error:ne([t().min(1),r()]).optional()}).passthrough();function $(e){let t=Ze.safeParse(e);return t.success?t.data.isError===!0||t.data.error!==void 0:!1}var Qe=r({attachments:n(i()).optional()}).passthrough();function $e(e){let t=Qe.safeParse(e),n=t.success?t.data.attachments:void 0;if(!Array.isArray(n)||n.length===0)return null;let r=[],i=[],a=[];for(let e of n){let t=te.safeParse(e);if(t.success){if(t.data.kind===`image`&&t.data.thumb!==void 0)r.push(t.data.thumb);else{let e=t.data.name??(t.data.kind===`image`?`image`:`file`);i.push(e),t.data.kind===`image`&&a.push(e)}}}return r.length>0||i.length>0?{images:r,files:i,imageChipNames:a}:null}var et=r({todos:n(i())}),tt=r({content:t(),status:t()}),nt=r({questions:n(ee)}),rt=r({from:c,to:c}),it=r({childId:t().min(1),mode:a([`one-shot`,`continuable`]),label:t().optional()});function at(e){let t=et.safeParse(e);if(!t.success)return null;let n=[];for(let e of t.data.todos){let t=tt.safeParse(e);t.success&&n.push(t.data)}return n}function ot(e){switch(e.kind){case`turn-start`:R.turnStartedAt=e.at,G=new Map,R.items.push({kind:`turn`,seq:e.seq,label:`Turn`});break;case`status`:R.items.push({kind:`status`,seq:e.seq,text:JSON.stringify(e.payload??{})});break;case`auto-compact`:typeof e.text==`string`&&e.text.length>0&&R.items.push({kind:`note`,seq:e.seq,text:e.text});break;case`subagent`:{let t=it.safeParse(e.payload);if(!t.success)break;let n=typeof e.text==`string`&&e.text.length>0?e.text:t.data.childId;R.items.push({kind:`subagent`,seq:e.seq,label:n,mode:t.data.mode});break}case`user-text`:if(typeof e.text==`string`&&e.text.length>0){v(e.text),Y();let t=U.indexOf(e.text);if(t>=0){U.splice(t,1);break}let n=$e(e.payload);R.items.push({kind:`user`,seq:e.seq,text:e.text,...n&&n.images.length>0?{images:n.images}:{},...n&&n.files.length>0?{files:n.files}:{},...n&&n.imageChipNames.length>0?{imageChipNames:n.imageChipNames}:{}})}break;case`assistant-delta`:if(typeof e.text==`string`&&e.text.length>0){let t=R.items[R.items.length-1];t?.kind===`assistant`&&t.streaming?t.text+=e.text:R.items.push({kind:`assistant`,seq:e.seq,text:e.text,streaming:!0})}break;case`assistant-reasoning-delta`:if(typeof e.text==`string`&&e.text.length>0){let t=R.items[R.items.length-1];t?.kind===`reasoning`&&t.streaming?t.text+=e.text:R.items.push({kind:`reasoning`,seq:e.seq,text:e.text,streaming:!0})}break;case`assistant-reasoning`:typeof e.text==`string`&&e.text.length>0&&Ye(`reasoning`,e.seq,e.text);break;case`todo-snapshot`:{let t=at(e.payload);t!==null&&(R.todos=t);break}case`session-title`:{let t=typeof e.text==`string`?e.text.trim():``;if(t.length>0)for(let n of z.sessions)n.sessionId===e.sessionId&&(n.title=t);break}case`assistant-text`:if(typeof e.text==`string`&&e.text.length>0){Ye(`assistant`,e.seq,e.text);let t=Xe(e.payload);t&&(R.lastUsage=t,W=t)}break;case`tool-args-delta`:if(typeof e.text==`string`&&e.text.length>0&&e.toolCallId){let t=Q(e.toolCallId,e.toolName??``);if(t&&t.toolCallId===e.toolCallId&&t.phase===`calling`)t.argsText=(t.argsText??``)+e.text;else if(!t){let t=G.get(e.toolCallId);G.set(e.toolCallId,{...e.toolName?{name:e.toolName}:{},text:(t?.text??``)+e.text})}}break;case`tool-call`:{let t=e.toolName??`tool`,n=e.toolCallId;if(n!==void 0&&Q(n,t)!==null)break;let r=n===void 0?void 0:G.get(n);n!==void 0&&G.delete(n);let i;e.payload!==void 0&&e.payload!==null&&(i=typeof e.payload==`string`?e.payload:st(e.payload)),(i===void 0||i.length===0)&&r&&(i=r.text),R.items.push({kind:`tool`,seq:e.seq,...n===void 0?{}:{toolCallId:n},toolName:t,...i!==void 0&&i.length>0?{argsText:i}:{},phase:`calling`,startedAt:e.at});break}case`tool-result`:{let t=e.toolName??`tool`,n=Q(e.toolCallId,t);if(n){n.result=e.payload,n.phase=$(e.payload)?`error`:`done`,n.endedAt=e.at;break}R.items.push({kind:`tool`,seq:e.seq,...e.toolCallId===void 0?{}:{toolCallId:e.toolCallId},toolName:t,result:e.payload,phase:$(e.payload)?`error`:`done`,startedAt:e.at,endedAt:e.at});break}case`turn-end`:{let t=typeof e.text==`string`&&e.text.length>0?e.text:`completed`;Y();let n=W;W=null;let r=R.turnStartedAt,i=r===null||Number.isNaN(Date.parse(r))||Number.isNaN(Date.parse(e.at))?void 0:Math.max(0,Date.parse(e.at)-Date.parse(r));R.items.push({kind:`turn-end`,seq:e.seq,reason:t,...n?{usage:n}:{},...i===void 0?{}:{elapsedMs:i}});break}case`approval-request`:{let t=nt.safeParse(e.payload);if(!t.success)break;R.items.push({kind:`approval`,seq:e.seq,questions:t.data.questions,resolved:!1});break}case`approval-resolved`:for(let e of R.items)e.kind===`approval`&&(e.resolved=!0);break;case`mode-changed`:{let t=rt.safeParse(e.payload);if(!t.success)break;R.items.push({kind:`mode`,seq:e.seq,from:t.data.from,to:t.data.to}),R.mode=t.data.to;break}}R.items.length>500&&R.items.splice(0,R.items.length-500)}function st(e){try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}async function ct(){let e=Oe.issue();V.loading=!0;try{let t=await u().agent.settings.get({});return e.isCurrent()?(V.view=t,V.error=null,{view:t,error:null}):{view:null,error:null}}catch(t){if(!e.isCurrent())return{view:null,error:null};let n=t instanceof Error?t.message:String(t);return V.error=n,{view:null,error:n}}finally{e.isCurrent()&&(V.loading=!1)}}async function lt(e){let t=ke.issue();V.updating=!0;try{let n=await u().agent.settings.update(e);return t.isCurrent()?(n.outcome===`updated`&&(V.view=n.view),n):null}catch(e){return t.isCurrent()?{outcome:`error`,message:e instanceof Error?e.message:String(e)}:null}finally{t.isCurrent()&&(V.updating=!1)}}async function ut(e){try{let t=l();return t===null?null:await t.agent.files.pickFiles({mode:e})}catch(e){return f(`File picker failed: ${e instanceof Error?e.message:String(e)}`),null}}async function dt(e){try{let t=l();if(t===null)return null;let n=await t.agent.files.preview({path:e});return n.kind===`image`?n.dataUrl:null}catch{return null}}async function ft(e){await Promise.all(e.map(async e=>{let t=await dt(e.path);if(t===null)return;let n=x.images.find(t=>t.path===e.path&&t.name===e.name&&t.preview===void 0);n!==void 0&&(n.preview=t)}))}async function pt(e,t){let n=N.issue();V.updating=!0;try{let r=await u().agent.credentials.set({provider:e,apiKey:t});return n.isCurrent()?(r.outcome===`stored`&&(V.view=r.view),r):null}catch(e){return n.isCurrent()?{outcome:`rejected`,code:`NETWORK`,detail:e instanceof Error?e.message:String(e)}:null}finally{n.isCurrent()&&(V.updating=!1)}}async function mt(e){let t=N.issue();V.updating=!0;try{let n=await u().agent.credentials.clear({provider:e});if(!t.isCurrent())return;V.view=n}catch(e){if(!t.isCurrent())return;V.error=e instanceof Error?e.message:String(e)}finally{t.isCurrent()&&(V.updating=!1)}}async function ht(e){let t=l();if(t===null)return null;try{return await t.agent.settings.testConnection(e)}catch(e){return{outcome:`failed`,detail:e instanceof Error?e.message:String(e)}}}export{xe as A,oe as B,ht as C,M as D,j as E,be as F,pe as I,h as L,k as M,_e as N,fe as O,ve as P,ie as R,Re as S,lt as T,ae as V,We as _,z as a,Fe as b,Ge as c,ft as d,q as f,Ve as g,Be as h,R as i,x as j,Se as k,Ie as l,ut as m,B as n,qe as o,ct as p,V as r,J as s,I as t,mt as u,pt as v,Ke as w,Ue as x,Pe as y,g as z};
@@ -1 +1 @@
1
- import{$ as e,ut as t}from"./CmCJ0SKP.js";import{a as n,s as r,t as i}from"./CPbfZBJo.js";import{a}from"./D3qCeXbe.js";import{n as o}from"./1aUphu7Y.js";function s(e){return r().creator.save(e)}function c(e,t){return r().creator.load({...e,skillId:t})}async function l(e){await r().creator.remove({workspaceId:e.target.workspaceId,providerId:e.target.providerId,skillId:e.skillId,expectedRevision:e.expectedRevision})}var u=i(n),d=i(n),f=i(n),p=i(n),m=i(n),h=t({target:null,skills:[],selected:null,loading:!1,refreshing:!1,error:null,query:``});async function g(t){let n=u.issue(),i=()=>n.isCurrent()&&x(h.target,t),a=e(()=>!x(h.target,t)),o=e(()=>h.skills.length>0);a&&(d.invalidate(),h.target=t,h.skills=[],h.selected=null),h.loading=!o,h.refreshing=o,h.error=null;try{let{skills:e}=await r().skills.list({...t,includeDisabled:!0});if(!i())return;h.skills=e,h.selected&&!e.some(e=>e.id===h.selected?.id)&&(h.selected=null)}catch(e){if(!i())return;h.error=e instanceof Error?e.message:String(e)}finally{n.isLatest()&&(h.loading=!1,h.refreshing=!1)}}async function _(e){let t=h.target;if(!t)return;let n=d.issue(),i=()=>n.isCurrent()&&x(h.target,t);h.error=null;try{let n=await r().skills.info({...t,skillId:e,includeDisabled:!0});i()&&(h.selected=n)}catch(e){if(!i())return;h.error=e instanceof Error?e.message:String(e)}}async function v(e,t){let n=h.target;if(!n)return null;let i=f.issue(),a=()=>i.isCurrent()&&x(h.target,n),o;try{o=await r().skills.toggle({...n,skillIds:e,mode:t})}catch(e){if(!a())return null;throw e}return!a()||(await g(n),!a())?null:(h.selected&&e.includes(h.selected.id)&&await _(h.selected.id),a()?o:null)}async function y(e){let t=h.target;if(!t)return null;let n=p.issue(),i=()=>n.isCurrent()&&x(h.target,t);try{let n=await r().skills.validate({...t,skillId:e});return i()?n:null}catch(e){if(!i())return null;throw e}}function b(e,t){return r().skills.info({...e,skillId:t,includeDisabled:!0})}function x(e,t){return e?.workspaceId===t?.workspaceId&&e?.providerId===t?.providerId}var S=t({query:``,results:[],searching:!1,error:null});async function C(e,t=20){let n=e.trim();if(!n){E();return}let i=m.issue();S.query=n,S.searching=!0;try{let{results:e}=await r().skills.search({query:n,limit:t});if(!i.isCurrent())return;S.results=e,S.error=null}catch(e){if(!i.isCurrent())return;S.error=e instanceof Error?e.message:String(e),console.debug(`[skill-search] search failed`,S.error)}finally{i.isLatest()&&(S.searching=!1)}}var w=!1;async function T(){if(!w){w=!0;try{await r().skills.searchConfig.open({})}catch(e){o(e instanceof Error?e.message:String(e))}finally{w=!1}}}function E(){m.invalidate(),S.query=``,S.results=[],S.searching=!1,S.error=null}function D(e,t){let n=a.workspaces.find(t=>t.id===e);if(!n)return`${e} / ${t}`;let r=n.providers.find(e=>e.id===t);return`${n.label} / ${r?.label??t}`}var O=t({groups:[],loading:!1,error:null}),k=i(n);async function A(){let e=k.issue();O.loading=!0,O.error=null;try{let{groups:t}=await r().skills.duplicates({});if(!e.isCurrent())return;O.groups=t}catch(t){if(!e.isCurrent())return;O.error=t instanceof Error?t.message:String(t),console.debug(`[skill-search] duplicates load failed`,O.error)}finally{e.isLatest()&&(O.loading=!1)}}export{T as a,S as c,x as d,v as f,s as g,l as h,g as i,O as l,c as m,D as n,E as o,y as p,A as r,C as s,b as t,h as u};
1
+ import{$ as e,ut as t}from"./CmCJ0SKP.js";import{a as n,s as r,t as i}from"./DlsPNMHX.js";import{a}from"./BgJCuTDs.js";import{n as o}from"./1aUphu7Y.js";function s(e){return r().creator.save(e)}function c(e,t){return r().creator.load({...e,skillId:t})}async function l(e){await r().creator.remove({workspaceId:e.target.workspaceId,providerId:e.target.providerId,skillId:e.skillId,expectedRevision:e.expectedRevision})}var u=i(n),d=i(n),f=i(n),p=i(n),m=i(n),h=t({target:null,skills:[],selected:null,loading:!1,refreshing:!1,error:null,query:``});async function g(t){let n=u.issue(),i=()=>n.isCurrent()&&x(h.target,t),a=e(()=>!x(h.target,t)),o=e(()=>h.skills.length>0);a&&(d.invalidate(),h.target=t,h.skills=[],h.selected=null),h.loading=!o,h.refreshing=o,h.error=null;try{let{skills:e}=await r().skills.list({...t,includeDisabled:!0});if(!i())return;h.skills=e,h.selected&&!e.some(e=>e.id===h.selected?.id)&&(h.selected=null)}catch(e){if(!i())return;h.error=e instanceof Error?e.message:String(e)}finally{n.isLatest()&&(h.loading=!1,h.refreshing=!1)}}async function _(e){let t=h.target;if(!t)return;let n=d.issue(),i=()=>n.isCurrent()&&x(h.target,t);h.error=null;try{let n=await r().skills.info({...t,skillId:e,includeDisabled:!0});i()&&(h.selected=n)}catch(e){if(!i())return;h.error=e instanceof Error?e.message:String(e)}}async function v(e,t){let n=h.target;if(!n)return null;let i=f.issue(),a=()=>i.isCurrent()&&x(h.target,n),o;try{o=await r().skills.toggle({...n,skillIds:e,mode:t})}catch(e){if(!a())return null;throw e}return!a()||(await g(n),!a())?null:(h.selected&&e.includes(h.selected.id)&&await _(h.selected.id),a()?o:null)}async function y(e){let t=h.target;if(!t)return null;let n=p.issue(),i=()=>n.isCurrent()&&x(h.target,t);try{let n=await r().skills.validate({...t,skillId:e});return i()?n:null}catch(e){if(!i())return null;throw e}}function b(e,t){return r().skills.info({...e,skillId:t,includeDisabled:!0})}function x(e,t){return e?.workspaceId===t?.workspaceId&&e?.providerId===t?.providerId}var S=t({query:``,results:[],searching:!1,error:null});async function C(e,t=20){let n=e.trim();if(!n){E();return}let i=m.issue();S.query=n,S.searching=!0;try{let{results:e}=await r().skills.search({query:n,limit:t});if(!i.isCurrent())return;S.results=e,S.error=null}catch(e){if(!i.isCurrent())return;S.error=e instanceof Error?e.message:String(e),console.debug(`[skill-search] search failed`,S.error)}finally{i.isLatest()&&(S.searching=!1)}}var w=!1;async function T(){if(!w){w=!0;try{await r().skills.searchConfig.open({})}catch(e){o(e instanceof Error?e.message:String(e))}finally{w=!1}}}function E(){m.invalidate(),S.query=``,S.results=[],S.searching=!1,S.error=null}function D(e,t){let n=a.workspaces.find(t=>t.id===e);if(!n)return`${e} / ${t}`;let r=n.providers.find(e=>e.id===t);return`${n.label} / ${r?.label??t}`}var O=t({groups:[],loading:!1,error:null}),k=i(n);async function A(){let e=k.issue();O.loading=!0,O.error=null;try{let{groups:t}=await r().skills.duplicates({});if(!e.isCurrent())return;O.groups=t}catch(t){if(!e.isCurrent())return;O.error=t instanceof Error?t.message:String(t),console.debug(`[skill-search] duplicates load failed`,O.error)}finally{e.isLatest()&&(O.loading=!1)}}export{T as a,S as c,x as d,v as f,s as g,l as h,g as i,O as l,c as m,D as n,E as o,y as p,A as r,C as s,b as t,h as u};
@@ -0,0 +1 @@
1
+ import{o as e,s as t,ut as n}from"./CmCJ0SKP.js";import"./xihTtKlq.js";import{t as r}from"./BkEnd9_Z.js";import{a as i,o as a,t as o}from"./DlsPNMHX.js";import{K as s}from"./Crg8KRap.js";var c=new Set([`$$slots`,`$$events`,`$$legacy`]);function l(n,i){let a=e(i,c),o=[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}],[`path`,{d:`m7 16.5-4.74-2.85`}],[`path`,{d:`m7 16.5 5-3`}],[`path`,{d:`M7 16.5v5.17`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}],[`path`,{d:`m17 16.5-5-3`}],[`path`,{d:`m17 16.5 4.74-2.85`}],[`path`,{d:`M17 16.5v5.17`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}],[`path`,{d:`M12 8 7.26 5.15`}],[`path`,{d:`m12 8 4.74-2.85`}],[`path`,{d:`M12 13.5V8`}]];r(n,t({name:`boxes`},()=>a,{get iconNode(){return o}}))}var u=o(i),d=o(i),f=n({status:null,loading:!1});async function p(){let e=u.issue(),t=a();if(!t){e.isLatest()&&(f.loading=!1);return}f.loading=!0;try{let n=await t.selfSkill.state({});if(!e.isCurrent())return;f.status=n}catch{e.isCurrent()&&(f.status=null)}finally{e.isLatest()&&(f.loading=!1)}}async function m(e){let t=d.issue(),n=a();if(!n)return{ok:!1,reason:`Not connected to the daemon.`};try{let r=await n.selfSkill.resolve({backup:e});return r.ok&&t.isCurrent()&&p(),r}catch(e){return{ok:!1,reason:e instanceof Error?e.message:String(e)}}}async function h(){let e=d.issue(),t=a();if(!t)return{ok:!1,reason:`Not connected to the daemon.`};try{let n=await t.selfSkill.keep({});return n.ok&&e.isCurrent()&&p(),n}catch(e){return{ok:!1,reason:e instanceof Error?e.message:String(e)}}}var g=n({open:!1});function _(){g.open=!0}var v={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,transform:`translateX(-100%)`};s(v);var y=new Set([`$$slots`,`$$events`,`$$legacy`]);function b(n,i){let a=e(i,y),o=[[`path`,{d:`M12 10v6`}],[`path`,{d:`M9 13h6`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}]];r(n,t({name:`folder-plus`},()=>a,{get iconNode(){return o}}))}var x=new Set([`$$slots`,`$$events`,`$$legacy`]);function S(n,i){let a=e(i,x),o=[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}]];r(n,t({name:`message-square`},()=>a,{get iconNode(){return o}}))}var C=new Set([`$$slots`,`$$events`,`$$legacy`]);function w(n,i){let a=e(i,C),o=[[`path`,{d:`M13 21h8`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}]];r(n,t({name:`pen-line`},()=>a,{get iconNode(){return o}}))}export{g as a,p as c,l as d,v as i,m as l,S as n,_ as o,b as r,h as s,w as t,f as u};
@@ -0,0 +1,5 @@
1
+ import{$ as e,At as t,B as n,C as r,Ct as i,D as a,H as o,I as s,L as c,M as l,N as u,O as d,P as f,Q as p,R as m,St as h,U as g,X as _,Y as v,a as y,bt as b,dt as x,et as ee,f as S,ft as C,gt as w,it as T,jt as E,kt as te,l as ne,lt as re,mt as D,o as O,ot as k,pt as ie,q as A,rt as j,s as M,st as N,tt as ae,ut as oe,wt as se,xt as ce,yt as le,z as P}from"./CmCJ0SKP.js";import"./xihTtKlq.js";import{i as F,n as ue}from"./DnPeA-9c.js";import{t as de}from"./BEPs9Z9s.js";function fe(e){return typeof e==`function`}function pe(e){return typeof e==`object`&&!!e}var me=[`string`,`number`,`bigint`,`boolean`];function he(e){return e==null||me.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>he(e)):typeof e==`object`&&Object.getPrototypeOf(e)===Object.prototype}var I=Symbol(`box`),ge=Symbol(`is-writable`);function L(e,t){let n=w(e);return t?{[I]:!0,[ge]:!0,get current(){return _(n)},set current(e){t(e)}}:{[I]:!0,get current(){return e()}}}function _e(e){return pe(e)&&I in e}function ve(e){return _e(e)&&ge in e}function ye(e){return _e(e)?e:fe(e)?L(e):Se(e)}function be(e){return Object.entries(e).reduce((e,[t,n])=>_e(n)?(ve(n)?Object.defineProperty(e,t,{get(){return n.current},set(e){n.current=e}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function xe(e){return ve(e)?{[I]:!0,get current(){return e.current}}:e}function Se(e){let t=D(oe(e));return{[I]:!0,[ge]:!0,get current(){return _(t)},set current(e){C(t,e,!0)}}}function R(e){let t=D(oe(e));return{[I]:!0,[ge]:!0,get current(){return _(t)},set current(e){C(t,e,!0)}}}R.from=ye,R.with=L,R.flatten=be,R.readonly=xe,R.isBox=_e,R.isWritableBox=ve;function Ce(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var we=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Te=/\n/g,Ee=/^\s*/,De=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Oe=/^:\s*/,ke=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ae=/^[;\s]*/,je=/^\s+|\s+$/g,Me=`
2
+ `,Ne=`/`,Pe=`*`,z=``,Fe=`comment`,Ie=`declaration`;function Le(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(Te);t&&(n+=t.length);var i=e.lastIndexOf(Me);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Ee)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(Ne==e.charAt(0)&&Pe==e.charAt(1)){for(var n=2;z!=e.charAt(n)&&(Pe!=e.charAt(n)||Ne!=e.charAt(n+1));)++n;if(n+=2,z===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Fe,comment:o})}}function f(){var e=a(),t=c(De);if(t){if(d(),!c(Oe))return s(`property missing ':'`);var n=c(ke),r=e({type:Ie,property:Re(t[0].replace(we,z)),value:n?Re(n[0].replace(we,z)):z});return c(Ae),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Re(e){return e?e.replace(je,z):z}function ze(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Le(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var Be=/\d/,Ve=[`-`,`_`,`/`,`.`];function He(e=``){if(!Be.test(e))return e!==e.toLowerCase()}function Ue(e){let t=[],n=``,r,i;for(let a of e){let e=Ve.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=He(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function We(e){return e?Ue(e).map(e=>Ke(e)).join(``):``}function Ge(e){return qe(We(e||``))}function Ke(e){return e?e[0].toUpperCase()+e.slice(1):``}function qe(e){return e?e[0].toLowerCase()+e.slice(1):``}function Je(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[We(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[Ge(e)]=n}return ze(e,n),t}function B(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function Ye(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var Xe=Ye(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Ze(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${Xe(t)}: ${e[t]};`).join(`
3
+ `)}function Qe(e={}){return Ze(e).replace(`
4
+ `,` `)}var $e=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function et(e){return $e.has(e)}function V(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let i=e[n];if(i){for(let e of Object.keys(i)){let n=t[e],a=i[e],o=typeof n==`function`,s=typeof a==`function`;if(o&&typeof s&&et(e))t[e]=Ce(n,a);else if(o&&s)t[e]=B(n,a);else if(e===`class`){let i=he(n),o=he(a);i&&o?t[e]=r(n,a):i?t[e]=r(n):o&&(t[e]=r(a))}else if(e===`style`){let r=typeof n==`object`,i=typeof a==`object`,o=typeof n==`string`,s=typeof a==`string`;if(r&&i)t[e]={...n,...a};else if(r&&s){let r=Je(a);t[e]={...n,...r}}else if(o&&i)t[e]={...Je(n),...a};else if(o&&s){let r=Je(n),i=Je(a);t[e]={...r,...i}}else r?t[e]=n:i?t[e]=a:o?t[e]=n:s&&(t[e]=a)}else t[e]=a===void 0?n:a}for(let e of Object.getOwnPropertySymbols(i)){let n=t[e],r=i[e];t[e]=r===void 0?n:r}}}return typeof t.style==`object`&&(t.style=Qe(t.style).replaceAll(`
5
+ `,` `)),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}var tt=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function nt(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var rt=class extends Map{#e=new Map;#t=D(0);#n=D(0);#r=ee||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return ee===this.#r?D(e):ie(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else return _(this.#t),!1}return _(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else{_(this.#t);return}}return _(n),super.get(e)}getOrInsert(e,t){return super.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return super.has(e)||this.set(e,t(e)),this.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),C(this.#n,super.size),x(o);else if(i!==t){x(r);var s=o.reactions===null?null:new Set(o.reactions);(s===null||!r.reactions?.every(e=>s.has(e)))&&x(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),C(n,-1)),r&&(C(this.#n,super.size),x(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;C(this.#n,0);for(var t of e.values())C(t,-1);x(this.#t),e.clear()}}#a(){_(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)_(n)}keys(){return _(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return _(this.#n),super.size}};new class{#e;#t;constructor(e={}){let{window:t=tt,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=c(e=>{let n=A(t,`focusin`,e),r=A(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?nt(this.#e):null}};function it(e){return typeof e==`function`}var H=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return ce(this.#t)}get(){let e=b(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=b(this.#t);return t===void 0?e:t}set(e){return se(this.#t,e)}};function at(e,t){switch(e){case`post`:j(t);break;case`pre`:T(t)}}function ot(t,n,r,i={}){let{lazy:a=!1}=i,o=!a,s=Array.isArray(t)?[]:void 0;at(n,()=>{let n=Array.isArray(t)?t.map(e=>e()):t();if(!o){o=!0,s=n;return}let i=e(()=>r(n,s));return s=n,i})}function U(e,t,n){ot(e,`post`,t,n)}function st(e,t,n){ot(e,`pre`,t,n)}U.pre=st;function ct(e){return it(e)?e():e}var lt=class{#e={width:0,height:0};#t=!1;#n;#r;#i;#a=w(()=>(_(this.#s)?.(),this.getSize().width));#o=w(()=>(_(this.#s)?.(),this.getSize().height));#s=w(()=>{let e=ct(this.#r);if(e)return c(t=>{if(!this.#i)return;let n=new this.#i.ResizeObserver(e=>{this.#t=!0;for(let t of e){let e=this.#n.box===`content-box`?t.contentBoxSize:t.borderBoxSize,n=Array.isArray(e)?e:[e];this.#e.width=n.reduce((e,t)=>Math.max(e,t.inlineSize),0),this.#e.height=n.reduce((e,t)=>Math.max(e,t.blockSize),0)}t()});return n.observe(e),()=>{this.#t=!1,n.disconnect()}})});constructor(e,t={box:`border-box`}){this.#i=t.window??tt,this.#n=t,this.#r=e,this.#e={width:0,height:0}}calculateSize(){let e=ct(this.#r);if(!e||!this.#i)return;let t=e.offsetWidth,n=e.offsetHeight;if(this.#n.box===`border-box`)return{width:t,height:n};let r=this.#i.getComputedStyle(e),i=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),a=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom),o=parseFloat(r.borderLeftWidth)+parseFloat(r.borderRightWidth),s=parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth);return{width:t-i-o,height:n-a-s}}getSize(){return this.#t?this.#e:this.calculateSize()??this.#e}get current(){return _(this.#s)?.(),this.getSize()}get width(){return _(this.#a)}get height(){return _(this.#o)}};function W(e){j(()=>()=>{e()})}function ut(e,t){return setTimeout(t,e)}function G(e){p().then(e)}var dt=1,ft=9,pt=11;function mt(e){return pe(e)&&e.nodeType===dt&&typeof e.nodeName==`string`}function ht(e){return pe(e)&&e.nodeType===ft}function gt(e){return pe(e)&&e.constructor?.name===`VisualViewport`}function _t(e){return pe(e)&&e.nodeType!==void 0}function vt(e){return _t(e)&&e.nodeType===pt&&`host`in e}function yt(e,t){if(!e||!t||!mt(e)||!mt(t))return!1;let n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&vt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function bt(e){return ht(e)?e:gt(e)?e.document:e?.ownerDocument??document}function xt(e){return vt(e)?xt(e.host):ht(e)?e.defaultView??window:mt(e)?e.ownerDocument?.defaultView??window:window}function St(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var Ct=class{element;#e=w(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return _(this.#e)}set root(e){C(this.#e,e)}constructor(e){this.element=typeof e==`function`?L(e):e}getDocument=()=>bt(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>St(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function K(t,n){return{[v()]:r=>_e(t)?(t.current=r,e(()=>n?.(r)),()=>{`isConnected`in r&&r.isConnected||(t.current=null,n?.(null))}):(t(r),e(()=>n?.(r)),()=>{`isConnected`in r&&r.isConnected||(t(null),n?.(null))})}}function wt(e){return e?`true`:`false`}function q(e){return e?``:void 0}function Tt(e){return e?`open`:`closed`}function Et(e){return e===`starting`?{"data-starting-style":``}:e===`ending`?{"data-ending-style":``}:{}}function Dt(e,t){return t?`mixed`:e?`true`:`false`}var Ot=class{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(e=>[e,this.getAttr(e)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}};function kt(e){let t=new Ot(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}var At=`ArrowDown`,jt=`ArrowLeft`,Mt=`ArrowRight`,Nt=`ArrowUp`,Pt=`Enter`,Ft=`Home`,It=`PageDown`,Lt=`PageUp`;function Rt(e){return window.getComputedStyle(e).getPropertyValue(`direction`)}var zt=[At,Lt,Ft],Bt=[Nt,It,`End`];[...zt,...Bt];function Vt(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?jt:Mt,vertical:At}[t]}function Ht(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?Mt:jt,vertical:Nt}[t]}function Ut(e=`ltr`,t=`horizontal`){return[`ltr`,`rtl`].includes(e)||(e=`ltr`),[`horizontal`,`vertical`].includes(t)||(t=`horizontal`),{nextKey:Vt(e,t),prevKey:Ht(e,t)}}var Wt=typeof document<`u`,Gt=Kt();function Kt(){return Wt&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function J(e){return e instanceof HTMLElement}function qt(e){return e instanceof Element}function Jt(e){return e instanceof Element||e instanceof SVGElement}function Yt(e){return e!==null}function Xt(e){return e instanceof HTMLInputElement&&`select`in e}var Zt=class{#e;#t=R(null);constructor(e){this.#e=e}getCandidateNodes(){return this.#e.rootNode.current?this.#e.candidateSelector?Array.from(this.#e.rootNode.current.querySelectorAll(this.#e.candidateSelector)):this.#e.candidateAttr?Array.from(this.#e.rootNode.current.querySelectorAll(`[${this.#e.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){let e=this.getCandidateNodes();e.length&&e[0]?.focus()}handleKeydown(e,t,n=!1){let r=this.#e.rootNode.current;if(!r||!e)return;let i=this.getCandidateNodes();if(!i.length)return;let a=i.indexOf(e),{nextKey:o,prevKey:s}=Ut(Rt(r),this.#e.orientation.current),c=this.#e.loop.current,l={[o]:a+1,[s]:a-1,[Ft]:0,End:i.length-1};if(n){let e=o===`ArrowDown`?Mt:At,t=s===`ArrowUp`?jt:Nt;l[e]=a+1,l[t]=a-1}let u=l[t.key];if(u===void 0)return;t.preventDefault(),u<0&&c?u=i.length-1:u===i.length&&c&&(u=0);let d=i[u];if(d)return d.focus(),this.#t.current=d.id,this.#e.onCandidateFocus?.(d),d}getTabIndex(e){let t=this.getCandidateNodes(),n=this.#t.current!==null;return e&&!n&&t[0]===e?(this.#t.current=e.id,0):e?.id===this.#t.current?0:-1}setCurrentTabStopId(e){this.#t.current=e}focusCurrentTabStop(){let e=this.#t.current;if(!e)return;let t=this.#e.rootNode.current?.querySelector(`#${e}`);t&&J(t)&&t.focus()}},Qt=class{#e;#t=null;#n=null;#r=0;constructor(e){this.#e=e,W(()=>this.#i())}#i(){this.#t!==null&&(window.cancelAnimationFrame(this.#t),this.#t=null),this.#n?.disconnect(),this.#n=null,this.#r++}run(e){this.#i();let t=this.#e.ref.current;if(!t)return;if(typeof t.getAnimations!=`function`){this.#a(e);return}let n=this.#r,r=()=>{n===this.#r&&this.#a(e)},i=()=>{if(n!==this.#r)return;let e=t.getAnimations();if(e.length===0){r();return}Promise.all(e.map(e=>e.finished)).then(()=>{r()}).catch(()=>{if(n===this.#r){if(t.getAnimations().some(e=>e.pending||e.playState!==`finished`)){i();return}r()}})},a=()=>{this.#t=window.requestAnimationFrame(()=>{this.#t=null,i()})};if(!this.#e.afterTick.current){a();return}this.#t=window.requestAnimationFrame(()=>{this.#t=null;let e=`data-starting-style`;if(!t.hasAttribute(e)){a();return}this.#n=new MutationObserver(()=>{n===this.#r&&(t.hasAttribute(e)||(this.#n?.disconnect(),this.#n=null,a()))}),this.#n.observe(t,{attributes:!0,attributeFilter:[e]})})}#a(e){let t=()=>{e()};this.#e.afterTick?G(t):t()}},$t=class{#e;#t;#n;#r=D(!1);#i=D(void 0);#a=!1;#o=null;constructor(e){this.#e=e,C(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new Qt({ref:this.#e.ref,afterTick:this.#e.open}),W(()=>this.#s()),U(()=>this.#e.open.current,e=>{if(!this.#a){this.#a=!0;return}if(this.#s(),!e&&this.#e.shouldSkipExitAnimation?.()){C(this.#r,!1),C(this.#i,void 0),this.#e.onComplete?.();return}if(e&&C(this.#r,!0),C(this.#i,e?`starting`:`ending`,!0),e&&(this.#o=window.requestAnimationFrame(()=>{this.#o=null,this.#e.open.current&&C(this.#i,void 0)})),!this.#t){e||C(this.#r,!1),C(this.#i,void 0),this.#e.onComplete?.();return}this.#n.run(()=>{e===this.#e.open.current&&(this.#e.open.current||C(this.#r,!1),C(this.#i,void 0),this.#e.onComplete?.())})})}get shouldRender(){return _(this.#r)}get transitionStatus(){return _(this.#i)}#s(){this.#o!==null&&(window.cancelAnimationFrame(this.#o),this.#o=null)}};function Y(){}function X(e,t){return t===void 0?`bits-${e}`:`bits-${e}-${t}`}var en=kt({component:`dialog`,parts:[`content`,`trigger`,`overlay`,`title`,`description`,`close`,`cancel`,`action`]}),Z=new H(`Dialog.Root | AlertDialog.Root`),tn=class e{static create(t){let n=Z.getOr(null);return Z.set(new e(t,n))}opts;#e=D(null);get triggerNode(){return _(this.#e)}set triggerNode(e){C(this.#e,e,!0)}#t=D(null);get contentNode(){return _(this.#t)}set contentNode(e){C(this.#t,e,!0)}#n=D(null);get overlayNode(){return _(this.#n)}set overlayNode(e){C(this.#n,e,!0)}#r=D(null);get descriptionNode(){return _(this.#r)}set descriptionNode(e){C(this.#r,e,!0)}#i=D(void 0);get contentId(){return _(this.#i)}set contentId(e){C(this.#i,e,!0)}#a=D(void 0);get titleId(){return _(this.#a)}set titleId(e){C(this.#a,e,!0)}#o=D(void 0);get triggerId(){return _(this.#o)}set triggerId(e){C(this.#o,e,!0)}#s=D(void 0);get descriptionId(){return _(this.#s)}set descriptionId(e){C(this.#s,e,!0)}#c=D(null);get cancelNode(){return _(this.#c)}set cancelNode(e){C(this.#c,e,!0)}#l=D(0);get nestedOpenCount(){return _(this.#l)}set nestedOpenCount(e){C(this.#l,e,!0)}depth;parent;contentPresence;overlayPresence;constructor(e,t){this.opts=e,this.parent=t,this.depth=t?t.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new $t({ref:L(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new $t({ref:L(()=>this.overlayNode),open:this.opts.open,enabled:!0}),U(()=>this.opts.open.current,e=>{this.parent&&(e?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),W(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>en.getAttr(e,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=w(()=>({"data-state":Tt(this.opts.open.current)}));get sharedProps(){return _(this.#u)}set sharedProps(e){C(this.#u,e)}},nn=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),this.root.handleClose())}#e=w(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:``,onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return _(this.#e)}set props(e){C(this.#e,e)}},rn=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=K(this.opts.ref),U.pre(()=>this.opts.id.current,e=>{this.root.titleId=e})}#e=w(()=>({id:this.opts.id.current,role:`heading`,"aria-level":this.opts.level.current,[this.root.getBitsAttr(`title`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return _(this.#e)}set props(e){C(this.#e,e)}},an=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=K(this.opts.ref,e=>{this.root.descriptionNode=e}),U.pre(()=>this.opts.id.current,e=>{this.root.descriptionId=e})}#e=w(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`description`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return _(this.#e)}set props(e){C(this.#e,e)}},on=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref,e=>{this.root.contentNode=e,this.root.contentId=e?.id})}#e=w(()=>({open:this.root.opts.open.current}));get snippetProps(){return _(this.#e)}set snippetProps(e){C(this.#e,e)}#t=w(()=>({id:this.opts.id.current,role:this.root.opts.variant.current===`alert-dialog`?`alertdialog`:`dialog`,"aria-modal":`true`,"aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr(`content`)]:``,style:{pointerEvents:`auto`,outline:this.root.opts.variant.current===`alert-dialog`?`none`:void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:`layout style`},tabindex:this.root.opts.variant.current===`alert-dialog`?-1:void 0,"data-nested-open":q(this.root.nestedOpenCount>0),"data-nested":q(this.root.parent!==null),...Et(this.root.contentPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return _(this.#t)}set props(e){C(this.#t,e)}get shouldRender(){return this.root.contentPresence.shouldRender}},sn=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref,e=>this.root.overlayNode=e)}#e=w(()=>({open:this.root.opts.open.current}));get snippetProps(){return _(this.#e)}set snippetProps(e){C(this.#e,e)}#t=w(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`overlay`)]:``,style:{pointerEvents:`auto`,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":q(this.root.nestedOpenCount>0),"data-nested":q(this.root.parent!==null),...Et(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return _(this.#t)}set props(e){C(this.#t,e)}get shouldRender(){return this.root.overlayPresence.shouldRender}},cn=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`level`]),ln=n(`<div><!></div>`);function un(e,n){let r=o();i(n,!0);let a=y(n,`id`,19,()=>X(r)),s=y(n,`ref`,15,null),c=y(n,`level`,3,2),l=O(n,cn),f=rn.create({id:L(()=>a()),level:L(()=>c()),ref:L(()=>s(),e=>s(e))}),p=w(()=>V(l,f.props));var g=P(),v=N(g),b=e=>{var t=P(),r=N(t);d(r,()=>n.child,()=>({props:_(p)})),m(e,t)},x=e=>{var r=ln();S(r,()=>({..._(p)}));var i=k(r);d(i,()=>n.children??E),t(r),m(e,r)};u(v,e=>{n.child?e(b):e(x,-1)}),m(e,g),h()}function dn(e,t){var n=P(),r=N(n);l(r,()=>t.children,e=>{var n=P(),r=N(n);d(r,()=>t.children??E),m(e,n)}),m(e,n)}var fn=new H(`BitsConfig`);function pn(){let e=new mn(null,{});return fn.getOr(e).opts}var mn=class{opts;constructor(e,t){let n=hn(e,t);this.opts={defaultPortalTo:n(e=>e.defaultPortalTo),defaultLocale:n(e=>e.defaultLocale)}}};function hn(e,t){return n=>L(()=>{let r=n(t)?.current;if(r!==void 0)return r;if(e!==null)return n(e.opts)?.current})}function gn(e,t){return n=>{let r=pn();return L(()=>{let i=n();if(i!==void 0)return i;let a=e(r).current;return a===void 0?t:a})}}var _n=gn(e=>e.defaultPortalTo,`body`);function vn(e,t){i(t,!0);let n=_n(()=>t.to),r=le(),a=w(o);function o(){if(!Wt||t.disabled)return null;let e=null;return e=typeof n.current==`string`?document.querySelector(n.current):n.current,e}let c;function l(){c&&=(s(c),null)}U([()=>_(a),()=>t.disabled],([e,n])=>{if(!e||n){l();return}return c=f(dn,{target:e,props:{children:t.children},context:r}),()=>{l()}});var p=P(),g=N(p),v=e=>{var n=P(),r=N(n);d(r,()=>t.children??E),m(e,n)};u(g,e=>{t.disabled&&e(v)}),m(e,p),h()}var yn=class{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){let n=this.createEvent(t);return e.dispatchEvent(n),n}listen(e,t,n){return A(e,this.eventName,e=>{t(e)},n)}};function bn(e,t=500){let n=null,r=(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function xn(e,t){return e===t||e.contains(t)}function Sn(e){return e?.ownerDocument??document}function Cn(e){if(!e)return null;for(let t of e.childNodes)if(t.nodeType!==Node.COMMENT_NODE)return t;return null}function wn(e,t){let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}var Tn=[Pt,` `],En=[At,Lt,Ft],Dn=[Nt,It,`End`],On=[...En,...Dn];[...Tn],[...Tn];function Q(e){return e.pointerType===`mouse`}function kn(e,{select:t=!1}={}){if(!e||!e.focus)return;let n=bt(e);if(n.activeElement===e)return;let r=n.activeElement;e.focus({preventScroll:!0}),e!==r&&Xt(e)&&t&&e.select()}function An(e,{select:t=!1}={},n){let r=n();for(let i of e)if(kn(i,{select:t}),n()!==r)return!0}var jn=D(!1),Mn=class e{static _refs=0;static _cleanup;constructor(){j(()=>(e._refs===0&&(e._cleanup=ae(()=>{let e=[],t=e=>{C(jn,!1)};return e.push(A(document,`pointerdown`,t,{capture:!0}),A(document,`pointermove`,t,{capture:!0}),A(document,`keydown`,e=>{C(jn,!0)},{capture:!0})),B(...e)})),e._refs++,()=>{e._refs--,e._refs===0&&(C(jn,!1),e._cleanup?.())}))}get current(){return _(jn)}set current(e){C(jn,e,!0)}},Nn=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],Pn=Nn.join(`,`),Fn=typeof Element>`u`,$=Fn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,In=!Fn&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Ln=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):Ln(e.parentNode))},Rn=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},zn=function(e,t,n){if(Ln(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Pn));return t&&$.call(e,Pn)&&r.unshift(e),r=r.filter(n),r},Bn=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Ln(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Bn(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{$.call(a,Pn)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Ln(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Bn(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}}return r},Vn=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Hn=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Rn(e))&&!Vn(e)?0:e.tabIndex},Un=function(e,t){var n=Hn(e);return n<0&&t&&!Vn(e)?0:n},Wn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Gn=function(e){return e.tagName===`INPUT`},Kn=function(e){return Gn(e)&&e.type===`hidden`},qn=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Jn=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Yn=function(e){if(!e.name)return!0;var t=e.form||In(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Jn(r,e.form);return!i||i===e},Xn=function(e){return Gn(e)&&e.type===`radio`},Zn=function(e){return Xn(e)&&!Yn(e)},Qn=function(e){var t=e&&In(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=In(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},$n=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},er=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=$.call(e,`details>summary:first-of-type`)?e.parentElement:e;if($.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=In(e);if(s&&!s.shadowRoot&&r(s)===!0)return $n(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(Qn(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return $n(e);return!1},tr=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return $.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},nr=function(e,t){return!(t.disabled||Kn(t)||er(t,e)||qn(t)||tr(t))},rr=function(e,t){return!(Zn(t)||Hn(t)<0||!nr(e,t))},ir=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},ar=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Un(a,i),s=i?ar(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Wn).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},or=function(e,t){return t||={},ar(t.getShadowRoot?Bn([e],t.includeContainer,{filter:rr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ir}):zn(e,t.includeContainer,rr.bind(null,t)))},sr=function(e,t){return t||={},t.getShadowRoot?Bn([e],t.includeContainer,{filter:nr.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):zn(e,t.includeContainer,nr.bind(null,t))},cr=function(e,t){if(t||={},!e)throw Error(`No node provided`);return $.call(e,Pn)!==!1&&rr(t,e)},lr=Nn.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),ur=function(e,t){if(t||={},!e)throw Error(`No node provided`);return $.call(e,lr)!==!1&&nr(t,e)};function dr(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`}}function fr(e,t){if(!cr(e,dr()))return pr(e,t);let n=bt(e),r=or(n.body,dr());t===`prev`&&r.reverse();let i=r.indexOf(e);return i===-1?n.body:r.slice(i+1)[0]}function pr(e,t){let n=bt(e);if(!ur(e,dr()))return n.body;let r=sr(n.body,dr());t===`prev`&&r.reverse();let i=r.indexOf(e);return i===-1?n.body:r.slice(i+1).find(e=>cr(e,dr()))??n.body}function mr(e,t,n){let r=t.toLowerCase();if(r.endsWith(` `)){let i=r.slice(0,-1);if(e.filter(e=>e.toLowerCase().startsWith(i)).length<=1)return mr(e,i,n);let a=n?.toLowerCase();if(a&&a.startsWith(i)&&a.charAt(i.length)===` `&&t.trim()===i)return n;let o=e.filter(e=>e.toLowerCase().startsWith(r));if(o.length>0){let t=n?e.indexOf(n):-1;return hr(o,Math.max(t,0)).find(e=>e!==n)||n}}let i=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=i.toLowerCase(),o=n?e.indexOf(n):-1,s=hr(e,Math.max(o,0));i.length===1&&(s=s.filter(e=>e!==n));let c=s.find(e=>e?.toLowerCase().startsWith(a));return c===n?void 0:c}function hr(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var gr={afterMs:1e4,onChange:Y};function _r(e,t){let{afterMs:n,onChange:r,getWindow:i}={...gr,...t},a=null,o=D(oe(e));function s(){return i().setTimeout(()=>{C(o,e,!0),r?.(e)},n)}return j(()=>()=>{a&&i().clearTimeout(a)}),L(()=>_(o),e=>{C(o,e,!0),r?.(e),a&&i().clearTimeout(a),a=s()})}var vr=class{#e;#t;#n=w(()=>this.#e.onMatch?this.#e.onMatch:e=>e.focus());#r=w(()=>this.#e.getCurrentItem?this.#e.getCurrentItem:this.#e.getActiveElement);constructor(e){this.#e=e,this.#t=_r(``,{afterMs:1e3,getWindow:e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e,t){if(!t.length)return;this.#t.current=this.#t.current+e;let n=_(this.#r)(),r=t.find(e=>e===n)?.textContent?.trim()??``,i=mr(t.map(e=>e.textContent?.trim()??``),this.#t.current,r),a=t.find(e=>e.textContent?.trim()===i);return a&&_(this.#n)(a),a}resetTypeahead(){this.#t.current=``}get search(){return this.#t.current}},yr=`data-context-menu-trigger`,br=`data-context-menu-content`,xr=new H(`Menu.Root`),Sr=new H(`Menu.Root | Menu.Sub`),Cr=new H(`Menu.Content`),wr=new H(`Menu.Group | Menu.RadioGroup`),Tr=new H(`Menu.RadioGroup`),Er=new H(`Menu.CheckboxGroup`),Dr=new yn(`bitsmenuopen`,{bubbles:!1,cancelable:!0}),Or=kt({component:`menu`,parts:[`trigger`,`content`,`sub-trigger`,`item`,`group`,`group-heading`,`checkbox-group`,`checkbox-item`,`radio-group`,`radio-item`,`separator`,`sub-content`,`arrow`]}),kr=class{#e;#t=null;#n=null;#r=!1;#i=null;#a=null;#o=null;#s=null;constructor(e){this.#e=e,U([e.triggerNode,e.contentNode,e.enabled],([e,t,n])=>{if(this.#_(),!e||!t||!n)return;let r=e=>{Q(e)&&(this.#s={x:e.clientX,y:e.clientY},this.#r||this.#d(e,`content`))},i=e=>{Q(e)&&this.#f(e,`content`)},a=e=>{Q(e)&&(this.#r||this.#d(e,`trigger`))},o=e=>{if(Q(e)){if(qt(e.relatedTarget)){let n=this.#e.subContentSelector(),r=e.relatedTarget.closest(n);if(r&&r!==t&&r.id&&t.querySelector(`[aria-controls="${r.id}"]`))return}this.#f(e,`trigger`)}},s=e=>{Q(e)&&this.#m()},c=e=>{Q(e)&&this.#m()};return e.addEventListener(`pointermove`,r),e.addEventListener(`pointerleave`,i),e.addEventListener(`pointerenter`,s),t.addEventListener(`pointermove`,a),t.addEventListener(`pointerleave`,o),t.addEventListener(`pointerenter`,c),()=>{e.removeEventListener(`pointermove`,r),e.removeEventListener(`pointerleave`,i),e.removeEventListener(`pointerenter`,s),t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerleave`,o),t.removeEventListener(`pointerenter`,c),this.#_()}}),W(()=>{this.#_()})}#c(){let e=this.#e.parentContentNode();return e?e.getBoundingClientRect():this.#e.triggerNode()?.getBoundingClientRect()??null}#l(e,t){let n=this.#e.triggerNode(),r=this.#e.contentNode();if(!n||!r)return null;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=Nr(i,a),s,c,l;return t===`content`?(s=this.#r?this.#a??e:e,c=a):(s=this.#s??e,c=this.#c()??i,l=a),this.#a=s,{corridor:Pr(i,a,o),intent:Fr(s,c,o,t,l),targetRect:c,side:o}}#u(e,t,n){return Ar(e,t)||Ar(e,n)}#d(e,t){let n={x:e.clientX,y:e.clientY};this.#l(n,t)&&(this.#i=t,this.#o=n)}#f(e,t){if(!this.#e.enabled())return;let n=this.#e.triggerNode(),r=this.#e.contentNode();if(!n||!r)return;let i=e.relatedTarget;if(qt(i)&&(t===`content`&&r.contains(i)||t===`trigger`&&n.contains(i)))return;let a={x:e.clientX,y:e.clientY},o=this.#l(a,t);if(o){if(!jr(a,o.targetRect)&&!this.#u(a,o.corridor,o.intent)){this.#w();return}this.#r=!0,this.#i=t,this.#o=a,this.#e.setIsPointerInTransit(!0),this.#b(),this.#S()}}#p=null;#m(){if(!this.#r)return;let e=this.#i===`trigger`;this.#x(),this.#C(),this.#r=!1,this.#w(),e?(this.#h(),this.#p=setTimeout(()=>{this.#p=null,this.#e.setIsPointerInTransit(!1)},100)):this.#e.setIsPointerInTransit(!1)}#h(){this.#p!==null&&(clearTimeout(this.#p),this.#p=null)}#g(){let e=this.#o;this.#x(),this.#C(),this.#h(),this.#r=!1,this.#e.setIsPointerInTransit(!1),this.#w(),this.#e.onIntentExit(e)}#_(){this.#x(),this.#C(),this.#h(),this.#r&&this.#e.setIsPointerInTransit(!1),this.#r=!1,this.#i=null,this.#a=null,this.#o=null,this.#s=null}#v(e){let t=this.#e.contentNode();if(!t)return!1;let n=t.ownerDocument.elementFromPoint(e.x,e.y);if(!n)return!1;let r=this.#e.subContentSelector(),i=n.closest(r);return!i||i===t?!1:i.id?!!t.querySelector(`[aria-controls="${i.id}"]`):!1}#y=e=>{if(!this.#r||!this.#i||!Q(e))return;let t=this.#e.triggerNode(),n=this.#e.contentNode();if(!t||!n){this.#g();return}this.#C();let r={x:e.clientX,y:e.clientY};this.#o=r;let i=t.getBoundingClientRect(),a=n.getBoundingClientRect();if(this.#i===`content`&&jr(r,a)){this.#m();return}if(this.#i===`trigger`&&Mr(r,i,4)){this.#m();return}if(this.#v(r)){this.#S();return}let o=this.#l(r,this.#i);if(!o){this.#g();return}if(this.#u(r,o.corridor,o.intent)){this.#S();return}this.#g()};#b(){if(this.#t)return;let e=bt(this.#e.triggerNode()??this.#e.contentNode());e&&(e.addEventListener(`pointermove`,this.#y,!0),this.#t=()=>{e.removeEventListener(`pointermove`,this.#y,!0),this.#t=null})}#x(){this.#t?.()}#S(){this.#C(),this.#n=setTimeout(()=>{this.#n=null,this.#r&&this.#g()},500)}#C(){this.#n!==null&&(clearTimeout(this.#n),this.#n=null)}#w(){this.#i=null,this.#a=null,this.#o=null}};function Ar(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function jr(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}function Mr(e,t,n){return e.x>=t.left+n&&e.x<=t.right-n&&e.y>=t.top+n&&e.y<=t.bottom-n}function Nr(e,t){let n=e.left+e.width/2,r=e.top+e.height/2,i=t.left+t.width/2,a=t.top+t.height/2,o=i-n,s=a-r;return Math.abs(o)>Math.abs(s)?o>0?`right`:`left`:s>0?`bottom`:`top`}function Pr(e,t,n){switch(n){case`top`:return[{x:Math.min(e.left,t.left)-2,y:e.top},{x:Math.min(e.left,t.left)-2,y:t.bottom},{x:Math.max(e.right,t.right)+2,y:t.bottom},{x:Math.max(e.right,t.right)+2,y:e.top}];case`bottom`:return[{x:Math.min(e.left,t.left)-2,y:e.bottom},{x:Math.min(e.left,t.left)-2,y:t.top},{x:Math.max(e.right,t.right)+2,y:t.top},{x:Math.max(e.right,t.right)+2,y:e.bottom}];case`left`:return[{x:e.left,y:Math.min(e.top,t.top)-2},{x:t.right,y:Math.min(e.top,t.top)-2},{x:t.right,y:Math.max(e.bottom,t.bottom)+2},{x:e.left,y:Math.max(e.bottom,t.bottom)+2}];case`right`:return[{x:e.right,y:Math.min(e.top,t.top)-2},{x:t.left,y:Math.min(e.top,t.top)-2},{x:t.left,y:Math.max(e.bottom,t.bottom)+2},{x:e.right,y:Math.max(e.bottom,t.bottom)+2}]}}function Fr(e,t,n,r,i){let a=r===`trigger`?Ir(n):n,o=i?Math.min(t.top,i.top)-8:t.top-8,s=i?Math.max(t.bottom,i.bottom)+8:t.bottom+8,c=i?Math.min(t.left,i.left)-8:t.left-8,l=i?Math.max(t.right,i.right)+8:t.right+8;switch(a){case`right`:return[e,{x:t.left,y:o},{x:t.left,y:s}];case`left`:return[e,{x:t.right,y:o},{x:t.right,y:s}];case`bottom`:return[e,{x:c,y:t.top},{x:l,y:t.top}];case`top`:return[e,{x:c,y:t.bottom},{x:l,y:t.bottom}]}}function Ir(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`}}var Lr=class e{static create(t){let n=new e(t);return xr.set(n)}opts;isUsingKeyboard=new Mn;#e=D(!1);get ignoreCloseAutoFocus(){return _(this.#e)}set ignoreCloseAutoFocus(e){C(this.#e,e,!0)}#t=D(!1);get isPointerInTransit(){return _(this.#t)}set isPointerInTransit(e){C(this.#t,e,!0)}constructor(e){this.opts=e}getBitsAttr=e=>Or.getAttr(e,this.opts.variant.current)},Rr=class e{static create(t,n){return Sr.set(new e(t,n,null))}opts;root;parentMenu;contentId=L(()=>``);#e=D(null);get contentNode(){return _(this.#e)}set contentNode(e){C(this.#e,e,!0)}contentPresence;#t=D(null);get triggerNode(){return _(this.#t)}set triggerNode(e){C(this.#t,e,!0)}constructor(e,t,n){this.opts=e,this.root=t,this.parentMenu=n,this.contentPresence=new $t({ref:L(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)},shouldSkipExitAnimation:()=>this.root.opts.variant.current!==`menubar`||this.parentMenu!==null?!1:this.root.opts.shouldSkipExitAnimation?.()??!1}),n&&U(()=>n.opts.open.current,()=>{n.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}},zr=class e{static create(t){return Cr.set(new e(t,Sr.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#e=D(``);get search(){return _(this.#e)}set search(e){C(this.#e,e,!0)}#t=0;#n;#r=D(!1);get mounted(){return _(this.#r)}set mounted(e){C(this.#r,e,!0)}#i;constructor(e,t){this.opts=e,this.parentMenu=t,this.domContext=new Ct(e.ref),this.attachment=K(this.opts.ref,e=>{this.parentMenu.contentNode!==e&&(this.parentMenu.contentNode=e)}),t.contentId=e.id,this.#i=e.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new kr({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,parentContentNode:()=>this.parentMenu.parentMenu?.contentNode??null,subContentSelector:()=>`[${this.parentMenu.root.getBitsAttr(`sub-content`)}]`,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr(`sub-trigger`)),onIntentExit:e=>{this.parentMenu.opts.open.current=!1,this.#s(e)},setIsPointerInTransit:e=>{this.parentMenu.root.isPointerInTransit=e}}),this.#n=new vr({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new Zt({rootNode:L(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr(`item`),loop:this.opts.loop,orientation:L(()=>`vertical`)}),U(()=>this.parentMenu.contentNode,e=>e?Dr.listen(e,()=>{G(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})}):void 0),j(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#t)})}#a(){let e=this.parentMenu.contentNode;return e?Array.from(e.querySelectorAll(`[${this.parentMenu.root.getBitsAttr(`item`)}]:not([data-disabled])`)):[]}#o(){return this.parentMenu.root.isPointerInTransit}#s(e){if(!e)return;let t=this.parentMenu.parentMenu?.contentNode;if(!t)return;let n=this.domContext.getDocument().elementFromPoint(e.x,e.y);if(!qt(n))return;let r=n.closest(`[${this.parentMenu.root.getBitsAttr(`sub-trigger`)}]`);r&&t.contains(r)&&r!==this.parentMenu.triggerNode&&r.dispatchEvent(new PointerEvent(`pointermove`,{bubbles:!0,cancelable:!0,pointerType:`mouse`,clientX:e.x,clientY:e.y}))}onCloseAutoFocus=e=>{if(this.opts.onCloseAutoFocus.current?.(e),!(e.defaultPrevented||this.#i)){if(this.parentMenu.root.ignoreCloseAutoFocus){e.preventDefault();return}this.parentMenu.triggerNode&&cr(this.parentMenu.triggerNode)&&(e.preventDefault(),this.parentMenu.triggerNode.focus())}};handleTabKeyDown(e){let t=this.parentMenu;for(;t.parentMenu!==null;)t=t.parentMenu;if(!t.triggerNode)return;e.preventDefault();let n=fr(t.triggerNode,e.shiftKey?`prev`:`next`);n?(this.parentMenu.root.ignoreCloseAutoFocus=!0,t.onClose(),G(()=>{n.focus(),G(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(e){if(e.defaultPrevented)return;if(e.key===`Tab`){this.handleTabKeyDown(e);return}let t=e.target,n=e.currentTarget;if(!J(t)||!J(n))return;let r=t.closest(`[${this.parentMenu.root.getBitsAttr(`content`)}]`)?.id===this.parentMenu.contentId.current,i=e.ctrlKey||e.altKey||e.metaKey,a=e.key.length===1;if(this.rovingFocusGroup.handleKeydown(t,e)||e.code===`Space`)return;let o=this.#a();r&&!i&&a&&this.#n(e.key,o),e.target?.id===this.parentMenu.contentId.current&&On.includes(e.key)&&(e.preventDefault(),Dn.includes(e.key)&&o.reverse(),An(o,{select:!1},()=>this.domContext.getActiveElement()))}onblur(e){qt(e.currentTarget)&&qt(e.target)&&(e.currentTarget.contains?.(e.target)||(this.domContext.getWindow().clearTimeout(this.#t),this.search=``))}onfocus(e){this.parentMenu.root.isUsingKeyboard.current&&G(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#o()}onItemLeave(e){e.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr(`sub-trigger`))||this.#o()||this.parentMenu.root.isUsingKeyboard.current||(this.parentMenu.contentNode?.focus({preventScroll:!0}),this.rovingFocusGroup.setCurrentTabStopId(``))}onTriggerLeave(){return!!this.#o()}handleInteractOutside(e){if(!Jt(e.target))return;let t=this.parentMenu.triggerNode?.id;if(e.target.id===t){e.preventDefault();return}if(e.target.closest(`#${t}`)){e.preventDefault();return}this.parentMenu.root.ignoreCloseAutoFocus=!0,G(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#c=w(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return _(this.#c)}set snippetProps(e){C(this.#c,e)}#l=w(()=>({id:this.opts.id.current,role:`menu`,"aria-orientation":`vertical`,[this.parentMenu.root.getBitsAttr(`content`)]:``,"data-state":Tt(this.parentMenu.opts.open.current),...Et(this.parentMenu.contentPresence.transitionStatus),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:`auto`,contain:`layout style`},...this.attachment}));get props(){return _(this.#l)}set props(e){C(this.#l,e)}popperProps={onCloseAutoFocus:e=>this.onCloseAutoFocus(e)}},Br=class{opts;content;attachment;#e=D(!1);constructor(e,t){this.opts=e,this.content=t,this.attachment=K(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(e){if(!e.defaultPrevented&&Q(e)){if(this.opts.disabled.current)this.content.onItemLeave(e);else{if(this.content.onItemEnter())return;let t=e.currentTarget;if(!J(t))return;t.focus({preventScroll:!0})}}}onpointerleave(e){e.defaultPrevented||Q(e)&&this.content.onItemLeave(e)}onfocus(e){G(()=>{e.defaultPrevented||this.opts.disabled.current||C(this.#e,!0)})}onblur(e){G(()=>{e.defaultPrevented||C(this.#e,!1)})}#t=w(()=>({id:this.opts.id.current,tabindex:-1,role:`menuitem`,"aria-disabled":wt(this.opts.disabled.current),"data-disabled":q(this.opts.disabled.current),"data-highlighted":_(this.#e)?``:void 0,[this.content.parentMenu.root.getBitsAttr(`item`)]:``,onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return _(this.#t)}set props(e){C(this.#t,e)}},Vr=class e{static create(t){let n=new Br(t,Cr.get());return new e(t,n)}opts;item;root;#e=!1;constructor(e,t){this.opts=e,this.item=t,this.root=t.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#t(){if(this.item.opts.disabled.current)return;let e=new CustomEvent(`menuitemselect`,{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(e),e.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(e){let t=this.item.content.search!==``;if(!(this.item.opts.disabled.current||t&&e.key===` `)&&Tn.includes(e.key)){if(!J(e.currentTarget))return;e.currentTarget.click(),e.preventDefault()}}onclick(e){this.item.opts.disabled.current||this.#t()}onpointerup(e){if(!e.defaultPrevented&&!this.#e){if(!J(e.currentTarget))return;e.currentTarget?.click()}}onpointerdown(e){this.#e=!0}#n=w(()=>V(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return _(this.#n)}set props(e){C(this.#n,e)}},Hr=class e{static create(t){return wr.set(new e(t,xr.get()))}opts;root;attachment;#e=D(void 0);get groupHeadingId(){return _(this.#e)}set groupHeadingId(e){C(this.#e,e,!0)}constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref)}#t=w(()=>({id:this.opts.id.current,role:`group`,"aria-labelledby":this.groupHeadingId,[this.root.getBitsAttr(`group`)]:``,...this.attachment}));get props(){return _(this.#t)}set props(e){C(this.#t,e)}},Ur=class e{static create(t){let n=Er.getOr(null);if(n)return new e(t,n);let r=Tr.getOr(null);return r?new e(t,r):new e(t,wr.get())}opts;group;attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=K(this.opts.ref,e=>this.group.groupHeadingId=e?.id)}#e=w(()=>({id:this.opts.id.current,role:`group`,[this.group.root.getBitsAttr(`group-heading`)]:``,...this.attachment}));get props(){return _(this.#e)}set props(e){C(this.#e,e)}},Wr=class e{static create(t){return new e(t,xr.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref)}#e=w(()=>({id:this.opts.id.current,role:`group`,[this.root.getBitsAttr(`separator`)]:``,...this.attachment}));get props(){return _(this.#e)}set props(e){C(this.#e,e)}},Gr=class e{static create(t){return new e(t,Sr.get())}opts;parentMenu;attachment;constructor(e,t){this.opts=e,this.parentMenu=t,this.attachment=K(this.opts.ref,e=>this.parentMenu.triggerNode=e)}onclick=e=>{this.opts.disabled.current||e.detail!==0||(this.parentMenu.toggleOpen(),e.preventDefault())};onpointerdown=e=>{if(!this.opts.disabled.current){if(e.pointerType===`touch`)return e.preventDefault();e.button===0&&e.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||e.preventDefault())}};onpointerup=e=>{this.opts.disabled.current||e.pointerType===`touch`&&(e.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=e=>{if(!this.opts.disabled.current){if(e.key===` `||e.key===`Enter`){this.parentMenu.toggleOpen(),e.preventDefault();return}e.key===`ArrowDown`&&(this.parentMenu.onOpen(),e.preventDefault())}};#e=w(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#t=w(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":`menu`,"aria-expanded":wt(this.parentMenu.opts.open.current),"aria-controls":_(this.#e),"data-disabled":q(this.opts.disabled.current),"data-state":Tt(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr(`trigger`)]:``,onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return _(this.#t)}set props(e){C(this.#t,e)}};globalThis.bitsDismissableLayers??=new Map;var Kr=class e{static create(t){return new e(t)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#i=!1;#a=void 0;#o;#s=Y;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#o=e.onFocusOutside,j(()=>{this.#a=Sn(this.opts.ref.current)});let t=Y,n=null,r=!1,i=()=>{n!=null&&(clearTimeout(n),n=null)},a=()=>{i(),this.#g(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),t()};U([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(this.opts.enabled.current&&this.opts.ref.current)return i(),n=ut(1,()=>{n=null,!r&&this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#l())}),a}),W(()=>{r=!0,i(),this.#g.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),t()})}#c=e=>{e.defaultPrevented||this.opts.ref.current&&G(()=>{this.opts.ref.current&&!this.#h(e.target)&&e.target&&!this.#i&&this.#o.current?.(e)})};#l(){return B(A(this.#a,`pointerdown`,B(this.#f,this.#m),{capture:!0}),A(this.#a,`pointerdown`,B(this.#p,this.#d)),A(this.#a,`focusin`,this.#c))}#u=e=>{let t=e;t.defaultPrevented&&(t=Xr(e)),this.#e.current(e)};#d=bn(e=>{if(!this.opts.ref.current){this.#s();return}let t=this.opts.isValidEvent.current(e,this.opts.ref.current)||Yr(e,this.opts.ref.current);if(!this.#r||this.#_()||!t){this.#s();return}let n=e;if(n.defaultPrevented&&(n=Xr(n)),this.#t.current!==`close`&&this.#t.current!==`defer-otherwise-close`){this.#s();return}e.pointerType===`touch`?(this.#s(),this.#s=A(this.#a,`click`,this.#u,{once:!0})):this.#e.current(n)},10);#f=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#m=()=>{this.opts.ref.current&&(this.#r=Jr(this.opts.ref.current))};#h=e=>this.opts.ref.current?xn(this.opts.ref.current,e):!1;#g=bn(()=>{for(let e in this.#n)this.#n[e]=!1;this.#r=!1},20);#_(){return Object.values(this.#n).some(Boolean)}#v=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#v,onblurcapture:this.#y}};function qr(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([e,{current:t}])=>t===`close`||t===`ignore`)}function Jr(e){let t=[...globalThis.bitsDismissableLayers],n=qr(t);if(n)return n[0].opts.ref.current===e;let[r]=t[0];return r.opts.ref.current===e}function Yr(e,t){let n=e.target;if(!Jt(n))return!1;let r=!!n.closest(`[${yr}]`),i=!!t.closest(`[${br}]`);return`button`in e&&e.button>0&&!r?!1:`button`in e&&e.button===0&&r&&i?!0:r&&i?!1:Sn(n).documentElement.contains(n)&&!xn(t,n)&&wn(e,t)}function Xr(e){let t=e.currentTarget,n=e.target,r;r=e instanceof PointerEvent?new PointerEvent(e.type,e):new PointerEvent(`pointerdown`,e);let i=!1;return new Proxy(r,{get:(r,a)=>a===`currentTarget`?t:a===`target`?n:a===`preventDefault`?()=>{i=!0,typeof r.preventDefault==`function`&&r.preventDefault()}:a===`defaultPrevented`?i:a in r?r[a]:e[a]})}function Zr(e,t){i(t,!0);let n=y(t,`interactOutsideBehavior`,3,`close`),r=y(t,`onInteractOutside`,3,Y),a=y(t,`onFocusOutside`,3,Y),o=y(t,`isValidEvent`,3,()=>!1),s=Kr.create({id:L(()=>t.id),interactOutsideBehavior:L(()=>n()),onInteractOutside:L(()=>r()),enabled:L(()=>t.enabled),onFocusOutside:L(()=>a()),isValidEvent:L(()=>o()),ref:t.ref});var c=P(),l=N(c);d(l,()=>t.children??E,()=>({props:s.props})),m(e,c),h()}globalThis.bitsEscapeLayers??=new Map;var Qr=class e{static create(t){return new e(t)}opts;domContext;constructor(e){this.opts=e,this.domContext=new Ct(this.opts.ref);let t=Y;U(()=>e.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>A(this.domContext.getDocument(),`keydown`,this.#t,{passive:!1});#t=e=>{if(e.key!==`Escape`||!$r(this))return;let t=new KeyboardEvent(e.type,e);e.preventDefault();let n=this.opts.escapeKeydownBehavior.current;(n===`close`||n===`defer-otherwise-close`)&&this.opts.onEscapeKeydown.current(t)}};function $r(e){let t=[...globalThis.bitsEscapeLayers],n=t.findLast(([e,{current:t}])=>t===`close`||t===`ignore`);if(n)return n[0]===e;let[r]=t[0];return r===e}function ei(e,t){i(t,!0);let n=y(t,`escapeKeydownBehavior`,3,`close`),r=y(t,`onEscapeKeydown`,3,Y);Qr.create({escapeKeydownBehavior:L(()=>n()),onEscapeKeydown:L(()=>r()),enabled:L(()=>t.enabled),ref:t.ref});var a=P(),o=N(a);d(o,()=>t.children??E),m(e,a),h()}var ti=class e{static instance;#e=Se([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||=new e,this.instance}register(e){let t=this.getActive();t&&t!==e&&t.pause();let n=document.activeElement;n&&n!==document.body&&this.#n.set(e,n),this.#e.current=this.#e.current.filter(t=>t!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(t=>t!==e);let t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}},ni=class e{#e=!1;#t=null;#n=ti.getInstance();#r=[];#i;constructor(e){this.#i=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#a(){for(let e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#c(),this.#o()}unmount(){this.#t&&=(this.#a(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),null)}#o(){if(!this.#t)return;let e=new CustomEvent(`focusScope.onOpenAutoFocus`,{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;let e=this.#u();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#t.focus()})}#s(){let e=new CustomEvent(`focusScope.onCloseAutoFocus`,{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(e),!e.defaultPrevented){let e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#c(){if(!this.#t||!this.#i.trap.current)return;let e=this.#t,t=e.ownerDocument;this.#r.push(A(t,`focusin`,t=>{if(this.#e||!this.#n.isActiveScope(this))return;let n=t.target;if(n){if(e.contains(n))this.#n.setFocusMemory(this,n);else{let n=this.#n.getFocusMemory(this);if(n&&e.contains(n)&&ur(n))t.preventDefault(),n.focus();else{let t=this.#u(),n=this.#d()[0];(t||n||e).focus()}}}},{capture:!0}),A(e,`keydown`,e=>{if(!this.#i.loop||this.#e||e.key!==`Tab`||!this.#n.isActiveScope(this))return;let n=this.#l();if(n.length===0)return;let r=n[0],i=n[n.length-1];!e.shiftKey&&t.activeElement===i?(e.preventDefault(),r.focus()):e.shiftKey&&t.activeElement===r&&(e.preventDefault(),i.focus())}));let n=new MutationObserver(()=>{let t=this.#n.getFocusMemory(this);if(t&&!e.contains(t)){let t=this.#u(),n=this.#d()[0],r=t||n;r?(r.focus(),this.#n.setFocusMemory(this,r)):e.focus()}});n.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>n.disconnect())}#l(){return this.#t?or(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#l()[0]||null}#d(){return this.#t?sr(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return U([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||=new e(t),n.mount(r)):n&&=(n.unmount(),null)}),W(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}};function ri(e,t){i(t,!0);let n=y(t,`enabled`,3,!1),r=y(t,`trapFocus`,3,!1),a=y(t,`loop`,3,!1),o=y(t,`onCloseAutoFocus`,3,Y),s=y(t,`onOpenAutoFocus`,3,Y),c=ni.use({enabled:L(()=>n()),trap:L(()=>r()),loop:a(),onCloseAutoFocus:L(()=>o()),onOpenAutoFocus:L(()=>s()),ref:t.ref});var l=P(),u=N(l);d(u,()=>t.focusScope??E,()=>({props:c.props})),m(e,l),h()}var ii=()=>{};globalThis.bitsTextSelectionLayers??=new Map;var ai=class e{static create(t){return new e(t)}opts;domContext;#e=Y;#t=!1;#n=ii;#r=ii;constructor(e){this.opts=e,this.domContext=new Ct(e.ref);let t=Y;U(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([e,n,r])=>(this.#t=e,this.#n=n,this.#r=r,e&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#i()),()=>{this.#t=!1,t(),this.#s(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return B(A(this.domContext.getDocument(),`pointerdown`,this.#o),A(this.domContext.getDocument(),`pointerup`,Ce(this.#s,this.#a)))}#a=e=>{this.#r(e)};#o=e=>{if(!this.#t)return;let t=this.opts.ref.current,n=e.target;J(t)&&J(n)&&li(this)&&yt(t,n)&&(this.#n(e),!e.defaultPrevented&&(this.#e=si(t,this.domContext.getDocument().body)))};#s=()=>{this.#e(),this.#e=Y}},oi=e=>e.style.userSelect||e.style.webkitUserSelect;function si(e,t){let n=oi(t),r=oi(e);return ci(t,`none`),ci(e,`text`),()=>{ci(t,n),ci(e,r)}}function ci(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function li(e){let t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;let n=t.at(-1);return n?n[0]===e:!1}function ui(e,t){i(t,!0);let n=y(t,`preventOverflowTextSelection`,3,!0),r=y(t,`onPointerDown`,3,Y),a=y(t,`onPointerUp`,3,Y);ai.create({id:L(()=>t.id),onPointerDown:L(()=>r()),onPointerUp:L(()=>a()),enabled:L(()=>t.enabled&&n()),ref:t.ref});var o=P(),s=N(o);d(s,()=>t.children??E),m(e,o),h()}globalThis.bitsIdCounter??={current:0};function di(e=`bits`){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}var fi=class{#e;#t=0;#n=D();#r;constructor(e){this.#e=e}#i(){--this.#t,this.#r&&this.#t<=0&&(this.#r(),C(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,_(this.#n)===void 0&&(this.#r=ae(()=>{C(this.#n,this.#e(...e),!0)})),j(()=>()=>{this.#i()}),_(this.#n)}},pi=new rt,mi=D(null),hi=null,gi=null,_i=!1,vi=L(()=>{for(let e of pi.values())if(e)return!0;return!1}),yi=null,bi=new fi(()=>{function e(){document.body.setAttribute(`style`,_(mi)??``),document.body.style.removeProperty(`--scrollbar-width`),Gt&&hi?.(),C(mi,null)}function t(){gi!==null&&(window.clearTimeout(gi),gi=null)}function n(e,n){t(),_i=!0,yi=Date.now();let r=yi,i=()=>{gi=null,yi===r&&(Si(pi)?_i=!1:(_i=!1,n()))},a=e===null?24:e;gi=window.setTimeout(i,a)}function r(){_(mi)===null&&pi.size===0&&!_i&&C(mi,document.body.getAttribute(`style`),!0)}return U(()=>vi.current,()=>{if(!vi.current)return;r(),_i=!1;let e=getComputedStyle(document.documentElement),t=getComputedStyle(document.body),n=e.scrollbarGutter?.includes(`stable`)||t.scrollbarGutter?.includes(`stable`),i=window.innerWidth-document.documentElement.clientWidth,a={padding:Number.parseInt(t.paddingRight??`0`,10)+i,margin:Number.parseInt(t.marginRight??`0`,10)};i>0&&!n&&(document.body.style.paddingRight=`${a.padding}px`,document.body.style.marginRight=`${a.margin}px`,document.body.style.setProperty(`--scrollbar-width`,`${i}px`)),document.body.style.overflow=`hidden`,Gt&&(hi=A(document,`touchmove`,e=>{e.target===document.documentElement&&(e.touches.length>1||e.preventDefault())},{passive:!1})),G(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})}),W(()=>()=>{hi?.()}),{get lockMap(){return pi},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}}),xi=class{#e=di();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=bi.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=L(()=>this.#r.lockMap.get(this.#e)??!1,e=>this.#r.lockMap.set(this.#e,e)),W(()=>{if(this.#r.lockMap.delete(this.#e),Si(this.#r.lockMap))return;let e=this.#n();this.#r.scheduleCleanupIfNoNewLocks(e,()=>{this.#r.resetBodyStyle()})}))}};function Si(e){for(let[t,n]of e)if(n)return!0;return!1}function Ci(e,t){i(t,!0);let n=y(t,`preventScroll`,3,!0),r=y(t,`restoreScrollDelay`,3,null);n()&&new xi(n(),()=>r()),h()}var wi=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`forceMount`,`child`,`children`,`ref`]),Ti=n(`<div><!></div>`);function Ei(e,n){let r=o();i(n,!0);let a=y(n,`id`,19,()=>X(r)),s=y(n,`forceMount`,3,!1),c=y(n,`ref`,15,null),l=O(n,wi),f=sn.create({id:L(()=>a()),ref:L(()=>c(),e=>c(e))}),p=w(()=>V(l,f.props));var g=P(),v=N(g),b=e=>{var r=P(),i=N(r),a=e=>{var t=P(),r=N(t);{let e=w(()=>({props:V(_(p)),...f.snippetProps}));d(r,()=>n.child,()=>_(e))}m(e,t)},o=e=>{var r=Ti();S(r,e=>({...e}),[()=>V(_(p))]);var i=k(r);d(i,()=>n.children??E,()=>f.snippetProps),t(r),m(e,r)};u(i,e=>{n.child?e(a):e(o,-1)}),m(e,r)};u(v,e=>{(f.shouldRender||s())&&e(b)}),m(e,g),h()}var Di=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`]),Oi=n(`<div><!></div>`);function ki(e,n){let r=o();i(n,!0);let a=y(n,`id`,19,()=>X(r)),s=y(n,`ref`,15,null),c=O(n,Di),l=an.create({id:L(()=>a()),ref:L(()=>s(),e=>s(e))}),f=w(()=>V(c,l.props));var p=P(),g=N(p),v=e=>{var t=P(),r=N(t);d(r,()=>n.child,()=>({props:_(f)})),m(e,t)},b=e=>{var r=Oi();S(r,()=>({..._(f)}));var i=k(r);d(i,()=>n.children??E),t(r),m(e,r)};u(g,e=>{n.child?e(v):e(b,-1)}),m(e,p),h()}function Ai(e,t){i(t,!0);let n=y(t,`open`,15,!1),r=y(t,`onOpenChange`,3,Y),a=y(t,`onOpenChangeComplete`,3,Y);tn.create({variant:L(()=>`dialog`),open:L(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:L(()=>a())});var o=P(),s=N(o);d(s,()=>t.children??E),m(e,o),h()}var ji=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`disabled`]),Mi=n(`<button><!></button>`);function Ni(e,n){let r=o();i(n,!0);let a=y(n,`id`,19,()=>X(r)),s=y(n,`ref`,15,null),c=y(n,`disabled`,3,!1),l=O(n,ji),f=nn.create({variant:L(()=>`close`),id:L(()=>a()),ref:L(()=>s(),e=>s(e)),disabled:L(()=>!!c())}),p=w(()=>V(l,f.props));var g=P(),v=N(g),b=e=>{var t=P(),r=N(t);d(r,()=>n.child,()=>({props:_(p)})),m(e,t)},x=e=>{var r=Mi();S(r,()=>({..._(p)}));var i=k(r);d(i,()=>n.children??E),t(r),m(e,r)};u(v,e=>{n.child?e(b):e(x,-1)}),m(e,g),h()}var Pi=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`onCloseAutoFocus`,`onOpenAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`restoreScrollDelay`]),Fi=n(`<!> <!>`,1),Ii=n(`<!> <div><!></div>`,1);function Li(e,n){let r=o();i(n,!0);let a=y(n,`id`,19,()=>X(r)),s=y(n,`ref`,15,null),c=y(n,`forceMount`,3,!1),l=y(n,`onCloseAutoFocus`,3,Y),f=y(n,`onOpenAutoFocus`,3,Y),p=y(n,`onEscapeKeydown`,3,Y),g=y(n,`onInteractOutside`,3,Y),v=y(n,`trapFocus`,3,!0),b=y(n,`preventScroll`,3,!0),x=y(n,`restoreScrollDelay`,3,null),ee=O(n,Pi),C=on.create({id:L(()=>a()),ref:L(()=>s(),e=>s(e))}),T=w(()=>V(ee,C.props));var te=P(),ne=N(te),D=e=>{ri(e,{get ref(){return C.opts.ref},loop:!0,get trapFocus(){return v()},get enabled(){return C.root.opts.open.current},get onOpenAutoFocus(){return f()},get onCloseAutoFocus(){return l()},focusScope:(e,r)=>{let i=()=>(r?.()).props;ei(e,M(()=>_(T),{get enabled(){return C.root.opts.open.current},get ref(){return C.opts.ref},onEscapeKeydown:e=>{p()(e),!e.defaultPrevented&&C.root.handleClose()},children:(e,r)=>{Zr(e,M(()=>_(T),{get ref(){return C.opts.ref},get enabled(){return C.root.opts.open.current},onInteractOutside:e=>{g()(e),!e.defaultPrevented&&C.root.handleClose()},children:(e,r)=>{ui(e,M(()=>_(T),{get ref(){return C.opts.ref},get enabled(){return C.root.opts.open.current},children:(e,r)=>{var a=P(),o=N(a),s=e=>{var t=Fi(),r=N(t),a=e=>{Ci(e,{get preventScroll(){return b()},get restoreScrollDelay(){return x()}})};u(r,e=>{C.root.opts.open.current&&e(a)});var o=re(r,2);{let e=w(()=>({props:V(_(T),i()),...C.snippetProps}));d(o,()=>n.child,()=>_(e))}m(e,t)},c=e=>{var r=Ii(),a=N(r);Ci(a,{get preventScroll(){return b()}});var o=re(a,2);S(o,e=>({...e}),[()=>V(_(T),i())]);var s=k(o);d(s,()=>n.children??E),t(o),m(e,r)};u(o,e=>{n.child?e(s):e(c,-1)}),m(e,a)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};u(ne,e=>{(C.shouldRender||c())&&e(D)}),m(e,te),h()}var Ri=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function zi(e,t){i(t,!0);let n=y(t,`open`,15,!1),r=O(t,Ri);var o=P(),s=N(o);a(s,()=>Ai,(e,t)=>{t(e,M(()=>r,{get open(){return n()},set open(e){n(e)}}))}),m(e,o),h()}var Bi=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vi(e,t){let n=O(t,Bi);var r=P(),i=N(r);a(i,()=>vn,(e,t)=>{t(e,M(()=>n))}),m(e,r)}var Hi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Ui(e,t){i(t,!0);let n=y(t,`ref`,15,null),r=O(t,Hi);var o=P(),s=N(o);{let e=w(()=>F(`text-sm font-medium`,t.class));a(s,()=>un,(t,i)=>{i(t,M({"data-slot":`dialog-title`,get class(){return _(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}m(e,o),h()}var Wi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`,`showCloseButton`]),Gi=n(`<div><!> <!></div>`);function Ki(e,n){i(n,!0);let r=y(n,`ref`,15,null),o=y(n,`showCloseButton`,3,!1),s=O(n,Wi);var c=Gi();S(c,e=>({"data-slot":`dialog-footer`,class:e,...s}),[()=>F(`gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,n.class)]);var l=k(c);d(l,()=>n.children??E);var f=re(l,2),p=e=>{var t=P(),n=N(t);{let e=(e,t)=>{ue(e,M({variant:`outline`},()=>(t?.()).props,{children:(e,t)=>{te();var n=g(`Close`);m(e,n)},$$slots:{default:!0}}))};a(n,()=>Ni,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}m(e,t)};u(f,e=>{o()&&e(p)}),t(c),ne(c,e=>r(e),()=>r()),m(e,c),h()}var qi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),Ji=n(`<div><!></div>`);function Yi(e,n){i(n,!0);let r=y(n,`ref`,15,null),a=O(n,qi);var o=Ji();S(o,e=>({"data-slot":`dialog-header`,class:e,...a}),[()=>F(`gap-1 flex flex-col`,n.class)]);var s=k(o);d(s,()=>n.children??E),t(o),ne(o,e=>r(e),()=>r()),m(e,o),h()}var Xi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Zi(e,t){i(t,!0);let n=y(t,`ref`,15,null),r=O(t,Xi);var o=P(),s=N(o);{let e=w(()=>F(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,t.class));a(s,()=>Ei,(t,i)=>{i(t,M({"data-slot":`dialog-overlay`,get class(){return _(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}m(e,o),h()}var Qi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`portalProps`,`children`,`showCloseButton`]),$i=n(`<!> <span class="sr-only">Close</span>`,1),ea=n(`<!> <!>`,1);function ta(e,t){i(t,!0);let n=y(t,`ref`,15,null),r=y(t,`showCloseButton`,3,!0),o=O(t,Qi);Vi(e,M(()=>t.portalProps,{children:(e,i)=>{var s=ea(),c=N(s);a(c,()=>Zi,(e,t)=>{t(e,{})});var l=re(c,2);{let e=w(()=>F(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,t.class));a(l,()=>Li,(i,s)=>{s(i,M({"data-slot":`dialog-content`,get class(){return _(e)}},()=>o,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var i=ea(),o=N(i);d(o,()=>t.children??E);var s=re(o,2),c=e=>{var t=P(),n=N(t);{let e=(e,t)=>{ue(e,M({variant:`ghost`,class:`absolute top-2 right-2`,size:`icon-sm`},()=>(t?.()).props,{children:(e,t)=>{var n=$i(),r=N(n);de(r,{}),te(2),m(e,n)},$$slots:{default:!0}}))};a(n,()=>Ni,(t,n)=>{n(t,{"data-slot":`dialog-close`,child:e,$$slots:{child:!0}})})}m(e,t)};u(s,e=>{r()&&e(c)}),m(e,i)},$$slots:{default:!0}}))})}m(e,s)},$$slots:{default:!0}})),h()}var na=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function ra(e,t){i(t,!0);let n=y(t,`ref`,15,null),r=O(t,na);var o=P(),s=N(o);{let e=w(()=>F(`text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3`,t.class));a(s,()=>ki,(t,i)=>{i(t,M({"data-slot":`dialog-description`,get class(){return _(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}m(e,o),h()}export{Nt as A,ut as B,X as C,At as D,Yt as E,kt as F,V as G,lt as H,Dt as I,ye as J,Qe as K,K as L,Ft as M,q as N,jt as O,wt as P,xt as R,vn as S,J as T,U,W as V,H as W,Se as X,L as Y,Vr as _,Ui as a,Wr as b,di as c,ei as d,Zr as f,Hr as g,Ur as h,Ki as i,Pt as j,Mt as k,ui as l,zr as m,ta as n,zi as o,Gr as p,Je as q,Yi as r,Ci as s,ra as t,ri as u,Rr as v,Y as w,Cn as x,Lr as y,G as z};
@@ -1 +1 @@
1
- import"./CmCJ0SKP.js";import{a as e}from"./8hp3I3ac.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};
1
+ import"./CmCJ0SKP.js";import{a as e}from"./B0stYqX9.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};
@@ -1 +1 @@
1
- import{A as e,At as t,B as n,Ct as r,F as i,G as a,N as o,R as s,S as c,St as l,W as u,X as d,ct as f,d as p,ft as m,gt as h,kt as g,lt as _,m as v,mt as y,nt as b,o as x,ot as S,p as C,rt as w,s as T,st as E,x as D}from"./CmCJ0SKP.js";import{t as O}from"./8hp3I3ac.js";import"./xihTtKlq.js";import"./DXKynIUR.js";import{t as k}from"./BkEnd9_Z.js";import{i as ee}from"./oxP0dM6z.js";import{n as A}from"./1aUphu7Y.js";import{n as j,t as M}from"./p_ObVaZi.js";import{i as N}from"./DnPeA-9c.js";import{a as P,i as F,n as I,o as te,s as L,t as R}from"./CgxChsUX.js";var z=new Set([`$$slots`,`$$events`,`$$legacy`]);function B(e,t){let n=x(t,z),r=[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`M10 14 21 3`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}]];k(e,T({name:`external-link`},()=>n,{get iconNode(){return r}}))}var V=n(`<span class="text-amber-600 dark:text-amber-400">stale · rescan for latest</span>`),H=n(`<span> </span> <span class="font-mono"> </span> <!>`,1),U=n(`<span class="italic">Not scanned yet</span>`),W=n(`<a target="_blank" rel="noreferrer noopener" class="inline-flex h-7 items-center gap-1 rounded-md border border-border px-2 text-[11px] text-muted-foreground transition-colors hover:bg-muted/50"><!> Home</a>`),G=n(`<button type="button" class="ml-auto inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11px] text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive"><!></button>`),ne=n(`<article class="flex h-full flex-col gap-2 rounded-lg border border-border bg-card p-3 text-left transition-colors hover:border-primary/40"><header class="flex items-start gap-2"><div class="min-w-0 flex-1"><div class="flex items-center gap-1.5"><h3 class="truncate text-sm font-medium text-foreground"> </h3> <span> </span></div> <p class="mt-0.5 line-clamp-2 text-[11px] leading-4 text-muted-foreground"> </p></div></header> <dl class="mt-auto flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[11px] text-muted-foreground"><!></dl> <footer class="flex shrink-0 items-center gap-2"><button type="button" class="inline-flex h-7 items-center rounded-md bg-primary px-2.5 text-[11px] font-medium text-primary-foreground transition-colors hover:bg-primary/90">Scan</button> <!> <!></footer></article>`);function re(e,n){r(n,!0);var u=ne(),d=S(u),p=S(d),m=S(p),h=S(m),y=f(h,!0),x=_(h,2),C=f(x,!0);t(m);var w=_(m,2),T=f(w,!0);t(p),t(d);var O=_(d,2),k=S(O),ee=e=>{var t=H(),r=E(t),a=f(r),c=_(r,2),l=f(c,!0),u=_(c,2),d=e=>{var t=V();s(e,t)};o(u,e=>{n.stale&&e(d)}),b(()=>{i(a,`${n.scanSummary.skillCount??``} skills`),i(l,n.scanSummary.commitPrefix)}),s(e,t)},A=e=>{var t=U();s(e,t)};o(k,e=>{n.scanSummary?e(ee):e(A,-1)}),t(O);var j=_(O,2),P=S(j),F=_(P,2),I=e=>{var r=W();B(S(r),{class:`h-3 w-3`}),g(),t(r),b(()=>{v(r,`href`,n.homepage),v(r,`aria-label`,`Open ${n.label} homepage`)}),s(e,r)};o(F,e=>{n.homepage&&e(I)});var te=_(F,2),L=e=>{var r=G(),i=S(r);M(i,{class:`h-3.5 w-3.5`}),t(r),b(()=>v(r,`aria-label`,`Remove ${n.label}`)),a(`click`,r,function(...e){n.onremove?.apply(this,e)}),s(e,r)};o(te,e=>{!n.builtIn&&n.onremove&&e(L)}),t(j),t(u),b(e=>{i(y,n.label),D(x,1,e),i(C,n.builtIn?`Built-in`:`Custom`),i(T,n.description||n.gitUrl)},[()=>c(N(`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium`,n.builtIn?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground`))]),a(`click`,P,function(...e){n.onscan?.apply(this,e)}),s(e,u),l()}u([`click`]);var ie=n(`<p class="py-8 text-center text-xs text-muted-foreground">Loading sources…</p>`),ae=n(`<p class="py-8 text-center text-xs text-destructive"> </p>`),oe=n(`<p class="py-8 text-center text-xs text-muted-foreground"> </p>`),se=n(`<div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3"></div>`),ce=n(`<li><button type="button" class="flex w-full items-center justify-between rounded px-2 py-1 text-left text-xs transition-colors hover:bg-muted/60"><span class="truncate font-medium text-foreground"> </span> <span class="ml-2 shrink-0 text-muted-foreground"> </span></button></li>`),le=n(`<section class="rounded-lg border border-border bg-muted/20 p-3"><h2 class="text-xs font-medium text-muted-foreground">Recent scans</h2> <ul class="mt-2 space-y-1"></ul></section>`),ue=n(`<p class="text-xs text-destructive"> </p>`),de=n(`<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4"><div class="w-full max-w-md rounded-lg border border-border bg-background p-4 shadow-lg"><h2 class="text-sm font-semibold">Add custom source</h2> <p class="mt-0.5 text-xs text-muted-foreground">Paste an <code class="font-mono">https</code> Git URL. It persists across restarts.</p> <div class="mt-3 space-y-2"><label class="block text-xs"><span class="text-muted-foreground">Label</span> <input class="mt-1 h-8 w-full rounded-md border border-border bg-background px-2 text-sm" placeholder="My skills repo"/></label> <label class="block text-xs"><span class="text-muted-foreground">Git URL (https only)</span> <input class="mt-1 h-8 w-full rounded-md border border-border bg-background px-2 font-mono text-xs" placeholder="https://github.com/me/skills.git"/></label> <label class="block text-xs"><span class="text-muted-foreground">Description (optional)</span> <input class="mt-1 h-8 w-full rounded-md border border-border bg-background px-2 text-sm" placeholder="What kind of skills?"/></label> <!></div> <div class="mt-4 flex justify-end gap-2"><button type="button" class="h-8 rounded-md border border-border px-3 text-xs hover:bg-muted/50">Cancel</button> <button type="button" class="h-8 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50"> </button></div></div></div>`),fe=n(`<div class="flex h-full flex-col overflow-y-auto p-5"><header class="flex shrink-0 items-center gap-3 border-b border-border pb-4"><div class="min-w-0 flex-1"><h1 class="text-lg font-semibold">Discover skills</h1> <p class="mt-0.5 text-xs text-muted-foreground">Browse curated and custom skill repositories, then scan to install.</p></div> <button type="button" class="inline-flex h-8 shrink-0 items-center rounded-md border border-border px-3 text-xs font-medium transition-colors hover:bg-muted/50">Add source</button></header> <div class="mx-auto mt-4 w-full max-w-4xl flex-1 space-y-4"><div class="flex items-center gap-2"><input type="search" placeholder="Filter sources by name or description…" class="h-9 w-full rounded-md border border-border bg-background px-3 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" aria-label="Filter sources"/></div> <!> <!></div></div> <!> <!>`,1);function K(n,c){r(c,!0);let u=ee(),g=h(()=>u?.()?.q?.trim()??``),v=y(``);w(()=>{m(v,d(g),!0)}),w(()=>{P()});let x=h(()=>[...L.builtIn.map(e=>({id:e.id,label:e.label,description:e.description,gitUrl:e.gitUrl,homepage:e.homepage,builtIn:!0})),...L.user.map(e=>({id:e.id,label:e.label,description:e.description,gitUrl:e.gitUrl,homepage:void 0,builtIn:!1}))]),T=h(()=>{let e=d(g).toLowerCase();return e?d(x).filter(t=>t.label.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)):d(x)}),D=h(()=>{let e=[];for(let t of d(x)){let n=R(t.id);n&&e.push({id:t.id,label:t.label,summary:n})}return e.sort((e,t)=>(t.summary?.scannedAt??0)-(e.summary?.scannedAt??0)),e.slice(0,5)}),k=y(!1),M=y(``),N=y(``),z=y(``),B=y(null),V=y(!1);function H(e){let t=e.trim(),n=`/repository${t?`?q=${encodeURIComponent(t)}`:``}`;O(n,{replaceState:!0})}function U(){let e=d(v).trim(),t=e?`?q=${encodeURIComponent(e)}`:``;O(`/repository${t}`)}function W(e){O(`/repository/scan/${encodeURIComponent(e)}`)}function G(){m(k,!0),m(M,``),m(N,``),m(z,``),m(B,null)}async function ne(){let e=d(M).trim(),t=d(N).trim();if(!e||!t){m(B,`Label and Git URL are required.`);return}m(V,!0),m(B,null);try{await F({label:e,gitUrl:t,description:d(z).trim()||void 0})&&m(k,!1)}catch(e){m(B,e instanceof Error?e.message:String(e),!0)}finally{m(V,!1)}}let K=y(null),q=y(!1),J=y(!1);function pe(e,t){m(K,{id:e,label:t},!0),m(q,!0)}w(()=>{d(q)||m(K,null)});async function me(){let e=d(K);if(e){m(J,!0);try{await te(e.id)&&(m(q,!1),A(`Removed source ${e.label}.`))}catch(e){A(e instanceof Error?e.message:String(e))}finally{m(J,!1)}}}var Y=fe(),X=E(Y),Z=S(X),he=_(S(Z),2);t(Z);var ge=_(Z,2),Q=S(ge),$=S(Q);C($),t(Q);var _e=_(Q,2),ve=e=>{var t=ie();s(e,t)},ye=e=>{var t=ae(),n=f(t,!0);b(()=>i(n,L.error)),s(e,t)},be=e=>{var t=oe(),n=f(t);b(()=>i(n,`No sources match “${d(g)??``}”.`)),s(e,t)},xe=n=>{var r=se();e(r,21,()=>d(T),e=>e.id,(e,t)=>{{let n=h(()=>R(d(t).id)),r=h(()=>I(R(d(t).id))),i=h(()=>d(t).builtIn?void 0:()=>pe(d(t).id,d(t).label));re(e,{get label(){return d(t).label},get description(){return d(t).description},get gitUrl(){return d(t).gitUrl},get homepage(){return d(t).homepage},get builtIn(){return d(t).builtIn},get scanSummary(){return d(n)},get stale(){return d(r)},onscan:()=>W(d(t).id),get onremove(){return d(i)}})}}),t(r),s(n,r)};o(_e,e=>{L.loading?e(ve):L.error?e(ye,1):d(T).length===0?e(be,2):e(xe,-1)});var Se=_(_e,2),Ce=n=>{var r=le(),o=_(S(r),2);e(o,21,()=>d(D),e=>e.id,(e,n)=>{var r=ce(),o=S(r),c=S(o),l=f(c,!0),u=_(c,2),p=f(u);t(o),t(r),b(()=>{i(l,d(n).label),i(p,`${d(n).summary?.skillCount??0??``} skills`)}),a(`click`,o,()=>W(d(n).id)),s(e,r)}),t(o),t(r),s(n,r)};o(Se,e=>{d(D).length>0&&e(Ce)}),t(ge),t(X);var we=_(X,2),Te=e=>{var n=de(),r=S(n),c=_(S(r),4),l=S(c),u=_(S(l),2);C(u),t(l);var h=_(l,2),g=_(S(h),2);C(g),t(h);var v=_(h,2),y=_(S(v),2);C(y),t(v);var x=_(v,2),w=e=>{var t=ue(),n=f(t,!0);b(()=>i(n,d(B))),s(e,t)};o(x,e=>{d(B)&&e(w)}),t(c);var T=_(c,2),E=S(T),D=_(E,2),O=f(D,!0);t(T),t(r),t(n),b(()=>{D.disabled=d(V),i(O,d(V)?`Adding…`:`Add`)}),p(u,()=>d(M),e=>m(M,e)),p(g,()=>d(N),e=>m(N,e)),p(y,()=>d(z),e=>m(z,e)),a(`click`,E,()=>m(k,!1)),a(`click`,D,ne),s(e,n)};o(we,e=>{d(k)&&e(Te)});var Ee=_(we,2);{let e=h(()=>d(K)?`Remove ${d(K).label} from your Discover feed? Installed skills stay on disk.`:``);j(Ee,{title:`Remove custom source`,get description(){return d(e)},confirmLabel:`Remove`,get busy(){return d(J)},onConfirm:()=>void me(),get open(){return d(q)},set open(e){m(q,e,!0)}})}a(`click`,he,G),a(`input`,$,()=>H(d(v))),a(`keydown`,$,e=>{e.key===`Enter`&&U()}),p($,()=>d(v),e=>m(v,e)),s(n,Y),l()}u([`click`,`input`,`keydown`]);export{K as default};
1
+ import{A as e,At as t,B as n,Ct as r,F as i,G as a,N as o,R as s,S as c,St as l,W as u,X as d,ct as f,d as p,ft as m,gt as h,kt as g,lt as _,m as v,mt as y,nt as b,o as x,ot as S,p as C,rt as w,s as T,st as E,x as D}from"./CmCJ0SKP.js";import{t as O}from"./B0stYqX9.js";import"./xihTtKlq.js";import"./oJ4aK8PG.js";import{t as k}from"./BkEnd9_Z.js";import{i as ee}from"./D7DTLcps.js";import{n as A}from"./1aUphu7Y.js";import{i as j}from"./DnPeA-9c.js";import{n as M,t as N}from"./hIGXQE4_.js";import{a as P,i as F,n as I,o as te,s as L,t as R}from"./Du6-3Tbt.js";var z=new Set([`$$slots`,`$$events`,`$$legacy`]);function B(e,t){let n=x(t,z),r=[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`M10 14 21 3`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}]];k(e,T({name:`external-link`},()=>n,{get iconNode(){return r}}))}var V=n(`<span class="text-amber-600 dark:text-amber-400">stale · rescan for latest</span>`),H=n(`<span> </span> <span class="font-mono"> </span> <!>`,1),U=n(`<span class="italic">Not scanned yet</span>`),W=n(`<a target="_blank" rel="noreferrer noopener" class="inline-flex h-7 items-center gap-1 rounded-md border border-border px-2 text-[11px] text-muted-foreground transition-colors hover:bg-muted/50"><!> Home</a>`),G=n(`<button type="button" class="ml-auto inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11px] text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive"><!></button>`),ne=n(`<article class="flex h-full flex-col gap-2 rounded-lg border border-border bg-card p-3 text-left transition-colors hover:border-primary/40"><header class="flex items-start gap-2"><div class="min-w-0 flex-1"><div class="flex items-center gap-1.5"><h3 class="truncate text-sm font-medium text-foreground"> </h3> <span> </span></div> <p class="mt-0.5 line-clamp-2 text-[11px] leading-4 text-muted-foreground"> </p></div></header> <dl class="mt-auto flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[11px] text-muted-foreground"><!></dl> <footer class="flex shrink-0 items-center gap-2"><button type="button" class="inline-flex h-7 items-center rounded-md bg-primary px-2.5 text-[11px] font-medium text-primary-foreground transition-colors hover:bg-primary/90">Scan</button> <!> <!></footer></article>`);function re(e,n){r(n,!0);var u=ne(),d=S(u),p=S(d),m=S(p),h=S(m),y=f(h,!0),x=_(h,2),C=f(x,!0);t(m);var w=_(m,2),T=f(w,!0);t(p),t(d);var O=_(d,2),k=S(O),ee=e=>{var t=H(),r=E(t),a=f(r),c=_(r,2),l=f(c,!0),u=_(c,2),d=e=>{var t=V();s(e,t)};o(u,e=>{n.stale&&e(d)}),b(()=>{i(a,`${n.scanSummary.skillCount??``} skills`),i(l,n.scanSummary.commitPrefix)}),s(e,t)},A=e=>{var t=U();s(e,t)};o(k,e=>{n.scanSummary?e(ee):e(A,-1)}),t(O);var M=_(O,2),P=S(M),F=_(P,2),I=e=>{var r=W();B(S(r),{class:`h-3 w-3`}),g(),t(r),b(()=>{v(r,`href`,n.homepage),v(r,`aria-label`,`Open ${n.label} homepage`)}),s(e,r)};o(F,e=>{n.homepage&&e(I)});var te=_(F,2),L=e=>{var r=G(),i=S(r);N(i,{class:`h-3.5 w-3.5`}),t(r),b(()=>v(r,`aria-label`,`Remove ${n.label}`)),a(`click`,r,function(...e){n.onremove?.apply(this,e)}),s(e,r)};o(te,e=>{!n.builtIn&&n.onremove&&e(L)}),t(M),t(u),b(e=>{i(y,n.label),D(x,1,e),i(C,n.builtIn?`Built-in`:`Custom`),i(T,n.description||n.gitUrl)},[()=>c(j(`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium`,n.builtIn?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground`))]),a(`click`,P,function(...e){n.onscan?.apply(this,e)}),s(e,u),l()}u([`click`]);var ie=n(`<p class="py-8 text-center text-xs text-muted-foreground">Loading sources…</p>`),ae=n(`<p class="py-8 text-center text-xs text-destructive"> </p>`),oe=n(`<p class="py-8 text-center text-xs text-muted-foreground"> </p>`),se=n(`<div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3"></div>`),ce=n(`<li><button type="button" class="flex w-full items-center justify-between rounded px-2 py-1 text-left text-xs transition-colors hover:bg-muted/60"><span class="truncate font-medium text-foreground"> </span> <span class="ml-2 shrink-0 text-muted-foreground"> </span></button></li>`),le=n(`<section class="rounded-lg border border-border bg-muted/20 p-3"><h2 class="text-xs font-medium text-muted-foreground">Recent scans</h2> <ul class="mt-2 space-y-1"></ul></section>`),ue=n(`<p class="text-xs text-destructive"> </p>`),de=n(`<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4"><div class="w-full max-w-md rounded-lg border border-border bg-background p-4 shadow-lg"><h2 class="text-sm font-semibold">Add custom source</h2> <p class="mt-0.5 text-xs text-muted-foreground">Paste an <code class="font-mono">https</code> Git URL. It persists across restarts.</p> <div class="mt-3 space-y-2"><label class="block text-xs"><span class="text-muted-foreground">Label</span> <input class="mt-1 h-8 w-full rounded-md border border-border bg-background px-2 text-sm" placeholder="My skills repo"/></label> <label class="block text-xs"><span class="text-muted-foreground">Git URL (https only)</span> <input class="mt-1 h-8 w-full rounded-md border border-border bg-background px-2 font-mono text-xs" placeholder="https://github.com/me/skills.git"/></label> <label class="block text-xs"><span class="text-muted-foreground">Description (optional)</span> <input class="mt-1 h-8 w-full rounded-md border border-border bg-background px-2 text-sm" placeholder="What kind of skills?"/></label> <!></div> <div class="mt-4 flex justify-end gap-2"><button type="button" class="h-8 rounded-md border border-border px-3 text-xs hover:bg-muted/50">Cancel</button> <button type="button" class="h-8 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50"> </button></div></div></div>`),fe=n(`<div class="flex h-full flex-col overflow-y-auto p-5"><header class="flex shrink-0 items-center gap-3 border-b border-border pb-4"><div class="min-w-0 flex-1"><h1 class="text-lg font-semibold">Discover skills</h1> <p class="mt-0.5 text-xs text-muted-foreground">Browse curated and custom skill repositories, then scan to install.</p></div> <button type="button" class="inline-flex h-8 shrink-0 items-center rounded-md border border-border px-3 text-xs font-medium transition-colors hover:bg-muted/50">Add source</button></header> <div class="mx-auto mt-4 w-full max-w-4xl flex-1 space-y-4"><div class="flex items-center gap-2"><input type="search" placeholder="Filter sources by name or description…" class="h-9 w-full rounded-md border border-border bg-background px-3 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" aria-label="Filter sources"/></div> <!> <!></div></div> <!> <!>`,1);function K(n,c){r(c,!0);let u=ee(),g=h(()=>u?.()?.q?.trim()??``),v=y(``);w(()=>{m(v,d(g),!0)}),w(()=>{P()});let x=h(()=>[...L.builtIn.map(e=>({id:e.id,label:e.label,description:e.description,gitUrl:e.gitUrl,homepage:e.homepage,builtIn:!0})),...L.user.map(e=>({id:e.id,label:e.label,description:e.description,gitUrl:e.gitUrl,homepage:void 0,builtIn:!1}))]),T=h(()=>{let e=d(g).toLowerCase();return e?d(x).filter(t=>t.label.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)):d(x)}),D=h(()=>{let e=[];for(let t of d(x)){let n=R(t.id);n&&e.push({id:t.id,label:t.label,summary:n})}return e.sort((e,t)=>(t.summary?.scannedAt??0)-(e.summary?.scannedAt??0)),e.slice(0,5)}),k=y(!1),j=y(``),N=y(``),z=y(``),B=y(null),V=y(!1);function H(e){let t=e.trim(),n=`/repository${t?`?q=${encodeURIComponent(t)}`:``}`;O(n,{replaceState:!0})}function U(){let e=d(v).trim(),t=e?`?q=${encodeURIComponent(e)}`:``;O(`/repository${t}`)}function W(e){O(`/repository/scan/${encodeURIComponent(e)}`)}function G(){m(k,!0),m(j,``),m(N,``),m(z,``),m(B,null)}async function ne(){let e=d(j).trim(),t=d(N).trim();if(!e||!t){m(B,`Label and Git URL are required.`);return}m(V,!0),m(B,null);try{await F({label:e,gitUrl:t,description:d(z).trim()||void 0})&&m(k,!1)}catch(e){m(B,e instanceof Error?e.message:String(e),!0)}finally{m(V,!1)}}let K=y(null),q=y(!1),J=y(!1);function pe(e,t){m(K,{id:e,label:t},!0),m(q,!0)}w(()=>{d(q)||m(K,null)});async function me(){let e=d(K);if(e){m(J,!0);try{await te(e.id)&&(m(q,!1),A(`Removed source ${e.label}.`))}catch(e){A(e instanceof Error?e.message:String(e))}finally{m(J,!1)}}}var Y=fe(),X=E(Y),Z=S(X),he=_(S(Z),2);t(Z);var ge=_(Z,2),Q=S(ge),$=S(Q);C($),t(Q);var _e=_(Q,2),ve=e=>{var t=ie();s(e,t)},ye=e=>{var t=ae(),n=f(t,!0);b(()=>i(n,L.error)),s(e,t)},be=e=>{var t=oe(),n=f(t);b(()=>i(n,`No sources match “${d(g)??``}”.`)),s(e,t)},xe=n=>{var r=se();e(r,21,()=>d(T),e=>e.id,(e,t)=>{{let n=h(()=>R(d(t).id)),r=h(()=>I(R(d(t).id))),i=h(()=>d(t).builtIn?void 0:()=>pe(d(t).id,d(t).label));re(e,{get label(){return d(t).label},get description(){return d(t).description},get gitUrl(){return d(t).gitUrl},get homepage(){return d(t).homepage},get builtIn(){return d(t).builtIn},get scanSummary(){return d(n)},get stale(){return d(r)},onscan:()=>W(d(t).id),get onremove(){return d(i)}})}}),t(r),s(n,r)};o(_e,e=>{L.loading?e(ve):L.error?e(ye,1):d(T).length===0?e(be,2):e(xe,-1)});var Se=_(_e,2),Ce=n=>{var r=le(),o=_(S(r),2);e(o,21,()=>d(D),e=>e.id,(e,n)=>{var r=ce(),o=S(r),c=S(o),l=f(c,!0),u=_(c,2),p=f(u);t(o),t(r),b(()=>{i(l,d(n).label),i(p,`${d(n).summary?.skillCount??0??``} skills`)}),a(`click`,o,()=>W(d(n).id)),s(e,r)}),t(o),t(r),s(n,r)};o(Se,e=>{d(D).length>0&&e(Ce)}),t(ge),t(X);var we=_(X,2),Te=e=>{var n=de(),r=S(n),c=_(S(r),4),l=S(c),u=_(S(l),2);C(u),t(l);var h=_(l,2),g=_(S(h),2);C(g),t(h);var v=_(h,2),y=_(S(v),2);C(y),t(v);var x=_(v,2),w=e=>{var t=ue(),n=f(t,!0);b(()=>i(n,d(B))),s(e,t)};o(x,e=>{d(B)&&e(w)}),t(c);var T=_(c,2),E=S(T),D=_(E,2),O=f(D,!0);t(T),t(r),t(n),b(()=>{D.disabled=d(V),i(O,d(V)?`Adding…`:`Add`)}),p(u,()=>d(j),e=>m(j,e)),p(g,()=>d(N),e=>m(N,e)),p(y,()=>d(z),e=>m(z,e)),a(`click`,E,()=>m(k,!1)),a(`click`,D,ne),s(e,n)};o(we,e=>{d(k)&&e(Te)});var Ee=_(we,2);{let e=h(()=>d(K)?`Remove ${d(K).label} from your Discover feed? Installed skills stay on disk.`:``);M(Ee,{title:`Remove custom source`,get description(){return d(e)},confirmLabel:`Remove`,get busy(){return d(J)},onConfirm:()=>void me(),get open(){return d(q)},set open(e){m(q,e,!0)}})}a(`click`,he,G),a(`input`,$,()=>H(d(v))),a(`keydown`,$,e=>{e.key===`Enter`&&U()}),p($,()=>d(v),e=>m(v,e)),s(n,Y),l()}u([`click`,`input`,`keydown`]);export{K as default};
@@ -1 +1 @@
1
- import{$ as e,At as t,B as n,Ct as r,D as i,F as a,N as o,R as s,St as c,X as l,bt as u,ct as d,ft as f,gt as p,it as m,l as h,lt as g,mt as _,nt as v,ot as y,rt as b,st as ee,wt as x,xt as S,z as te}from"./CmCJ0SKP.js";import{t as C}from"./8hp3I3ac.js";import"./xihTtKlq.js";import{t as w}from"./B0-OMyfG.js";import"./DXKynIUR.js";import{E as T,S as E,T as D,w as O}from"./CPbfZBJo.js";function k(e){return e.activities.find(e=>e.entry)??e.activities[0]}var A=class{entries=new Map;register(e){this.entries.set(e.id,e)}get(e){return this.entries.get(e)}list(){return[...this.entries.values()]}findByPath(e){for(let t of this.entries.values()){let n=t.absolutePattern.replace(/:[^/]+/g,`[^/]+`);try{if(RegExp(`^${n.replace(/\//g,`\\/`)}\\/?$`).test(e))return t}catch{}}}},j=class{apps=new Map;register(e){this.apps.set(e.id,e)}get(e){return this.apps.get(e)}list(){return[...this.apps.values()]}},M=new A,N=new j;function P(e){let t={id:e.id,pattern:e.pattern,params:e.params,search:e.search,component:e.component,children:e.children};return I(t,t.pattern||`/`),t}function F(e,t){L(e,t)}function I(e,t){if(M.register({id:e.id,route:e,absolutePattern:t}),e.children)for(let n of e.children)I(n,R(t,n.pattern))}function L(e,t){let n=R(e,t.pattern);if(M.register({id:t.id,route:t,absolutePattern:n}),t.children)for(let e of t.children)L(n,e)}function R(e,t){let n=e.replace(/\/+$/,``),r=t.replace(/^\/+|\/+$/g,``);return r===``?n||`/`:`${n}/${r}`}function ne(e){return F(e.pattern,e.root),{pattern:e.pattern,root:e.root,entry:e.entry}}function re(e){return{id:e.id,pattern:``,search:e.search,component:e.component}}function ie(e){return N.register(e),{manifest:e}}function ae(e){let t=Object.entries(e).filter(([,e])=>e!=null);if(t.length===0)return``;let n=new URLSearchParams;for(let[e,r]of t)n.set(e,typeof r==`string`?r:String(r));let r=n.toString();return r?`?${r}`:``}function z(e){let t=e.startsWith(`?`)?e.slice(1):e;if(!t)return{};let n={},r=new URLSearchParams(t);for(let[e,t]of r)n[e]=t;return n}function B(e,t,n,r){let i=G(e,H(V(t,r)),r);if(i.length===0)return{kind:`no-match`,reason:`no-route`};let a=K(i),o=i[i.length-1].route,s=o.params;if(s){let e=s.safeParse(a);if(!e.success)return{kind:`parse-error`,reason:`params`,chain:i,errors:e.error}}let c=o.search;if(c){let e=z(n),t=c.safeParse(e);if(!t.success)return{kind:`parse-error`,reason:`search`,chain:i,errors:t.error}}return{kind:`matched`,chain:i}}function V(e,t){let n=t.replace(/\/+$/,``);return e===n?``:e.startsWith(n+`/`)?e.slice(n.length):e}function H(e){let t=e.replace(/^\/+|\/+$/g,``);return t===``?[]:t.split(`/`).map(e=>{try{return decodeURIComponent(e)}catch{return e}})}function U(e){let t=e.replace(/^\/+|\/+$/g,``);return t===``?[]:t.split(`/`).map(e=>e.startsWith(`:`)?{kind:`param`,value:e.slice(1)}:{kind:`static`,value:e})}function W(e,t){let n=e.replace(/\/+$/,``),r=t.replace(/^\/+|\/+$/g,``);return r===``?n:`${n}/${r}`}function G(e,t,n){let r=W(n,e.pattern),i=U(e.pattern);if(t.length<i.length)return[];let a={};for(let e=0;e<i.length;e++){let n=i[e],r=t[e];if(!r)return[];if(n.kind===`static`){if(n.value!==r)return[]}else a[n.value]=r}let o={absolutePattern:r,route:e,rawParams:a},s=t.slice(i.length);if(s.length===0)return[o];if(e.children&&e.children.length>0)for(let t of e.children){let e=G(t,s,r);if(e.length>0)return[o,...e]}return[]}function K(e){let t={};for(let n of e)Object.assign(t,n.rawParams);return t}var q=/:([A-Za-z_][A-Za-z0-9_]*)/g;function J(e,t){return e.replace(q,(e,n)=>{let r=t[n];return r===void 0?`:${n}`:encodeURIComponent(r)})}var Y=`/workspaces`;function oe(e,t){let n=se(e),r=n?N.get(n):void 0;if(!r)return{kind:`redirect`,path:Y};let i=k(r);if(!i)return{kind:`redirect`,path:Y};for(let n of r.activities){let r=B(n.root,e,t,n.pattern);if(r.kind===`matched`)return{kind:`ok`};if(r.kind===`parse-error`)return r.reason===`params`?{kind:`redirect`,path:i.pattern}:{kind:`redirect`,path:e}}return{kind:`redirect`,path:i.pattern}}function se(e){let t=e.replace(/^\/+/,``);return t?t.split(`/`)[0]??null:null}var X=null;function ce(e){X=e}function le(e,t,n){let r=M.get(e);return r?de(r.absolutePattern,t,n):`/`}function ue(e,t,n,r){let i=le(e,t,n);X?.navigate(i,r)}function de(e,t,n){return`${J(e,t??{})}${n?ae(n):``}`}var fe=Symbol(`skill-creator:portal-target`),pe=Symbol(`skill-creator:app-context`);function me(e){x(fe,e)}function he(e){x(pe,e)}var Z=Symbol(`skill-creator:router`);function ge(e){x(Z,{get:e})}function _e(){if(!S(Z))return;let e=u(Z).get;return()=>e().params}function ve(){if(!S(Z))return;let e=u(Z).get;return()=>e().search}function Q(e){let t=e.replace(/^\/+|\/+$/g,``);if(!t)return null;let n=t.split(`/`),r=n[0];return r?{app:r,instanceKey:n[1]??`home`}:null}var ye={navigate(e,t=`PUSH`){t===`REPLACE`?C(e,{replaceState:!0,keepFocus:!0,noScroll:!0}):C(e)},replace(e){this.navigate(e,`REPLACE`)}};T({version:D(1),theme:E([`light`,`dark`,`system`]).default(`system`),sidebarCollapsed:O().default(!1)});var be=n(`<div class="app-shell-error svelte-1oszhz"> </div>`),$=n(`<div class="app-shell-loading svelte-1oszhz" aria-label="Loading"></div>`),xe=n(`<div class="app-shell-empty svelte-1oszhz">No route matched</div>`),Se=n(`<div class="app-shell svelte-1oszhz"><!> <div class="app-portal-root svelte-1oszhz"></div></div>`);function Ce(n,u){r(u,!0);let m=_(null),x=p(()=>B(u.activity.root,w.url.pathname,w.url.search,u.activity.pattern)),S=p(()=>l(x).kind===`matched`?l(x).chain:[]),C=p(()=>A(l(S))),T=p(()=>j(l(x),l(S)));me(()=>l(m)),he({get manifest(){return{id:u.app.id,name:u.app.name,icon:u.app.icon}},get pathname(){return w.url.pathname}}),ge(()=>({match:l(x),params:l(C),search:l(T),chain:l(S)}));let E=_(null),D=_(null),O=null,k=0;b(()=>{let t=(l(S).length>0?l(S)[l(S).length-1]:void 0)?.route,n=e(()=>O);if(!t){O=null,k+=1,f(E,null),f(D,null);return}if(n===t)return;O=t,f(E,null),f(D,null);let r=++k;t.component().then(e=>{r===k&&f(E,e.default,!0)}).catch(e=>{r===k&&f(D,e instanceof Error?e.message:String(e),!0)})});function A(e){if(e.length===0)return;let t={};for(let n of e)Object.assign(t,n.rawParams);return t}function j(e,t){if(e.kind===`no-match`||t.length===0)return;let n=t[t.length-1]?.route.search;if(!n)return;let r=n.safeParse(z(w.url.search));return r.success?r.data:void 0}var M=Se(),N=y(M),P=e=>{var t=be(),n=d(t);v(()=>a(n,`Failed to load: ${l(D)??``}`)),s(e,t)},F=e=>{let t=p(()=>l(E));var n=te(),r=ee(n);i(r,()=>l(t),(e,t)=>{t(e,{})}),s(e,n)},I=e=>{var t=$();s(e,t)},L=e=>{var t=xe();s(e,t)};o(N,e=>{l(D)?e(P):l(E)?e(F,1):l(S).length>0?e(I,2):e(L,-1)});var R=g(N,2);h(R,e=>f(m,e),()=>l(m)),t(M),s(n,M),c()}var we=n(`<div class="tab-empty svelte-t4mhty">Select an app from the sidebar.</div>`),Te=n(`<div class="tab-outlet-root svelte-t4mhty"><!></div>`);function Ee(e,n){r(n,!0);let i=p(()=>w.url.pathname),a=p(()=>Q(l(i))?.app??null),u=p(()=>l(a)?N.get(l(a)):null);m(()=>{let e=oe(l(i),w.url.search);e.kind===`redirect`&&(e.path!==l(i)||w.url.search)&&ye.replace(e.path)});let d=p(()=>{if(!l(u))return null;for(let e of l(u).activities)if(B(e.root,l(i),w.url.search,e.pattern).kind===`matched`)return e;return l(u).activities.find(e=>e.entry)??l(u).activities[0]??null});var f=Te(),h=y(f),g=e=>{Ce(e,{get app(){return l(u)},get activity(){return l(d)}})},_=e=>{var t=we();s(e,t)};o(h,e=>{l(u)&&l(d)?e(g):e(_,-1)}),t(f),s(e,f),c()}export{ue as a,ne as c,N as d,ve as i,re as l,Q as n,ce as o,_e as r,ie as s,Ee as t,P as u};
1
+ import{$ as e,At as t,B as n,Ct as r,D as i,F as a,N as o,R as s,St as c,X as l,bt as u,ct as d,ft as f,gt as p,it as m,l as h,lt as g,mt as _,nt as v,ot as y,rt as b,st as ee,wt as x,xt as S,z as te}from"./CmCJ0SKP.js";import{t as C}from"./B0stYqX9.js";import"./xihTtKlq.js";import{t as w}from"./CvO5eq4f.js";import"./oJ4aK8PG.js";import{D as T,S as E,T as D,w as O}from"./DlsPNMHX.js";function k(e){return e.activities.find(e=>e.entry)??e.activities[0]}var A=class{entries=new Map;register(e){this.entries.set(e.id,e)}get(e){return this.entries.get(e)}list(){return[...this.entries.values()]}findByPath(e){for(let t of this.entries.values()){let n=t.absolutePattern.replace(/:[^/]+/g,`[^/]+`);try{if(RegExp(`^${n.replace(/\//g,`\\/`)}\\/?$`).test(e))return t}catch{}}}},j=class{apps=new Map;register(e){this.apps.set(e.id,e)}get(e){return this.apps.get(e)}list(){return[...this.apps.values()]}},M=new A,N=new j;function P(e){let t={id:e.id,pattern:e.pattern,params:e.params,search:e.search,component:e.component,children:e.children};return I(t,t.pattern||`/`),t}function F(e,t){L(e,t)}function I(e,t){if(M.register({id:e.id,route:e,absolutePattern:t}),e.children)for(let n of e.children)I(n,R(t,n.pattern))}function L(e,t){let n=R(e,t.pattern);if(M.register({id:t.id,route:t,absolutePattern:n}),t.children)for(let e of t.children)L(n,e)}function R(e,t){let n=e.replace(/\/+$/,``),r=t.replace(/^\/+|\/+$/g,``);return r===``?n||`/`:`${n}/${r}`}function ne(e){return F(e.pattern,e.root),{pattern:e.pattern,root:e.root,entry:e.entry}}function re(e){return{id:e.id,pattern:``,search:e.search,component:e.component}}function ie(e){return N.register(e),{manifest:e}}function ae(e){let t=Object.entries(e).filter(([,e])=>e!=null);if(t.length===0)return``;let n=new URLSearchParams;for(let[e,r]of t)n.set(e,typeof r==`string`?r:String(r));let r=n.toString();return r?`?${r}`:``}function z(e){let t=e.startsWith(`?`)?e.slice(1):e;if(!t)return{};let n={},r=new URLSearchParams(t);for(let[e,t]of r)n[e]=t;return n}function B(e,t,n,r){let i=G(e,H(V(t,r)),r);if(i.length===0)return{kind:`no-match`,reason:`no-route`};let a=K(i),o=i[i.length-1].route,s=o.params;if(s){let e=s.safeParse(a);if(!e.success)return{kind:`parse-error`,reason:`params`,chain:i,errors:e.error}}let c=o.search;if(c){let e=z(n),t=c.safeParse(e);if(!t.success)return{kind:`parse-error`,reason:`search`,chain:i,errors:t.error}}return{kind:`matched`,chain:i}}function V(e,t){let n=t.replace(/\/+$/,``);return e===n?``:e.startsWith(n+`/`)?e.slice(n.length):e}function H(e){let t=e.replace(/^\/+|\/+$/g,``);return t===``?[]:t.split(`/`).map(e=>{try{return decodeURIComponent(e)}catch{return e}})}function U(e){let t=e.replace(/^\/+|\/+$/g,``);return t===``?[]:t.split(`/`).map(e=>e.startsWith(`:`)?{kind:`param`,value:e.slice(1)}:{kind:`static`,value:e})}function W(e,t){let n=e.replace(/\/+$/,``),r=t.replace(/^\/+|\/+$/g,``);return r===``?n:`${n}/${r}`}function G(e,t,n){let r=W(n,e.pattern),i=U(e.pattern);if(t.length<i.length)return[];let a={};for(let e=0;e<i.length;e++){let n=i[e],r=t[e];if(!r)return[];if(n.kind===`static`){if(n.value!==r)return[]}else a[n.value]=r}let o={absolutePattern:r,route:e,rawParams:a},s=t.slice(i.length);if(s.length===0)return[o];if(e.children&&e.children.length>0)for(let t of e.children){let e=G(t,s,r);if(e.length>0)return[o,...e]}return[]}function K(e){let t={};for(let n of e)Object.assign(t,n.rawParams);return t}var q=/:([A-Za-z_][A-Za-z0-9_]*)/g;function J(e,t){return e.replace(q,(e,n)=>{let r=t[n];return r===void 0?`:${n}`:encodeURIComponent(r)})}var Y=`/workspaces`;function oe(e,t){let n=se(e),r=n?N.get(n):void 0;if(!r)return{kind:`redirect`,path:Y};let i=k(r);if(!i)return{kind:`redirect`,path:Y};for(let n of r.activities){let r=B(n.root,e,t,n.pattern);if(r.kind===`matched`)return{kind:`ok`};if(r.kind===`parse-error`)return r.reason===`params`?{kind:`redirect`,path:i.pattern}:{kind:`redirect`,path:e}}return{kind:`redirect`,path:i.pattern}}function se(e){let t=e.replace(/^\/+/,``);return t?t.split(`/`)[0]??null:null}var X=null;function ce(e){X=e}function le(e,t,n){let r=M.get(e);return r?de(r.absolutePattern,t,n):`/`}function ue(e,t,n,r){let i=le(e,t,n);X?.navigate(i,r)}function de(e,t,n){return`${J(e,t??{})}${n?ae(n):``}`}var fe=Symbol(`skill-creator:portal-target`),pe=Symbol(`skill-creator:app-context`);function me(e){x(fe,e)}function he(e){x(pe,e)}var Z=Symbol(`skill-creator:router`);function ge(e){x(Z,{get:e})}function _e(){if(!S(Z))return;let e=u(Z).get;return()=>e().params}function ve(){if(!S(Z))return;let e=u(Z).get;return()=>e().search}function Q(e){let t=e.replace(/^\/+|\/+$/g,``);if(!t)return null;let n=t.split(`/`),r=n[0];return r?{app:r,instanceKey:n[1]??`home`}:null}var ye={navigate(e,t=`PUSH`){t===`REPLACE`?C(e,{replaceState:!0,keepFocus:!0,noScroll:!0}):C(e)},replace(e){this.navigate(e,`REPLACE`)}};T({version:D(1),theme:E([`light`,`dark`,`system`]).default(`system`),sidebarCollapsed:O().default(!1)});var be=n(`<div class="app-shell-error svelte-1oszhz"> </div>`),$=n(`<div class="app-shell-loading svelte-1oszhz" aria-label="Loading"></div>`),xe=n(`<div class="app-shell-empty svelte-1oszhz">No route matched</div>`),Se=n(`<div class="app-shell svelte-1oszhz"><!> <div class="app-portal-root svelte-1oszhz"></div></div>`);function Ce(n,u){r(u,!0);let m=_(null),x=p(()=>B(u.activity.root,w.url.pathname,w.url.search,u.activity.pattern)),S=p(()=>l(x).kind===`matched`?l(x).chain:[]),C=p(()=>A(l(S))),T=p(()=>j(l(x),l(S)));me(()=>l(m)),he({get manifest(){return{id:u.app.id,name:u.app.name,icon:u.app.icon}},get pathname(){return w.url.pathname}}),ge(()=>({match:l(x),params:l(C),search:l(T),chain:l(S)}));let E=_(null),D=_(null),O=null,k=0;b(()=>{let t=(l(S).length>0?l(S)[l(S).length-1]:void 0)?.route,n=e(()=>O);if(!t){O=null,k+=1,f(E,null),f(D,null);return}if(n===t)return;O=t,f(E,null),f(D,null);let r=++k;t.component().then(e=>{r===k&&f(E,e.default,!0)}).catch(e=>{r===k&&f(D,e instanceof Error?e.message:String(e),!0)})});function A(e){if(e.length===0)return;let t={};for(let n of e)Object.assign(t,n.rawParams);return t}function j(e,t){if(e.kind===`no-match`||t.length===0)return;let n=t[t.length-1]?.route.search;if(!n)return;let r=n.safeParse(z(w.url.search));return r.success?r.data:void 0}var M=Se(),N=y(M),P=e=>{var t=be(),n=d(t);v(()=>a(n,`Failed to load: ${l(D)??``}`)),s(e,t)},F=e=>{let t=p(()=>l(E));var n=te(),r=ee(n);i(r,()=>l(t),(e,t)=>{t(e,{})}),s(e,n)},I=e=>{var t=$();s(e,t)},L=e=>{var t=xe();s(e,t)};o(N,e=>{l(D)?e(P):l(E)?e(F,1):l(S).length>0?e(I,2):e(L,-1)});var R=g(N,2);h(R,e=>f(m,e),()=>l(m)),t(M),s(n,M),c()}var we=n(`<div class="tab-empty svelte-t4mhty">Select an app from the sidebar.</div>`),Te=n(`<div class="tab-outlet-root svelte-t4mhty"><!></div>`);function Ee(e,n){r(n,!0);let i=p(()=>w.url.pathname),a=p(()=>Q(l(i))?.app??null),u=p(()=>l(a)?N.get(l(a)):null);m(()=>{let e=oe(l(i),w.url.search);e.kind===`redirect`&&(e.path!==l(i)||w.url.search)&&ye.replace(e.path)});let d=p(()=>{if(!l(u))return null;for(let e of l(u).activities)if(B(e.root,l(i),w.url.search,e.pattern).kind===`matched`)return e;return l(u).activities.find(e=>e.entry)??l(u).activities[0]??null});var f=Te(),h=y(f),g=e=>{Ce(e,{get app(){return l(u)},get activity(){return l(d)}})},_=e=>{var t=we();s(e,t)};o(h,e=>{l(u)&&l(d)?e(g):e(_,-1)}),t(f),s(e,f),c()}export{ue as a,ne as c,N as d,ve as i,re as l,Q as n,ce as o,_e as r,ie as s,Ee as t,P as u};
@@ -1,2 +1,2 @@
1
- import{A as e,At as t,B as n,Ct as r,F as i,G as a,K as o,N as s,R as c,St as l,W as u,X as d,ct as f,d as p,ft as m,gt as h,h as ee,lt as g,m as te,mt as _,nt as v,ot as y,p as b,rt as x,st as S,ut as ne,x as re}from"./CmCJ0SKP.js";import{t as C}from"./8hp3I3ac.js";import"./xihTtKlq.js";import{t as w}from"./B0-OMyfG.js";import"./DXKynIUR.js";import{a as ie,i as T,r as E}from"./oxP0dM6z.js";import{c as ae,d as D,l as O,n as k,o as A,u as j}from"./D3qCeXbe.js";import{a as M,r as oe,s as se}from"./CgxChsUX.js";var N=[{id:`anthropics-skills`,label:`Anthropic Skills`,gitUrl:`https://github.com/anthropics/skills.git`,description:`Anthropic 官方维护的 Agent skills 集合。`,homepage:`https://github.com/anthropics/skills`},{id:`vercel-labs-skills`,label:`Vercel Labs Skills`,gitUrl:`https://github.com/vercel-labs/skills.git`,description:`Vercel Labs 维护的社区 Agent skills 集合。`,homepage:`https://github.com/vercel-labs/skills`}];function ce(e){return N.find(t=>t.id===e)}var le=n(`<p class="truncate font-mono text-[11px] text-muted-foreground"> </p>`),ue=n(`<span class="shrink-0 text-[11px] text-muted-foreground"> </span>`),de=n(`<div class="flex shrink-0 items-center gap-3 border-b border-amber-500/40 bg-amber-500/10 px-4 py-2.5 text-xs" role="alert" data-testid="session-expired"><span class="min-w-0 flex-1"><span class="font-medium">Scan session expired.</span> <span class="text-muted-foreground">The pinned commit is no longer held by the daemon. Rescan this repository to continue.</span></span> <button type="button" class="h-7 shrink-0 rounded-md border border-border bg-background px-3 text-[11px] font-medium transition-colors hover:bg-muted/50 disabled:opacity-50">Rescan</button></div>`),fe=n(`<p class="px-4 py-8 text-center text-xs text-muted-foreground">Scanning…</p>`),pe=n(`<div class="px-4 text-center"><button type="button" class="rounded-md border border-border px-3 py-1 text-xs hover:bg-muted/50">Retry scan</button></div>`),me=n(`<p class="px-4 py-8 text-center text-xs text-destructive"> </p> <!>`,1),he=n(`<p class="px-4 py-8 text-center text-xs text-muted-foreground">No scan yet.</p>`),ge=n(`<p class="px-4 py-8 text-center text-xs text-muted-foreground">No installable skills found in this repository.</p>`),_e=n(`<button type="button" class="hover:text-foreground">Clear</button>`),ve=n(`<span class="mt-0.5 block text-[10px] text-amber-600 dark:text-amber-400"> </span>`),ye=n(`<button type="button"><input type="checkbox" class="mt-0.5 h-3.5 w-3.5" aria-label="Select skill"/> <span class="min-w-0 flex-1"><span class="block truncate text-[13px] font-medium text-foreground"> </span> <span class="mt-0.5 line-clamp-2 block text-[11px] text-muted-foreground"> </span> <!></span></button>`),be=n(`<p class="mt-2 text-xs text-muted-foreground">Loading…</p>`),xe=n(`<pre class="mt-2 max-h-48 overflow-auto rounded bg-muted/50 p-2 text-[11px] leading-4"> </pre>`),Se=n(`<p class="mt-2 text-xs text-muted-foreground">Select a skill to preview.</p>`),Ce=n(`<p class="mt-2 text-xs text-muted-foreground">No writable workspace providers. Import a directory workspace first.</p>`),we=n(`<li><label class="flex items-center gap-2 text-xs"><input type="checkbox" class="h-3.5 w-3.5"/> <span class="truncate"> </span></label></li>`),Te=n(`<ul class="mt-2 space-y-1"></ul>`),Ee=n(`<p class="mt-2 break-words text-xs text-destructive"> </p>`),De=n(`<div class="p-3 text-xs"><h2 class="font-medium text-muted-foreground">Dry-run preview</h2> <p class="mt-1"> </p></div>`),Oe=n(`<div class="flex items-center justify-between gap-2 rounded border border-border px-2 py-1"><span class="truncate"> </span> <button type="button" class="shrink-0 rounded bg-primary/10 px-2 py-0.5 text-[10px] text-primary hover:bg-primary/20">View in Workspaces</button></div>`),ke=n(`<div class="mt-2 space-y-1"></div>`),Ae=n(`<div class="p-3 text-xs"><h2 class="font-medium text-muted-foreground"> </h2> <!></div>`),je=n(`<div class="flex min-h-0 flex-1"><section class="flex w-1/2 min-w-0 flex-col border-r border-border"><header class="flex shrink-0 items-center justify-between px-3 py-2 text-xs text-muted-foreground"><span> </span> <!></header> <div class="min-h-0 flex-1 overflow-y-auto"></div></section> <section class="flex w-1/2 min-w-0 flex-col overflow-y-auto"><div class="border-b border-border p-3"><h2 class="text-xs font-medium text-muted-foreground">Preview</h2> <!></div> <div class="border-b border-border p-3"><h2 class="text-xs font-medium text-muted-foreground"> </h2> <!> <div class="mt-2 flex gap-2"><button type="button" class="h-7 rounded-md border border-border px-2 text-[11px] hover:bg-muted/50 disabled:opacity-50">Dry-run</button> <button type="button" class="h-7 rounded-md bg-primary px-3 text-[11px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50"> </button></div> <!></div> <!> <!></section></div>`),Me=n(`<div class="flex h-full flex-col overflow-hidden"><header class="flex shrink-0 items-center gap-3 border-b border-border px-4 py-3"><div class="min-w-0 flex-1"><h1 class="truncate text-sm font-semibold"> </h1> <!></div> <!> <form class="flex shrink-0 items-center gap-1"><input placeholder="branch / tag" title="Optional Git ref to scan (defaults to the repository default branch)" aria-label="Git ref for scanning" class="h-7 w-28 rounded-md border border-input bg-input/20 px-2 font-mono text-[11px] outline-none placeholder:text-muted-foreground focus-visible:border-ring"/> <button type="submit" class="h-7 rounded-md border border-border px-2 text-[11px] transition-colors hover:bg-muted/50 disabled:opacity-50"> </button></form> <button type="button" class="shrink-0 rounded-md border border-border px-2 py-1 text-[11px] hover:bg-muted/50">Discover</button></header> <!> <!></div>`);function P(n,u){r(u,!0);let N=E(),P=T(),F=h(()=>N?.()?.sourceId),Ne=h(()=>d(F)?ce(d(F)):void 0),Pe=h(()=>d(F)?se.user.find(e=>e.id===d(F)):void 0),Fe=h(()=>d(Ne)?.label??d(Pe)?.label??d(F)??`Repository`),I=h(()=>d(Ne)?.gitUrl??d(Pe)?.gitUrl),L=_(null),R=_(!1),z=_(null),B=_(null),V=_(!1),H=_(null),U=_(null),W=_(!1),G=_(null),K=_(``),Ie=h(()=>P?.()?.selected??``),q=h(()=>{let e=d(Ie).split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(e)}),Le=h(()=>P?.()?.skill),J=_(ne([]));x(()=>{M()}),x(()=>{k()});let Re=h(A),ze=_(null);x(()=>{d(F)&&d(I)&&(d(ze)===d(F)&&d(L)||(m(ze,d(F),!0),Y(d(I))))});async function Y(e,t){m(R,!0),m(z,null),m(L,null),m(B,null),m(H,null),m(U,null),m(G,null);let n=t?.trim()||void 0,{scan:r,error:i}=await D(e,n);m(L,r,!0),m(z,i,!0),r&&d(F)&&oe(d(F),{skillCount:r.skills.length,commit:r.commit}),m(R,!1)}x(()=>{if(!d(L)||!d(Le)){m(B,null);return}let e=d(Le);if(!d(L).skills.some(t=>t.id===e)){m(B,null);return}Be(d(L).sessionId,e)});async function Be(e,t){m(V,!0),m(H,null);let{preview:n,error:r}=await j(e,t);m(B,n,!0),m(H,r,!0),m(V,!1)}function Ve(e){let t=new Set(d(q));t.has(e.id)?t.delete(e.id):t.add(e.id),He(t)}function He(e){let t=[...e].join(`,`),n=new URLSearchParams(w.url.search);t?n.set(`selected`,t):n.delete(`selected`);let r=n.toString();C(`/repository/scan/${encodeURIComponent(d(F)??``)}${r?`?${r}`:``}`,{replaceState:!0})}function Ue(e){let t=new URLSearchParams(w.url.search);t.set(`skill`,e.id),C(`/repository/scan/${encodeURIComponent(d(F)??``)}?${t.toString()}`,{replaceState:!0})}function We(e){let t=d(J).some(t=>t.workspaceId===e.workspaceId&&t.providerId===e.providerId);m(J,t?d(J).filter(t=>t.workspaceId!==e.workspaceId||t.providerId!==e.providerId):[...d(J),e],!0)}function Ge(e){return d(J).some(t=>t.workspaceId===e.workspaceId&&t.providerId===e.providerId)}let Ke=h(()=>d(L)?d(L).skills.filter(e=>d(q).has(e.id)):[]),X=h(()=>d(Ke).filter(e=>e.installable));async function qe(e){if(!d(L)||d(X).length===0||d(J).length===0)return;m(W,!0),m(G,null),m(U,null);let t=d(X).map(e=>e.id),{result:n,error:r}=await ae({sessionId:d(L).sessionId,skillIds:t,targets:d(J),dryRun:e});m(U,n,!0),m(G,r,!0),m(W,!1),n&&!e&&await k()}let Je=h(()=>O(d(H))||O(d(G))),Z=h(()=>d(U)?.kind===`result`?d(U):null),Ye=h(()=>d(Z)?d(Z).results.filter(e=>e.status===`installed`||e.status===`overwritten`):[]);function Xe(e,t,n){ie(`workspaces.provider`,{wsId:e,providerId:t},{skill:n})}var Ze=Me(),Qe=y(Ze),Q=y(Qe),$e=y(Q),et=f($e,!0),tt=g($e,2),nt=e=>{var t=le(),n=f(t,!0);v(()=>i(n,d(I))),c(e,t)};s(tt,e=>{d(I)&&e(nt)}),t(Q);var rt=g(Q,2),it=e=>{var t=ue(),n=f(t);v(e=>i(n,`${d(L).skills.length??``} skills · commit ${e??``}`),[()=>d(L).commit.slice(0,12)]),c(e,t)};s(rt,e=>{d(L)&&e(it)});var $=g(rt,2),at=y($);b(at);var ot=g(at,2),st=f(ot,!0);t($);var ct=g($,2);t(Qe);var lt=g(Qe,2),ut=e=>{var n=de(),r=g(y(n),2);t(n),v(()=>r.disabled=d(R)||!d(I)),a(`click`,r,()=>d(I)&&void Y(d(I),d(K))),c(e,n)};s(lt,e=>{d(Je)&&e(ut)});var dt=g(lt,2),ft=e=>{var t=fe();c(e,t)},pt=e=>{var t=me(),n=S(t),r=f(n,!0),o=g(n,2),l=e=>{var t=pe(),n=f(t);a(`click`,n,()=>Y(d(I))),c(e,t)};s(o,e=>{d(I)&&e(l)}),v(()=>i(r,d(z).message)),c(e,t)},mt=e=>{var t=he();c(e,t)},ht=e=>{var t=ge();c(e,t)},gt=n=>{var r=je(),o=y(r),l=y(o),u=y(l),p=f(u),m=g(u,2),h=e=>{var t=_e();a(`click`,t,()=>He(new Set)),c(e,t)};s(m,e=>{d(q).size>0&&e(h)}),t(l);var _=g(l,2);e(_,21,()=>d(L).skills,e=>e.id,(e,n)=>{var r=ye(),o=y(r);b(o);var l=g(o,2),u=y(l),p=f(u,!0),m=g(u,2),h=f(m,!0),_=g(m,2),x=e=>{var t=ve(),r=f(t,!0);v(e=>i(r,e),[()=>d(n).issues.join(` `)||`Not installable`]),c(e,t)};s(_,e=>{d(n).installable||e(x)}),t(l),t(r),v((e,t,a)=>{re(r,1,`flex w-full items-start gap-2 border-b border-border/70 px-3 py-2 text-left transition-colors ${e??``}`),te(r,`aria-pressed`,t),ee(o,a),i(p,d(n).name),i(h,d(n).description||`No description`)},[()=>d(q).has(d(n).id)?`bg-accent`:`hover:bg-accent/60`,()=>d(q).has(d(n).id),()=>d(q).has(d(n).id)]),a(`click`,r,()=>Ue(d(n))),a(`click`,o,e=>{e.stopPropagation(),Ve(d(n))}),c(e,r)}),t(_),t(o);var x=g(o,2),S=y(x),ne=g(y(S),2),C=e=>{var t=be();c(e,t)},w=e=>{var t=xe(),n=f(t,!0);v(()=>i(n,d(B).content)),c(e,t)},ie=e=>{var t=Se();c(e,t)};s(ne,e=>{d(V)?e(C):d(B)?e(w,1):e(ie,-1)}),t(S);var T=g(S,2),E=y(T),ae=f(E),D=g(E,2),O=e=>{var t=Ce();c(e,t)},k=n=>{var r=Te();e(r,21,()=>d(Re),e=>e.target.workspaceId+`:`+e.target.providerId,(e,n)=>{var r=we(),o=y(r),s=y(o);b(s);var l=g(s,2),u=f(l,!0);t(o),t(r),v(e=>{ee(s,e),i(u,d(n).label)},[()=>Ge(d(n).target)]),a(`change`,s,()=>We(d(n).target)),c(e,r)}),t(r),c(n,r)};s(D,e=>{d(Re).length===0?e(O):e(k,-1)});var A=g(D,2),j=y(A),M=g(j,2),oe=f(M,!0);t(A);var se=g(A,2),N=e=>{var t=Ee(),n=f(t,!0);v(()=>i(n,d(G).message)),c(e,t)};s(se,e=>{d(G)&&!d(Je)&&e(N)}),t(T);var ce=g(T,2),le=e=>{var n=De(),r=g(y(n),2),a=f(r);t(n),v(()=>i(a,`${d(U).totalInstalls??``} install(s) planned across ${d(U).destinations.length??``} destination(s).`)),c(e,n)};s(ce,e=>{d(U)?.kind===`preview`&&e(le)});var ue=g(ce,2),de=n=>{var r=Ae(),o=y(r),l=f(o),u=g(o,2),p=n=>{var r=ke();e(r,21,()=>d(Ye),e=>e.target.workspaceId+`:`+e.target.providerId+`:`+e.skillId,(e,n)=>{var r=Oe(),o=y(r),s=f(o),l=g(o,2);t(r),v(()=>i(s,`${d(n).skill??``} → ${d(n).target.workspaceId??``}/${d(n).target.providerId??``}`)),a(`click`,l,()=>Xe(d(n).target.workspaceId,d(n).target.providerId,d(n).skillId)),c(e,r)}),t(r),c(n,r)};s(u,e=>{d(Ye).length>0&&e(p)}),t(r),v(()=>i(l,`Installed ${d(Z).installed??``} · overwritten ${d(Z).overwritten??``} · skipped
1
+ import{A as e,At as t,B as n,Ct as r,F as i,G as a,K as o,N as s,R as c,St as l,W as u,X as d,ct as f,d as p,ft as m,gt as h,h as ee,lt as g,m as te,mt as _,nt as v,ot as y,p as b,rt as x,st as S,ut as ne,x as re}from"./CmCJ0SKP.js";import{t as C}from"./B0stYqX9.js";import"./xihTtKlq.js";import{t as w}from"./CvO5eq4f.js";import"./oJ4aK8PG.js";import{a as ie,i as T,r as E}from"./D7DTLcps.js";import{c as ae,d as D,l as O,n as k,o as A,u as j}from"./BgJCuTDs.js";import{a as M,r as oe,s as se}from"./Du6-3Tbt.js";var N=[{id:`anthropics-skills`,label:`Anthropic Skills`,gitUrl:`https://github.com/anthropics/skills.git`,description:`Anthropic 官方维护的 Agent skills 集合。`,homepage:`https://github.com/anthropics/skills`},{id:`vercel-labs-skills`,label:`Vercel Labs Skills`,gitUrl:`https://github.com/vercel-labs/skills.git`,description:`Vercel Labs 维护的社区 Agent skills 集合。`,homepage:`https://github.com/vercel-labs/skills`}];function ce(e){return N.find(t=>t.id===e)}var le=n(`<p class="truncate font-mono text-[11px] text-muted-foreground"> </p>`),ue=n(`<span class="shrink-0 text-[11px] text-muted-foreground"> </span>`),de=n(`<div class="flex shrink-0 items-center gap-3 border-b border-amber-500/40 bg-amber-500/10 px-4 py-2.5 text-xs" role="alert" data-testid="session-expired"><span class="min-w-0 flex-1"><span class="font-medium">Scan session expired.</span> <span class="text-muted-foreground">The pinned commit is no longer held by the daemon. Rescan this repository to continue.</span></span> <button type="button" class="h-7 shrink-0 rounded-md border border-border bg-background px-3 text-[11px] font-medium transition-colors hover:bg-muted/50 disabled:opacity-50">Rescan</button></div>`),fe=n(`<p class="px-4 py-8 text-center text-xs text-muted-foreground">Scanning…</p>`),pe=n(`<div class="px-4 text-center"><button type="button" class="rounded-md border border-border px-3 py-1 text-xs hover:bg-muted/50">Retry scan</button></div>`),me=n(`<p class="px-4 py-8 text-center text-xs text-destructive"> </p> <!>`,1),he=n(`<p class="px-4 py-8 text-center text-xs text-muted-foreground">No scan yet.</p>`),ge=n(`<p class="px-4 py-8 text-center text-xs text-muted-foreground">No installable skills found in this repository.</p>`),_e=n(`<button type="button" class="hover:text-foreground">Clear</button>`),ve=n(`<span class="mt-0.5 block text-[10px] text-amber-600 dark:text-amber-400"> </span>`),ye=n(`<button type="button"><input type="checkbox" class="mt-0.5 h-3.5 w-3.5" aria-label="Select skill"/> <span class="min-w-0 flex-1"><span class="block truncate text-[13px] font-medium text-foreground"> </span> <span class="mt-0.5 line-clamp-2 block text-[11px] text-muted-foreground"> </span> <!></span></button>`),be=n(`<p class="mt-2 text-xs text-muted-foreground">Loading…</p>`),xe=n(`<pre class="mt-2 max-h-48 overflow-auto rounded bg-muted/50 p-2 text-[11px] leading-4"> </pre>`),Se=n(`<p class="mt-2 text-xs text-muted-foreground">Select a skill to preview.</p>`),Ce=n(`<p class="mt-2 text-xs text-muted-foreground">No writable workspace providers. Import a directory workspace first.</p>`),we=n(`<li><label class="flex items-center gap-2 text-xs"><input type="checkbox" class="h-3.5 w-3.5"/> <span class="truncate"> </span></label></li>`),Te=n(`<ul class="mt-2 space-y-1"></ul>`),Ee=n(`<p class="mt-2 break-words text-xs text-destructive"> </p>`),De=n(`<div class="p-3 text-xs"><h2 class="font-medium text-muted-foreground">Dry-run preview</h2> <p class="mt-1"> </p></div>`),Oe=n(`<div class="flex items-center justify-between gap-2 rounded border border-border px-2 py-1"><span class="truncate"> </span> <button type="button" class="shrink-0 rounded bg-primary/10 px-2 py-0.5 text-[10px] text-primary hover:bg-primary/20">View in Workspaces</button></div>`),ke=n(`<div class="mt-2 space-y-1"></div>`),Ae=n(`<div class="p-3 text-xs"><h2 class="font-medium text-muted-foreground"> </h2> <!></div>`),je=n(`<div class="flex min-h-0 flex-1"><section class="flex w-1/2 min-w-0 flex-col border-r border-border"><header class="flex shrink-0 items-center justify-between px-3 py-2 text-xs text-muted-foreground"><span> </span> <!></header> <div class="min-h-0 flex-1 overflow-y-auto"></div></section> <section class="flex w-1/2 min-w-0 flex-col overflow-y-auto"><div class="border-b border-border p-3"><h2 class="text-xs font-medium text-muted-foreground">Preview</h2> <!></div> <div class="border-b border-border p-3"><h2 class="text-xs font-medium text-muted-foreground"> </h2> <!> <div class="mt-2 flex gap-2"><button type="button" class="h-7 rounded-md border border-border px-2 text-[11px] hover:bg-muted/50 disabled:opacity-50">Dry-run</button> <button type="button" class="h-7 rounded-md bg-primary px-3 text-[11px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50"> </button></div> <!></div> <!> <!></section></div>`),Me=n(`<div class="flex h-full flex-col overflow-hidden"><header class="flex shrink-0 items-center gap-3 border-b border-border px-4 py-3"><div class="min-w-0 flex-1"><h1 class="truncate text-sm font-semibold"> </h1> <!></div> <!> <form class="flex shrink-0 items-center gap-1"><input placeholder="branch / tag" title="Optional Git ref to scan (defaults to the repository default branch)" aria-label="Git ref for scanning" class="h-7 w-28 rounded-md border border-input bg-input/20 px-2 font-mono text-[11px] outline-none placeholder:text-muted-foreground focus-visible:border-ring"/> <button type="submit" class="h-7 rounded-md border border-border px-2 text-[11px] transition-colors hover:bg-muted/50 disabled:opacity-50"> </button></form> <button type="button" class="shrink-0 rounded-md border border-border px-2 py-1 text-[11px] hover:bg-muted/50">Discover</button></header> <!> <!></div>`);function P(n,u){r(u,!0);let N=E(),P=T(),F=h(()=>N?.()?.sourceId),Ne=h(()=>d(F)?ce(d(F)):void 0),Pe=h(()=>d(F)?se.user.find(e=>e.id===d(F)):void 0),Fe=h(()=>d(Ne)?.label??d(Pe)?.label??d(F)??`Repository`),I=h(()=>d(Ne)?.gitUrl??d(Pe)?.gitUrl),L=_(null),R=_(!1),z=_(null),B=_(null),V=_(!1),H=_(null),U=_(null),W=_(!1),G=_(null),K=_(``),Ie=h(()=>P?.()?.selected??``),q=h(()=>{let e=d(Ie).split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(e)}),Le=h(()=>P?.()?.skill),J=_(ne([]));x(()=>{M()}),x(()=>{k()});let Re=h(A),ze=_(null);x(()=>{d(F)&&d(I)&&(d(ze)===d(F)&&d(L)||(m(ze,d(F),!0),Y(d(I))))});async function Y(e,t){m(R,!0),m(z,null),m(L,null),m(B,null),m(H,null),m(U,null),m(G,null);let n=t?.trim()||void 0,{scan:r,error:i}=await D(e,n);m(L,r,!0),m(z,i,!0),r&&d(F)&&oe(d(F),{skillCount:r.skills.length,commit:r.commit}),m(R,!1)}x(()=>{if(!d(L)||!d(Le)){m(B,null);return}let e=d(Le);if(!d(L).skills.some(t=>t.id===e)){m(B,null);return}Be(d(L).sessionId,e)});async function Be(e,t){m(V,!0),m(H,null);let{preview:n,error:r}=await j(e,t);m(B,n,!0),m(H,r,!0),m(V,!1)}function Ve(e){let t=new Set(d(q));t.has(e.id)?t.delete(e.id):t.add(e.id),He(t)}function He(e){let t=[...e].join(`,`),n=new URLSearchParams(w.url.search);t?n.set(`selected`,t):n.delete(`selected`);let r=n.toString();C(`/repository/scan/${encodeURIComponent(d(F)??``)}${r?`?${r}`:``}`,{replaceState:!0})}function Ue(e){let t=new URLSearchParams(w.url.search);t.set(`skill`,e.id),C(`/repository/scan/${encodeURIComponent(d(F)??``)}?${t.toString()}`,{replaceState:!0})}function We(e){let t=d(J).some(t=>t.workspaceId===e.workspaceId&&t.providerId===e.providerId);m(J,t?d(J).filter(t=>t.workspaceId!==e.workspaceId||t.providerId!==e.providerId):[...d(J),e],!0)}function Ge(e){return d(J).some(t=>t.workspaceId===e.workspaceId&&t.providerId===e.providerId)}let Ke=h(()=>d(L)?d(L).skills.filter(e=>d(q).has(e.id)):[]),X=h(()=>d(Ke).filter(e=>e.installable));async function qe(e){if(!d(L)||d(X).length===0||d(J).length===0)return;m(W,!0),m(G,null),m(U,null);let t=d(X).map(e=>e.id),{result:n,error:r}=await ae({sessionId:d(L).sessionId,skillIds:t,targets:d(J),dryRun:e});m(U,n,!0),m(G,r,!0),m(W,!1),n&&!e&&await k()}let Je=h(()=>O(d(H))||O(d(G))),Z=h(()=>d(U)?.kind===`result`?d(U):null),Ye=h(()=>d(Z)?d(Z).results.filter(e=>e.status===`installed`||e.status===`overwritten`):[]);function Xe(e,t,n){ie(`workspaces.provider`,{wsId:e,providerId:t},{skill:n})}var Ze=Me(),Qe=y(Ze),Q=y(Qe),$e=y(Q),et=f($e,!0),tt=g($e,2),nt=e=>{var t=le(),n=f(t,!0);v(()=>i(n,d(I))),c(e,t)};s(tt,e=>{d(I)&&e(nt)}),t(Q);var rt=g(Q,2),it=e=>{var t=ue(),n=f(t);v(e=>i(n,`${d(L).skills.length??``} skills · commit ${e??``}`),[()=>d(L).commit.slice(0,12)]),c(e,t)};s(rt,e=>{d(L)&&e(it)});var $=g(rt,2),at=y($);b(at);var ot=g(at,2),st=f(ot,!0);t($);var ct=g($,2);t(Qe);var lt=g(Qe,2),ut=e=>{var n=de(),r=g(y(n),2);t(n),v(()=>r.disabled=d(R)||!d(I)),a(`click`,r,()=>d(I)&&void Y(d(I),d(K))),c(e,n)};s(lt,e=>{d(Je)&&e(ut)});var dt=g(lt,2),ft=e=>{var t=fe();c(e,t)},pt=e=>{var t=me(),n=S(t),r=f(n,!0),o=g(n,2),l=e=>{var t=pe(),n=f(t);a(`click`,n,()=>Y(d(I))),c(e,t)};s(o,e=>{d(I)&&e(l)}),v(()=>i(r,d(z).message)),c(e,t)},mt=e=>{var t=he();c(e,t)},ht=e=>{var t=ge();c(e,t)},gt=n=>{var r=je(),o=y(r),l=y(o),u=y(l),p=f(u),m=g(u,2),h=e=>{var t=_e();a(`click`,t,()=>He(new Set)),c(e,t)};s(m,e=>{d(q).size>0&&e(h)}),t(l);var _=g(l,2);e(_,21,()=>d(L).skills,e=>e.id,(e,n)=>{var r=ye(),o=y(r);b(o);var l=g(o,2),u=y(l),p=f(u,!0),m=g(u,2),h=f(m,!0),_=g(m,2),x=e=>{var t=ve(),r=f(t,!0);v(e=>i(r,e),[()=>d(n).issues.join(` `)||`Not installable`]),c(e,t)};s(_,e=>{d(n).installable||e(x)}),t(l),t(r),v((e,t,a)=>{re(r,1,`flex w-full items-start gap-2 border-b border-border/70 px-3 py-2 text-left transition-colors ${e??``}`),te(r,`aria-pressed`,t),ee(o,a),i(p,d(n).name),i(h,d(n).description||`No description`)},[()=>d(q).has(d(n).id)?`bg-accent`:`hover:bg-accent/60`,()=>d(q).has(d(n).id),()=>d(q).has(d(n).id)]),a(`click`,r,()=>Ue(d(n))),a(`click`,o,e=>{e.stopPropagation(),Ve(d(n))}),c(e,r)}),t(_),t(o);var x=g(o,2),S=y(x),ne=g(y(S),2),C=e=>{var t=be();c(e,t)},w=e=>{var t=xe(),n=f(t,!0);v(()=>i(n,d(B).content)),c(e,t)},ie=e=>{var t=Se();c(e,t)};s(ne,e=>{d(V)?e(C):d(B)?e(w,1):e(ie,-1)}),t(S);var T=g(S,2),E=y(T),ae=f(E),D=g(E,2),O=e=>{var t=Ce();c(e,t)},k=n=>{var r=Te();e(r,21,()=>d(Re),e=>e.target.workspaceId+`:`+e.target.providerId,(e,n)=>{var r=we(),o=y(r),s=y(o);b(s);var l=g(s,2),u=f(l,!0);t(o),t(r),v(e=>{ee(s,e),i(u,d(n).label)},[()=>Ge(d(n).target)]),a(`change`,s,()=>We(d(n).target)),c(e,r)}),t(r),c(n,r)};s(D,e=>{d(Re).length===0?e(O):e(k,-1)});var A=g(D,2),j=y(A),M=g(j,2),oe=f(M,!0);t(A);var se=g(A,2),N=e=>{var t=Ee(),n=f(t,!0);v(()=>i(n,d(G).message)),c(e,t)};s(se,e=>{d(G)&&!d(Je)&&e(N)}),t(T);var ce=g(T,2),le=e=>{var n=De(),r=g(y(n),2),a=f(r);t(n),v(()=>i(a,`${d(U).totalInstalls??``} install(s) planned across ${d(U).destinations.length??``} destination(s).`)),c(e,n)};s(ce,e=>{d(U)?.kind===`preview`&&e(le)});var ue=g(ce,2),de=n=>{var r=Ae(),o=y(r),l=f(o),u=g(o,2),p=n=>{var r=ke();e(r,21,()=>d(Ye),e=>e.target.workspaceId+`:`+e.target.providerId+`:`+e.skillId,(e,n)=>{var r=Oe(),o=y(r),s=f(o),l=g(o,2);t(r),v(()=>i(s,`${d(n).skill??``} → ${d(n).target.workspaceId??``}/${d(n).target.providerId??``}`)),a(`click`,l,()=>Xe(d(n).target.workspaceId,d(n).target.providerId,d(n).skillId)),c(e,r)}),t(r),c(n,r)};s(u,e=>{d(Ye).length>0&&e(p)}),t(r),v(()=>i(l,`Installed ${d(Z).installed??``} · overwritten ${d(Z).overwritten??``} · skipped
2
2
  ${d(Z).skipped??``} · failed ${d(Z).failed??``}`)),c(n,r)};s(ue,e=>{d(Z)&&e(de)}),t(x),t(r),v(()=>{i(p,`${d(q).size??``} selected`),i(ae,`Install targets (${d(J).length??``})`),j.disabled=d(W)||d(X).length===0||d(J).length===0,M.disabled=d(W)||d(X).length===0||d(J).length===0,i(oe,d(W)?`Installing…`:`Install`)}),a(`click`,j,()=>qe(!0)),a(`click`,M,()=>qe(!1)),c(n,r)};s(dt,e=>{d(R)?e(ft):d(z)?e(pt,1):d(L)?d(L).skills.length===0?e(ht,3):e(gt,-1):e(mt,2)}),t(Ze),v(()=>{i(et,d(Fe)),ot.disabled=d(R)||!d(I),i(st,d(R)?`Scanning…`:`Rescan`)}),o(`submit`,$,e=>{e.preventDefault(),d(I)&&Y(d(I),d(K))}),p(at,()=>d(K),e=>m(K,e)),a(`click`,ct,()=>C(`/repository`)),c(n,Ze),l()}u([`click`,`change`]);export{P as default};
@@ -0,0 +1,5 @@
1
+ import{A as e,At as t,B as n,Ct as r,F as i,G as a,N as o,R as s,St as c,U as l,W as u,X as d,ct as f,ft as p,gt as m,kt as h,l as g,lt as _,m as v,mt as y,nt as b,ot as x,rt as S,st as C,ut as w,z as T}from"./CmCJ0SKP.js";import{t as E}from"./B0stYqX9.js";import"./xihTtKlq.js";import"./oJ4aK8PG.js";import{r as D}from"./D7DTLcps.js";import{A as O,E as k,_ as A,a as j,k as M,s as N,t as P,x as ee}from"./DlsPNMHX.js";import{t as te}from"./BT2vrlul.js";import"./CdjBDc_u.js";import{a as ne}from"./BgJCuTDs.js";import{n as F}from"./1aUphu7Y.js";import{n as I,t as L}from"./DnPeA-9c.js";import{t as re}from"./BEPs9Z9s.js";import{t as ie}from"./DOjT7y5f.js";import{t as ae}from"./M-b0y9AQ.js";import{n as R,t as oe}from"./Do_MDwCJ.js";import{t as se}from"./UeEccMjN.js";import{t as ce}from"./BIfnT_mK.js";import{t as z}from"./HopcQwhZ.js";import{t as B}from"./Bs27XW8_.js";import{a as le,c as V,i as ue,n as de,t as fe}from"./BTuMeN4z.js";import{t as H}from"./Bl0jjuyR.js";import{t as pe}from"./DKQHhdJ1.js";var U=P(j),W=P(j),G=P(j),K=P(j),me=1500;function q(e){return e===`completed`||e===`failed`||e===`cancelled`}var J=w({source:null,runId:null,state:null,reason:null,counters:null,proposalRefs:[],starting:!1,cancelling:!1,errorCode:null,error:null,pollError:null}),Y=w({open:!1,loading:!1,error:null,proposals:[]}),X=null;function Z(){X!==null&&(clearTimeout(X),X=null)}function he(){Z(),X=setTimeout(()=>{Q()},me)}function ge(e){if(e instanceof A)switch(e.code){case`DISTILL_ACTIVE_RUN`:return{code:e.code,message:`A distillation is already running for this workspace. Wait for it to finish or cancel it first.`};case`DISTILL_LIMIT`:return{code:e.code,message:`The proposal store is at capacity, so every proposal was refused. Decide or clear older proposals, then retry.`};case`DISTILL_IO`:return{code:e.code,message:`A distill registry IO error occurred: ${e.message}`};case`INVALID_OPERATION`:return{code:e.code,message:`Only an imported workspace can be distilled to the global wiki.`};case`NOT_FOUND`:return{code:e.code,message:`The workspace is no longer registered. Re-import it and retry.`};default:return{code:String(e.code),message:e.message}}return{code:`UNAVAILABLE`,message:e instanceof Error?e.message:String(e)}}async function _e(e){if(J.starting||J.runId!==null&&!ve())return{outcome:`rejected`,code:`INVALID_OPERATION`,message:`A distillation run is already in progress.`};let t=U.issue();J.starting=!0,J.error=null,J.errorCode=null,J.pollError=null,J.source=e,J.runId=null,J.state=null,J.reason=null,J.counters=null,J.proposalRefs=[],Y.open=!1,Y.proposals=[],Y.error=null,Z();try{let{runId:n}=await N().wiki.distill.start({source:e});return t.isCurrent()?(J.runId=n,Q(),{outcome:`started`,runId:n}):null}catch(e){if(!t.isCurrent())return null;let n=ge(e);return J.errorCode=n.code,J.error=n.message,{outcome:`rejected`,...n}}finally{t.isLatest()&&(J.starting=!1)}}function ve(){return J.state!==null&&q(J.state)}async function Q(){let e=J.runId;if(e===null)return;let t=W.issue();try{let n=await N().wiki.distill.status({runId:e});if(!t.isCurrent()||J.runId!==e)return;if(J.state=n.state,J.reason=n.reason,J.counters=n.counters,J.proposalRefs=[...n.proposalRefs],J.pollError=null,q(n.state)){Z(),Y.open&&$();return}n.state===`awaiting-approval`&&Y.open&&$(),he()}catch(e){if(!t.isCurrent())return;J.pollError=e instanceof Error?e.message:String(e),Z()}}async function ye(){let e=J.runId;if(e===null||J.cancelling)return!1;let t=G.issue();J.cancelling=!0;try{let n=await N().wiki.distill.cancel({runId:e});return!t.isCurrent()||J.runId!==e?!1:(J.state=n.state,J.error=null,J.errorCode=null,q(n.state)?(Z(),Y.open&&$()):Q(),!0)}catch(e){if(!t.isCurrent())return!1;let n=ge(e);return J.errorCode=n.code,J.error=n.message,!1}finally{t.isLatest()&&(J.cancelling=!1)}}var be=M({runId:O(),ordinal:k().int().nonnegative()});async function $(){let e=J.runId;if(e===null)return;let t=K.issue();Y.loading=!0;try{let n=await N().agent.proposals.list({});if(!t.isCurrent()||J.runId!==e)return;let r=[];for(let t of n.proposals){if(t.capability!==`wiki.distill_apply`)continue;let n=be.safeParse(t.input);n.success&&n.data.runId===e&&r.push({view:t,ordinal:n.data.ordinal})}r.sort((e,t)=>e.ordinal-t.ordinal),Y.proposals=r,Y.error=null}catch(e){if(!t.isCurrent())return;Y.error=e instanceof Error?e.message:String(e)}finally{t.isLatest()&&(Y.loading=!1)}}function xe(e){Y.open=e,e&&J.runId!==null&&$()}function Se(){U.invalidate(),W.invalidate(),G.invalidate(),K.invalidate(),Z(),J.source=null,J.runId=null,J.state=null,J.reason=null,J.counters=null,J.proposalRefs=[],J.starting=!1,J.cancelling=!1,J.errorCode=null,J.error=null,J.pollError=null,Y.open=!1,Y.loading=!1,Y.error=null,Y.proposals=[]}var Ce=n(`<!> Distill to global`,1),we=n(`<!> Add fragment`,1),Te=n(`<!> <span class="min-w-0 flex-1 text-sm font-medium">Distilling fragments to the global wiki…</span>`,1),Ee=n(`<!> <span class="min-w-0 flex-1 text-sm font-medium text-destructive">Couldn't start the distillation</span>`,1),De=n(`<!> <span class="min-w-0 flex-1 text-sm font-medium">Distillation failed</span>`,1),Oe=n(`<!> <span class="min-w-0 flex-1 text-sm font-medium">Distillation completed</span>`,1),ke=n(`<span class="min-w-0 flex-1 text-sm font-medium">Distillation cancelled</span>`),Ae=n(`<!> <span class="min-w-0 flex-1 text-sm font-medium">Distilling to the global wiki…</span>`,1),je=n(`<p>Collecting this workspace's fragments and asking the model for generalizations — this
2
+ can take up to two minutes.</p>`),Me=n(`<p class="break-words text-destructive/90"> </p>`),Ne=n(`<p> </p>`),Pe=n(`<p>Cancelled — no proposal was applied.</p>`),Fe=n(`<p class="font-mono"> </p>`),Ie=n(`<p class="break-words text-destructive/90" role="alert"> </p>`),Le=n(`<!> Cancel run`,1),Re=n(`<p class="flex items-center gap-2 text-xs text-muted-foreground" role="status"><!> Loading proposals…</p>`),ze=n(`<p class="break-words text-xs text-destructive" role="alert"> </p>`),Be=n(`<p class="text-xs text-muted-foreground">No proposals found for this run.</p>`),Ve=n(`<div class="mt-3 space-y-2 border-t border-border/60 pt-3"><!> <!></div>`),He=n(`<section aria-label="Distill to global" class="rounded-lg border border-border bg-background p-4"><div class="flex flex-wrap items-center gap-2"><!> <!></div> <div class="mt-1 min-w-0 space-y-1 text-xs text-muted-foreground"><!> <!> <!></div> <div class="mt-3 flex flex-wrap justify-end gap-2"><!> <!> <!></div> <!></section>`),Ue=n(`<!> Add to wiki`,1),We=n(`<section aria-label="Add a fragment" class="rounded-lg border border-border bg-background p-4"><div class="flex items-center justify-between gap-2"><h2 class="text-sm font-medium">New fragment</h2> <!></div> <div class="mt-3 space-y-3"><label class="block space-y-1.5"><span class="text-xs font-medium text-muted-foreground">Title</span> <!></label> <label class="block space-y-1.5"><span class="text-xs font-medium text-muted-foreground">Note</span> <!></label> <div class="flex justify-end gap-2"><!> <!></div></div></section>`),Ge=n(`<div class="flex items-start gap-3 rounded-lg border border-destructive/40 bg-destructive/10 p-4" role="alert"><!> <div class="min-w-0 flex-1"><p class="text-sm font-medium text-destructive">Couldn't load the wiki</p> <p class="mt-1 break-words text-xs text-destructive/90"> </p></div> <!></div>`),Ke=n(`<div class="space-y-3" aria-label="Loading wiki"><div class="h-16 animate-pulse rounded-lg border border-border bg-muted/50"></div> <div class="h-16 animate-pulse rounded-lg border border-border bg-muted/50"></div></div>`),qe=n(`<!> Add the first fragment`,1),Je=n(`<div class="rounded-lg border border-dashed border-border p-8 text-center"><!> <p class="mt-3 text-sm font-medium">No fragments yet</p> <p class="mt-1 text-xs text-muted-foreground">Capture recurring insights here; they become the input for skill evolution.</p> <!></div>`),Ye=n(`<p class="flex items-center gap-2 text-xs text-muted-foreground" role="status"><!> Loading…</p>`),Xe=n(`<p class="text-xs text-destructive" role="alert"> </p>`),Ze=n(`<pre class="max-h-72 overflow-y-auto whitespace-pre-wrap break-words rounded-md bg-muted/40 p-3 text-xs leading-relaxed"> </pre>`),Qe=n(`<div class="border-t border-border/60 px-3 py-2.5"><!></div>`),$e=n(`<li><button class="flex min-h-11 w-full items-center gap-2.5 px-3 py-2.5 text-left transition-colors hover:bg-muted/50"><span class="min-w-0 flex-1"><span class="block truncate text-sm font-medium"> </span> <span class="block truncate font-mono text-xs text-muted-foreground"> </span></span> <!> <span class="shrink-0 text-xs text-muted-foreground"> </span></button> <!></li>`),et=n(`<li class="px-3 py-6 text-center text-xs text-muted-foreground"> </li>`),tt=n(`<!> <ul class="divide-y divide-border rounded-lg border border-border"></ul>`,1),nt=n(`<div class="flex h-full flex-col overflow-y-auto p-5"><header class="flex shrink-0 items-start justify-between gap-3 border-b border-border pb-4 max-[720px]:flex-col max-[720px]:gap-2.5"><div class="min-w-0 max-[720px]:w-full"><div class="flex items-center gap-2"><!> <h1 tabindex="-1" class="min-w-0 flex-1 truncate text-lg font-semibold outline-none"> </h1></div> <p class="mt-0.5 flex items-center gap-1.5 text-xs text-muted-foreground"><!> <span class="min-w-0 max-[720px]:truncate"> </span></p></div> <div class="flex shrink-0 items-center gap-1.5 max-[720px]:w-full"><!> <!> <!></div></header> <div class="mx-auto mt-5 w-full max-w-3xl space-y-4"><!> <!> <!></div></div>`);function rt(n,u){r(u,!0);let O=D(),k=m(()=>O?.()?.wsId),A=m(()=>ee.parse(d(k)??`~`)),j=m(()=>ne.workspaces.find(e=>e.id===d(A))?.label??(d(A)===`~`?`Global`:d(A))),M=y(``),N=y(!1),P=y(``),U=y(``),W=y(!1),G=y(w({})),K=y(null),me=m(()=>{let e=d(M).trim().toLowerCase();return e===``?V.patterns:V.patterns.filter(t=>t.title.toLowerCase().includes(e)||t.name.toLowerCase().includes(e))});S(()=>{de(d(A))}),S(()=>()=>{le(),Se()}),S(()=>{d(K)?.focus()});async function X(){await de(d(A))}function Z(){p(N,!0),p(P,``),p(U,``)}async function he(){let e=d(P).trim(),t=d(U);if(!(e===``||d(W))){p(W,!0);try{let n=await fe(d(A),{title:e,body:t});if(n===null)return;n.deduplicated?F(`Already captured as “${n.item.title}”.`):F(`Added “${n.item.title}” to the wiki.`),p(N,!1),p(P,``),p(U,``)}catch(e){F(e instanceof Error?e.message:String(e))}finally{p(W,!1)}}}async function ge(e){if(d(G)[e.name]?.read){delete d(G)[e.name],p(G,{...d(G)},!0);return}p(G,{...d(G),[e.name]:{loading:!0,error:null,read:null}},!0);try{let t=await ue(d(A),e.name);p(G,{...d(G),[e.name]:{loading:!1,error:null,read:t}},!0)}catch(t){p(G,{...d(G),[e.name]:{loading:!1,error:t instanceof Error?t.message:String(t),read:null}},!0)}}let ve={collecting:`collecting`,"kernel-running":`running model`,"awaiting-approval":`awaiting approval`,completed:`completed`,failed:`failed`,cancelled:`cancelled`},Q={"no-valid-proposals":`The model produced no valid proposals, so nothing was generalized.`,capacity:`The proposal store was at capacity; every proposal was refused.`,io:`A disk error interrupted the run.`,timeout:`The model run timed out.`,"kernel-unavailable":`The agent kernel is unavailable right now.`,restarted:`The daemon restarted and the run was cancelled.`,"cancelled-by-shutdown":`The daemon stopped and the run was cancelled.`},be=[`applied`,`idempotent`,`stale`,`patch-failed`,`model-invalid`,`rejected`,`expired`,`not-proposed`,`io-failed`],$=m(()=>J.starting||J.runId!==null&&J.state!==null&&!q(J.state)),rt=m(()=>J.starting||J.runId!==null||J.error!==null),it=m(()=>J.proposalRefs.filter(e=>e.status===`pending`||e.status===`applying`).length),at=m(()=>{let e=J.counters;if(e===null)return``;let t=[];for(let n of be){let r=e[n];r>0&&t.push(`${n} ${r}`)}return t.join(` · `)});async function ot(){await _e(d(A))}var st=nt(),ct=x(st),lt=x(ct),ut=x(lt),dt=x(ut);I(dt,{variant:`ghost`,size:`icon`,class:`h-8 w-8 shrink-0 max-[720px]:h-11 max-[720px]:w-11`,title:`Back to wiki scopes`,"aria-label":`Back to wiki scopes`,onclick:()=>void E(`/wiki`),children:(e,t)=>{pe(e,{class:`h-4 w-4`})},$$slots:{default:!0}});var ft=_(dt,2),pt=f(ft);g(ft,e=>p(K,e),()=>d(K)),t(ut);var mt=_(ut,2),ht=x(mt),gt=e=>{H(e,{variant:`secondary`,class:`shrink-0`,children:(e,t)=>{h();var n=l(`~ global`);s(e,n)},$$slots:{default:!0}})},_t=e=>{H(e,{variant:`secondary`,class:`shrink-0`,children:(e,t)=>{h();var n=l(`workspace`);s(e,n)},$$slots:{default:!0}})};o(ht,e=>{d(A)===`~`?e(gt):e(_t,-1)});var vt=_(ht,2),yt=f(vt);t(mt),t(lt);var bt=_(lt,2),xt=x(bt);I(xt,{variant:`ghost`,size:`icon`,class:`h-9 w-9 max-[720px]:h-11 max-[720px]:w-11`,title:`Refresh wiki`,"aria-label":`Refresh wiki`,get disabled(){return V.loading},onclick:()=>void X(),children:(e,t)=>{var n=T(),r=C(n),i=e=>{L(e,{class:`h-4 w-4 animate-spin`})},a=e=>{ce(e,{class:`h-4 w-4`})};o(r,e=>{V.loading?e(i):e(a,-1)}),s(e,n)},$$slots:{default:!0}});var St=_(xt,2),Ct=e=>{I(e,{size:`sm`,variant:`outline`,class:`max-[720px]:h-11`,title:`Distill this workspace's fragments into the global wiki`,get disabled(){return d($)},onclick:()=>void ot(),children:(e,t)=>{var n=Ce(),r=C(n);se(r,{class:`h-4 w-4`}),h(),s(e,n)},$$slots:{default:!0}})};o(St,e=>{d(A)!==`~`&&e(Ct)});var wt=_(St,2);I(wt,{size:`sm`,class:`max-[720px]:h-11`,onclick:Z,children:(e,t)=>{var n=we(),r=C(n);z(r,{class:`h-4 w-4`}),h(),s(e,n)},$$slots:{default:!0}}),t(bt),t(ct);var Tt=_(ct,2),Et=x(Tt),Dt=n=>{var r=He(),a=x(r),c=x(a),u=e=>{var t=Te(),n=C(t);L(n,{class:`h-4 w-4 shrink-0 animate-spin text-muted-foreground`}),h(2),s(e,t)},p=e=>{var t=Ee(),n=C(t);B(n,{class:`h-4 w-4 shrink-0 text-destructive`}),h(2),s(e,t)},g=e=>{var t=De(),n=C(t);B(n,{class:`h-4 w-4 shrink-0 text-destructive`}),h(2),s(e,t)},v=e=>{var t=Oe(),n=C(t);ae(n,{class:`h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400`}),h(2),s(e,t)},y=e=>{var t=ke();s(e,t)},S=e=>{var t=Ae(),n=C(t);L(n,{class:`h-4 w-4 shrink-0 animate-spin text-muted-foreground`}),h(2),s(e,t)};o(c,e=>{J.starting?e(u):J.runId===null&&J.error!==null?e(p,1):J.state===`failed`?e(g,2):J.state===`completed`?e(v,3):J.state===`cancelled`?e(y,4):J.state!==null&&e(S,5)});var w=_(c,2),E=e=>{{let t=m(()=>J.state===`failed`?`destructive`:J.state===`awaiting-approval`?`default`:J.state===`completed`||J.state===`cancelled`?`outline`:`secondary`);H(e,{class:`shrink-0`,get variant(){return d(t)},children:(e,t)=>{h();var n=l();b(()=>i(n,ve[J.state])),s(e,n)},$$slots:{default:!0}})}};o(w,e=>{J.state!==null&&e(E)}),t(a);var D=_(a,2),O=x(D),k=e=>{var t=je();s(e,t)},A=e=>{var t=Me(),n=f(t,!0);b(()=>i(n,J.error)),s(e,t)},j=e=>{var t=Ne(),n=f(t);b(()=>i(n,`${J.proposalRefs.length??``}
3
+ ${J.proposalRefs.length===1?`proposal`:`proposals`}
4
+ ready for review (${d(it)??``} pending). Nothing is written to the global wiki
5
+ until you approve.`)),s(e,t)},M=e=>{var t=T(),n=C(t),r=e=>{var t=Ne(),n=f(t,!0);b(()=>i(n,Q[J.reason])),s(e,t)};o(n,e=>{J.reason!==null&&e(r)}),s(e,t)},N=e=>{var t=T(),n=C(t),r=e=>{var t=Ne(),n=f(t,!0);b(()=>i(n,Q[J.reason])),s(e,t)},a=e=>{var t=Pe();s(e,t)};o(n,e=>{J.reason===null?e(a,-1):e(r)}),s(e,t)};o(O,e=>{J.starting?e(k):J.runId===null&&J.error!==null?e(A,1):J.state===`awaiting-approval`?e(j,2):J.state===`failed`?e(M,3):J.state===`cancelled`&&e(N,4)});var P=_(O,2),ee=e=>{var t=Fe(),n=f(t,!0);b(()=>i(n,d(at))),s(e,t)};o(P,e=>{d(at)!==``&&e(ee)});var te=_(P,2),ne=e=>{var t=Ie(),n=f(t);b(()=>i(n,`Status polling stopped: ${J.pollError??``}`)),s(e,t)};o(te,e=>{J.pollError!==null&&e(ne)}),t(D);var F=_(D,2),re=x(F),ie=e=>{I(e,{size:`sm`,onclick:()=>xe(!Y.open),children:(e,t)=>{h();var n=l();b(()=>i(n,Y.open?`Hide proposals`:`View proposals`)),s(e,n)},$$slots:{default:!0}})};o(re,e=>{J.state===`awaiting-approval`&&e(ie)});var R=_(re,2),se=e=>{I(e,{size:`sm`,variant:`outline`,get disabled(){return J.cancelling},onclick:()=>void ye(),children:(e,t)=>{var n=Le(),r=C(n),i=e=>{L(e,{class:`h-4 w-4 animate-spin`})};o(r,e=>{J.cancelling&&e(i)}),h(),s(e,n)},$$slots:{default:!0}})},ce=m(()=>J.runId!==null&&J.state!==null&&!q(J.state));o(R,e=>{d(ce)&&e(se)});var z=_(R,2),le=e=>{I(e,{size:`sm`,variant:`ghost`,class:`max-[720px]:h-11`,onclick:()=>Se(),children:(e,t)=>{h();var n=l(`Dismiss`);s(e,n)},$$slots:{default:!0}})};o(z,e=>{d($)||e(le)}),t(F);var V=_(F,2),ue=n=>{var r=Ve(),a=x(r),c=e=>{var n=Re(),r=x(n);L(r,{class:`h-3.5 w-3.5 animate-spin`}),h(),t(n),s(e,n)},l=e=>{var t=ze(),n=f(t,!0);b(()=>i(n,Y.error)),s(e,t)},u=e=>{var t=Be();s(e,t)};o(a,e=>{Y.loading&&Y.proposals.length===0?e(c):Y.error===null?Y.proposals.length===0&&e(u,2):e(l,1)});var p=_(a,2);e(p,17,()=>Y.proposals,e=>e.view.proposalId,(e,t)=>{oe(e,{get proposalId(){return d(t).view.proposalId},get capability(){return d(t).view.capability},get input(){return d(t).view.input},get status(){return d(t).view.status}})}),t(r),s(n,r)};o(V,e=>{Y.open&&e(ue)}),t(r),s(n,r)};o(Et,e=>{d(rt)&&e(Dt)});var Ot=_(Et,2),kt=e=>{var n=We(),r=x(n),i=_(x(r),2);I(i,{variant:`ghost`,size:`icon`,class:`h-8 w-8`,title:`Cancel`,"aria-label":`Cancel adding a fragment`,onclick:()=>p(N,!1),children:(e,t)=>{re(e,{class:`h-4 w-4`})},$$slots:{default:!0}}),t(r);var a=_(r,2),c=x(a),u=_(x(c),2);ie(u,{placeholder:`One-line insight, e.g. Pin exit codes`,maxlength:120,get value(){return d(P)},set value(e){p(P,e,!0)}}),t(c);var f=_(c,2),g=_(x(f),2);R(g,{rows:4,placeholder:`What should the agent remember next time?`,get value(){return d(U)},set value(e){p(U,e,!0)}}),t(f);var v=_(f,2),y=x(v);I(y,{variant:`outline`,size:`sm`,onclick:()=>p(N,!1),children:(e,t)=>{h();var n=l(`Cancel`);s(e,n)},$$slots:{default:!0}});var b=_(y,2);{let e=m(()=>d(P).trim()===``||d(W));I(b,{size:`sm`,get disabled(){return d(e)},onclick:()=>void he(),children:(e,t)=>{var n=Ue(),r=C(n),i=e=>{L(e,{class:`h-4 w-4 animate-spin`})};o(r,e=>{d(W)&&e(i)}),h(),s(e,n)},$$slots:{default:!0}})}t(v),t(a),t(n),s(e,n)};o(Ot,e=>{d(N)&&e(kt)});var At=_(Ot,2),jt=e=>{var n=Ge(),r=x(n);B(r,{class:`mt-0.5 h-4 w-4 shrink-0 text-destructive`});var a=_(r,2),o=_(x(a),2),c=f(o,!0);t(a);var u=_(a,2);I(u,{variant:`outline`,size:`sm`,onclick:()=>void X(),children:(e,t)=>{h();var n=l(`Retry`);s(e,n)},$$slots:{default:!0}}),t(n),b(()=>i(c,V.error)),s(e,n)},Mt=e=>{var t=Ke();s(e,t)},Nt=e=>{var n=Je(),r=x(n);te(r,{class:`mx-auto h-8 w-8 text-muted-foreground`});var i=_(r,6);I(i,{class:`mt-4`,size:`sm`,onclick:Z,children:(e,t)=>{var n=qe(),r=C(n);z(r,{class:`h-4 w-4`}),h(),s(e,n)},$$slots:{default:!0}}),t(n),s(e,n)},Pt=n=>{var r=tt(),c=C(r),u=e=>{ie(e,{placeholder:`Filter fragments…`,"aria-label":`Filter wiki fragments`,get value(){return d(M)},set value(e){p(M,e,!0)}})};o(c,e=>{V.patterns.length>0&&e(u)});var g=_(c,2);e(g,21,()=>d(me),e=>e.name,(e,n)=>{let r=m(()=>d(G)[d(n).name]);var c=$e(),u=x(c),p=x(u),g=x(p),y=f(g,!0),S=_(g,2),C=f(S,!0);t(p);var w=_(p,2),T=e=>{H(e,{variant:`outline`,class:`shrink-0 text-xs`,children:(e,t)=>{h();var n=l(`promoted`);s(e,n)},$$slots:{default:!0}})};o(w,e=>{d(n).promotedFrom&&e(T)});var E=_(w,2),D=f(E,!0);t(u);var O=_(u,2),k=e=>{var n=Qe(),a=x(n),c=e=>{var n=Ye(),r=x(n);L(r,{class:`h-3.5 w-3.5 animate-spin`}),h(),t(n),s(e,n)},l=e=>{var t=Xe(),n=f(t,!0);b(()=>i(n,d(r).error)),s(e,t)},u=e=>{var t=Ze(),n=f(t,!0);b(e=>i(n,e),[()=>d(r).read.body.trim()]),s(e,t)};o(a,e=>{d(r).loading?e(c):d(r).error?e(l,1):d(r).read&&e(u,2)}),t(n),s(e,n)};o(O,e=>{d(r)&&e(k)}),t(c),b(e=>{v(u,`aria-expanded`,d(r)?.read!==null&&d(r)!==void 0),i(y,d(n).title),i(C,d(n).name),i(D,e)},[()=>d(n).updated.slice(0,10)]),a(`click`,u,()=>void ge(d(n))),s(e,c)},e=>{var t=et(),n=f(t);b(e=>i(n,`No fragments match “${e??``}”.`),[()=>d(M).trim()]),s(e,t)}),t(g),s(n,r)};o(At,e=>{V.error?e(jt):V.loading&&V.patterns.length===0?e(Mt,1):V.patterns.length===0?e(Nt,2):e(Pt,-1)}),t(Tt),t(st),b(()=>{i(pt,`${d(j)??``} wiki`),i(yt,`Persistent notes for ${d(j)??``} — fragments collected here feed skill evolution.`)}),s(n,st),c()}u([`click`]);export{rt as default};