@inkeep/open-knowledge 0.57.3 → 0.57.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-z0kwtWNz.mjs → acp-harness-probe-TGlkQYgH.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-CKNeBi9z.mjs +2 -0
- package/dist/index.d.mts +17 -17
- package/dist/index.mjs +1 -1
- package/dist/init-B72eUnnk.mjs +1 -0
- package/dist/{init-CuxgCZK8.mjs → init-DXnMBBQi.mjs} +3 -3
- package/dist/{launch-json-removal-YpPZRaoj.mjs → launch-json-removal-BbBIGJP_.mjs} +2 -2
- package/dist/{loader-CpDf5eCy.mjs → loader-By2s0-mv.mjs} +2 -2
- package/dist/loader-CvyHlLSG.mjs +1 -0
- package/dist/{open-browser-DKdJEb2P.mjs → open-browser-B3YQRXop.mjs} +2 -2
- package/dist/{preview-B9-lbB2r.mjs → preview-BsrkMFJu.mjs} +2 -2
- package/dist/preview-CnIamYfw.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-DtoUWb1c.js → ActivityModeContent-DpWNwM6n.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-0NV8wGXH.js → AgentDiffPane-vuhizpEd.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-B7BMwPdk.js → AgentThreadClientBinder-ChxqWHn_.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-DRIXyyO3.js → CodeMirrorPropInput-3xTSMwVk.js} +1 -1
- package/dist/public/assets/DocumentContext-CHPcruUq.js +38 -0
- package/dist/public/assets/{EditorModeToggle-B_J4DJWs.js → EditorModeToggle-CwqwRfuU.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CFk3AHnv.js → EnableSyncConfirmDialog-BGsAPro5.js} +1 -1
- package/dist/public/assets/FeedbackForm-Cc58Nk7P.js +1 -0
- package/dist/public/assets/{GraphPanel-9WkmeASt.js → GraphPanel-COPEU9QX.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DVl5vnNu.js → ImportSkillDialog-DqCi6EGK.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-MWJgrpYU.js → LintConfigEditor-BwsiJDfg.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-6zQd8tBx.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-E_X-hSBL.js → ManagedArtifactProperties-v6Fpk3Fo.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-CMojAadB.js → MermaidDocEditor-6MtXqzan.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-nYf3Nzvv.js → PropertyDisplayRow-DqvVKGtH.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-COUOzPXp.js → SchemaConfigEditor-BsE7oA0r.js} +1 -1
- package/dist/public/assets/{SessionsHost-BgY2S9NG.js → SessionsHost-CUgKgDkz.js} +2 -2
- package/dist/public/assets/SettingsDialogBody-BwytOGSu.js +12 -0
- package/dist/public/assets/{ShareReceiveMissDialog-CX3klyil.js → ShareReceiveMissDialog-CA3y3xQf.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-CT53ITFp.js → SkillInstallMenu-BgV-kMhM.js} +3 -3
- package/dist/public/assets/{SkillToolbarControls-D3v2Hs4j.js → SkillToolbarControls-Dod_5zs_.js} +1 -1
- package/dist/public/assets/{SourceEditor-CN-TUPAh.js → SourceEditor-CNg6hcSq.js} +1 -1
- package/dist/public/assets/{TerminalPanel-DxL20Rgf.js → TerminalPanel-CyjfYWsq.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-BZemj599.js → TerminalWindowApp-Ce4imhj9.js} +1 -1
- package/dist/public/assets/{TextDocEditor-CbRGs1HT.js → TextDocEditor-CTZRYi5V.js} +1 -1
- package/dist/public/assets/{ThreadView-BQPg9S8A.js → ThreadView-CI9w5I4i.js} +5 -8
- package/dist/public/assets/{TimelineDiffPane-U-Xtvkw6.js → TimelineDiffPane-m1We7iSj.js} +1 -1
- package/dist/public/assets/{agent-diff-store-iABbjLTR.js → agent-diff-store-Bxwv7QUN.js} +1 -1
- package/dist/public/assets/{auth-state-cache-ZDnOSM98.js → auth-state-cache-CxjHGWZm.js} +1 -1
- package/dist/public/assets/{client-version-CvdpPTtb.js → client-version-5Ke_ACOR.js} +1 -1
- package/dist/public/assets/{comment-chips-DTsOTJH8.js → comment-chips-ChCY4B1k.js} +1 -1
- package/dist/public/assets/{config-provider-CFTiAtpH.js → config-provider-Cow2MOvb.js} +3 -3
- package/dist/public/assets/{file-tree-adapter-BFt5lrJf.js → file-tree-adapter-BaT9ZAI6.js} +1 -1
- package/dist/public/assets/{follow-file-BvKFjLSz.js → follow-file-CfdGzNSh.js} +1 -1
- package/dist/public/assets/i18n-DtNuevxm.js +1 -0
- package/dist/public/assets/index-Cp5x9JeS.js +2095 -0
- package/dist/public/assets/messages-B-36DfpF.js +1 -0
- package/dist/public/assets/messages-BYJHcIk0.js +1 -0
- package/dist/public/assets/messages-BaI5ubzY.js +1 -0
- package/dist/public/assets/messages-BhNfOuoD.js +1 -0
- package/dist/public/assets/messages-CIAvaKgB.js +1 -0
- package/dist/public/assets/messages-COdCL7Ya.js +1 -0
- package/dist/public/assets/messages-CPWYTaHY.js +1 -0
- package/dist/public/assets/messages-Dtcb5u8J.js +1 -0
- package/dist/public/assets/messages-Kwe4pdGx.js +1 -0
- package/dist/public/assets/messages-PZjg3eYF.js +1 -0
- package/dist/public/assets/messages-rCGMF4pK.js +1 -0
- package/dist/public/assets/messages-xnmpxMsz.js +1 -0
- package/dist/public/assets/{navigation-targets-DKOMUIlH.js → navigation-targets-BlmF0SDc.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-CMgNWqay.js → pending-receive-nav-store-BP3YcKOH.js} +1 -1
- package/dist/public/assets/{prop-types-CpmiBFCU.js → prop-types-x3L5Ba9q.js} +1 -1
- package/dist/public/assets/{selection-context-BajeGoV5.js → selection-context-BdxcxNyo.js} +1 -1
- package/dist/public/assets/{skill-actions-Dg0c2EFw.js → skill-actions-DFktYEsA.js} +1 -1
- package/dist/public/assets/{src-CJl_A7Op.js → src-CiwcnlkH.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-DJRGhwM3.js → target-navigation-intent-Cq4g4MwT.js} +1 -1
- package/dist/public/assets/{telemetry-impl-DRTdire4.js → telemetry-impl-aSUUu3k2.js} +1 -1
- package/dist/public/assets/{telemetry-startup-DWe6KY2T.js → telemetry-startup-D6l5t8d3.js} +1 -1
- package/dist/public/assets/terminal-telemetry-zuOv8zuu.js +1 -0
- package/dist/public/assets/thread-client-B1jXINMp.js +1 -0
- package/dist/public/assets/{typing-burst-detector-DBj9oKSQ.js → typing-burst-detector-0Kh3NkMo.js} +1 -1
- package/dist/public/assets/{uninstall-Cvh4Iu4I.js → uninstall-Cq81zlCV.js} +1 -1
- package/dist/public/assets/{use-activity-panel-Bh3C3n8-.js → use-activity-panel-9LDeBM04.js} +1 -1
- package/dist/public/assets/{use-open-skill-C9ju-IL1.js → use-open-skill-BJyEtUo4.js} +1 -1
- package/dist/public/assets/{use-popular-skills-DHiWi3V2.js → use-popular-skills-DmIQH2eT.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-Dh008W1x.js → use-terminal-enabled-CC64PnYB.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-ooVH_oUf.js → use-timeline-entry-diff-CbaYxlTE.js} +1 -1
- package/dist/public/index.html +27 -27
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-BRgTZeMm.mjs → repair-launch-json-7sjZW-Ft.mjs} +2 -2
- package/dist/{repair-mcp-configs-CYBY9hkz.mjs → repair-mcp-configs-DJakjIAJ.mjs} +2 -2
- package/dist/repair-skills-BzuY54h2.mjs +1 -0
- package/dist/{repair-skills-DbvWHh50.mjs → repair-skills-D-WezUYL.mjs} +2 -2
- package/dist/{skill-teardown-sZPAAcyi.mjs → skill-teardown-C5wK_7-E.mjs} +2 -2
- package/dist/{src-BsTo_BQp.mjs → src-Bw_6oq5M.mjs} +1 -1
- package/dist/src-D6ZdQntm.mjs +1 -0
- package/dist/{src-B9IqHTFZ.mjs → src-DeMJz-ry.mjs} +2 -2
- package/dist/src-DoyY0aGc.mjs +2017 -0
- package/dist/start-6573xPGG.mjs +1 -0
- package/dist/{start-DA0DLWF1.mjs → start-N-ExL6WZ.mjs} +4 -4
- package/dist/{ui-CTtklN4L.mjs → ui-CDGZp9uY.mjs} +3 -3
- package/dist/{write-project-skill-CpzPK3Kr.mjs → write-project-skill-CqUFi6y1.mjs} +2 -2
- package/package.json +5 -5
- package/dist/constants-BU7Q80Kc.mjs +0 -2
- package/dist/init-icHkVUwe.mjs +0 -1
- package/dist/loader-BP4vfYMD.mjs +0 -1
- package/dist/preview-BGOmXIgS.mjs +0 -1
- package/dist/public/assets/DocumentContext-BzOkOcsd.js +0 -38
- package/dist/public/assets/FeedbackForm-srcVmSOs.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-WUogeRZ9.js +0 -1
- package/dist/public/assets/SettingsDialogBody-NFfs-Exd.js +0 -12
- package/dist/public/assets/i18n-B1dD_x6I.js +0 -1
- package/dist/public/assets/index-DAEjqhX2.js +0 -2095
- package/dist/public/assets/messages-31YqY4SS.js +0 -1
- package/dist/public/assets/messages-BVHIx_qK.js +0 -1
- package/dist/public/assets/messages-C7nddMWQ.js +0 -1
- package/dist/public/assets/messages-CL4xikKQ.js +0 -1
- package/dist/public/assets/messages-C_8WTeHE.js +0 -1
- package/dist/public/assets/messages-CrwpWrRW.js +0 -1
- package/dist/public/assets/messages-Cs6jyHNU.js +0 -1
- package/dist/public/assets/messages-D2XUrFhu.js +0 -1
- package/dist/public/assets/messages-DPWJimCT.js +0 -1
- package/dist/public/assets/messages-VnNooCHl.js +0 -1
- package/dist/public/assets/messages-e1iGNZ1R.js +0 -1
- package/dist/public/assets/messages-f9-p4BhX.js +0 -1
- package/dist/public/assets/terminal-telemetry-hqCajE8l.js +0 -1
- package/dist/public/assets/thread-client-CfT0-9Kx.js +0 -1
- package/dist/repair-skills-Cw6FhG82.mjs +0 -1
- package/dist/src-BgAHj6S9.mjs +0 -1
- package/dist/src-BnJNsU3L.mjs +0 -2017
- package/dist/start-B1c9LmyX.mjs +0 -1
package/dist/public/assets/{ShareReceiveMissDialog-CX3klyil.js → ShareReceiveMissDialog-CA3y3xQf.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-DWuLC0Dh.js";import{a as l,i as u,n as d,r as f}from"./pending-receive-nav-store-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{c as i,i as a,n as o,s,t as c}from"./dialog-DWuLC0Dh.js";import{a as l,i as u,n as d,r as f}from"./pending-receive-nav-store-BP3YcKOH.js";import{t as p}from"./miss-dialog-store-DbO2b6tB.js";import{f as m,p as h}from"./doc-paths-7BigDJzU.js";var g=r(),_=e(n(),1),v=t();function y(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function b(){let e=(0,g.c)(2),t=(0,_.useSyncExternalStore)(p.subscribe,p.getSnapshot,x);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,v.jsx)(S,{nav:t},t.path),e[0]=t,e[1]=n),n}function x(){return null}function S(e){let t=(0,g.c)(29),{nav:n}=e,{state:r,refetch:_}=l(n),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(){p.dismiss()},t[0]=b):b=t[0];let x=b,S;t[1]===n.path?S=t[2]:(S=function(){window.location.hash=h(u(n.path)),x()},t[1]=n.path,t[2]=S);let C=S,w;t[3]!==n.branch||t[4]!==n.kind?(w=function(e){d.arm({kind:n.kind,path:e,branch:n.branch}),window.location.hash=n.kind===`folder`?h(e):m(e),x()},t[3]=n.branch,t[4]=n.kind,t[5]=w):w=t[5];let T=w,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||x()},t[6]=E):E=t[6];let D=r.phase,O=r.phase===`resolved`?r.resolution.verdict:void 0,k;t[7]===n.path?k=t[8]:(k=y(n.path),t[7]=n.path,t[8]=k);let A;t[9]===k?A=t[10]:(A=(0,v.jsx)(s,{children:(0,v.jsx)(i,{className:`truncate`,children:k})}),t[9]=k,t[10]=A);let j=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,M;t[11]!==n.path||t[12]!==T?(M=()=>T(n.path),t[11]=n.path,t[12]=T,t[13]=M):M=t[13];let N;t[14]!==C||t[15]!==n||t[16]!==T||t[17]!==_||t[18]!==r||t[19]!==M?(N=(0,v.jsx)(f,{nav:n,state:r,onBrowseFolder:C,onOpenRenamed:T,onEnableAutoSync:x,onSyncCompleted:_,onPullApplied:M}),t[14]=C,t[15]=n,t[16]=T,t[17]=_,t[18]=r,t[19]=M,t[20]=N):N=t[20];let P;t[21]!==N||t[22]!==j?(P=(0,v.jsx)(o,{className:j,children:N}),t[21]=N,t[22]=j,t[23]=P):P=t[23];let F;return t[24]!==r.phase||t[25]!==P||t[26]!==O||t[27]!==A?(F=(0,v.jsx)(c,{open:!0,onOpenChange:E,children:(0,v.jsxs)(a,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":D,"data-verdict":O,children:[A,P]})}),t[24]=r.phase,t[25]=P,t[26]=O,t[27]=A,t[28]=F):F=t[28],F}export{b as ShareReceiveMissDialog};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{On as n}from"./DocumentContext-BzOkOcsd.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./mascot-outline-CtS592mc.js";import{t as l}from"./button-CA0dewJJ.js";import{a as u,r as d}from"./dist-mv8e6dBX.js";import{c as f,o as p}from"./dist-DsLZcVyZ.js";import{i as m,n as h,t as g}from"./tooltip-DHXgxWLL.js";import{_,d as v,f as y,g as b,h as x,l as S,m as C,p as w,u as T,v as E}from"./dialog-DWuLC0Dh.js";import{c as D,d as O,f as k,l as A,m as j,o as M,p as N,r as P,u as F,w as I}from"./terminal-cli-display-CpAOcb2j.js";import{a as L,d as R,f as z,i as B,n as V,o as H,p as U,u as W}from"./dropdown-menu-CCTsTCfv.js";import{Wt as ee,Xr as te,io as ne}from"./dist-COv61_fZ2.js";import{n as re}from"./dist-BLaUOTRG.js";import{s as G}from"./documents-events-BG9v7ZR8.js";import{t as K}from"./createLucideIcon-6iYxif1u.js";import{o as ie}from"./use-open-skill-C9ju-IL1.js";import{t as ae}from"./spinner-DmnAF0L7.js";import{c as q,n as oe,r as se}from"./skill-scope-Dvl0F_Nc.js";import{A as ce,M as le,S as ue,x as de}from"./skills-api-D3yktqw_.js";import{t as fe}from"./use-skills-RGrgR7Ae.js";var J=t(),Y=e(r(),1),X=o(),pe=3100,me=3;function he(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??me;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var ge={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},_e=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function ve(e,t={}){let n=t.rng??Math.random,r=t.colors??_e,i=ge[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var ye=1.8,be=90,xe=16,Se=380,Ce=.025,we=.1,Te=.18,Ee=400,De=9.2736,Oe=18.1799,Z=14.5244,ke={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function Ae(e,t){let{halfWidth:n,apexLift:r}=ke[t];return`M${e-n} ${Z+.3} Q${e} ${Z-r}, ${e+n} ${Z+.3}`}function je(e){let t=1.5,n=.3;return`M${e-t} ${Z-n} Q${e} ${Z+1.4}, ${e+t} ${Z-n}`}var Me=15,Ne=15;function Pe(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function Fe(e){let t=(0,X.c)(73),{size:n,className:r,style:i,trackMouse:a,variant:o,celebrateSignal:l,onRage:u}=e,d=n===void 0?48:n,f=a===void 0?!0:a,p=o===void 0?`default`:o,m=l===void 0?0:l,h=(0,Y.useRef)(null),g=(0,Y.useRef)(null),_=(0,Y.useRef)(null),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={x:0,y:0},t[0]=v):v=t[0];let y=(0,Y.useRef)(v),[b,x]=(0,Y.useState)(0),[S,C]=(0,Y.useState)(0),w;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(w=[],t[1]=w):w=t[1];let[T,E]=(0,Y.useState)(w),D=(0,Y.useRef)(0),O=(0,Y.useRef)(void 0),k=p===`sleeping`,A;t[2]!==b||t[3]!==k||t[4]!==u?(A=function(){if(k)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=D.current===0?1/0:e-D.current;D.current=e;let n=he(b,t);n===3&&u?.(),x(n),C(ze),E(ve(n)),clearTimeout(O.current),O.current=setTimeout(()=>{x(0),E([])},pe)},t[2]=b,t[3]=k,t[4]=u,t[5]=A):A=t[5];let j=A,M,N;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>()=>clearTimeout(O.current),N=[],t[6]=M,t[7]=N):(M=t[6],N=t[7]),(0,Y.useEffect)(M,N);let P,F;t[8]!==m||t[9]!==k?(P=()=>{m===0||k||(x(3),C(Re),E(ve(3)),clearTimeout(O.current),O.current=setTimeout(()=>{x(0),E([])},pe))},F=[m,k],t[8]=m,t[9]=k,t[10]=P,t[11]=F):(P=t[10],F=t[11]),(0,Y.useEffect)(P,F);let I,L;t[12]!==k||t[13]!==f?(I=()=>{if(!f||k||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,c=function(){s===0&&(s=requestAnimationFrame(u))},l=function(r){e=r.clientX,t=r.clientY,n=!0,c()};function u(){s=0;let l=g.current,u=h.current;if(!l||!u){c();return}let d=n;n=!1;let f=l.getBoundingClientRect(),p=f.left+f.width/2,m=f.top+f.height*.48,v=e-p,b=t-m,x=Math.hypot(v,b),S=Math.max(-1,Math.min(1,v/Se)),C=-Math.max(-1,Math.min(1,b/Se))*xe,w=S*xe,T=0,E=0;if(x>=1){let e=Math.min(x/be,1)*ye;T=v/x*e,E=b/x*e}let D=Math.abs(C-r)<.01&&Math.abs(w-i)<.01&&Math.abs(T-a)<.01&&Math.abs(E-o)<.01;if(!d&&D)return;c(),r+=(C-r)*we,i+=(w-i)*we,u.style.transform=`perspective(${Ee}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*Te,o+=(E-o)*Te;let O=i*Ce,k=-r*Ce,A=a+O,j=o+k;y.current.x=A,y.current.y=j,_.current?.setAttribute(`transform`,`translate(${A.toFixed(3)} ${j.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),c(),()=>{document.removeEventListener(`mousemove`,l),s!==0&&cancelAnimationFrame(s),s=0,h.current&&(h.current.style.transform=``),y.current={x:0,y:0},_.current?.removeAttribute(`transform`)}},L=[f,k],t[12]=k,t[13]=f,t[14]=I,t[15]=L):(I=t[14],L=t[15]),(0,Y.useEffect)(I,L);let R;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>{let e=_.current;if(!e)return;let{x:t,y:n}=y.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[16]=R):R=t[16],(0,Y.useLayoutEffect)(R);let z=b>0,B=z?b:1,V=z?`ok-blob-clicked-${b}`:null,H;t[17]===r?H=t[18]:(H=s(`ok-blob-3d-wrapper`,r),t[17]=r,t[18]=H);let U=k?`cursor-default`:`cursor-pointer`,W=`body-${S}`,ee=k&&`ok-blob-sleeping`,te;t[19]!==V||t[20]!==ee?(te=s(`ok-blob-group`,ee,V),t[19]=V,t[20]=ee,t[21]=te):te=t[21];let ne;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,J.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=ne):ne=t[22];let re=(z||k)&&`ok-blob-eye-hidden`,G;t[23]===re?G=t[24]:(G=s(`ok-blob-eye`,re),t[23]=re,t[24]=G);let K;t[25]===G?K=t[26]:(K=(0,J.jsx)(`ellipse`,{cx:De,cy:Z,rx:1.2722,ry:1.9083,className:G}),t[25]=G,t[26]=K);let ie=(z||k)&&`ok-blob-eye-hidden`,ae;t[27]===ie?ae=t[28]:(ae=s(`ok-blob-eye ok-blob-eye-right`,ie),t[27]=ie,t[28]=ae);let q;t[29]===ae?q=t[30]:(q=(0,J.jsx)(`ellipse`,{cx:Oe,cy:Z,rx:1.2722,ry:1.9083,className:ae}),t[29]=ae,t[30]=q);let oe;t[31]===B?oe=t[32]:(oe=Ae(De,B),t[31]=B,t[32]=oe);let se=(!z||k)&&`ok-blob-eye-hidden`,ce;t[33]===se?ce=t[34]:(ce=s(`ok-blob-happy-eye`,se),t[33]=se,t[34]=ce);let le;t[35]!==oe||t[36]!==ce?(le=(0,J.jsx)(`path`,{d:oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ce}),t[35]=oe,t[36]=ce,t[37]=le):le=t[37];let ue;t[38]===B?ue=t[39]:(ue=Ae(Oe,B),t[38]=B,t[39]=ue);let de=(!z||k)&&`ok-blob-eye-hidden`,fe;t[40]===de?fe=t[41]:(fe=s(`ok-blob-happy-eye`,de),t[40]=de,t[41]=fe);let me;t[42]!==ue||t[43]!==fe?(me=(0,J.jsx)(`path`,{d:ue,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:fe}),t[42]=ue,t[43]=fe,t[44]=me):me=t[44];let ge;t[45]===k?ge=t[46]:(ge=k?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`path`,{d:je(De),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,J.jsx)(`path`,{d:je(Oe),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=k,t[46]=ge);let _e;t[47]!==K||t[48]!==q||t[49]!==le||t[50]!==me||t[51]!==ge?(_e=(0,J.jsxs)(`g`,{ref:_,children:[K,q,le,me,ge]}),t[47]=K,t[48]=q,t[49]=le,t[50]=me,t[51]=ge,t[52]=_e):_e=t[52];let ke;t[53]!==W||t[54]!==te||t[55]!==_e?(ke=(0,J.jsxs)(`g`,{className:te,children:[ne,_e]},W),t[53]=W,t[54]=te,t[55]=_e,t[56]=ke):ke=t[56];let Me;t[57]===k?Me=t[58]:(Me=k?(0,J.jsxs)(`g`,{children:[(0,J.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,J.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[57]=k,t[58]=Me);let Ne;t[59]!==S||t[60]!==T?(Ne=T.length>0&&(0,J.jsx)(`g`,{children:T.map(Ie)},`firework-${S}`),t[59]=S,t[60]=T,t[61]=Ne):Ne=t[61];let Pe;t[62]!==j||t[63]!==d||t[64]!==U||t[65]!==ke||t[66]!==Me||t[67]!==Ne?(Pe=(0,J.jsxs)(`svg`,{ref:g,width:d,height:d,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:U,"aria-hidden":`true`,onClick:j,onMouseDown:Le,children:[ke,Me,Ne]}),t[62]=j,t[63]=d,t[64]=U,t[65]=ke,t[66]=Me,t[67]=Ne,t[68]=Pe):Pe=t[68];let Fe;return t[69]!==i||t[70]!==H||t[71]!==Pe?(Fe=(0,J.jsx)(`span`,{ref:h,className:H,style:i,children:Pe}),t[69]=i,t[70]=H,t[71]=Pe,t[72]=Fe):Fe=t[72],Fe}function Ie(e){return(0,J.jsx)(`circle`,{cx:Me+e.originDx,cy:Ne+e.originDy,r:e.size,className:`ok-blob-firework`,style:Pe(e)},e.id)}function Le(e){return e.preventDefault()}function Re(e){return e+1}function ze(e){return e+1}var Be=`AlertDialog`,[Ve,He]=f(Be,[E]),Q=E(),Ue=e=>{let{__scopeAlertDialog:t,...n}=e,r=Q(t);return(0,J.jsx)(C,{...r,...n,modal:!0})};Ue.displayName=Be;var We=`AlertDialogTrigger`,Ge=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,J.jsx)(b,{...i,...r,ref:t})});Ge.displayName=We;var Ke=`AlertDialogPortal`,qe=e=>{let{__scopeAlertDialog:t,...n}=e,r=Q(t);return(0,J.jsx)(w,{...r,...n})};qe.displayName=Ke;var Je=`AlertDialogOverlay`,Ye=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,J.jsx)(y,{...i,...r,ref:t})});Ye.displayName=Je;var Xe=`AlertDialogContent`,[Ze,Qe]=Ve(Xe),$e=d(`AlertDialogContent`),et=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=Q(n),o=Y.useRef(null),s=u(t,o),c=Y.useRef(null);return(0,J.jsx)(_,{contentName:Xe,titleName:tt,docsSlug:`alert-dialog`,children:(0,J.jsx)(Ze,{scope:n,cancelRef:c,children:(0,J.jsxs)(T,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:p(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,J.jsx)($e,{children:r}),(0,J.jsx)(lt,{contentRef:o})]})})})});et.displayName=Xe;var tt=`AlertDialogTitle`,nt=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,J.jsx)(x,{...i,...r,ref:t})});nt.displayName=tt;var rt=`AlertDialogDescription`,it=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,J.jsx)(v,{...i,...r,ref:t})});it.displayName=rt;var at=`AlertDialogAction`,ot=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,J.jsx)(S,{...i,...r,ref:t})});ot.displayName=at;var st=`AlertDialogCancel`,ct=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Qe(st,n),a=Q(n),o=u(t,i);return(0,J.jsx)(S,{...a,...r,ref:o})});ct.displayName=st;var lt=({contentRef:e})=>{let t=`\`${Xe}\` requires a description for the component to be accessible for screen reader users.
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{On as n}from"./DocumentContext-CHPcruUq.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./mascot-outline-CtS592mc.js";import{t as l}from"./button-CA0dewJJ.js";import{a as u,r as d}from"./dist-mv8e6dBX.js";import{c as f,o as p}from"./dist-DsLZcVyZ.js";import{i as m,n as h,t as g}from"./tooltip-DHXgxWLL.js";import{_,d as v,f as y,g as b,h as x,l as S,m as C,p as w,u as T,v as E}from"./dialog-DWuLC0Dh.js";import{c as D,d as O,f as k,l as A,m as j,o as M,p as N,r as P,u as F,w as I}from"./terminal-cli-display-CpAOcb2j.js";import{a as L,d as R,f as z,i as B,n as ee,o as V,p as H,u as U}from"./dropdown-menu-CCTsTCfv.js";import{Wt as W,Xr as G,io as te}from"./dist-COv61_fZ2.js";import{n as ne}from"./dist-BLaUOTRG.js";import{s as re}from"./documents-events-BG9v7ZR8.js";import{t as K}from"./createLucideIcon-6iYxif1u.js";import{o as ie}from"./use-open-skill-BJyEtUo4.js";import{t as ae}from"./spinner-DmnAF0L7.js";import{c as q,n as oe,r as se}from"./skill-scope-Dvl0F_Nc.js";import{A as ce,M as le,S as ue,x as de}from"./skills-api-D3yktqw_.js";import{t as fe}from"./use-skills-RGrgR7Ae.js";var J=t(),Y=e(r(),1),X=o(),pe=3100,me=3;function he(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??me;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var ge={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},_e=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function ve(e,t={}){let n=t.rng??Math.random,r=t.colors??_e,i=ge[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var ye=1.8,be=90,xe=16,Se=380,Ce=.025,we=.1,Te=.18,Ee=400,De=9.2736,Oe=18.1799,Z=14.5244,ke={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function Ae(e,t){let{halfWidth:n,apexLift:r}=ke[t];return`M${e-n} ${Z+.3} Q${e} ${Z-r}, ${e+n} ${Z+.3}`}function je(e){let t=1.5,n=.3;return`M${e-t} ${Z-n} Q${e} ${Z+1.4}, ${e+t} ${Z-n}`}var Me=15,Ne=15;function Pe(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function Fe(e){let t=(0,X.c)(73),{size:n,className:r,style:i,trackMouse:a,variant:o,celebrateSignal:l,onRage:u}=e,d=n===void 0?48:n,f=a===void 0?!0:a,p=o===void 0?`default`:o,m=l===void 0?0:l,h=(0,Y.useRef)(null),g=(0,Y.useRef)(null),_=(0,Y.useRef)(null),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={x:0,y:0},t[0]=v):v=t[0];let y=(0,Y.useRef)(v),[b,x]=(0,Y.useState)(0),[S,C]=(0,Y.useState)(0),w;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(w=[],t[1]=w):w=t[1];let[T,E]=(0,Y.useState)(w),D=(0,Y.useRef)(0),O=(0,Y.useRef)(void 0),k=p===`sleeping`,A;t[2]!==b||t[3]!==k||t[4]!==u?(A=function(){if(k)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=D.current===0?1/0:e-D.current;D.current=e;let n=he(b,t);n===3&&u?.(),x(n),C(ze),E(ve(n)),clearTimeout(O.current),O.current=setTimeout(()=>{x(0),E([])},pe)},t[2]=b,t[3]=k,t[4]=u,t[5]=A):A=t[5];let j=A,M,N;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>()=>clearTimeout(O.current),N=[],t[6]=M,t[7]=N):(M=t[6],N=t[7]),(0,Y.useEffect)(M,N);let P,F;t[8]!==m||t[9]!==k?(P=()=>{m===0||k||(x(3),C(Re),E(ve(3)),clearTimeout(O.current),O.current=setTimeout(()=>{x(0),E([])},pe))},F=[m,k],t[8]=m,t[9]=k,t[10]=P,t[11]=F):(P=t[10],F=t[11]),(0,Y.useEffect)(P,F);let I,L;t[12]!==k||t[13]!==f?(I=()=>{if(!f||k||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,c=function(){s===0&&(s=requestAnimationFrame(u))},l=function(r){e=r.clientX,t=r.clientY,n=!0,c()};function u(){s=0;let l=g.current,u=h.current;if(!l||!u){c();return}let d=n;n=!1;let f=l.getBoundingClientRect(),p=f.left+f.width/2,m=f.top+f.height*.48,v=e-p,b=t-m,x=Math.hypot(v,b),S=Math.max(-1,Math.min(1,v/Se)),C=-Math.max(-1,Math.min(1,b/Se))*xe,w=S*xe,T=0,E=0;if(x>=1){let e=Math.min(x/be,1)*ye;T=v/x*e,E=b/x*e}let D=Math.abs(C-r)<.01&&Math.abs(w-i)<.01&&Math.abs(T-a)<.01&&Math.abs(E-o)<.01;if(!d&&D)return;c(),r+=(C-r)*we,i+=(w-i)*we,u.style.transform=`perspective(${Ee}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*Te,o+=(E-o)*Te;let O=i*Ce,k=-r*Ce,A=a+O,j=o+k;y.current.x=A,y.current.y=j,_.current?.setAttribute(`transform`,`translate(${A.toFixed(3)} ${j.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),c(),()=>{document.removeEventListener(`mousemove`,l),s!==0&&cancelAnimationFrame(s),s=0,h.current&&(h.current.style.transform=``),y.current={x:0,y:0},_.current?.removeAttribute(`transform`)}},L=[f,k],t[12]=k,t[13]=f,t[14]=I,t[15]=L):(I=t[14],L=t[15]),(0,Y.useEffect)(I,L);let R;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>{let e=_.current;if(!e)return;let{x:t,y:n}=y.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[16]=R):R=t[16],(0,Y.useLayoutEffect)(R);let z=b>0,B=z?b:1,ee=z?`ok-blob-clicked-${b}`:null,V;t[17]===r?V=t[18]:(V=s(`ok-blob-3d-wrapper`,r),t[17]=r,t[18]=V);let H=k?`cursor-default`:`cursor-pointer`,U=`body-${S}`,W=k&&`ok-blob-sleeping`,G;t[19]!==ee||t[20]!==W?(G=s(`ok-blob-group`,W,ee),t[19]=ee,t[20]=W,t[21]=G):G=t[21];let te;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,J.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=te):te=t[22];let ne=(z||k)&&`ok-blob-eye-hidden`,re;t[23]===ne?re=t[24]:(re=s(`ok-blob-eye`,ne),t[23]=ne,t[24]=re);let K;t[25]===re?K=t[26]:(K=(0,J.jsx)(`ellipse`,{cx:De,cy:Z,rx:1.2722,ry:1.9083,className:re}),t[25]=re,t[26]=K);let ie=(z||k)&&`ok-blob-eye-hidden`,ae;t[27]===ie?ae=t[28]:(ae=s(`ok-blob-eye ok-blob-eye-right`,ie),t[27]=ie,t[28]=ae);let q;t[29]===ae?q=t[30]:(q=(0,J.jsx)(`ellipse`,{cx:Oe,cy:Z,rx:1.2722,ry:1.9083,className:ae}),t[29]=ae,t[30]=q);let oe;t[31]===B?oe=t[32]:(oe=Ae(De,B),t[31]=B,t[32]=oe);let se=(!z||k)&&`ok-blob-eye-hidden`,ce;t[33]===se?ce=t[34]:(ce=s(`ok-blob-happy-eye`,se),t[33]=se,t[34]=ce);let le;t[35]!==oe||t[36]!==ce?(le=(0,J.jsx)(`path`,{d:oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ce}),t[35]=oe,t[36]=ce,t[37]=le):le=t[37];let ue;t[38]===B?ue=t[39]:(ue=Ae(Oe,B),t[38]=B,t[39]=ue);let de=(!z||k)&&`ok-blob-eye-hidden`,fe;t[40]===de?fe=t[41]:(fe=s(`ok-blob-happy-eye`,de),t[40]=de,t[41]=fe);let me;t[42]!==ue||t[43]!==fe?(me=(0,J.jsx)(`path`,{d:ue,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:fe}),t[42]=ue,t[43]=fe,t[44]=me):me=t[44];let ge;t[45]===k?ge=t[46]:(ge=k?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`path`,{d:je(De),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,J.jsx)(`path`,{d:je(Oe),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=k,t[46]=ge);let _e;t[47]!==K||t[48]!==q||t[49]!==le||t[50]!==me||t[51]!==ge?(_e=(0,J.jsxs)(`g`,{ref:_,children:[K,q,le,me,ge]}),t[47]=K,t[48]=q,t[49]=le,t[50]=me,t[51]=ge,t[52]=_e):_e=t[52];let ke;t[53]!==U||t[54]!==G||t[55]!==_e?(ke=(0,J.jsxs)(`g`,{className:G,children:[te,_e]},U),t[53]=U,t[54]=G,t[55]=_e,t[56]=ke):ke=t[56];let Me;t[57]===k?Me=t[58]:(Me=k?(0,J.jsxs)(`g`,{children:[(0,J.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,J.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[57]=k,t[58]=Me);let Ne;t[59]!==S||t[60]!==T?(Ne=T.length>0&&(0,J.jsx)(`g`,{children:T.map(Ie)},`firework-${S}`),t[59]=S,t[60]=T,t[61]=Ne):Ne=t[61];let Pe;t[62]!==j||t[63]!==d||t[64]!==H||t[65]!==ke||t[66]!==Me||t[67]!==Ne?(Pe=(0,J.jsxs)(`svg`,{ref:g,width:d,height:d,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:H,"aria-hidden":`true`,onClick:j,onMouseDown:Le,children:[ke,Me,Ne]}),t[62]=j,t[63]=d,t[64]=H,t[65]=ke,t[66]=Me,t[67]=Ne,t[68]=Pe):Pe=t[68];let Fe;return t[69]!==i||t[70]!==V||t[71]!==Pe?(Fe=(0,J.jsx)(`span`,{ref:h,className:V,style:i,children:Pe}),t[69]=i,t[70]=V,t[71]=Pe,t[72]=Fe):Fe=t[72],Fe}function Ie(e){return(0,J.jsx)(`circle`,{cx:Me+e.originDx,cy:Ne+e.originDy,r:e.size,className:`ok-blob-firework`,style:Pe(e)},e.id)}function Le(e){return e.preventDefault()}function Re(e){return e+1}function ze(e){return e+1}var Be=`AlertDialog`,[Ve,He]=f(Be,[E]),Q=E(),Ue=e=>{let{__scopeAlertDialog:t,...n}=e,r=Q(t);return(0,J.jsx)(C,{...r,...n,modal:!0})};Ue.displayName=Be;var We=`AlertDialogTrigger`,Ge=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,J.jsx)(b,{...i,...r,ref:t})});Ge.displayName=We;var Ke=`AlertDialogPortal`,qe=e=>{let{__scopeAlertDialog:t,...n}=e,r=Q(t);return(0,J.jsx)(w,{...r,...n})};qe.displayName=Ke;var Je=`AlertDialogOverlay`,Ye=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,J.jsx)(y,{...i,...r,ref:t})});Ye.displayName=Je;var Xe=`AlertDialogContent`,[Ze,Qe]=Ve(Xe),$e=d(`AlertDialogContent`),et=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=Q(n),o=Y.useRef(null),s=u(t,o),c=Y.useRef(null);return(0,J.jsx)(_,{contentName:Xe,titleName:tt,docsSlug:`alert-dialog`,children:(0,J.jsx)(Ze,{scope:n,cancelRef:c,children:(0,J.jsxs)(T,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:p(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,J.jsx)($e,{children:r}),(0,J.jsx)(lt,{contentRef:o})]})})})});et.displayName=Xe;var tt=`AlertDialogTitle`,nt=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,J.jsx)(x,{...i,...r,ref:t})});nt.displayName=tt;var rt=`AlertDialogDescription`,it=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,J.jsx)(v,{...i,...r,ref:t})});it.displayName=rt;var at=`AlertDialogAction`,ot=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Q(n);return(0,J.jsx)(S,{...i,...r,ref:t})});ot.displayName=at;var st=`AlertDialogCancel`,ct=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Qe(st,n),a=Q(n),o=u(t,i);return(0,J.jsx)(S,{...a,...r,ref:o})});ct.displayName=st;var lt=({contentRef:e})=>{let t=`\`${Xe}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${Xe}\` by passing a \`${rt}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
5
5
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Xe}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
6
6
|
|
|
7
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return Y.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},ut=Ue,dt=qe,ft=Ye,pt=et,mt=ct,ht=nt,gt=it,_t=K(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),vt=K(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),yt=K(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),bt=[...new Set(I.flatMap(e=>e.schemes))];function xt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of I){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function St(e){return xt({},e)}async function Ct(e){let t=e.schemes??bt,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var wt=Object.fromEntries(bt.map(e=>[e,{installed:!1}]));async function Tt(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return wt}if(!t.ok)return wt;let n;try{n=await t.json()}catch{return wt}if(typeof n!=`object`||!n||Array.isArray(n))return wt;let r=n,i={};for(let e of bt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Et(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Dt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=St({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=xt(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Et(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function Ot(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function kt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Ct({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>Tt({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function At(){let e=(0,X.c)(5),[t,n]=(0,Y.useState)(jt),r=(0,Y.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Dt(kt());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Y.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function jt(){return St({isElectronHost:Ot(),now:Date.now})}var Mt=(0,Y.createContext)(null);function Nt(e){let t=(0,X.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,J.jsx)(Mt,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Pt(){return(0,Y.use)(Mt)}function Ft(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,J.jsx)(ut,{"data-slot":`alert-dialog`,...n}),t[2]=n,t[3]=r),r}function It(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,J.jsx)(dt,{"data-slot":`alert-dialog-portal`,...n}),t[2]=n,t[3]=r),r}function Lt(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs [-webkit-app-region:no-drag] data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(ft,{"data-slot":`alert-dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Rt(e){let t=(0,X.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,J.jsx)(Lt,{}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=s(`fixed top-1/2 left-1/2 z-50 flex w-full max-w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-6 overflow-hidden rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm [-webkit-app-region:no-drag] data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,J.jsxs)(It,{children:[i,(0,J.jsx)(pt,{"data-slot":`alert-dialog-content`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function zt(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`flex shrink-0 flex-col gap-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Bt(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`-mx-6 min-h-0 flex-1 overflow-y-auto px-6 subtle-scrollbar scroll-fade-mask`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(`div`,{"data-slot":`alert-dialog-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vt(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`-mx-6 -mb-6 flex shrink-0 flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 px-6 py-4 sm:flex-row sm:justify-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ht(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`font-heading text-base leading-none font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(ht,{"data-slot":`alert-dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ut(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(gt,{"data-slot":`alert-dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Wt(e){let t=(0,X.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`outline`:i,c=a===void 0?`default`:a,u;t[5]===n?u=t[6]:(u=s(`font-mono uppercase`,n),t[5]=n,t[6]=u);let d;t[7]!==r||t[8]!==u?(d=(0,J.jsx)(mt,{"data-slot":`alert-dialog-cancel`,className:u,...r}),t[7]=r,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==c||t[11]!==d||t[12]!==o?(f=(0,J.jsx)(l,{variant:o,size:c,asChild:!0,children:d}),t[10]=c,t[11]=d,t[12]=o,t[13]=f):f=t[13],f}function Gt(e){let t=(0,X.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:p}=e,{_:m}=a(),h;t[0]!==m||t[1]!==n?(h=n??m({id:`L3CEC1`}),t[0]=m,t[1]=n,t[2]=h):h=t[2];let g=h,_;t[3]!==m||t[4]!==d?(_=d??m({id:`cnGeoo`}),t[3]=m,t[4]=d,t[5]=_):_=t[5];let v=_,y;t[6]!==m||t[7]!==d||t[8]!==f?(y=f??d??m({id:`s3caR3`}),t[6]=m,t[7]=d,t[8]=f,t[9]=y):y=t[9];let b=y,x;t[10]!==m||t[11]!==s||t[12]!==g?(x=s??m({id:`77SdEP`,values:{itemName:g}}),t[10]=m,t[11]=s,t[12]=g,t[13]=x):x=t[13];let S;t[14]===x?S=t[15]:(S=(0,J.jsx)(Ht,{children:x}),t[14]=x,t[15]=S);let C;t[16]!==m||t[17]!==c||t[18]!==g?(C=c??m({id:`16D5Zj`,values:{itemName:g}}),t[16]=m,t[17]=c,t[18]=g,t[19]=C):C=t[19];let w;t[20]===C?w=t[21]:(w=(0,J.jsx)(Ut,{className:`whitespace-pre-wrap`,children:C}),t[20]=C,t[21]=w);let T;t[22]===u?T=t[23]:(T=u?(0,J.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=T);let E;t[24]!==S||t[25]!==w||t[26]!==T?(E=(0,J.jsxs)(zt,{children:[S,w,T]}),t[24]=S,t[25]=w,t[26]=T,t[27]=E):E=t[27];let D;t[28]===p?D=t[29]:(D=p?(0,J.jsx)(Bt,{children:p}):null,t[28]=p,t[29]=D);let O;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,J.jsx)(i,{id:`dEgA5A`}),t[30]=O):O=t[30];let k;t[31]===r?k=t[32]:(k=(0,J.jsx)(Wt,{disabled:r,children:O}),t[31]=r,t[32]=k);let A;t[33]!==v||t[34]!==b||t[35]!==r?(A=r?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ae,{"aria-hidden":`true`,className:`size-4`}),` `,b]}):v,t[33]=v,t[34]=b,t[35]=r,t[36]=A):A=t[36];let j;t[37]!==r||t[38]!==o||t[39]!==A?(j=(0,J.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:A}),t[37]=r,t[38]=o,t[39]=A,t[40]=j):j=t[40];let M;t[41]!==k||t[42]!==j?(M=(0,J.jsxs)(Vt,{children:[k,j]}),t[41]=k,t[42]=j,t[43]=M):M=t[43];let N;return t[44]!==D||t[45]!==M||t[46]!==E?(N=(0,J.jsxs)(Rt,{children:[E,D,M]}),t[44]=D,t[45]=M,t[46]=E,t[47]=N):N=t[47],N}function Kt(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:ne[e]??e}function qt(e){return e===`claude`?`claude-code`:e}function Jt(e){let t=(0,X.c)(18),r,i;if(t[0]===e?(r=t[1],i=t[2]):({host:r,...i}=e,t[0]=e,t[1]=r,t[2]=i),r===`agents`){let e;return t[3]===i?e=t[4]:(e=(0,J.jsx)(n,{...i}),t[3]=i,t[4]=e),e}if(r.includes(`/`)){if(r===`.agents`||r.startsWith(`.agents/`)){let e;return t[5]===i?e=t[6]:(e=(0,J.jsx)(n,{...i}),t[5]=i,t[6]=e),e}if(r===`.ok`||r.startsWith(`.ok/`)){let e;if(t[7]!==i){let{className:n,...r}=i;e=r,t[7]=i,t[8]=e}else e=t[8];let n=e,r;return t[9]===n?r=t[10]:(r=(0,J.jsx)(Fe,{size:14,...n}),t[9]=n,t[10]=r),r}let e;return t[11]===i?e=t[12]:(e=(0,J.jsx)(ie,{...i}),t[11]=i,t[12]=e),e}let a;t[13]===r?a=t[14]:(a=qt(r),t[13]=r,t[14]=a);let o;return t[15]!==i||t[16]!==a?(o=(0,J.jsx)(P,{...i,id:a}),t[15]=i,t[16]=a,t[17]=o):o=t[17],o}function Yt(e){let t=(0,X.c)(14),{hosts:n,className:r,iconClassName:i}=e,a,o,c;if(t[0]!==r||t[1]!==n||t[2]!==i){let e=n.slice(0,2),l=n.slice(2);t[6]===r?a=t[7]:(a=s(`flex items-center gap-1`,r),t[6]=r,t[7]=a);let u;t[8]===i?u=t[9]:(u=e=>(0,J.jsxs)(g,{children:[(0,J.jsx)(m,{asChild:!0,children:(0,J.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,J.jsx)(Jt,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":Kt(e)})})}),(0,J.jsx)(h,{children:Kt(e)})]},e),t[8]=i,t[9]=u),o=e.map(u),c=l.length>0?(0,J.jsxs)(g,{children:[(0,J.jsx)(m,{asChild:!0,children:(0,J.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,J.jsx)(h,{children:l.map(Kt).join(`, `)})]}):null,t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=c}else a=t[3],o=t[4],c=t[5];let l;return t[10]!==a||t[11]!==o||t[12]!==c?(l=(0,J.jsxs)(`span`,{className:a,children:[o,c]}),t[10]=a,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Xt(e){let t=(0,X.c)(6),{testId:n,title:r}=e,a;t[0]===r?a=t[1]:(a=r===void 0?{}:{title:r},t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,J.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,J.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}function Zt(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(D,{...r}):(0,J.jsx)(B,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Qt(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(A,{...r}):(0,J.jsx)(L,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function $t(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(M,{...r}):(0,J.jsx)(V,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function en(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(F,{...r}):(0,J.jsx)(H,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function tn(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(O,{...r}):(0,J.jsx)(W,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function nn(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(k,{...r}):(0,J.jsx)(R,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function rn(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(N,{...r}):(0,J.jsx)(z,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function an(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(j,{...r}):(0,J.jsx)(U,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var on=Object.freeze({hosts:null,source:null}),sn=new Map,cn=new Map;function ln(e,t){return`${e}:${t}`}function un(e){return sn.get(e)??on}function dn(e,t){let n=cn.get(e)??new Set;return cn.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&cn.delete(e)}}function fn(e,t){let n=un(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?sn.delete(e):sn.set(e,r);for(let t of cn.get(e)??[])t()}}var pn=ee.options,mn=`.agents/`;function hn({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${q(t,e.scope)}/${e.name}`:null,o=e!==void 0&&((e.hosts??[]).includes(`agents`)||t?.some(e=>e.hosts.includes(`agents`)||e.path.startsWith(mn))),s=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),c=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),l=c?new Set(c):null,u=(o?[`agents`,...pn]:pn).filter(e=>!(e in s)).filter(e=>e===`agents`||l===null||l.has(e)||n.has(e)),d=new Set(u.map(e=>a(e))),f=e?.scope===`global`?`~/`:``,p=e?.path?.includes(`/`)?`${f}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,m=p!==null&&!d.has(p)?p:null,h=m===null?r??e?.hosts?.[0]:void 0,g=new Set(e?.conflictHosts??[]),_=new Set(e?.driftPaths??[]),v=new Set(e?.symlinkedHosts??[]),y=[...[...n].filter(e=>e!==h&&!(e in s)&&!g.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:v.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:se(e),display:`${f}${e.path}`,mode:e.mode}))],b=y.map(e=>e.mode),x=b.filter(e=>e===`link`).length,S=b.length===0?i?`link`:`copy`:x*2>=b.length?`link`:`copy`,C=new Map((e?.customPlacements??[]).map(e=>[se(e),e])),w=new Set(C.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=se(e);t!==``&&w.add(t)}}return{pathFor:a,aliases:s,rows:u,sourceRow:m,sourceHost:h,conflicted:g,drifted:_,linked:v,expectedMode:S,convertible:y,customRootRows:e===void 0?[]:[...w].sort().map(t=>({root:t,display:`${f}${t}/${e.name}`,placed:C.get(t)??null})).filter(e=>!d.has(e.display)&&e.display!==p&&!(e.root in s))}}var gn=`min-w-[24rem]`;function _n(e,t){let n=(0,X.c)(45),r=t.installingName===e.name,i=(0,Y.useRef)(e),[a,o]=(0,Y.useState)(!1),s=(0,Y.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,Y.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,Y.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=ln(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>dn(m,e),g=()=>un(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,Y.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&fn(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,Y.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,Y.useRef)(e.hosts),O,k;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},k=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,Y.useEffect)(O,k);let A;n[23]===e.hosts?A=n[24]:(A=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=A);let j=A,M,N;n[25]!==m||n[26]!==j?(M=()=>{let e=un(m).hosts;e&&[...e].sort().join(`,`)===j&&fn(m,{hosts:null})},N=[j,m],n[25]=m,n[26]=j,n[27]=M,n[28]=N):(M=n[27],N=n[28]),(0,Y.useEffect)(M,N);let P=(0,Y.useRef)(null),F=(0,Y.useRef)(null),I,L;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current),F.current?.(),F.current=null},L=[],n[29]=I,n[30]=L):(I=n[29],L=n[30]),(0,Y.useEffect)(I,L);let R;n[31]!==t||n[32]!==m||n[33]!==e?(R=function(n,r){D.current=n,fn(m,{hosts:n}),P.current&&clearTimeout(P.current);let i=async()=>{F.current=null,P.current=null;let r=await t.install(e,n.filter(te));if(!r.ok){fn(m,{hosts:null});return}D.current=[...r.hosts],fn(m,{hosts:[...r.hosts]})};r?(F.current=()=>void i(),P.current=setTimeout(()=>void i(),350)):(F.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=R):R=n[34];let z=R,B;return n[35]!==t||n[36]!==z||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(B={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)},installAll(){let t=D.current.filter(bn),n=e.installableEditors??pn,r=pn.filter(e=>n.includes(e)||D.current.includes(e));z([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>de({scope:e.scope,name:e.name,dir:n,mode:r})).then(yn)},unplaceAt(n){t.runLocationWrite(e,()=>le({scope:e.scope,name:e.name,path:n})).then(vn)},setSource(n){fn(m,{source:n}),t.runLocationWrite(e,()=>ce({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(fn(m,{source:null}),re.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=z,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=B):B=n[44],B}function vn(e){e.ok||re.error(e.error)}function yn(e){e.ok||re.error(e.error)}function bn(e){return!pn.includes(e)}function $(e){let t=(0,X.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,J.jsx)(m,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,J.jsx)(h,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,J.jsxs)(g,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function xn(e){let t=(0,X.c)(69),{toggles:n,skill:r,onResolveFork:o,onRunStart:s,menuKind:c}=e,u=c===void 0?`dropdown`:c,{_:d}=a(),{hostSet:f,toggleEditor:p,installAll:m}=n,h=fe(),g,_,v,y,b,x,S;if(t[0]!==d||t[1]!==h.data||t[2]!==h.status||t[3]!==f||t[4]!==m||t[5]!==u||t[6]!==o||t[7]!==s||t[8]!==r||t[9]!==p||t[10]!==n){let{pathFor:e,aliases:a,rows:c,sourceRow:C,sourceHost:w,conflicted:T,drifted:E,linked:D,expectedMode:O,convertible:k,customRootRows:A}=hn({skill:r,allSkills:h.status===`ready`?h.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});v=O,_=k;let j=e=>oe(a,e),M=On,N=e=>{let t=j(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(M).join(`, `),rootRel:e}}))},P;t[18]!==d||t[19]!==r?(P=(e,t)=>{let n=e.includes(`/`)?e:q(e,r?.scope??`project`);return(0,J.jsx)($,{hint:d({id:`0dslv8`,values:{0:M(e),1:M(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":d({id:`G6Lrs_`,values:{0:M(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:M(e),1:r.name,2:M(e),subRoot:n,poolRootRel:t}}))&&ue({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?G():re.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,J.jsx)(Jt,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[18]=d,t[19]=r,t[20]=P):P=t[20];let F=P;g=n.installing;let I=Dn,L;t[21]!==d||t[22]!==s||t[23]!==n?(L=(e,t,r)=>{let a=r===`link`?`copy`:`link`;return(0,J.jsx)($,{hint:d(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(d(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(s?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,J.jsx)(i,{id:`uUCrBv`}):(0,J.jsx)(i,{id:`iaPtht`})})})},t[21]=d,t[22]=s,t[23]=n,t[24]=L):L=t[24];let R=L,z;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,J.jsx)(i,{id:`npcziF`}),t[25]=z):z=t[25];let B;t[26]===d?B=t[27]:(B=d({id:`6f_UX4`}),t[26]=d,t[27]=B);let V;t[28]===m?V=t[29]:(V=()=>m(),t[28]=m,t[29]=V);let H;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,J.jsx)(i,{id:`N40H-G`}),t[30]=H):H=t[30];let U;t[31]!==g||t[32]!==V?(U=(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:g,onClick:V,"data-testid":`skill-install-all`,children:H}),t[31]=g,t[32]=V,t[33]=U):U=t[33];let W;t[34]!==B||t[35]!==U?(W=(0,J.jsx)($,{hint:B,children:U}),t[34]=B,t[35]=U,t[36]=W):W=t[36],t[37]!==u||t[38]!==W?(y=(0,J.jsxs)(en,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[z,W]}),t[37]=u,t[38]=W,t[39]=y):y=t[39],b=C===null?null:(0,J.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,J.jsxs)($t,{menuKind:u,disabled:g,checked:!0,onSelect:En,"data-testid":`skill-source-row`,children:[(0,J.jsx)(ie,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:C}),(()=>{let e=I(C).split(`/`).slice(0,-1).join(`/`),t=j(e);return t.length>0?(0,J.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>F(t,e))}):null})(),(0,J.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,J.jsx)(i,{id:`tiFPjk`})})]})]})}),x=c.map(t=>{let a=e(t),s=t===`agents`?`.agents`:ne[t],c=I(a).split(`/`).slice(0,-1).join(`/`),m=j(c);return(0,J.jsx)($,{hint:T.has(t)?d({id:`8HvJlU`,values:{0:a??s}}):t===w?a?d({id:`ssk6rl`,values:{path:a}}):s:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:s}}):d(a?v===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:s}}),children:(0,J.jsxs)($t,{menuKind:u,disabled:g,checked:f.has(t),onCheckedChange:e=>{T.has(t)||e===!0&&!N(c)||p(t,e===!0)},onSelect:Tn,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,J.jsx)(Jt,{host:t,"aria-hidden":!0,className:`size-4`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??s}),m.length>0?(0,J.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:m.map(e=>F(e,c))}):null,T.has(t)?(0,J.jsx)($,{hint:d({id:`_O7dJS`}),children:(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:e=>{e.preventDefault(),o?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,J.jsx)(i,{id:`jng7Ko`})})}):t===w?(0,J.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,J.jsx)(i,{id:`tiFPjk`})}):f.has(t)&&r?.hosts?(0,J.jsxs)(J.Fragment,{children:[!g&&(D.has(t)?`link`:`copy`)!==v?R(t,a??s,D.has(t)?`link`:`copy`):null,(0,J.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,J.jsx)(i,{id:`VNNRfN`})})})]}):null,!g&&E.has(I(a))?(0,J.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,J.jsx)(Xt,{testId:`skill-drift-${t}`})}):null]})]})},t)}),S=A.map(e=>(0,J.jsx)($,{hint:e.placed===null?d(v===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):d({id:`C0cll5`,values:{0:e.display}}),children:(0,J.jsxs)($t,{menuKind:u,disabled:g,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!N(e.root))return;n.placeAt(e.root,v)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:wn,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,J.jsx)(Jt,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,J.jsx)(ie,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),j(e.root).length>0?(0,J.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:j(e.root).map(t=>F(t,e.root))}):null,!g&&e.placed!==null&&E.has(e.placed.path)?(0,J.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,J.jsx)(Xt,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,J.jsxs)(J.Fragment,{children:[!g&&e.placed.mode!==v?R(e.root,e.display,e.placed.mode):null,(0,J.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,J.jsx)(i,{id:`VNNRfN`})})})]})]})]})},e.root)),t[0]=d,t[1]=h.data,t[2]=h.status,t[3]=f,t[4]=m,t[5]=u,t[6]=o,t[7]=s,t[8]=r,t[9]=p,t[10]=n,t[11]=g,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S}else g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17];let C;t[40]!==d||t[41]!==g||t[42]!==_||t[43]!==v||t[44]!==s||t[45]!==n?(C=_.length>0&&n.convertLocations?(0,J.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=v===`link`?`copy`:`link`,r=_.filter(e=>e.mode!==t);if(r.length===0)return;let i=d(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=d(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(Cn).join(`
|
|
8
|
-
`);window.confirm(`${i}\n\n${a}\n\n${o}\n\n${d({id:`Cu6GXQ`})}`)&&(s?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:g,"data-testid":`skill-convert-all`,children:
|
|
7
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return Y.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},ut=Ue,dt=qe,ft=Ye,pt=et,mt=ct,ht=nt,gt=it,_t=K(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),vt=K(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),yt=K(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),bt=[...new Set(I.flatMap(e=>e.schemes))];function xt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of I){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function St(e){return xt({},e)}async function Ct(e){let t=e.schemes??bt,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var wt=Object.fromEntries(bt.map(e=>[e,{installed:!1}]));async function Tt(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return wt}if(!t.ok)return wt;let n;try{n=await t.json()}catch{return wt}if(typeof n!=`object`||!n||Array.isArray(n))return wt;let r=n,i={};for(let e of bt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Et(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Dt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=St({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=xt(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Et(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function Ot(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function kt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Ct({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>Tt({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function At(){let e=(0,X.c)(5),[t,n]=(0,Y.useState)(jt),r=(0,Y.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Dt(kt());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Y.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function jt(){return St({isElectronHost:Ot(),now:Date.now})}var Mt=(0,Y.createContext)(null);function Nt(e){let t=(0,X.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,J.jsx)(Mt,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Pt(){return(0,Y.use)(Mt)}function Ft(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,J.jsx)(ut,{"data-slot":`alert-dialog`,...n}),t[2]=n,t[3]=r),r}function It(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,J.jsx)(dt,{"data-slot":`alert-dialog-portal`,...n}),t[2]=n,t[3]=r),r}function Lt(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs [-webkit-app-region:no-drag] data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(ft,{"data-slot":`alert-dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Rt(e){let t=(0,X.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,J.jsx)(Lt,{}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=s(`fixed top-1/2 left-1/2 z-50 flex w-full max-w-[calc(100%-2rem)] max-h-[calc(100dvh-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-6 overflow-hidden rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm [-webkit-app-region:no-drag] data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,J.jsxs)(It,{children:[i,(0,J.jsx)(pt,{"data-slot":`alert-dialog-content`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function zt(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`flex shrink-0 flex-col gap-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Bt(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`-mx-6 min-h-0 flex-1 overflow-y-auto px-6 subtle-scrollbar scroll-fade-mask`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(`div`,{"data-slot":`alert-dialog-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vt(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`-mx-6 -mb-6 flex shrink-0 flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 px-6 py-4 sm:flex-row sm:justify-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ht(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`font-heading text-base leading-none font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(ht,{"data-slot":`alert-dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ut(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=s(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(gt,{"data-slot":`alert-dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Wt(e){let t=(0,X.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`outline`:i,c=a===void 0?`default`:a,u;t[5]===n?u=t[6]:(u=s(`font-mono uppercase`,n),t[5]=n,t[6]=u);let d;t[7]!==r||t[8]!==u?(d=(0,J.jsx)(mt,{"data-slot":`alert-dialog-cancel`,className:u,...r}),t[7]=r,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==c||t[11]!==d||t[12]!==o?(f=(0,J.jsx)(l,{variant:o,size:c,asChild:!0,children:d}),t[10]=c,t[11]=d,t[12]=o,t[13]=f):f=t[13],f}function Gt(e){let t=(0,X.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:p}=e,{_:m}=a(),h;t[0]!==m||t[1]!==n?(h=n??m({id:`L3CEC1`}),t[0]=m,t[1]=n,t[2]=h):h=t[2];let g=h,_;t[3]!==m||t[4]!==d?(_=d??m({id:`cnGeoo`}),t[3]=m,t[4]=d,t[5]=_):_=t[5];let v=_,y;t[6]!==m||t[7]!==d||t[8]!==f?(y=f??d??m({id:`s3caR3`}),t[6]=m,t[7]=d,t[8]=f,t[9]=y):y=t[9];let b=y,x;t[10]!==m||t[11]!==s||t[12]!==g?(x=s??m({id:`77SdEP`,values:{itemName:g}}),t[10]=m,t[11]=s,t[12]=g,t[13]=x):x=t[13];let S;t[14]===x?S=t[15]:(S=(0,J.jsx)(Ht,{children:x}),t[14]=x,t[15]=S);let C;t[16]!==m||t[17]!==c||t[18]!==g?(C=c??m({id:`16D5Zj`,values:{itemName:g}}),t[16]=m,t[17]=c,t[18]=g,t[19]=C):C=t[19];let w;t[20]===C?w=t[21]:(w=(0,J.jsx)(Ut,{className:`whitespace-pre-wrap`,children:C}),t[20]=C,t[21]=w);let T;t[22]===u?T=t[23]:(T=u?(0,J.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=T);let E;t[24]!==S||t[25]!==w||t[26]!==T?(E=(0,J.jsxs)(zt,{children:[S,w,T]}),t[24]=S,t[25]=w,t[26]=T,t[27]=E):E=t[27];let D;t[28]===p?D=t[29]:(D=p?(0,J.jsx)(Bt,{children:p}):null,t[28]=p,t[29]=D);let O;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,J.jsx)(i,{id:`dEgA5A`}),t[30]=O):O=t[30];let k;t[31]===r?k=t[32]:(k=(0,J.jsx)(Wt,{disabled:r,children:O}),t[31]=r,t[32]=k);let A;t[33]!==v||t[34]!==b||t[35]!==r?(A=r?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ae,{"aria-hidden":`true`,className:`size-4`}),` `,b]}):v,t[33]=v,t[34]=b,t[35]=r,t[36]=A):A=t[36];let j;t[37]!==r||t[38]!==o||t[39]!==A?(j=(0,J.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:A}),t[37]=r,t[38]=o,t[39]=A,t[40]=j):j=t[40];let M;t[41]!==k||t[42]!==j?(M=(0,J.jsxs)(Vt,{children:[k,j]}),t[41]=k,t[42]=j,t[43]=M):M=t[43];let N;return t[44]!==D||t[45]!==M||t[46]!==E?(N=(0,J.jsxs)(Rt,{children:[E,D,M]}),t[44]=D,t[45]=M,t[46]=E,t[47]=N):N=t[47],N}function Kt(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:te[e]??e}function qt(e){return e===`claude`?`claude-code`:e}function Jt(e){let t=(0,X.c)(18),r,i;if(t[0]===e?(r=t[1],i=t[2]):({host:r,...i}=e,t[0]=e,t[1]=r,t[2]=i),r===`agents`){let e;return t[3]===i?e=t[4]:(e=(0,J.jsx)(n,{...i}),t[3]=i,t[4]=e),e}if(r.includes(`/`)){if(r===`.agents`||r.startsWith(`.agents/`)){let e;return t[5]===i?e=t[6]:(e=(0,J.jsx)(n,{...i}),t[5]=i,t[6]=e),e}if(r===`.ok`||r.startsWith(`.ok/`)){let e;if(t[7]!==i){let{className:n,...r}=i;e=r,t[7]=i,t[8]=e}else e=t[8];let n=e,r;return t[9]===n?r=t[10]:(r=(0,J.jsx)(Fe,{size:14,...n}),t[9]=n,t[10]=r),r}let e;return t[11]===i?e=t[12]:(e=(0,J.jsx)(ie,{...i}),t[11]=i,t[12]=e),e}let a;t[13]===r?a=t[14]:(a=qt(r),t[13]=r,t[14]=a);let o;return t[15]!==i||t[16]!==a?(o=(0,J.jsx)(P,{...i,id:a}),t[15]=i,t[16]=a,t[17]=o):o=t[17],o}function Yt(e){let t=(0,X.c)(14),{hosts:n,className:r,iconClassName:i}=e,a,o,c;if(t[0]!==r||t[1]!==n||t[2]!==i){let e=n.slice(0,2),l=n.slice(2);t[6]===r?a=t[7]:(a=s(`flex items-center gap-1`,r),t[6]=r,t[7]=a);let u;t[8]===i?u=t[9]:(u=e=>(0,J.jsxs)(g,{children:[(0,J.jsx)(m,{asChild:!0,children:(0,J.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,J.jsx)(Jt,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":Kt(e)})})}),(0,J.jsx)(h,{children:Kt(e)})]},e),t[8]=i,t[9]=u),o=e.map(u),c=l.length>0?(0,J.jsxs)(g,{children:[(0,J.jsx)(m,{asChild:!0,children:(0,J.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,J.jsx)(h,{children:l.map(Kt).join(`, `)})]}):null,t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=c}else a=t[3],o=t[4],c=t[5];let l;return t[10]!==a||t[11]!==o||t[12]!==c?(l=(0,J.jsxs)(`span`,{className:a,children:[o,c]}),t[10]=a,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Xt(e){let t=(0,X.c)(6),{testId:n,title:r}=e,a;t[0]===r?a=t[1]:(a=r===void 0?{}:{title:r},t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,J.jsx)(i,{id:`YjiZAs`}),t[2]=o):o=t[2];let s;return t[3]!==a||t[4]!==n?(s=(0,J.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide`,"data-testid":n,...a,children:o}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s}function Zt(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(D,{...r}):(0,J.jsx)(B,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function Qt(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(A,{...r}):(0,J.jsx)(L,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function $t(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(M,{...r}):(0,J.jsx)(ee,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function en(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(F,{...r}):(0,J.jsx)(V,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function tn(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(O,{...r}):(0,J.jsx)(U,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function nn(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(k,{...r}):(0,J.jsx)(R,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function rn(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(N,{...r}):(0,J.jsx)(z,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function an(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({menuKind:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=n===`context`?(0,J.jsx)(j,{...r}):(0,J.jsx)(H,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var on=Object.freeze({hosts:null,source:null}),sn=new Map,cn=new Map;function ln(e,t){return`${e}:${t}`}function un(e){return sn.get(e)??on}function dn(e,t){let n=cn.get(e)??new Set;return cn.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&cn.delete(e)}}function fn(e,t){let n=un(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?sn.delete(e):sn.set(e,r);for(let t of cn.get(e)??[])t()}}var pn=W.options,mn=`.agents/`;function hn({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${q(t,e.scope)}/${e.name}`:null,o=e!==void 0&&((e.hosts??[]).includes(`agents`)||t?.some(e=>e.hosts.includes(`agents`)||e.path.startsWith(mn))),s=e?.hostAliases??(e&&t!==null?Object.assign({},...t.filter(t=>t.scope===e.scope).map(e=>e.hostAliases??{})):{}),c=e?.installableEditors??(e&&t!==null?t.find(t=>t.scope===e.scope)?.installableEditors:void 0),l=c?new Set(c):null,u=(o?[...pn,`agents`]:pn).filter(e=>!(e in s)).filter(e=>e===`agents`||l===null||l.has(e)||n.has(e)),d=new Set(u.map(e=>a(e))),f=e?.scope===`global`?`~/`:``,p=e?.path?.includes(`/`)?`${f}${e.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,m=p!==null&&!d.has(p)?p:null,h=m===null?r??e?.hosts?.[0]:void 0,g=new Set(e?.conflictHosts??[]),_=new Set(e?.driftPaths??[]),v=new Set(e?.symlinkedHosts??[]),y=[...[...n].filter(e=>e!==h&&!(e in s)&&!g.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:a(e)??e,mode:v.has(e)?`link`:`copy`})),...(e?.customPlacements??[]).map(e=>({target:se(e),display:`${f}${e.path}`,mode:e.mode}))],b=y.map(e=>e.mode),x=b.filter(e=>e===`link`).length,S=b.length===0?i?`link`:`copy`:x*2>=b.length?`link`:`copy`,C=new Map((e?.customPlacements??[]).map(e=>[se(e),e])),w=new Set(C.keys());if(t!==null&&e){for(let n of t)if(n.scope===e.scope)for(let e of n.customPlacements??[]){let t=se(e);t!==``&&w.add(t)}}return{pathFor:a,aliases:s,rows:u,sourceRow:m,sourceHost:h,conflicted:g,drifted:_,linked:v,expectedMode:S,convertible:y,customRootRows:e===void 0?[]:[...w].sort().map(t=>({root:t,display:`${f}${t}/${e.name}`,placed:C.get(t)??null})).filter(e=>!d.has(e.display)&&e.display!==p&&!(e.root in s))}}var gn=`min-w-[24rem]`;function _n(e,t){let n=(0,X.c)(45),r=t.installingName===e.name,i=(0,Y.useRef)(e),[a,o]=(0,Y.useState)(!1),s=(0,Y.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,Y.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,Y.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=ln(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>dn(m,e),g=()=>un(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,Y.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&fn(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,Y.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,Y.useRef)(e.hosts),O,k;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},k=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,Y.useEffect)(O,k);let A;n[23]===e.hosts?A=n[24]:(A=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=A);let j=A,M,N;n[25]!==m||n[26]!==j?(M=()=>{let e=un(m).hosts;e&&[...e].sort().join(`,`)===j&&fn(m,{hosts:null})},N=[j,m],n[25]=m,n[26]=j,n[27]=M,n[28]=N):(M=n[27],N=n[28]),(0,Y.useEffect)(M,N);let P=(0,Y.useRef)(null),F=(0,Y.useRef)(null),I,L;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current),F.current?.(),F.current=null},L=[],n[29]=I,n[30]=L):(I=n[29],L=n[30]),(0,Y.useEffect)(I,L);let R;n[31]!==t||n[32]!==m||n[33]!==e?(R=function(n,r){D.current=n,fn(m,{hosts:n}),P.current&&clearTimeout(P.current);let i=async()=>{F.current=null,P.current=null;let r=await t.install(e,n.filter(G));if(!r.ok){fn(m,{hosts:null});return}D.current=[...r.hosts],fn(m,{hosts:[...r.hosts]})};r?(F.current=()=>void i(),P.current=setTimeout(()=>void i(),350)):(F.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=R):R=n[34];let z=R,B;return n[35]!==t||n[36]!==z||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(B={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)},installAll(){let t=D.current.filter(bn),n=e.installableEditors??pn,r=pn.filter(e=>n.includes(e)||D.current.includes(e));z([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>de({scope:e.scope,name:e.name,dir:n,mode:r})).then(yn)},unplaceAt(n){t.runLocationWrite(e,()=>le({scope:e.scope,name:e.name,path:n})).then(vn)},setSource(n){fn(m,{source:n}),t.runLocationWrite(e,()=>ce({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(fn(m,{source:null}),ne.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=z,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=B):B=n[44],B}function vn(e){e.ok||ne.error(e.error)}function yn(e){e.ok||ne.error(e.error)}function bn(e){return!pn.includes(e)}function $(e){let t=(0,X.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,J.jsx)(m,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,J.jsx)(h,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,J.jsxs)(g,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function xn(e){let t=(0,X.c)(77),{toggles:n,skill:r,onResolveFork:o,onRunStart:s,menuKind:c}=e,u=c===void 0?`dropdown`:c,{_:d}=a(),{hostSet:f,toggleEditor:p,installAll:m}=n,h=fe(),g,_,v,y,b,x,S,C,w,T;if(t[0]!==d||t[1]!==h.data||t[2]!==h.status||t[3]!==f||t[4]!==m||t[5]!==u||t[6]!==o||t[7]!==s||t[8]!==r||t[9]!==p||t[10]!==n){let{pathFor:e,aliases:a,rows:c,sourceRow:E,sourceHost:D,conflicted:O,drifted:k,linked:A,expectedMode:j,convertible:M,customRootRows:N}=hn({skill:r,allSkills:h.status===`ready`?h.data:null,hostSet:f,sourceHostOverlay:n.sourceHost,linkMode:n.linkMode});b=c,x=E,y=j,_=M,v=N;let P=e=>oe(a,e),F=On,I=e=>{let t=P(e);return t.length===0?!0:window.confirm(d({id:`Uobeu9`,values:{0:t.map(F).join(`, `),rootRel:e}}))},L;t[21]!==d||t[22]!==r?(L=(e,t)=>{let n=e.includes(`/`)?e:q(e,r?.scope??`project`);return(0,J.jsx)($,{hint:d({id:`0dslv8`,values:{0:F(e),1:F(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":d({id:`G6Lrs_`,values:{0:F(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(d({id:`iiqOKM`,values:{0:F(e),1:r.name,2:F(e),subRoot:n,poolRootRel:t}}))&&ue({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?re():ne.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,J.jsx)(Jt,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[21]=d,t[22]=r,t[23]=L):L=t[23];let R=L;g=n.installing;let z=Dn,B;t[24]!==d||t[25]!==s||t[26]!==n?(B=(e,t,r)=>{let a=r===`link`?`copy`:`link`;return(0,J.jsx)($,{hint:d(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(d(a===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(s?.(),n.convertLocation?.(e,a))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,J.jsx)(i,{id:`uUCrBv`}):(0,J.jsx)(i,{id:`iaPtht`})})})},t[24]=d,t[25]=s,t[26]=n,t[27]=B):B=t[27];let ee=B,V;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,J.jsx)(i,{id:`npcziF`}),t[28]=V):V=t[28];let H;t[29]===d?H=t[30]:(H=d({id:`6f_UX4`}),t[29]=d,t[30]=H);let U;t[31]===m?U=t[32]:(U=()=>m(),t[31]=m,t[32]=U);let W;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,J.jsx)(i,{id:`N40H-G`}),t[33]=W):W=t[33];let G;t[34]!==g||t[35]!==U?(G=(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:g,onClick:U,"data-testid":`skill-install-all`,children:W}),t[34]=g,t[35]=U,t[36]=G):G=t[36];let K;t[37]!==H||t[38]!==G?(K=(0,J.jsx)($,{hint:H,children:G}),t[37]=H,t[38]=G,t[39]=K):K=t[39],t[40]!==u||t[41]!==K?(S=(0,J.jsxs)(en,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[V,K]}),t[40]=u,t[41]=K,t[42]=S):S=t[42],C=x===null?null:(0,J.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,J.jsxs)($t,{menuKind:u,disabled:g,checked:!0,onSelect:En,"data-testid":`skill-source-row`,children:[(0,J.jsx)(ie,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:x}),(()=>{let e=z(x).split(`/`).slice(0,-1).join(`/`),t=P(e);return t.length>0?(0,J.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>R(t,e))}):null})(),(0,J.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,J.jsx)(i,{id:`tiFPjk`})})]})]})}),w=b.map(t=>{let a=e(t),s=t===`agents`?`.agents`:te[t],c=z(a).split(`/`).slice(0,-1).join(`/`),m=P(c);return(0,J.jsx)($,{hint:O.has(t)?d({id:`8HvJlU`,values:{0:a??s}}):t===D?a?d({id:`ssk6rl`,values:{path:a}}):s:f.has(t)?d(a?{id:`9ieZhu`,values:{path:a}}:{id:`n3T3EE`,values:{label:s}}):d(a?y===`link`?{id:`1LtA5r`,values:{path:a}}:{id:`opPbzN`,values:{path:a}}:{id:`Pp0Vgd`,values:{label:s}}),children:(0,J.jsxs)($t,{menuKind:u,disabled:g,checked:f.has(t),onCheckedChange:e=>{O.has(t)||e===!0&&!I(c)||p(t,e===!0)},onSelect:Tn,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,J.jsx)(Jt,{host:t,"aria-hidden":!0,className:`size-4`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:a??s}),m.length>0?(0,J.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${t}`,children:m.map(e=>R(e,c))}):null,O.has(t)?(0,J.jsx)($,{hint:d({id:`_O7dJS`}),children:(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:e=>{e.preventDefault(),o?.(t)},"data-testid":`skill-fork-chip-${t}`,children:(0,J.jsx)(i,{id:`jng7Ko`})})}):t===D?(0,J.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,J.jsx)(i,{id:`tiFPjk`})}):f.has(t)&&r?.hosts?(0,J.jsxs)(J.Fragment,{children:[!g&&(A.has(t)?`link`:`copy`)!==y?ee(t,a??s,A.has(t)?`link`:`copy`):null,(0,J.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),n.setSource?.(t)},"data-testid":`skill-set-source-${t}`,children:(0,J.jsx)(i,{id:`VNNRfN`})})})]}):null,!g&&k.has(z(a))?(0,J.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,J.jsx)(Xt,{testId:`skill-drift-${t}`})}):null]})]})},t)}),T=v.map(e=>(0,J.jsx)($,{hint:e.placed===null?d(y===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):d({id:`C0cll5`,values:{0:e.display}}),children:(0,J.jsxs)($t,{menuKind:u,disabled:g,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!I(e.root))return;n.placeAt(e.root,y)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:wn,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,J.jsx)(Jt,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,J.jsx)(ie,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),P(e.root).length>0?(0,J.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:P(e.root).map(t=>R(t,e.root))}):null,!g&&e.placed!==null&&k.has(e.placed.path)?(0,J.jsx)($,{hint:d({id:`iz1LdD`}),children:(0,J.jsx)(Xt,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,J.jsxs)(J.Fragment,{children:[!g&&e.placed.mode!==y?ee(e.root,e.display,e.placed.mode):null,(0,J.jsx)($,{hint:d({id:`nBgzKO`}),children:(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,J.jsx)(i,{id:`VNNRfN`})})})]})]})]})},e.root)),t[0]=d,t[1]=h.data,t[2]=h.status,t[3]=f,t[4]=m,t[5]=u,t[6]=o,t[7]=s,t[8]=r,t[9]=p,t[10]=n,t[11]=g,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w,t[20]=T}else g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18],w=t[19],T=t[20];let E;t[43]!==v||t[44]!==b.length||t[45]!==x?(E=b.length===0&&v.length===0&&x===null?(0,J.jsx)(`div`,{className:`px-2 py-1.5 text-[11px] text-muted-foreground leading-snug`,"data-testid":`skill-install-no-destinations`,children:(0,J.jsx)(i,{id:`MOAoFO`})}):null,t[43]=v,t[44]=b.length,t[45]=x,t[46]=E):E=t[46];let D;t[47]!==d||t[48]!==g||t[49]!==_||t[50]!==y||t[51]!==s||t[52]!==n?(D=_.length>0&&n.convertLocations?(0,J.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,J.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=y===`link`?`copy`:`link`,r=_.filter(e=>e.mode!==t);if(r.length===0)return;let i=d(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),a=d(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),o=r.map(Cn).join(`
|
|
8
|
+
`);window.confirm(`${i}\n\n${a}\n\n${o}\n\n${d({id:`Cu6GXQ`})}`)&&(s?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:g,"data-testid":`skill-convert-all`,children:y===`link`?(0,J.jsx)(i,{id:`rcJmK8`}):(0,J.jsx)(i,{id:`LBv_TR`})}),(0,J.jsx)($,{hint:d({id:`0J6nhG`}),children:(0,J.jsx)(l,{variant:`ghost`,size:`sm`,"aria-label":d({id:`qJSo0_`}),className:`size-4 shrink-0 rounded-full border border-border/60 p-0 font-normal text-[9px] text-muted-foreground hover:border-foreground/40 hover:bg-transparent hover:text-foreground`,onClick:Sn,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[47]=d,t[48]=g,t[49]=_,t[50]=y,t[51]=s,t[52]=n,t[53]=D):D=t[53];let O;t[54]===u?O=t[55]:(O=(0,J.jsx)(tn,{menuKind:u}),t[54]=u,t[55]=O);let k;t[56]===d?k=t[57]:(k=d({id:`jqe7Yq`}),t[56]=d,t[57]=k);let A;t[58]===r?.scope?A=t[59]:(A=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[58]=r?.scope,t[59]=A);let j,M;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,J.jsx)(yt,{"aria-hidden":!0}),M=(0,J.jsx)(i,{id:`ZBF9fn`}),t[60]=j,t[61]=M):(j=t[60],M=t[61]);let N;t[62]!==u||t[63]!==A?(N=(0,J.jsxs)(Qt,{menuKind:u,onSelect:A,children:[j,M]}),t[62]=u,t[63]=A,t[64]=N):N=t[64];let P;t[65]!==N||t[66]!==k?(P=(0,J.jsx)($,{hint:k,children:N}),t[65]=N,t[66]=k,t[67]=P):P=t[67];let F;return t[68]!==P||t[69]!==S||t[70]!==C||t[71]!==w||t[72]!==T||t[73]!==E||t[74]!==D||t[75]!==O?(F=(0,J.jsxs)(J.Fragment,{children:[S,C,w,T,E,D,O,P]}),t[68]=P,t[69]=S,t[70]=C,t[71]=w,t[72]=T,t[73]=E,t[74]=D,t[75]=O,t[76]=F):F=t[76],F}function Sn(e){return e.preventDefault()}function Cn(e){return e.display}function wn(e){return e.preventDefault()}function Tn(e){return e.preventDefault()}function En(e){return e.preventDefault()}function Dn(e){return(e??``).replace(/^~\//,``)}function On(e){return e===`agents`?`.agents`:te[e]??e}export{Nt as C,vt as D,yt as E,_t as O,Ht as S,At as T,Wt as _,Zt as a,Vt as b,nn as c,Xt as d,Jt as f,Bt as g,Ft as h,pn as i,Fe as k,rn as l,Gt as m,xn as n,Qt as o,Yt as p,_n as r,tn as s,gn as t,an as u,Rt as v,Pt as w,zt as x,Ut as y};
|
package/dist/public/assets/{SkillToolbarControls-D3v2Hs4j.js → SkillToolbarControls-Dod_5zs_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{D as s,O as c,n as l,p as u,r as d,t as f}from"./SkillInstallMenu-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{D as s,O as c,n as l,p as u,r as d,t as f}from"./SkillInstallMenu-BgV-kMhM.js";import{t as p}from"./button-CA0dewJJ.js";import{a as m,c as h,l as g,m as _,o as v,r as y,t as ee,u as b}from"./dropdown-menu-CCTsTCfv.js";import{a as x,i as S,n as C,o as w,r as T,s as E,t as D}from"./select-BjFjLtNo.js";import{a as O,i as k,u as A}from"./skill-actions-DFktYEsA.js";import{t as j}from"./chevron-down-DmoBYxyq.js";import{t as M}from"./list-plus-D42L1B7w.js";import{f as N,i as P,t as F}from"./skill-scope-Dvl0F_Nc.js";import{t as I}from"./use-skills-RGrgR7Ae.js";var L=a(),R=e(n(),1),z=t();function B(e){let t=(0,L.c)(52),{scope:n,name:a}=e,{_:c}=i(),m=I(),h=k(),g;t[0]!==a||t[1]!==n||t[2]!==m.data||t[3]!==m.status?(g=m.status===`ready`?m.data.find(e=>e.scope===n&&e.name===a):void 0,t[0]=a,t[1]=n,t[2]=m.data,t[3]=m.status,t[4]=g):g=t[4];let v=g,b;t[5]!==v||t[6]!==a||t[7]!==n?(b=v??{scope:n,name:a,path:a,description:``,installed:!1,hosts:[]},t[5]=v,t[6]=a,t[7]=n,t[8]=b):b=t[8];let x=b,[S,C]=(0,R.useState)(!1),w=d(x,h),{installed:T,installing:E,hostSet:D}=w,O=v===void 0&&!T,A;t[9]!==v||t[10]!==D?(A=v?P(v,[...D]):[],t[9]=v,t[10]=D,t[11]=A):A=t[11];let M=A,N;t[12]!==h||t[13]!==x?(N=()=>h.requestFileCreate(x),t[12]=h,t[13]=x,t[14]=N):N=t[14];let F;t[15]===c?F=t[16]:(F=c({id:`leF0i_`}),t[15]=c,t[16]=F);let B;t[17]===c?B=t[18]:(B=c({id:`leF0i_`}),t[17]=c,t[18]=B);let V;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,z.jsx)(s,{className:`size-4`,"aria-hidden":!0}),t[19]=V):V=t[19];let H;t[20]!==N||t[21]!==F||t[22]!==B?(H=(0,z.jsx)(p,{variant:`outline`,size:`icon-sm`,className:`shrink-0 text-muted-foreground`,onClick:N,title:F,"aria-label":B,"data-testid":`skill-editor-new-file`,children:V}),t[20]=N,t[21]=F,t[22]=B,t[23]=H):H=t[23];let U=O?`resolving`:`installed`,W=O?`border-border bg-muted/50 text-muted-foreground`:`border-primary/50 bg-primary/5 text-primary hover:bg-primary/10 hover:text-primary aria-expanded:bg-primary/10 aria-expanded:text-primary`,G;t[24]===W?G=t[25]:(G=o(`h-7 shrink-0 gap-1 rounded-lg border px-2 font-normal text-xs shadow-xs font-mono uppercase`,W),t[24]=W,t[25]=G);let K;t[26]!==M||t[27]!==E||t[28]!==O?(K=E?(0,z.jsx)(r,{id:`b4itZn`}):O?(0,z.jsx)(r,{id:`iKvAeG`}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(r,{id:`eQkgKV`}),(0,z.jsx)(u,{hosts:M,className:`text-muted-foreground`})]}),t[26]=M,t[27]=E,t[28]=O,t[29]=K):K=t[29];let q;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,z.jsx)(j,{className:`size-4 shrink-0 opacity-50`,"aria-hidden":!0}),t[30]=q):q=t[30];let J;t[31]!==E||t[32]!==G||t[33]!==K||t[34]!==U?(J=(0,z.jsx)(_,{asChild:!0,children:(0,z.jsxs)(p,{variant:`outline`,size:`sm`,disabled:E,"data-testid":`skill-install-menu-trigger`,"data-state":U,className:G,children:[K,q]})}),t[31]=E,t[32]=G,t[33]=K,t[34]=U,t[35]=J):J=t[35];let Y;t[36]!==h||t[37]!==x?(Y=e=>h.requestForkResolve(x,e),t[36]=h,t[37]=x,t[38]=Y):Y=t[38];let X;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(X=()=>C(!1),t[39]=X):X=t[39];let Z;t[40]!==x||t[41]!==Y||t[42]!==w?(Z=(0,z.jsx)(y,{align:`end`,className:f,children:(0,z.jsx)(l,{toggles:w,skill:x,onResolveFork:Y,onRunStart:X})}),t[40]=x,t[41]=Y,t[42]=w,t[43]=Z):Z=t[43];let Q;t[44]!==S||t[45]!==J||t[46]!==Z?(Q=(0,z.jsxs)(ee,{open:S,onOpenChange:C,children:[J,Z]}),t[44]=S,t[45]=J,t[46]=Z,t[47]=Q):Q=t[47];let $;return t[48]!==h.dialogs||t[49]!==Q||t[50]!==H?($=(0,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[H,Q,h.dialogs]}),t[48]=h.dialogs,t[49]=Q,t[50]=H,t[51]=$):$=t[51],$}function V(e){let t=(0,L.c)(21),{value:n,onRequestMove:a,disabled:s,triggerClassName:c}=e,{_:l}=i(),u=N(),d;t[0]===a?d=t[1]:(d=e=>a(e),t[0]=a,t[1]=d);let f;t[2]===l?f=t[3]:(f=l({id:`oCHfGC`}),t[2]=l,t[3]=f);let p;t[4]===c?p=t[5]:(p=o(`w-auto gap-1 text-xs font-mono uppercase`,c),t[4]=c,t[5]=p);let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,z.jsx)(E,{}),t[6]=m):m=t[6];let h;t[7]!==f||t[8]!==p?(h=(0,z.jsx)(w,{size:`sm`,"aria-label":f,"data-testid":`skill-level-select`,className:p,children:m}),t[7]=f,t[8]=p,t[9]=h):h=t[9];let g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,z.jsx)(x,{children:(0,z.jsx)(r,{id:`oCHfGC`})}),t[10]=g):g=t[10];let _;t[11]===u?_=t[12]:(_=F.map(e=>(0,z.jsx)(S,{value:e,children:u[e]},e)),t[11]=u,t[12]=_);let v;t[13]===_?v=t[14]:(v=(0,z.jsx)(C,{align:`end`,children:(0,z.jsxs)(T,{children:[g,_]})}),t[13]=_,t[14]=v);let y;return t[15]!==s||t[16]!==d||t[17]!==h||t[18]!==v||t[19]!==n?(y=(0,z.jsxs)(D,{value:n,onValueChange:d,disabled:s,children:[h,v]}),t[15]=s,t[16]=d,t[17]=h,t[18]=v,t[19]=n,t[20]=y):y=t[20],y}function H(e){let t=(0,L.c)(12),{scope:n,name:r}=e,[i,a]=(0,R.useState)(null),o;t[0]===n?o=t[1]:(o=e=>{e!==n&&a(e)},t[0]=n,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==n?(s=i?{scope:n,name:r,toScope:i}:null,t[2]=r,t[3]=i,t[4]=n,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>!e&&a(null),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,z.jsx)(O,{target:s,onOpenChange:c}),t[7]=s,t[8]=l);let u;return t[9]!==o||t[10]!==l?(u={requestMove:o,dialog:l},t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function U(e){let t=(0,L.c)(45),{scope:n,name:a,showAddPropertyButton:o,onAddProperty:s,problemCount:l,problemMessages:u}=e,{_:d}=i(),f=N(),x;t[0]!==a||t[1]!==n?(x={scope:n,name:a},t[0]=a,t[1]=n,t[2]=x):x=t[2];let S=H(x),C;t[3]!==S.requestMove||t[4]!==n?(C=(0,z.jsx)(V,{value:n,onRequestMove:S.requestMove,triggerClassName:`hidden @xl/toolbar:flex`}),t[3]=S.requestMove,t[4]=n,t[5]=C):C=t[5];let w;t[6]!==a||t[7]!==n?(w=(0,z.jsx)(B,{scope:n,name:a}),t[6]=a,t[7]=n,t[8]=w):w=t[8];let T;t[9]!==C||t[10]!==w?(T=(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[C,w]}),t[9]=C,t[10]=w,t[11]=T):T=t[11];let E;t[12]!==s||t[13]!==l||t[14]!==u||t[15]!==o?(E=o?(0,z.jsx)(A,{onAddProperty:s,problemCount:l,problemMessages:u,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=s,t[13]=l,t[14]=u,t[15]=o,t[16]=E):E=t[16];let D;t[17]===d?D=t[18]:(D=d({id:`Yzs3QX`}),t[17]=d,t[18]=D);let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,z.jsx)(c,{className:`size-4`,"aria-hidden":!0}),t[19]=O):O=t[19];let k;t[20]===D?k=t[21]:(k=(0,z.jsx)(_,{asChild:!0,children:(0,z.jsx)(p,{variant:`ghost`,size:`icon`,"aria-label":D,"data-testid":`skill-toolbar-overflow`,className:`@xl/toolbar:hidden`,children:O})}),t[20]=D,t[21]=k);let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,z.jsx)(v,{children:(0,z.jsx)(r,{id:`oCHfGC`})}),t[22]=j):j=t[22];let P;t[23]===S?P=t[24]:(P=e=>S.requestMove(e),t[23]=S,t[24]=P);let I;t[25]===f?I=t[26]:(I=F.map(e=>(0,z.jsx)(g,{value:e,children:f[e]},e)),t[25]=f,t[26]=I);let R;t[27]!==n||t[28]!==P||t[29]!==I?(R=(0,z.jsx)(h,{value:n,onValueChange:P,children:I}),t[27]=n,t[28]=P,t[29]=I,t[30]=R):R=t[30];let U;t[31]!==s||t[32]!==o?(U=o?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(b,{}),(0,z.jsxs)(m,{onSelect:s,children:[(0,z.jsx)(M,{}),(0,z.jsx)(r,{id:`81H_23`})]})]}):null,t[31]=s,t[32]=o,t[33]=U):U=t[33];let W;t[34]!==R||t[35]!==U?(W=(0,z.jsxs)(y,{align:`end`,className:`min-w-44`,children:[j,R,U]}),t[34]=R,t[35]=U,t[36]=W):W=t[36];let G;t[37]!==W||t[38]!==k?(G=(0,z.jsxs)(ee,{children:[k,W]}),t[37]=W,t[38]=k,t[39]=G):G=t[39];let K;return t[40]!==S.dialog||t[41]!==G||t[42]!==T||t[43]!==E?(K=(0,z.jsxs)(z.Fragment,{children:[T,E,G,S.dialog]}),t[40]=S.dialog,t[41]=G,t[42]=T,t[43]=E,t[44]=K):K=t[44],K}export{U as SkillToolbarControls};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{B as n,Dt as r,H as i,U as a,W as o,an as s,ct as c,ft as l,j as u,kt as d,ot as ee,pt as f,un as p}from"./DocumentContext-BzOkOcsd.js";import{t as m}from"./react-f2sANaYj.js";import{n as h}from"./dist-PQ5KMVDh.js";import{t as g}from"./compiler-runtime-BfE3aGVn.js";import{A as _,O as te,S as v,a as ne,i as re,o as ie}from"./CodeMirrorPropInput-DRIXyyO3.js";import{$r as y,Hi as ae,T as oe,co as b,mo as x,wo as S}from"./dist-COv61_fZ2.js";import{h as se}from"./use-apply-config-color-theme-B1zL7AB7.js";import{H as C,L as ce,M as le,O as ue,P as de,S as w,d as T,f as fe,i as pe,j as me,l as he,r as ge,t as _e,w as E}from"./typing-burst-detector-DBj9oKSQ.js";import{f as D,g as O}from"./doc-paths-7BigDJzU.js";import{J as k}from"./navigation-targets-DKOMUIlH.js";import"./config-provider-CFTiAtpH.js";import{$ as A,D as j,Dt as M,F as N,It as P,Lt as F,Ot as I,Pt as L,Y as R,Z as z,b as B,ct as V,ft as H,g as U,gt as W,ht as ve,it as G,kt as ye,l as K,lt as q,nt as J,pt as Y,rt as X,ut as Z,v as be}from"./dist-w_Y7XM3w.js";import{a as xe,n as Se}from"./cm-theme-Cmsb2GL4.js";import{i as Ce,n as we,o as Te,r as Ee}from"./dist-D2ar7Kk3.js";import{o as De,r as Oe}from"./selection-context-BajeGoV5.js";import{l as ke}from"./lint-config-client-D4Gin48u.js";import{a as Ae,i as je,n as Me,o as Ne,r as Pe,s as Fe,t as Ie}from"./dist-Bp7ly1AN.js";import{n as Le,t as Re}from"./src-CJl_A7Op.js";var Q=e(m(),1),ze=g();function Be(){let e=o();return e===null?null:new Set(e.keys())}function Ve(e,t,r){let i=[],a=N(e);if(r!=null){let n=[];for(let{from:e,to:r}of t)a.iterate({from:e,to:r,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return n.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>n.some(n=>e>=n.from&&t<=n.to);for(let{from:n,to:a}of t){let t=e.doc.sliceString(n,a);x.lastIndex=0;for(let e=x.exec(t);e!==null;e=x.exec(t)){let t=e[2];if(!S(t))continue;let a=n+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||i.push(R.mark({class:r.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:o,to:s}of t)a.iterate({from:o,to:s,enter(t){if(t.name!==`InlineCode`)return;let a=e.doc.sliceString(t.from,t.to),o=a.length-a.replace(/^`+/,``).length,s=a.length-a.replace(/`+$/,``).length,c=a.slice(o,a.length-s),l=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(c)?.[1];if(l!==void 0&&S(l)&&r!=null)return i.push(R.mark({class:r.has(l)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":l}}).range(t.from+o,t.to-s)),!1;let u=n.exec(c);if(u)return i.push(R.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":u[1]}}).range(t.from+o,t.to-s)),!1}});return i.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),R.set(i)}function He(e){let t=a(e);return t===null?[]:[A.fromClass(class{decorations;constructor(e){this.decorations=Ve(e.state,e.visibleRanges,Be())}update(e){(e.docChanged||e.viewportChanged||N(e.startState)!==N(e.state))&&(this.decorations=Ve(e.view.state,e.view.visibleRanges,Be()))}},{decorations:e=>e.decorations}),z.domEventHandlers({mousedown(n){let r=n.target?.closest?.(`[data-skill-ref]`),a=r instanceof HTMLElement?r.dataset.skillRef:void 0;if(a!==void 0){n.preventDefault();let e=o()?.get(a);return window.location.hash=e===void 0?O():D(k({scope:e.scope,name:a,path:e.path})),!0}let s=n.target?.closest?.(`.cm-skill-path-link`),c=s instanceof HTMLElement?s.dataset.skillPath:void 0;return c===void 0?!1:(n.preventDefault(),window.location.hash=i(t,e,c),!0)}})]}var Ue=R.line({attributes:{dir:`auto`}});function We(e){let t=new L;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,Ue),r=n.to+1}return t.finish()}var Ge=A.fromClass(class{decorations;constructor(e){this.decorations=We(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=We(e.view))}},{decorations:e=>e.decorations}),Ke=[z.perLineTextDirection.of(!0),Ge],qe=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Je=`cm-lint-local-target`;function Ye(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function Xe(e,t){let n=U(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(qe.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function Ze(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function Qe(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=Xe(e,Ye(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:Ze(i.severity),message:E(i),source:`${i.source}/${i.code}`,markClass:Je})}return r}var $e=P.define();function et(e){let t={findings:[]};return[je(e=>te()?Qe(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is($e)))}),A.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:$e.of(null)}),Ie(n)},i=w(e,e=>{e.status===`loaded`&&r(e.findings)}),a=_(()=>r(t.findings));return{destroy(){i(),a()}}})]}function tt(e,t){return e.enabled?[Me(),je(async n=>nt(n.state.doc,await y(n.state.doc.toString(),e,t)),{delay:600})]:[]}function $(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function nt(e,t){let n=[];for(let r of t){let t=$(e,r.range.start),i=$(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=rt(r);o&&(a.actions=[o]),n.push(a)}return n}function rt(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var it=[Y(),q(),Z(),be(),X(),G(),ye.allowMultipleSelections.of(!0),j(),K(),Ee(),we(),W(),J(),V(),Ae(),H.of([...Ce,...Se,...Fe,...B,...Te,...Pe])],at=R.mark({class:`cm-link-ref-broken`}),ot=/^\s{0,3}\[([^\]]+)\]:\s/,st=/\[([^\]]*)\]\[([^\]]*)\]/g,ct=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function lt(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function ut(e){let t=[];return N(e).iterate({enter(e){if(ct.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function dt(e){let t=new Set,n=[],r=e.doc,i=ut(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(lt(n.from,i))continue;let a=ot.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!lt(t.from,i)&&!ot.test(t.text))for(st.lastIndex=0;;){let e=st.exec(t.text);if(!e)break;let r=t.from+e.index;if(lt(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(at.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),R.set(a)}var ft=F.define({create(e){return dt(e)},update(e,t){return t.docChanged?dt(t.state):e},provide:e=>z.decorations.from(e)}),pt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,mt=R.mark({class:`cm-del`}),ht=R.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),gt=R.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function _t(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function vt(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!b.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(b.test(r.text))return{from:t.from,to:r.to}}return null}function yt(e,t){let n=[],r=N(e),i=vt(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(mt.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=pt.exec(r.text),a=i?i[1].length:2,o=R.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=_t(r.text),a=R.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(ht.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(gt.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(gt.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),R.set(n)}var bt=class{decorations;constructor(e){this.decorations=yt(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||N(e.startState)!==N(e.state))&&(this.decorations=yt(e.view.state,e.view.visibleRanges))}},xt=A.fromClass(bt,{decorations:e=>e.decorations});function St(){return[xt,ft]}var Ct=t(),wt=P.define();function Tt(e,t,n){let r=T(e.state.doc)[t.index];r&&p(n,()=>{e.dispatch({selection:I.cursor(r.from),effects:z.scrollIntoView(r.from,{y:`start`})}),e.focus()})}function Et(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let i=e.state.doc,a=Math.min(t.offset,i.length);p(r,()=>{e.dispatch({selection:I.cursor(a),effects:z.scrollIntoView(a,{y:`center`})}),e.focus()})})}function Dt(e,t,n){let r=e.state.doc,i=Math.min(Math.max(t.line,1),r.lines),a=r.line(i),o=Math.min(a.from+Math.max(0,t.column-1),a.to);p(n,()=>{e.dispatch({selection:I.cursor(o),effects:z.scrollIntoView(o,{y:`start`})}),e.focus()})}function Ot(e){let t=(0,ze.c)(50),{docName:n,ytext:i,provider:a,placeholder:o,isSourceModeActive:p}=e,m=(0,Q.useRef)(null),g=(0,Q.useRef)(null),[_,te]=(0,Q.useState)(null);if(_)throw _;let{resolvedTheme:v}=h(),{merged:y}=se(),b=(0,Q.useRef)(p),x=y?.editor?.wordWrap??!0,{data:S}=ke(n),C;t[0]!==S?.effective||t[1]!==y?(C=S?.effective??(y?.contentRules?ae(y.contentRules):oe),t[0]=S?.effective,t[1]=y,t[2]=C):C=t[2];let w=C,T;t[3]===w?T=t[4]:(T=JSON.stringify(w),t[3]=w,t[4]=T);let E=T,D,O;t[5]===p?(D=t[6],O=t[7]):(D=()=>{b.current=p},O=[p],t[5]=p,t[6]=D,t[7]=O),(0,Q.useEffect)(D,O);let k=(0,Q.useRef)(null),A;t[8]!==n||t[9]!==w||t[10]!==o||t[11]!==a||t[12]!==v||t[13]!==x||t[14]!==i?(A=()=>{let e=m.current;if(!e)return;let t=a.configuration.name??``,p,h=At;try{p=l({docName:t,container:e,sizeStats:{viewCount:0,bytes:i.length},factory:e=>{let r=null,l=u({ydoc:a.document,ytext:i,docName:t}),d=new M,f=new M,p=new M,m=new M,g=new z({state:ye.create({doc:i.toString(),extensions:[it,Ke,Ne({scrollToMatch:e=>s(t)?z.scrollIntoView(e,{y:`start`}):wt.of(null)}),H.of([xe]),Re(i,a.awareness),H.of(Le),...re({themeCompartment:d,resolvedTheme:v,ydoc:a.document,wordWrapCompartment:f,wordWrap:x,currentDocName:t}),St(),He(t),ce(),m.of(tt(w,n)),et(n),l,z.updateListener.of(e=>{ee(e)&&c(t)}),z.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,ge(t,`source`,pe(e.view)),Oe(t,`source`,De(e.view,t))},120))}),p.of(ve(o??``)),z.theme({"&":{height:`100%`}}),z.scrollMargins.of(kt)]}),parent:e});ge(t,`source`,pe(g)),Oe(t,`source`,De(g,t));let _=g.contentDOM;return _.addEventListener(`keydown`,h),_.addEventListener(`paste`,h),_.addEventListener(`drop`,h),_.addEventListener(`cut`,h),{view:g,ydoc:a.document,ytext:i,provider:a,themeCompartment:d,wordWrapCompartment:f,placeholderCompartment:p,lintCompartment:m}}}),k.current=p,g.current=p.view,r(n,p.view),_e()&&p.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),k.current=null,g.current=null,te(t instanceof Error?t:Error(String(t)))}return()=>{let e=k.current;e&&(f(e),d(n,e.view)),k.current=null,g.current=null}},t[8]=n,t[9]=w,t[10]=o,t[11]=a,t[12]=v,t[13]=x,t[14]=i,t[15]=A):A=t[15];let j;t[16]!==a||t[17]!==i?(j=[i,a],t[16]=a,t[17]=i,t[18]=j):j=t[18],(0,Q.useEffect)(A,j);let N,P;t[19]===n?(N=t[20],P=t[21]):(N=()=>{},P=[n],t[19]=n,t[20]=N,t[21]=P),(0,Q.useEffect)(N,P);let F,I;t[22]===v?(F=t[23],I=t[24]):(I=()=>{let e=k.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(v===`dark`?ne:ie)})},F=[v],t[22]=v,t[23]=F,t[24]=I),(0,Q.useEffect)(I,F);let L,R;t[25]===x?(L=t[26],R=t[27]):(L=()=>{let e=k.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(x?z.lineWrapping:[])})},R=[x],t[25]=x,t[26]=L,t[27]=R),(0,Q.useEffect)(L,R);let B,V;t[28]===o?(B=t[29],V=t[30]):(B=()=>{let e=k.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ve(o??``))})},V=[o],t[28]=o,t[29]=B,t[30]=V),(0,Q.useEffect)(B,V);let U;t[31]!==n||t[32]!==w?(U=()=>{let e=k.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(tt(w,n))})},t[31]=n,t[32]=w,t[33]=U):U=t[33];let W;t[34]===E?W=t[35]:(W=[E],t[34]=E,t[35]=W),(0,Q.useEffect)(U,W);let G,K;t[36]!==n||t[37]!==p?(G=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||t.mode!==`source`||!p)return;let r=g.current;r&&(Tt(r,t,n),me(n))};return window.addEventListener(he,e),()=>window.removeEventListener(he,e)},K=[n,p],t[36]=n,t[37]=p,t[38]=G,t[39]=K):(G=t[38],K=t[39]),(0,Q.useEffect)(G,K);let q,J;t[40]!==n||t[41]!==p?(q=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||!p)return;let r=g.current;r&&(Dt(r,t,n),me(n))};return window.addEventListener(fe,e),()=>window.removeEventListener(fe,e)},J=[n,p],t[40]=n,t[41]=p,t[42]=q,t[43]=J):(q=t[42],J=t[43]),(0,Q.useEffect)(q,J);let Y,X;t[44]!==n||t[45]!==p||t[46]!==a?(Y=()=>{if(!p)return;let e=g.current;if(!e)return;let t=de(n);if(!t)return;if(t.kind!==`selection-offset`){le(n),t.kind===`outline`?Tt(e,t.detail,n):t.kind===`lint`?Dt(e,t.detail,n):t.kind===`raw-mdx`&&Et(e,t.detail,()=>b.current,n);return}let r=!1,i=null;return queueMicrotask(()=>{if(r)return;let t=de(n);t?.kind===`selection-offset`&&(i=ue({view:e,docName:n,navigation:t,ydoc:a.document,transition:{from:`wysiwyg`,to:`source`}}),i&&le(n))}),()=>{r=!0,i?.cancel(`mode-flip`)}},X=[n,p,a],t[44]=n,t[45]=p,t[46]=a,t[47]=Y,t[48]=X):(Y=t[47],X=t[48]),(0,Q.useEffect)(Y,X);let Z;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,Ct.jsx)(`div`,{ref:m,className:`source-editor h-full pb-3`}),t[49]=Z):Z=t[49],Z}function kt(){return{top:C()}}function At(){return v()}export{Ot as SourceEditor,Et as applyRawMdxNavigation};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{B as n,Dt as r,H as i,U as a,W as o,an as s,ct as c,ft as l,j as u,kt as d,ot as ee,pt as f,un as p}from"./DocumentContext-CHPcruUq.js";import{t as m}from"./react-f2sANaYj.js";import{n as h}from"./dist-PQ5KMVDh.js";import{t as g}from"./compiler-runtime-BfE3aGVn.js";import{A as _,O as te,S as v,a as ne,i as re,o as ie}from"./CodeMirrorPropInput-3xTSMwVk.js";import{$r as y,Hi as ae,T as oe,co as b,mo as x,wo as S}from"./dist-COv61_fZ2.js";import{h as se}from"./use-apply-config-color-theme-B1zL7AB7.js";import{H as C,L as ce,M as le,O as ue,P as de,S as w,d as T,f as fe,i as pe,j as me,l as he,r as ge,t as _e,w as E}from"./typing-burst-detector-0Kh3NkMo.js";import{f as D,g as O}from"./doc-paths-7BigDJzU.js";import{J as k}from"./navigation-targets-BlmF0SDc.js";import"./config-provider-Cow2MOvb.js";import{$ as A,D as j,Dt as M,F as N,It as P,Lt as F,Ot as I,Pt as L,Y as R,Z as z,b as B,ct as V,ft as H,g as U,gt as W,ht as ve,it as G,kt as ye,l as K,lt as q,nt as J,pt as Y,rt as X,ut as Z,v as be}from"./dist-w_Y7XM3w.js";import{a as xe,n as Se}from"./cm-theme-Cmsb2GL4.js";import{i as Ce,n as we,o as Te,r as Ee}from"./dist-D2ar7Kk3.js";import{o as De,r as Oe}from"./selection-context-BdxcxNyo.js";import{l as ke}from"./lint-config-client-D4Gin48u.js";import{a as Ae,i as je,n as Me,o as Ne,r as Pe,s as Fe,t as Ie}from"./dist-Bp7ly1AN.js";import{n as Le,t as Re}from"./src-CiwcnlkH.js";var Q=e(m(),1),ze=g();function Be(){let e=o();return e===null?null:new Set(e.keys())}function Ve(e,t,r){let i=[],a=N(e);if(r!=null){let n=[];for(let{from:e,to:r}of t)a.iterate({from:e,to:r,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return n.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>n.some(n=>e>=n.from&&t<=n.to);for(let{from:n,to:a}of t){let t=e.doc.sliceString(n,a);x.lastIndex=0;for(let e=x.exec(t);e!==null;e=x.exec(t)){let t=e[2];if(!S(t))continue;let a=n+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||i.push(R.mark({class:r.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:o,to:s}of t)a.iterate({from:o,to:s,enter(t){if(t.name!==`InlineCode`)return;let a=e.doc.sliceString(t.from,t.to),o=a.length-a.replace(/^`+/,``).length,s=a.length-a.replace(/`+$/,``).length,c=a.slice(o,a.length-s),l=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(c)?.[1];if(l!==void 0&&S(l)&&r!=null)return i.push(R.mark({class:r.has(l)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":l}}).range(t.from+o,t.to-s)),!1;let u=n.exec(c);if(u)return i.push(R.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":u[1]}}).range(t.from+o,t.to-s)),!1}});return i.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),R.set(i)}function He(e){let t=a(e);return t===null?[]:[A.fromClass(class{decorations;constructor(e){this.decorations=Ve(e.state,e.visibleRanges,Be())}update(e){(e.docChanged||e.viewportChanged||N(e.startState)!==N(e.state))&&(this.decorations=Ve(e.view.state,e.view.visibleRanges,Be()))}},{decorations:e=>e.decorations}),z.domEventHandlers({mousedown(n){let r=n.target?.closest?.(`[data-skill-ref]`),a=r instanceof HTMLElement?r.dataset.skillRef:void 0;if(a!==void 0){n.preventDefault();let e=o()?.get(a);return window.location.hash=e===void 0?O():D(k({scope:e.scope,name:a,path:e.path})),!0}let s=n.target?.closest?.(`.cm-skill-path-link`),c=s instanceof HTMLElement?s.dataset.skillPath:void 0;return c===void 0?!1:(n.preventDefault(),window.location.hash=i(t,e,c),!0)}})]}var Ue=R.line({attributes:{dir:`auto`}});function We(e){let t=new L;for(let n of e.visibleRanges)for(let r=n.from;r<=n.to;){let n=e.state.doc.lineAt(r);t.add(n.from,n.from,Ue),r=n.to+1}return t.finish()}var Ge=A.fromClass(class{decorations;constructor(e){this.decorations=We(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=We(e.view))}},{decorations:e=>e.decorations}),Ke=[z.perLineTextDirection.of(!0),Ge],qe=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Je=`cm-lint-local-target`;function Ye(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function Xe(e,t){let n=U(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(qe.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function Ze(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function Qe(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=Xe(e,Ye(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:Ze(i.severity),message:E(i),source:`${i.source}/${i.code}`,markClass:Je})}return r}var $e=P.define();function et(e){let t={findings:[]};return[je(e=>te()?Qe(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is($e)))}),A.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:$e.of(null)}),Ie(n)},i=w(e,e=>{e.status===`loaded`&&r(e.findings)}),a=_(()=>r(t.findings));return{destroy(){i(),a()}}})]}function tt(e,t){return e.enabled?[Me(),je(async n=>nt(n.state.doc,await y(n.state.doc.toString(),e,t)),{delay:600})]:[]}function $(e,t){let n=Math.min(Math.max(t.line+1,1),e.lines),r=e.line(n);return Math.min(r.from+Math.max(0,t.character),r.to)}function nt(e,t){let n=[];for(let r of t){let t=$(e,r.range.start),i=$(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=rt(r);o&&(a.actions=[o]),n.push(a)}return n}function rt(e){let t=e.fixes;return!t||t.length===0?null:{name:`Fix`,apply(e){let n=e.state.doc;e.dispatch({changes:t.map(e=>({from:$(n,e.range.start),to:$(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var it=[Y(),q(),Z(),be(),X(),G(),ye.allowMultipleSelections.of(!0),j(),K(),Ee(),we(),W(),J(),V(),Ae(),H.of([...Ce,...Se,...Fe,...B,...Te,...Pe])],at=R.mark({class:`cm-link-ref-broken`}),ot=/^\s{0,3}\[([^\]]+)\]:\s/,st=/\[([^\]]*)\]\[([^\]]*)\]/g,ct=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function lt(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function ut(e){let t=[];return N(e).iterate({enter(e){if(ct.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function dt(e){let t=new Set,n=[],r=e.doc,i=ut(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(lt(n.from,i))continue;let a=ot.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!lt(t.from,i)&&!ot.test(t.text))for(st.lastIndex=0;;){let e=st.exec(t.text);if(!e)break;let r=t.from+e.index;if(lt(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(at.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),R.set(a)}var ft=F.define({create(e){return dt(e)},update(e,t){return t.docChanged?dt(t.state):e},provide:e=>z.decorations.from(e)}),pt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,mt=R.mark({class:`cm-del`}),ht=R.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),gt=R.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function _t(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function vt(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!b.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(b.test(r.text))return{from:t.from,to:r.to}}return null}function yt(e,t){let n=[],r=N(e),i=vt(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(mt.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=pt.exec(r.text),a=i?i[1].length:2,o=R.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=_t(r.text),a=R.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(ht.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(gt.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(gt.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),R.set(n)}var bt=class{decorations;constructor(e){this.decorations=yt(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||N(e.startState)!==N(e.state))&&(this.decorations=yt(e.view.state,e.view.visibleRanges))}},xt=A.fromClass(bt,{decorations:e=>e.decorations});function St(){return[xt,ft]}var Ct=t(),wt=P.define();function Tt(e,t,n){let r=T(e.state.doc)[t.index];r&&p(n,()=>{e.dispatch({selection:I.cursor(r.from),effects:z.scrollIntoView(r.from,{y:`start`})}),e.focus()})}function Et(e,t,n,r){requestAnimationFrame(()=>{if(!n())return;let i=e.state.doc,a=Math.min(t.offset,i.length);p(r,()=>{e.dispatch({selection:I.cursor(a),effects:z.scrollIntoView(a,{y:`center`})}),e.focus()})})}function Dt(e,t,n){let r=e.state.doc,i=Math.min(Math.max(t.line,1),r.lines),a=r.line(i),o=Math.min(a.from+Math.max(0,t.column-1),a.to);p(n,()=>{e.dispatch({selection:I.cursor(o),effects:z.scrollIntoView(o,{y:`start`})}),e.focus()})}function Ot(e){let t=(0,ze.c)(50),{docName:n,ytext:i,provider:a,placeholder:o,isSourceModeActive:p}=e,m=(0,Q.useRef)(null),g=(0,Q.useRef)(null),[_,te]=(0,Q.useState)(null);if(_)throw _;let{resolvedTheme:v}=h(),{merged:y}=se(),b=(0,Q.useRef)(p),x=y?.editor?.wordWrap??!0,{data:S}=ke(n),C;t[0]!==S?.effective||t[1]!==y?(C=S?.effective??(y?.contentRules?ae(y.contentRules):oe),t[0]=S?.effective,t[1]=y,t[2]=C):C=t[2];let w=C,T;t[3]===w?T=t[4]:(T=JSON.stringify(w),t[3]=w,t[4]=T);let E=T,D,O;t[5]===p?(D=t[6],O=t[7]):(D=()=>{b.current=p},O=[p],t[5]=p,t[6]=D,t[7]=O),(0,Q.useEffect)(D,O);let k=(0,Q.useRef)(null),A;t[8]!==n||t[9]!==w||t[10]!==o||t[11]!==a||t[12]!==v||t[13]!==x||t[14]!==i?(A=()=>{let e=m.current;if(!e)return;let t=a.configuration.name??``,p,h=At;try{p=l({docName:t,container:e,sizeStats:{viewCount:0,bytes:i.length},factory:e=>{let r=null,l=u({ydoc:a.document,ytext:i,docName:t}),d=new M,f=new M,p=new M,m=new M,g=new z({state:ye.create({doc:i.toString(),extensions:[it,Ke,Ne({scrollToMatch:e=>s(t)?z.scrollIntoView(e,{y:`start`}):wt.of(null)}),H.of([xe]),Re(i,a.awareness),H.of(Le),...re({themeCompartment:d,resolvedTheme:v,ydoc:a.document,wordWrapCompartment:f,wordWrap:x,currentDocName:t}),St(),He(t),ce(),m.of(tt(w,n)),et(n),l,z.updateListener.of(e=>{ee(e)&&c(t)}),z.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,ge(t,`source`,pe(e.view)),Oe(t,`source`,De(e.view,t))},120))}),p.of(ve(o??``)),z.theme({"&":{height:`100%`}}),z.scrollMargins.of(kt)]}),parent:e});ge(t,`source`,pe(g)),Oe(t,`source`,De(g,t));let _=g.contentDOM;return _.addEventListener(`keydown`,h),_.addEventListener(`paste`,h),_.addEventListener(`drop`,h),_.addEventListener(`cut`,h),{view:g,ydoc:a.document,ytext:i,provider:a,themeCompartment:d,wordWrapCompartment:f,placeholderCompartment:p,lintCompartment:m}}}),k.current=p,g.current=p.view,r(n,p.view),_e()&&p.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),k.current=null,g.current=null,te(t instanceof Error?t:Error(String(t)))}return()=>{let e=k.current;e&&(f(e),d(n,e.view)),k.current=null,g.current=null}},t[8]=n,t[9]=w,t[10]=o,t[11]=a,t[12]=v,t[13]=x,t[14]=i,t[15]=A):A=t[15];let j;t[16]!==a||t[17]!==i?(j=[i,a],t[16]=a,t[17]=i,t[18]=j):j=t[18],(0,Q.useEffect)(A,j);let N,P;t[19]===n?(N=t[20],P=t[21]):(N=()=>{},P=[n],t[19]=n,t[20]=N,t[21]=P),(0,Q.useEffect)(N,P);let F,I;t[22]===v?(F=t[23],I=t[24]):(I=()=>{let e=k.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(v===`dark`?ne:ie)})},F=[v],t[22]=v,t[23]=F,t[24]=I),(0,Q.useEffect)(I,F);let L,R;t[25]===x?(L=t[26],R=t[27]):(L=()=>{let e=k.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(x?z.lineWrapping:[])})},R=[x],t[25]=x,t[26]=L,t[27]=R),(0,Q.useEffect)(L,R);let B,V;t[28]===o?(B=t[29],V=t[30]):(B=()=>{let e=k.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ve(o??``))})},V=[o],t[28]=o,t[29]=B,t[30]=V),(0,Q.useEffect)(B,V);let U;t[31]!==n||t[32]!==w?(U=()=>{let e=k.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(tt(w,n))})},t[31]=n,t[32]=w,t[33]=U):U=t[33];let W;t[34]===E?W=t[35]:(W=[E],t[34]=E,t[35]=W),(0,Q.useEffect)(U,W);let G,K;t[36]!==n||t[37]!==p?(G=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||t.mode!==`source`||!p)return;let r=g.current;r&&(Tt(r,t,n),me(n))};return window.addEventListener(he,e),()=>window.removeEventListener(he,e)},K=[n,p],t[36]=n,t[37]=p,t[38]=G,t[39]=K):(G=t[38],K=t[39]),(0,Q.useEffect)(G,K);let q,J;t[40]!==n||t[41]!==p?(q=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==n||!p)return;let r=g.current;r&&(Dt(r,t,n),me(n))};return window.addEventListener(fe,e),()=>window.removeEventListener(fe,e)},J=[n,p],t[40]=n,t[41]=p,t[42]=q,t[43]=J):(q=t[42],J=t[43]),(0,Q.useEffect)(q,J);let Y,X;t[44]!==n||t[45]!==p||t[46]!==a?(Y=()=>{if(!p)return;let e=g.current;if(!e)return;let t=de(n);if(!t)return;if(t.kind!==`selection-offset`){le(n),t.kind===`outline`?Tt(e,t.detail,n):t.kind===`lint`?Dt(e,t.detail,n):t.kind===`raw-mdx`&&Et(e,t.detail,()=>b.current,n);return}let r=!1,i=null;return queueMicrotask(()=>{if(r)return;let t=de(n);t?.kind===`selection-offset`&&(i=ue({view:e,docName:n,navigation:t,ydoc:a.document,transition:{from:`wysiwyg`,to:`source`}}),i&&le(n))}),()=>{r=!0,i?.cancel(`mode-flip`)}},X=[n,p,a],t[44]=n,t[45]=p,t[46]=a,t[47]=Y,t[48]=X):(Y=t[47],X=t[48]),(0,Q.useEffect)(Y,X);let Z;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,Ct.jsx)(`div`,{ref:m,className:`source-editor h-full pb-3`}),t[49]=Z):Z=t[49],Z}function kt(){return{top:C()}}function At(){return v()}export{Ot as SourceEditor,Et as applyRawMdxNavigation};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./button-CA0dewJJ.js";import{Cn as c,Jt as l,Li as u,Ri as d,_n as f}from"./dist-COv61_fZ2.js";import{n as p}from"./dist-BLaUOTRG.js";import{m}from"./use-apply-config-color-theme-B1zL7AB7.js";import{t as h}from"./x-CSyDwLV0.js";import{f as g,p as _,u as v}from"./doc-paths-7BigDJzU.js";import{X as y}from"./navigation-targets-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./button-CA0dewJJ.js";import{Cn as c,Jt as l,Li as u,Ri as d,_n as f}from"./dist-COv61_fZ2.js";import{n as p}from"./dist-BLaUOTRG.js";import{m}from"./use-apply-config-color-theme-B1zL7AB7.js";import{t as h}from"./x-CSyDwLV0.js";import{f as g,p as _,u as v}from"./doc-paths-7BigDJzU.js";import{X as y}from"./navigation-targets-BlmF0SDc.js";import{f as b,h as x}from"./file-tree-adapter-BaT9ZAI6.js";import{t as ee}from"./use-live-xterm-theme-Bg0pl-eA.js";import{r as te}from"./terminal-command-events-DXmeHtnk.js";var S=a(),C=2,w=1,T=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(C,Math.floor(u/e.css.cell.width)),rows:Math.max(w,Math.floor(l/e.css.cell.height))}}},E=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],D=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],O;function ne(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var re=class{constructor(){if(this.version=`6`,!O){O=new Uint8Array(65536),O.fill(1),O[0]=0,O.fill(0,1,32),O.fill(0,127,160),O.fill(2,4352,4448),O[9001]=2,O[9002]=2,O.fill(2,11904,42192),O[12351]=1,O.fill(2,44032,55204),O.fill(2,63744,64256),O.fill(2,65040,65050),O.fill(2,65072,65136),O.fill(2,65280,65377),O.fill(2,65504,65511);for(let e=0;e<E.length;++e)O.fill(0,E[e][0],E[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?O[e]:ne(e,D)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=Ze.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return Ze.createPropertyValue(0,n,r)}},k=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?M.isErrorNoTelemetry(e)?new M(e.message+`
|
|
2
2
|
|
|
3
3
|
`+e.stack):Error(e.message+`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-PQ5KMVDh.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./config-provider-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-PQ5KMVDh.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./config-provider-Cow2MOvb.js";import{t as o}from"./use-installed-clis-DmyaQmU9.js";import{t as s}from"./use-live-xterm-theme-Bg0pl-eA.js";import{SessionsHost as c}from"./SessionsHost-CUgKgDkz.js";var l=i(),u=e(n(),1),d=t();function f(e){let t=(0,l.c)(5),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i;t[0]===n?i=t[1]:(i=(0,d.jsx)(p,{bridge:n}),t[0]=n,t[1]=i);let o;return t[2]!==r||t[3]!==i?(o=(0,d.jsx)(a,{collabUrl:r,children:i}),t[2]=r,t[3]=i,t[4]=o):o=t[4],o}function p(e){let t=(0,l.c)(9),{bridge:n}=e,{resolvedTheme:i}=r(),a=s(i),f=o(),[p,g]=(0,u.useState)(null),_;t[0]===a.background?_=t[1]:(_=(0,d.jsx)(`div`,{ref:g,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:a.background}}),t[0]=a.background,t[1]=_);let v;t[2]!==n||t[3]!==p||t[4]!==f?(v=(0,d.jsx)(c,{bridge:n,surface:`terminal-window`,terminalCapable:!0,visible:!0,onVisibleChange:h,installedClis:f,container:p,isShowing:!0,onRequestEditorFocus:m}),t[2]=n,t[3]=p,t[4]=f,t[5]=v):v=t[5];let y;return t[6]!==_||t[7]!==v?(y=(0,d.jsxs)(d.Fragment,{children:[_,v]}),t[6]=_,t[7]=v,t[8]=y):y=t[8],y}function m(){}function h(e){e||window.close()}export{f as TerminalWindowApp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o}from"./CodeMirrorPropInput-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o}from"./CodeMirrorPropInput-3xTSMwVk.js";import{Zo as s,cs as c,sr as l}from"./dist-COv61_fZ2.js";import{g as u}from"./config-provider-Cow2MOvb.js";import{Dt as d,P as f,Z as p,kt as m}from"./dist-w_Y7XM3w.js";import{t as h}from"./cm-theme-Cmsb2GL4.js";import{t as g}from"./dist-CMHE-EqI.js";import{t as _}from"./text-viewer-languages-6Ne07IiK.js";import{t as v}from"./src-CiwcnlkH.js";var y=a(),b=e(n(),1),x=t(),S=h({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),C=h({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function w(e){let t=(0,y.c)(19),{docName:n,provider:a}=e,{_:h}=r(),w=n.slice(n.lastIndexOf(`/`)+1),T=(0,b.useRef)(null),{resolvedTheme:E}=i(),D;t[0]===a.document?D=t[1]:(D=a.document.getText(`source`),t[0]=a.document,t[1]=D);let O=D,k;t[2]===O?k=t[3]:(k=()=>new u(O),t[2]=O,t[3]=k);let[A]=(0,b.useState)(k),j;t[4]!==n||t[5]!==a.awareness||t[6]!==E||t[7]!==A||t[8]!==O?(j=()=>{let e=T.current;if(!e)return;let t=E===`dark`?S:C,r=new d,i=new d,u=(s[l(n)]??c(l(n)))!==null&&l(n)!==``,h=new p({state:m.create({doc:O.toString(),extensions:[g,v(O,a.awareness,{undoManager:A}),r.of([]),f(o),i.of(u?[]:p.lineWrapping),p.theme({"&":{height:`100%`}}),t]}),parent:e}),y=!1,b=l(n)||null;return b&&_(b,s[b]??c(b)).then(e=>{y||!e||h.dispatch({effects:r.reconfigure(e)})}),()=>{y=!0,h.destroy()}},t[4]=n,t[5]=a.awareness,t[6]=E,t[7]=A,t[8]=O,t[9]=j):j=t[9];let M;t[10]!==n||t[11]!==a||t[12]!==E||t[13]!==A||t[14]!==O?(M=[O,a,E,n,A],t[10]=n,t[11]=a,t[12]=E,t[13]=A,t[14]=O,t[15]=M):M=t[15],(0,b.useEffect)(j,M);let N=h({id:`xAlHfe`,values:{basename:w}}),P;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,x.jsx)(`div`,{ref:T,className:`min-h-0 flex-1 overflow-auto`}),t[16]=P):P=t[16];let F;return t[17]===N?F=t[18]:(F=(0,x.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":N,"data-text-doc-editor":``,children:P}),t[17]=N,t[18]=F),F}export{w as TextDocEditor};
|