@inkeep/open-knowledge 0.62.0-beta.2 → 0.62.0-beta.3
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-CsOd2HY8.mjs → acp-harness-probe-DXigJXWq.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/constants-Bn8icX2f.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-1WSRoxGv.mjs → init-DyZnJhDX.mjs} +3 -3
- package/dist/init-m40Ku2qV.mjs +1 -0
- package/dist/{launch-json-removal-FkTYvACR.mjs → launch-json-removal-BEBKuKzZ.mjs} +2 -2
- package/dist/{loader-CPTihIGS.mjs → loader-DNfBy0qz.mjs} +2 -2
- package/dist/loader-DftaiXp1.mjs +1 -0
- package/dist/{preview-CTKAOWbX.mjs → preview-DJ62szaw.mjs} +2 -2
- package/dist/preview-kksucfkn.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-dydHORCJ.js → ActivityModeContent-BwO8-24X.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-BoHib7V-.js → AgentDiffPane-DE0Bcz9S.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-C4Sgk7Nu.js → CodeMirrorPropInput-Br0HbEoO.js} +1 -1
- package/dist/public/assets/{DocumentContext-BRyLZId_.js → DocumentContext-CDzXPsOB.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-9eGLVUIm.js → EditorModeToggle-D6rNH9WB.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-DLAT5Ood.js → EnableSyncConfirmDialog-BKNPm0-A.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-CO9dou3t.js → ExcalidrawDocEditor-BG1sH8Vc.js} +1 -1
- package/dist/public/assets/FeedbackForm-F_VtrNSZ.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-Byz6Z1dj.js → ImportSkillDialog-CEfmDQU8.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-Ba4tOwrd.js → LintConfigEditor-M5d2zRk3.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-CaeqK62r.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-Chh3WUTQ.js → ManagedArtifactProperties-D2PerB9y.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-D3_VxruW.js → MermaidDocEditor-BX1q9Rc8.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-Cu9Ln0I5.js → PropertyDisplayRow-4yqx17DZ.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-CpDc03Su.js → SchemaConfigEditor-C2oMK0Nl.js} +1 -1
- package/dist/public/assets/{SessionsHost-CjAX0WAW.js → SessionsHost-BL85wtJL.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-BeLZ_5xC.js → SettingsDialogBody-CDJv8Ntk.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-DBnTRDP2.js → ShareReceiveMissDialog-DooAH6HZ.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-CDr2JYhu.js → SkillInstallMenu-BcAD6mRd.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-CTxnGRS8.js → SkillToolbarControls-DLKu31-g.js} +1 -1
- package/dist/public/assets/{SourceEditor-CzJ30keY.js → SourceEditor-CGhHN1fq.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-Cs8TCoMa.js → TerminalWindowApp-BCty49sx.js} +1 -1
- package/dist/public/assets/{TextDocEditor-ygMtgeY7.js → TextDocEditor-wLlw3kKW.js} +1 -1
- package/dist/public/assets/{ThreadView-B6lIZKv1.js → ThreadView-BVNZrefh.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-D7Dq5YL_.js → TimelineDiffPane-Ch9WVnCp.js} +1 -1
- package/dist/public/assets/{agent-diff-store-DjDBy7Vi.js → agent-diff-store-c1zOQlrK.js} +1 -1
- package/dist/public/assets/{auth-state-cache-rHmLBb9X.js → auth-state-cache-JM40Ar4T.js} +1 -1
- package/dist/public/assets/{comment-chips-Df5Rd0T0.js → comment-chips-DUZfnEGs.js} +1 -1
- package/dist/public/assets/{config-provider-BEdlvRi2.js → config-provider-BHs4LyOQ.js} +3 -3
- package/dist/public/assets/globals-C8zrBTBL.css +1 -0
- package/dist/public/assets/i18n-pW7OFPfV.js +1 -0
- package/dist/public/assets/{index-vrkBhpz7.js → index-C5xHUDIG.js} +107 -107
- package/dist/public/assets/messages-BkL6oWHg.js +1 -0
- package/dist/public/assets/messages-C3xDNJLe.js +1 -0
- package/dist/public/assets/messages-CGqWrXZK.js +1 -0
- package/dist/public/assets/messages-CGw43ytR.js +1 -0
- package/dist/public/assets/messages-CJdQEZYP.js +1 -0
- package/dist/public/assets/messages-COuGBUFr.js +1 -0
- package/dist/public/assets/messages-CSJ16uA9.js +1 -0
- package/dist/public/assets/messages-CZa_BmA2.js +1 -0
- package/dist/public/assets/messages-Cgi0xg9T.js +1 -0
- package/dist/public/assets/messages-CtlqcdTj.js +1 -0
- package/dist/public/assets/messages-YHyKhEK1.js +1 -0
- package/dist/public/assets/messages-fJqQmhka.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store--uA_Ttz1.js → pending-receive-nav-store-luOT_9lJ.js} +1 -1
- package/dist/public/assets/{progress-BCKE1cPj.js → progress-BNUUReLc.js} +1 -1
- package/dist/public/assets/{selection-context-_FFqOhZk.js → selection-context-BHq5CXBh.js} +1 -1
- package/dist/public/assets/{skill-actions-BP-CCkh4.js → skill-actions-BEV4XcXI.js} +1 -1
- package/dist/public/assets/{src-CTOqSJUC.js → src-DAfekKTe.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-ZpjfAtrw.js → typing-burst-detector-hIE55MR9.js} +1 -1
- package/dist/public/assets/{uninstall-ZkNjYQIp.js → uninstall-BiXQbNQ4.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BEIbg3tr.js → use-activity-panel-UdSbaAYi.js} +1 -1
- package/dist/public/assets/{use-open-skill-5vxsvMFg.js → use-open-skill-DoRxbYIA.js} +1 -1
- package/dist/public/assets/{use-popular-skills-CrLiCM00.js → use-popular-skills-DSCOMRXV.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-er2JoZ-A.js → use-terminal-enabled-DE4_bgnu.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-BI2FRiaG.js → use-timeline-entry-diff-BtfFIZ3c.js} +1 -1
- package/dist/public/index.html +23 -23
- package/dist/public/uninstall.html +5 -5
- package/dist/{repair-launch-json-DgqIQIOF.mjs → repair-launch-json-BJjxa4TK.mjs} +2 -2
- package/dist/{repair-mcp-configs-DsLiavE4.mjs → repair-mcp-configs-CKgKwyC_.mjs} +2 -2
- package/dist/src-B1XBGwL7.mjs +1 -0
- package/dist/{src-DL44CZGU.mjs → src-Boz6iYhc.mjs} +2 -2
- package/dist/start-CRUKRtuu.mjs +1 -0
- package/dist/{start-DFHJtxzc.mjs → start-MEV9jurS.mjs} +2 -2
- package/package.json +5 -5
- package/dist/constants-gwiR1AXZ.mjs +0 -2
- package/dist/init-768uKYVu.mjs +0 -1
- package/dist/loader-CXbb_RbT.mjs +0 -1
- package/dist/preview-B9kGxHb1.mjs +0 -1
- package/dist/public/assets/FeedbackForm-BugXqXA0.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-FdkUWPgB.js +0 -1
- package/dist/public/assets/globals-Cm0uoqGd.css +0 -1
- package/dist/public/assets/i18n-D6RCXg6s.js +0 -1
- package/dist/public/assets/messages-9jq2H0Oi.js +0 -1
- package/dist/public/assets/messages-Bx_f87sx.js +0 -1
- package/dist/public/assets/messages-C3miiMeN.js +0 -1
- package/dist/public/assets/messages-CDKiFfjp.js +0 -1
- package/dist/public/assets/messages-DVwDXAsF.js +0 -1
- package/dist/public/assets/messages-Dk8a17Y8.js +0 -1
- package/dist/public/assets/messages-DkwLrsWG.js +0 -1
- package/dist/public/assets/messages-DqR117DY.js +0 -1
- package/dist/public/assets/messages-QUjY9svp.js +0 -1
- package/dist/public/assets/messages-WUH3Y5VP.js +0 -1
- package/dist/public/assets/messages-dHZujidV.js +0 -1
- package/dist/public/assets/messages-xF0EOnP_.js +0 -1
- package/dist/src-D9PIQWsr.mjs +0 -1
- package/dist/start-BADrSNko.mjs +0 -1
- /package/dist/public/assets/{globals-CKGGll07.js → globals-C5voaRc5.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Nn as n}from"./DocumentContext-BRyLZId_.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{i as u,n as d,t as f}from"./tooltip-DPvMEqsq.js";import{a as p,c as m,i as h,l as g,o as _,r as v,s as y}from"./alert-dialog-D3_HT0Lf.js";import{C as b,a as x,c as S,d as C,f as w,l as T,p as E,r as D,s as O,u as k}from"./terminal-cli-display-DtlGtdop.js";import{a as A,d as j,f as M,i as N,n as P,o as F,p as I,u as L}from"./dropdown-menu-C8skJt-Y.js";import{Kt as R,ei as z,lo as B}from"./dist-0WeLsvey2.js";import{n as ee}from"./dist-CuH7ikCn.js";import{s as V}from"./documents-events-Bswa3218.js";import{t as H}from"./createLucideIcon-IawHI4re.js";import{o as te}from"./use-open-skill-5vxsvMFg.js";import{t as U}from"./spinner-BfQfD3gf.js";import{c as ne,n as re,r as W}from"./skill-scope-CAVgRNo8.js";import{A as G,F as K,M as ie,S as ae,x as q}from"./skills-api-BmxNOfQ0.js";var J=t(),Y=e(r(),1),X=o(),oe=3100,se=3;function ce(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??se;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var le={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}},ue=[`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 de(e,t={}){let n=t.rng??Math.random,r=t.colors??ue,i=le[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 fe=1.8,pe=90,me=16,he=380,ge=.025,_e=.1,ve=.18,ye=400,be=9.2736,xe=18.1799,Se=14.5244,Ce={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function we(e,t){let{halfWidth:n,apexLift:r}=Ce[t];return`M${e-n} ${Se+.3} Q${e} ${Se-r}, ${e+n} ${Se+.3}`}function Te(e){let t=1.5,n=.3;return`M${e-t} ${Se-n} Q${e} ${Se+1.4}, ${e+t} ${Se-n}`}var Ee=15,De=15;function Oe(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 ke(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]=(0,Y.useState)(0),E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[1]=E):E=t[1];let[D,O]=(0,Y.useState)(E),k=(0,Y.useRef)(0),A=(0,Y.useRef)(0),j=(0,Y.useRef)(void 0),M=p===`sleeping`,N;t[2]!==b||t[3]!==M||t[4]!==u?(N=function(){if(M)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=A.current===0?1/0:e-A.current;A.current=e;let n=ce(b,t),r=b===3&&e-k.current<3100,i=n===3&&r;n===3&&u?.(),x(n),C(Fe),i||(O(de(n)),n===3&&(k.current=e,T(Pe))),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},oe)},t[2]=b,t[3]=M,t[4]=u,t[5]=N):N=t[5];let P=N,F,I;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>()=>clearTimeout(j.current),I=[],t[6]=F,t[7]=I):(F=t[6],I=t[7]),(0,Y.useEffect)(F,I);let L,R;t[8]!==m||t[9]!==M?(L=()=>{m===0||M||(x(3),C(Ne),O(de(3)),k.current=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),T(Me),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},oe))},R=[m,M],t[8]=m,t[9]=M,t[10]=L,t[11]=R):(L=t[10],R=t[11]),(0,Y.useEffect)(L,R);let z,B;t[12]!==M||t[13]!==f?(z=()=>{if(!f||M||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/he)),C=-Math.max(-1,Math.min(1,b/he))*me,w=S*me,T=0,E=0;if(x>=1){let e=Math.min(x/pe,1)*fe;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)*_e,i+=(w-i)*_e,u.style.transform=`perspective(${ye}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*ve,o+=(E-o)*ve;let O=i*ge,k=-r*ge,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`)}},B=[f,M],t[12]=M,t[13]=f,t[14]=z,t[15]=B):(z=t[14],B=t[15]),(0,Y.useEffect)(z,B);let ee;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>{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]=ee):ee=t[16],(0,Y.useLayoutEffect)(ee);let V=b>0,H=V?b:1,te=V?`ok-blob-clicked-${b}`:null,U;t[17]===r?U=t[18]:(U=s(`ok-blob-3d-wrapper`,r),t[17]=r,t[18]=U);let ne=M?`cursor-default`:`cursor-pointer`,re=`body-${S}`,W=M&&`ok-blob-sleeping`,G;t[19]!==te||t[20]!==W?(G=s(`ok-blob-group`,W,te),t[19]=te,t[20]=W,t[21]=G):G=t[21];let K;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,J.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=K):K=t[22];let ie=(V||M)&&`ok-blob-eye-hidden`,ae;t[23]===ie?ae=t[24]:(ae=s(`ok-blob-eye`,ie),t[23]=ie,t[24]=ae);let q;t[25]===ae?q=t[26]:(q=(0,J.jsx)(`ellipse`,{cx:be,cy:Se,rx:1.2722,ry:1.9083,className:ae}),t[25]=ae,t[26]=q);let se=(V||M)&&`ok-blob-eye-hidden`,le;t[27]===se?le=t[28]:(le=s(`ok-blob-eye ok-blob-eye-right`,se),t[27]=se,t[28]=le);let ue;t[29]===le?ue=t[30]:(ue=(0,J.jsx)(`ellipse`,{cx:xe,cy:Se,rx:1.2722,ry:1.9083,className:le}),t[29]=le,t[30]=ue);let Ce;t[31]===H?Ce=t[32]:(Ce=we(be,H),t[31]=H,t[32]=Ce);let Ee=(!V||M)&&`ok-blob-eye-hidden`,De;t[33]===Ee?De=t[34]:(De=s(`ok-blob-happy-eye`,Ee),t[33]=Ee,t[34]=De);let Oe;t[35]!==Ce||t[36]!==De?(Oe=(0,J.jsx)(`path`,{d:Ce,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:De}),t[35]=Ce,t[36]=De,t[37]=Oe):Oe=t[37];let ke;t[38]===H?ke=t[39]:(ke=we(xe,H),t[38]=H,t[39]=ke);let Ie=(!V||M)&&`ok-blob-eye-hidden`,Le;t[40]===Ie?Le=t[41]:(Le=s(`ok-blob-happy-eye`,Ie),t[40]=Ie,t[41]=Le);let Re;t[42]!==ke||t[43]!==Le?(Re=(0,J.jsx)(`path`,{d:ke,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:Le}),t[42]=ke,t[43]=Le,t[44]=Re):Re=t[44];let Z;t[45]===M?Z=t[46]:(Z=M?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`path`,{d:Te(be),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,J.jsx)(`path`,{d:Te(xe),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=M,t[46]=Z);let ze;t[47]!==q||t[48]!==ue||t[49]!==Oe||t[50]!==Re||t[51]!==Z?(ze=(0,J.jsxs)(`g`,{ref:_,children:[q,ue,Oe,Re,Z]}),t[47]=q,t[48]=ue,t[49]=Oe,t[50]=Re,t[51]=Z,t[52]=ze):ze=t[52];let Be;t[53]!==re||t[54]!==G||t[55]!==ze?(Be=(0,J.jsxs)(`g`,{className:G,children:[K,ze]},re),t[53]=re,t[54]=G,t[55]=ze,t[56]=Be):Be=t[56];let Ve;t[57]===M?Ve=t[58]:(Ve=M?(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]=M,t[58]=Ve);let Q;t[59]!==w||t[60]!==D?(Q=D.length>0&&(0,J.jsx)(`g`,{"data-slot":`ok-blob-burst`,children:D.map(Ae)},`firework-${w}`),t[59]=w,t[60]=D,t[61]=Q):Q=t[61];let He;t[62]!==P||t[63]!==d||t[64]!==ne||t[65]!==Be||t[66]!==Ve||t[67]!==Q?(He=(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:ne,"aria-hidden":`true`,onClick:P,onMouseDown:je,children:[Be,Ve,Q]}),t[62]=P,t[63]=d,t[64]=ne,t[65]=Be,t[66]=Ve,t[67]=Q,t[68]=He):He=t[68];let Ue;return t[69]!==i||t[70]!==U||t[71]!==He?(Ue=(0,J.jsx)(`span`,{ref:h,className:U,style:i,children:He}),t[69]=i,t[70]=U,t[71]=He,t[72]=Ue):Ue=t[72],Ue}function Ae(e){return(0,J.jsx)(`circle`,{cx:Ee+e.originDx,cy:De+e.originDy,r:e.size,className:`ok-blob-firework`,style:Oe(e)},e.id)}function je(e){return e.preventDefault()}function Me(e){return e+1}function Ne(e){return e+1}function Pe(e){return e+1}function Fe(e){return e+1}var Ie=H(`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`}]]),Le=H(`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`}]]),Re=H(`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`}]]),Z=[...new Set(b.flatMap(e=>e.schemes))];function ze(e,t){let n=t.now?.()??Date.now(),r={};for(let t of b){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 Be(e){return ze({},e)}async function Ve(e){let t=e.schemes??Z,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 Q=Object.fromEntries(Z.map(e=>[e,{installed:!1}]));async function He(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 Q}if(!t.ok)return Q;let n;try{n=await t.json()}catch{return Q}if(typeof n!=`object`||!n||Array.isArray(n))return Q;let r=n,i={};for(let e of Z)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Ue(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 We(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Be({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=ze(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=!Ue(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 Ge(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Ke(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Ve({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>He({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function qe(){let e=(0,X.c)(5),[t,n]=(0,Y.useState)(Je),r=(0,Y.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=We(Ke());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 Je(){return Be({isElectronHost:Ge(),now:Date.now})}var Ye=(0,Y.createContext)(null);function Xe(e){let t=(0,X.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,J.jsx)(Ye,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Ze(){return(0,Y.use)(Ye)}function Qe(e){return!(e instanceof Error)||e.name!==`NotAllowedError`?!1:/permission denied|permissions policy/i.test(e.message)}function $e(e){let t=globalThis.document;if(!t?.body||typeof t.createElement!=`function`||typeof t.execCommand!=`function`)return!1;let n=t.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,n.style.pointerEvents=`none`,n.setAttribute(`readonly`,``),t.body.appendChild(n);try{return n.focus(),n.select(),t.execCommand(`copy`)}catch{return!1}finally{n.remove()}}async function et(e){let t=globalThis.okDesktop?.clipboard;if(t&&typeof t.writeText==`function`){await t.writeText(e);return}let n=globalThis.navigator?.clipboard;if(n&&typeof n.writeText==`function`)try{await n.writeText(e);return}catch(t){if($e(e))return;throw t}if(!$e(e))throw Error(`clipboard API unavailable`)}function tt(e){let t=(0,X.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:b}=e,{_:x}=a(),S;t[0]!==x||t[1]!==n?(S=n??x({id:`L3CEC1`}),t[0]=x,t[1]=n,t[2]=S):S=t[2];let C=S,w;t[3]!==x||t[4]!==d?(w=d??x({id:`cnGeoo`}),t[3]=x,t[4]=d,t[5]=w):w=t[5];let T=w,E;t[6]!==x||t[7]!==d||t[8]!==f?(E=f??d??x({id:`s3caR3`}),t[6]=x,t[7]=d,t[8]=f,t[9]=E):E=t[9];let D=E,O;t[10]!==x||t[11]!==s||t[12]!==C?(O=s??x({id:`77SdEP`,values:{itemName:C}}),t[10]=x,t[11]=s,t[12]=C,t[13]=O):O=t[13];let k;t[14]===O?k=t[15]:(k=(0,J.jsx)(g,{children:O}),t[14]=O,t[15]=k);let A;t[16]!==x||t[17]!==c||t[18]!==C?(A=c??x({id:`16D5Zj`,values:{itemName:C}}),t[16]=x,t[17]=c,t[18]=C,t[19]=A):A=t[19];let j;t[20]===A?j=t[21]:(j=(0,J.jsx)(_,{className:`whitespace-pre-wrap`,children:A}),t[20]=A,t[21]=j);let M;t[22]===u?M=t[23]:(M=u?(0,J.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=M);let N;t[24]!==k||t[25]!==j||t[26]!==M?(N=(0,J.jsxs)(m,{children:[k,j,M]}),t[24]=k,t[25]=j,t[26]=M,t[27]=N):N=t[27];let P;t[28]===b?P=t[29]:(P=b?(0,J.jsx)(v,{children:b}):null,t[28]=b,t[29]=P);let F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,J.jsx)(i,{id:`dEgA5A`}),t[30]=F):F=t[30];let I;t[31]===r?I=t[32]:(I=(0,J.jsx)(h,{disabled:r,children:F}),t[31]=r,t[32]=I);let L;t[33]!==T||t[34]!==D||t[35]!==r?(L=r?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{"aria-hidden":`true`,className:`size-4`}),` `,D]}):T,t[33]=T,t[34]=D,t[35]=r,t[36]=L):L=t[36];let R;t[37]!==r||t[38]!==o||t[39]!==L?(R=(0,J.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:L}),t[37]=r,t[38]=o,t[39]=L,t[40]=R):R=t[40];let z;t[41]!==I||t[42]!==R?(z=(0,J.jsxs)(y,{children:[I,R]}),t[41]=I,t[42]=R,t[43]=z):z=t[43];let B;return t[44]!==P||t[45]!==z||t[46]!==N?(B=(0,J.jsxs)(p,{children:[N,P,z]}),t[44]=P,t[45]=z,t[46]=N,t[47]=B):B=t[47],B}function nt(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:B[e]??e}function rt(e){return e===`claude`?`claude-code`:e}function it(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)(ke,{size:14,...n}),t[9]=n,t[10]=r),r}let e;return t[11]===i?e=t[12]:(e=(0,J.jsx)(te,{...i}),t[11]=i,t[12]=e),e}let a;t[13]===r?a=t[14]:(a=rt(r),t[13]=r,t[14]=a);let o;return t[15]!==i||t[16]!==a?(o=(0,J.jsx)(D,{...i,id:a}),t[15]=i,t[16]=a,t[17]=o):o=t[17],o}function at(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 p;t[8]===i?p=t[9]:(p=e=>(0,J.jsxs)(f,{children:[(0,J.jsx)(u,{asChild:!0,children:(0,J.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,J.jsx)(it,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":nt(e)})})}),(0,J.jsx)(d,{children:nt(e)})]},e),t[8]=i,t[9]=p),o=e.map(p),c=l.length>0?(0,J.jsxs)(f,{children:[(0,J.jsx)(u,{asChild:!0,children:(0,J.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,J.jsx)(d,{children:l.map(nt).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 ot(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 st(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)(N,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ct(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)(S,{...r}):(0,J.jsx)(A,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function lt(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)(x,{...r}):(0,J.jsx)(P,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ut(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)(T,{...r}):(0,J.jsx)(F,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function dt(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)(L,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ft(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)(C,{...r}):(0,J.jsx)(j,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function pt(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)(w,{...r}):(0,J.jsx)(M,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function mt(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)(E,{...r}):(0,J.jsx)(I,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var ht=Object.freeze({hosts:null,source:null}),gt=new Map,_t=new Map;function vt(e,t){return`${e}:${t}`}function yt(e){return gt.get(e)??ht}function bt(e,t){let n=_t.get(e)??new Set;return _t.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&_t.delete(e)}}function xt(e,t){let n=yt(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?gt.delete(e):gt.set(e,r);for(let t of _t.get(e)??[])t()}}var St=R.options,Ct=`.agents/`;function wt({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${ne(t,e.scope)}/${e.name}`:null,o=e!==void 0&&((e.hosts??[]).includes(`agents`)||t?.some(e=>e.hosts.includes(`agents`)||e.path.startsWith(Ct))),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?[...St,`agents`]:St).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:W(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=>[W(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=W(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 Tt=`min-w-[24rem]`;function Et(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=vt(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=>bt(m,e),g=()=>yt(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&&xt(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=yt(m).hosts;e&&[...e].sort().join(`,`)===j&&xt(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,xt(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(z));if(!r.ok){xt(m,{hosts:null});return}D.current=[...r.hosts],xt(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 B=R,V;return n[35]!==t||n[36]!==B||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(V={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),B([...n],!0)},installAll(){let t=D.current.filter(kt),n=e.installableEditors??St,r=St.filter(e=>n.includes(e)||D.current.includes(e));B([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>q({scope:e.scope,name:e.name,dir:n,mode:r})).then(Ot)},unplaceAt(n){t.runLocationWrite(e,()=>ie({scope:e.scope,name:e.name,path:n})).then(Dt)},setSource(n){xt(m,{source:n}),t.runLocationWrite(e,()=>G({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(xt(m,{source:null}),ee.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=B,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=V):V=n[44],V}function Dt(e){e.ok||ee.error(e.error)}function Ot(e){e.ok||ee.error(e.error)}function kt(e){return!St.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)(u,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,J.jsx)(d,{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)(f,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function At(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=K(),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}=wt({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=>re(a,e),F=Lt,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:ne(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}}))&&ae({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?V():ee.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,J.jsx)(it,{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=It,H;t[24]!==d||t[25]!==s||t[26]!==n?(H=(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]=H):H=t[27];let U=H,W;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,J.jsx)(i,{id:`npcziF`}),t[28]=W):W=t[28];let G;t[29]===d?G=t[30]:(G=d({id:`6f_UX4`}),t[29]=d,t[30]=G);let K;t[31]===m?K=t[32]:(K=()=>m(),t[31]=m,t[32]=K);let ie;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,J.jsx)(i,{id:`N40H-G`}),t[33]=ie):ie=t[33];let q;t[34]!==g||t[35]!==K?(q=(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:K,"data-testid":`skill-install-all`,children:ie}),t[34]=g,t[35]=K,t[36]=q):q=t[36];let Y;t[37]!==G||t[38]!==q?(Y=(0,J.jsx)($,{hint:G,children:q}),t[37]=G,t[38]=q,t[39]=Y):Y=t[39],t[40]!==u||t[41]!==Y?(S=(0,J.jsxs)(ut,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[W,Y]}),t[40]=u,t[41]=Y,t[42]=S):S=t[42],C=x===null?null:(0,J.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,J.jsxs)(lt,{menuKind:u,disabled:g,checked:!0,onSelect:Ft,"data-testid":`skill-source-row`,children:[(0,J.jsx)(te,{"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`:B[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)(lt,{menuKind:u,disabled:g,checked:f.has(t),onCheckedChange:e=>{O.has(t)||e===!0&&!I(c)||p(t,e===!0)},onSelect:Pt,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,J.jsx)(it,{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?U(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)(ot,{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)(lt,{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:Nt,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,J.jsx)(it,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,J.jsx)(te,{"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)(ot,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,J.jsxs)(J.Fragment,{children:[!g&&e.placed.mode!==y?U(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(Mt).join(`
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Nn as n}from"./DocumentContext-CDzXPsOB.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{i as u,n as d,t as f}from"./tooltip-DPvMEqsq.js";import{a as p,c as m,i as h,l as g,o as _,r as v,s as y}from"./alert-dialog-D3_HT0Lf.js";import{C as b,a as x,c as S,d as C,f as w,l as T,p as E,r as D,s as O,u as k}from"./terminal-cli-display-DtlGtdop.js";import{a as A,d as j,f as M,i as N,n as P,o as F,p as I,u as L}from"./dropdown-menu-C8skJt-Y.js";import{Kt as R,ei as z,lo as B}from"./dist-0WeLsvey2.js";import{n as ee}from"./dist-CuH7ikCn.js";import{s as V}from"./documents-events-Bswa3218.js";import{t as H}from"./createLucideIcon-IawHI4re.js";import{o as te}from"./use-open-skill-DoRxbYIA.js";import{t as U}from"./spinner-BfQfD3gf.js";import{c as ne,n as re,r as W}from"./skill-scope-CAVgRNo8.js";import{A as G,F as K,M as ie,S as ae,x as q}from"./skills-api-BmxNOfQ0.js";var J=t(),Y=e(r(),1),X=o(),oe=3100,se=3;function ce(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??se;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var le={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}},ue=[`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 de(e,t={}){let n=t.rng??Math.random,r=t.colors??ue,i=le[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 fe=1.8,pe=90,me=16,he=380,ge=.025,_e=.1,ve=.18,ye=400,be=9.2736,xe=18.1799,Se=14.5244,Ce={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function we(e,t){let{halfWidth:n,apexLift:r}=Ce[t];return`M${e-n} ${Se+.3} Q${e} ${Se-r}, ${e+n} ${Se+.3}`}function Te(e){let t=1.5,n=.3;return`M${e-t} ${Se-n} Q${e} ${Se+1.4}, ${e+t} ${Se-n}`}var Ee=15,De=15;function Oe(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 ke(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]=(0,Y.useState)(0),E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=[],t[1]=E):E=t[1];let[D,O]=(0,Y.useState)(E),k=(0,Y.useRef)(0),A=(0,Y.useRef)(0),j=(0,Y.useRef)(void 0),M=p===`sleeping`,N;t[2]!==b||t[3]!==M||t[4]!==u?(N=function(){if(M)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=A.current===0?1/0:e-A.current;A.current=e;let n=ce(b,t),r=b===3&&e-k.current<3100,i=n===3&&r;n===3&&u?.(),x(n),C(Fe),i||(O(de(n)),n===3&&(k.current=e,T(Pe))),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},oe)},t[2]=b,t[3]=M,t[4]=u,t[5]=N):N=t[5];let P=N,F,I;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>()=>clearTimeout(j.current),I=[],t[6]=F,t[7]=I):(F=t[6],I=t[7]),(0,Y.useEffect)(F,I);let L,R;t[8]!==m||t[9]!==M?(L=()=>{m===0||M||(x(3),C(Ne),O(de(3)),k.current=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),T(Me),clearTimeout(j.current),j.current=setTimeout(()=>{x(0),O([])},oe))},R=[m,M],t[8]=m,t[9]=M,t[10]=L,t[11]=R):(L=t[10],R=t[11]),(0,Y.useEffect)(L,R);let z,B;t[12]!==M||t[13]!==f?(z=()=>{if(!f||M||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/he)),C=-Math.max(-1,Math.min(1,b/he))*me,w=S*me,T=0,E=0;if(x>=1){let e=Math.min(x/pe,1)*fe;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)*_e,i+=(w-i)*_e,u.style.transform=`perspective(${ye}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*ve,o+=(E-o)*ve;let O=i*ge,k=-r*ge,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`)}},B=[f,M],t[12]=M,t[13]=f,t[14]=z,t[15]=B):(z=t[14],B=t[15]),(0,Y.useEffect)(z,B);let ee;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>{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]=ee):ee=t[16],(0,Y.useLayoutEffect)(ee);let V=b>0,H=V?b:1,te=V?`ok-blob-clicked-${b}`:null,U;t[17]===r?U=t[18]:(U=s(`ok-blob-3d-wrapper`,r),t[17]=r,t[18]=U);let ne=M?`cursor-default`:`cursor-pointer`,re=`body-${S}`,W=M&&`ok-blob-sleeping`,G;t[19]!==te||t[20]!==W?(G=s(`ok-blob-group`,W,te),t[19]=te,t[20]=W,t[21]=G):G=t[21];let K;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,J.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=K):K=t[22];let ie=(V||M)&&`ok-blob-eye-hidden`,ae;t[23]===ie?ae=t[24]:(ae=s(`ok-blob-eye`,ie),t[23]=ie,t[24]=ae);let q;t[25]===ae?q=t[26]:(q=(0,J.jsx)(`ellipse`,{cx:be,cy:Se,rx:1.2722,ry:1.9083,className:ae}),t[25]=ae,t[26]=q);let se=(V||M)&&`ok-blob-eye-hidden`,le;t[27]===se?le=t[28]:(le=s(`ok-blob-eye ok-blob-eye-right`,se),t[27]=se,t[28]=le);let ue;t[29]===le?ue=t[30]:(ue=(0,J.jsx)(`ellipse`,{cx:xe,cy:Se,rx:1.2722,ry:1.9083,className:le}),t[29]=le,t[30]=ue);let Ce;t[31]===H?Ce=t[32]:(Ce=we(be,H),t[31]=H,t[32]=Ce);let Ee=(!V||M)&&`ok-blob-eye-hidden`,De;t[33]===Ee?De=t[34]:(De=s(`ok-blob-happy-eye`,Ee),t[33]=Ee,t[34]=De);let Oe;t[35]!==Ce||t[36]!==De?(Oe=(0,J.jsx)(`path`,{d:Ce,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:De}),t[35]=Ce,t[36]=De,t[37]=Oe):Oe=t[37];let ke;t[38]===H?ke=t[39]:(ke=we(xe,H),t[38]=H,t[39]=ke);let Ie=(!V||M)&&`ok-blob-eye-hidden`,Le;t[40]===Ie?Le=t[41]:(Le=s(`ok-blob-happy-eye`,Ie),t[40]=Ie,t[41]=Le);let Re;t[42]!==ke||t[43]!==Le?(Re=(0,J.jsx)(`path`,{d:ke,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:Le}),t[42]=ke,t[43]=Le,t[44]=Re):Re=t[44];let Z;t[45]===M?Z=t[46]:(Z=M?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`path`,{d:Te(be),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,J.jsx)(`path`,{d:Te(xe),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=M,t[46]=Z);let ze;t[47]!==q||t[48]!==ue||t[49]!==Oe||t[50]!==Re||t[51]!==Z?(ze=(0,J.jsxs)(`g`,{ref:_,children:[q,ue,Oe,Re,Z]}),t[47]=q,t[48]=ue,t[49]=Oe,t[50]=Re,t[51]=Z,t[52]=ze):ze=t[52];let Be;t[53]!==re||t[54]!==G||t[55]!==ze?(Be=(0,J.jsxs)(`g`,{className:G,children:[K,ze]},re),t[53]=re,t[54]=G,t[55]=ze,t[56]=Be):Be=t[56];let Ve;t[57]===M?Ve=t[58]:(Ve=M?(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]=M,t[58]=Ve);let Q;t[59]!==w||t[60]!==D?(Q=D.length>0&&(0,J.jsx)(`g`,{"data-slot":`ok-blob-burst`,children:D.map(Ae)},`firework-${w}`),t[59]=w,t[60]=D,t[61]=Q):Q=t[61];let He;t[62]!==P||t[63]!==d||t[64]!==ne||t[65]!==Be||t[66]!==Ve||t[67]!==Q?(He=(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:ne,"aria-hidden":`true`,onClick:P,onMouseDown:je,children:[Be,Ve,Q]}),t[62]=P,t[63]=d,t[64]=ne,t[65]=Be,t[66]=Ve,t[67]=Q,t[68]=He):He=t[68];let Ue;return t[69]!==i||t[70]!==U||t[71]!==He?(Ue=(0,J.jsx)(`span`,{ref:h,className:U,style:i,children:He}),t[69]=i,t[70]=U,t[71]=He,t[72]=Ue):Ue=t[72],Ue}function Ae(e){return(0,J.jsx)(`circle`,{cx:Ee+e.originDx,cy:De+e.originDy,r:e.size,className:`ok-blob-firework`,style:Oe(e)},e.id)}function je(e){return e.preventDefault()}function Me(e){return e+1}function Ne(e){return e+1}function Pe(e){return e+1}function Fe(e){return e+1}var Ie=H(`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`}]]),Le=H(`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`}]]),Re=H(`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`}]]),Z=[...new Set(b.flatMap(e=>e.schemes))];function ze(e,t){let n=t.now?.()??Date.now(),r={};for(let t of b){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 Be(e){return ze({},e)}async function Ve(e){let t=e.schemes??Z,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 Q=Object.fromEntries(Z.map(e=>[e,{installed:!1}]));async function He(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 Q}if(!t.ok)return Q;let n;try{n=await t.json()}catch{return Q}if(typeof n!=`object`||!n||Array.isArray(n))return Q;let r=n,i={};for(let e of Z)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Ue(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 We(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Be({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=ze(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=!Ue(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 Ge(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Ke(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Ve({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>He({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function qe(){let e=(0,X.c)(5),[t,n]=(0,Y.useState)(Je),r=(0,Y.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=We(Ke());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 Je(){return Be({isElectronHost:Ge(),now:Date.now})}var Ye=(0,Y.createContext)(null);function Xe(e){let t=(0,X.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,J.jsx)(Ye,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Ze(){return(0,Y.use)(Ye)}function Qe(e){return!(e instanceof Error)||e.name!==`NotAllowedError`?!1:/permission denied|permissions policy/i.test(e.message)}function $e(e){let t=globalThis.document;if(!t?.body||typeof t.createElement!=`function`||typeof t.execCommand!=`function`)return!1;let n=t.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,n.style.pointerEvents=`none`,n.setAttribute(`readonly`,``),t.body.appendChild(n);try{return n.focus(),n.select(),t.execCommand(`copy`)}catch{return!1}finally{n.remove()}}async function et(e){let t=globalThis.okDesktop?.clipboard;if(t&&typeof t.writeText==`function`){await t.writeText(e);return}let n=globalThis.navigator?.clipboard;if(n&&typeof n.writeText==`function`)try{await n.writeText(e);return}catch(t){if($e(e))return;throw t}if(!$e(e))throw Error(`clipboard API unavailable`)}function tt(e){let t=(0,X.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:s,customDescription:c,customDetail:u,customConfirmLabel:d,customConfirmLabelBusy:f,children:b}=e,{_:x}=a(),S;t[0]!==x||t[1]!==n?(S=n??x({id:`L3CEC1`}),t[0]=x,t[1]=n,t[2]=S):S=t[2];let C=S,w;t[3]!==x||t[4]!==d?(w=d??x({id:`cnGeoo`}),t[3]=x,t[4]=d,t[5]=w):w=t[5];let T=w,E;t[6]!==x||t[7]!==d||t[8]!==f?(E=f??d??x({id:`s3caR3`}),t[6]=x,t[7]=d,t[8]=f,t[9]=E):E=t[9];let D=E,O;t[10]!==x||t[11]!==s||t[12]!==C?(O=s??x({id:`77SdEP`,values:{itemName:C}}),t[10]=x,t[11]=s,t[12]=C,t[13]=O):O=t[13];let k;t[14]===O?k=t[15]:(k=(0,J.jsx)(g,{children:O}),t[14]=O,t[15]=k);let A;t[16]!==x||t[17]!==c||t[18]!==C?(A=c??x({id:`16D5Zj`,values:{itemName:C}}),t[16]=x,t[17]=c,t[18]=C,t[19]=A):A=t[19];let j;t[20]===A?j=t[21]:(j=(0,J.jsx)(_,{className:`whitespace-pre-wrap`,children:A}),t[20]=A,t[21]=j);let M;t[22]===u?M=t[23]:(M=u?(0,J.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:u}):null,t[22]=u,t[23]=M);let N;t[24]!==k||t[25]!==j||t[26]!==M?(N=(0,J.jsxs)(m,{children:[k,j,M]}),t[24]=k,t[25]=j,t[26]=M,t[27]=N):N=t[27];let P;t[28]===b?P=t[29]:(P=b?(0,J.jsx)(v,{children:b}):null,t[28]=b,t[29]=P);let F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,J.jsx)(i,{id:`dEgA5A`}),t[30]=F):F=t[30];let I;t[31]===r?I=t[32]:(I=(0,J.jsx)(h,{disabled:r,children:F}),t[31]=r,t[32]=I);let L;t[33]!==T||t[34]!==D||t[35]!==r?(L=r?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(U,{"aria-hidden":`true`,className:`size-4`}),` `,D]}):T,t[33]=T,t[34]=D,t[35]=r,t[36]=L):L=t[36];let R;t[37]!==r||t[38]!==o||t[39]!==L?(R=(0,J.jsx)(l,{variant:`destructive`,onClick:o,disabled:r,children:L}),t[37]=r,t[38]=o,t[39]=L,t[40]=R):R=t[40];let z;t[41]!==I||t[42]!==R?(z=(0,J.jsxs)(y,{children:[I,R]}),t[41]=I,t[42]=R,t[43]=z):z=t[43];let B;return t[44]!==P||t[45]!==z||t[46]!==N?(B=(0,J.jsxs)(p,{children:[N,P,z]}),t[44]=P,t[45]=z,t[46]=N,t[47]=B):B=t[47],B}function nt(e){return e===`agents`||e===`.agents`||e.startsWith(`.agents/`)?`.agents`:e.includes(`/`)?e:B[e]??e}function rt(e){return e===`claude`?`claude-code`:e}function it(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)(ke,{size:14,...n}),t[9]=n,t[10]=r),r}let e;return t[11]===i?e=t[12]:(e=(0,J.jsx)(te,{...i}),t[11]=i,t[12]=e),e}let a;t[13]===r?a=t[14]:(a=rt(r),t[13]=r,t[14]=a);let o;return t[15]!==i||t[16]!==a?(o=(0,J.jsx)(D,{...i,id:a}),t[15]=i,t[16]=a,t[17]=o):o=t[17],o}function at(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 p;t[8]===i?p=t[9]:(p=e=>(0,J.jsxs)(f,{children:[(0,J.jsx)(u,{asChild:!0,children:(0,J.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,J.jsx)(it,{host:e,className:s(`size-3.5 shrink-0`,i),"aria-label":nt(e)})})}),(0,J.jsx)(d,{children:nt(e)})]},e),t[8]=i,t[9]=p),o=e.map(p),c=l.length>0?(0,J.jsxs)(f,{children:[(0,J.jsx)(u,{asChild:!0,children:(0,J.jsxs)(`span`,{className:`ml-0.5 cursor-default`,children:[`+`,l.length]})}),(0,J.jsx)(d,{children:l.map(nt).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 ot(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 st(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)(N,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ct(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)(S,{...r}):(0,J.jsx)(A,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function lt(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)(x,{...r}):(0,J.jsx)(P,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ut(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)(T,{...r}):(0,J.jsx)(F,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function dt(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)(L,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ft(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)(C,{...r}):(0,J.jsx)(j,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function pt(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)(w,{...r}):(0,J.jsx)(M,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function mt(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)(E,{...r}):(0,J.jsx)(I,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var ht=Object.freeze({hosts:null,source:null}),gt=new Map,_t=new Map;function vt(e,t){return`${e}:${t}`}function yt(e){return gt.get(e)??ht}function bt(e,t){let n=_t.get(e)??new Set;return _t.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&_t.delete(e)}}function xt(e,t){let n=yt(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?gt.delete(e):gt.set(e,r);for(let t of _t.get(e)??[])t()}}var St=R.options,Ct=`.agents/`;function wt({skill:e,allSkills:t,hostSet:n,sourceHostOverlay:r,linkMode:i}){let a=t=>e?`${ne(t,e.scope)}/${e.name}`:null,o=e!==void 0&&((e.hosts??[]).includes(`agents`)||t?.some(e=>e.hosts.includes(`agents`)||e.path.startsWith(Ct))),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?[...St,`agents`]:St).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:W(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=>[W(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=W(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 Tt=`min-w-[24rem]`;function Et(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=vt(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=>bt(m,e),g=()=>yt(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&&xt(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=yt(m).hosts;e&&[...e].sort().join(`,`)===j&&xt(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,xt(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(z));if(!r.ok){xt(m,{hosts:null});return}D.current=[...r.hosts],xt(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 B=R,V;return n[35]!==t||n[36]!==B||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(V={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),B([...n],!0)},installAll(){let t=D.current.filter(kt),n=e.installableEditors??St,r=St.filter(e=>n.includes(e)||D.current.includes(e));B([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>q({scope:e.scope,name:e.name,dir:n,mode:r})).then(Ot)},unplaceAt(n){t.runLocationWrite(e,()=>ie({scope:e.scope,name:e.name,path:n})).then(Dt)},setSource(n){xt(m,{source:n}),t.runLocationWrite(e,()=>G({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(xt(m,{source:null}),ee.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=B,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=V):V=n[44],V}function Dt(e){e.ok||ee.error(e.error)}function Ot(e){e.ok||ee.error(e.error)}function kt(e){return!St.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)(u,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,J.jsx)(d,{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)(f,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function At(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=K(),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}=wt({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=>re(a,e),F=Lt,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:ne(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}}))&&ae({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?V():ee.error(d({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,J.jsx)(it,{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=It,H;t[24]!==d||t[25]!==s||t[26]!==n?(H=(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]=H):H=t[27];let U=H,W;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,J.jsx)(i,{id:`npcziF`}),t[28]=W):W=t[28];let G;t[29]===d?G=t[30]:(G=d({id:`6f_UX4`}),t[29]=d,t[30]=G);let K;t[31]===m?K=t[32]:(K=()=>m(),t[31]=m,t[32]=K);let ie;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,J.jsx)(i,{id:`N40H-G`}),t[33]=ie):ie=t[33];let q;t[34]!==g||t[35]!==K?(q=(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:K,"data-testid":`skill-install-all`,children:ie}),t[34]=g,t[35]=K,t[36]=q):q=t[36];let Y;t[37]!==G||t[38]!==q?(Y=(0,J.jsx)($,{hint:G,children:q}),t[37]=G,t[38]=q,t[39]=Y):Y=t[39],t[40]!==u||t[41]!==Y?(S=(0,J.jsxs)(ut,{menuKind:u,className:`flex items-center justify-between gap-2`,children:[W,Y]}),t[40]=u,t[41]=Y,t[42]=S):S=t[42],C=x===null?null:(0,J.jsx)($,{hint:d({id:`pXB6SL`}),children:(0,J.jsxs)(lt,{menuKind:u,disabled:g,checked:!0,onSelect:Ft,"data-testid":`skill-source-row`,children:[(0,J.jsx)(te,{"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`:B[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)(lt,{menuKind:u,disabled:g,checked:f.has(t),onCheckedChange:e=>{O.has(t)||e===!0&&!I(c)||p(t,e===!0)},onSelect:Pt,className:`group`,"data-testid":`skill-install-editor-${t}`,children:[(0,J.jsx)(it,{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?U(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)(ot,{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)(lt,{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:Nt,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,J.jsx)(it,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,J.jsx)(te,{"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)(ot,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,J.jsxs)(J.Fragment,{children:[!g&&e.placed.mode!==y?U(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(Mt).join(`
|
|
2
2
|
`);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:jt,"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)(dt,{menuKind:u}),t[54]=u,t[55]=O);let k;t[56]===d?k=t[57]:(k=d({id:`5ymuTA`}),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)(Re,{"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)(ct,{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 jt(e){return e.preventDefault()}function Mt(e){return e.display}function Nt(e){return e.preventDefault()}function Pt(e){return e.preventDefault()}function Ft(e){return e.preventDefault()}function It(e){return(e??``).replace(/^~\//,``)}function Lt(e){return e===`agents`?`.agents`:B[e]??e}export{Ie as C,Le as S,et as _,st as a,qe as b,ft as c,ot as d,it as f,Qe as g,tt as h,St as i,pt as l,nt as m,At as n,ct as o,at as p,Et as r,dt as s,Tt as t,mt as u,Xe as v,ke as w,Re as x,Ze as y};
|
package/dist/public/assets/{SkillToolbarControls-CTxnGRS8.js → SkillToolbarControls-DLKu31-g.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{C as s,S 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{C as s,S as c,n as l,p as u,r as d,t as f}from"./SkillInstallMenu-BcAD6mRd.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-C8skJt-Y.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-CErmRiOd.js";import{a as O,i as k,u as A}from"./skill-actions-BEV4XcXI.js";import{t as j}from"./chevron-down-DT2zmBir.js";import{t as M}from"./list-plus-Lm4FbPM9.js";import{f as N,i as P,t as F}from"./skill-scope-CAVgRNo8.js";import{F as I}from"./skills-api-BmxNOfQ0.js";var L=a(),R=e(n(),1),z=t();function B(e){let t=(0,L.c)(52),{scope:n,name:a}=e,{_:s}=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]===s?F=t[16]:(F=s({id:`leF0i_`}),t[15]=s,t[16]=F);let B;t[17]===s?B=t[18]:(B=s({id:`leF0i_`}),t[17]=s,t[18]=B);let V;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,z.jsx)(c,{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:c,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]!==c||t[13]!==l||t[14]!==u||t[15]!==o?(E=o?(0,z.jsx)(A,{onAddProperty:c,problemCount:l,problemMessages:u,className:`hidden @xl/toolbar:inline-flex`}):null,t[12]=c,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)(s,{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]!==c||t[32]!==o?(U=o?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(b,{}),(0,z.jsxs)(m,{onSelect:c,children:[(0,z.jsx)(M,{}),(0,z.jsx)(r,{id:`81H_23`})]})]}):null,t[31]=c,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{At as n,G as r,M as i,Ot as a,U as o,V as s,W as c,fn as l,lt as u,mt as d,pt as f,sn as ee,st as te}from"./DocumentContext-BRyLZId_.js";import{t as p}from"./react-f2sANaYj.js";import{n as m}from"./dist-PQ5KMVDh.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{A as g,O as ne,S as _,a as re,i as ie,o as ae}from"./CodeMirrorPropInput-C4Sgk7Nu.js";import{Ao as v,Ji as oe,T as se,bo as y,mo as b,ri as x}from"./dist-0WeLsvey2.js";import{i as ce}from"./use-apply-config-theme-yjXI2GwT.js";import{H as S,L as le,M as ue,O as de,P as fe,S as C,d as w,f as pe,i as me,j as he,l as ge,r as _e,t as ve,w as T}from"./typing-burst-detector-ZpjfAtrw.js";import{f as E,g as D}from"./doc-paths-CiuwB0oU.js";import{J as O}from"./navigation-targets-Df3QXcjS.js";import"./config-provider-BEdlvRi2.js";import{$ as k,D as A,Dt as j,F as M,It as N,Lt as P,Ot as F,Pt as I,Y as L,Z as R,b as z,ct as B,ft as V,g as H,gt as U,ht as ye,it as W,kt as be,l as G,lt as K,nt as q,pt as J,rt as Y,ut as X,v as xe}from"./dist-BL2TNIf3.js";import{a as Se,n as Ce}from"./cm-theme-CundV4JI.js";import{i as we,n as Te,o as Ee,r as De}from"./dist-DfNDNysF.js";import{o as Oe,r as ke}from"./selection-context-_FFqOhZk.js";import{l as Ae}from"./lint-config-client-B_Zy2yNf.js";import{a as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./dist-q2W-QRsN.js";import{n as Re,t as ze}from"./src-CTOqSJUC.js";var Z=e(p(),1),Be=h();function Ve(){let e=r();return e===null?null:new Set(e.keys())}function He(e,t,n){let r=[],i=M(e);if(n!=null){let a=[];for(let{from:e,to:n}of t)i.iterate({from:e,to:n,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return a.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>a.some(n=>e>=n.from&&t<=n.to);for(let{from:i,to:a}of t){let t=e.doc.sliceString(i,a);y.lastIndex=0;for(let e=y.exec(t);e!==null;e=y.exec(t)){let t=e[2];if(!v(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(L.mark({class:n.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:a,to:o}of t)i.iterate({from:a,to:o,enter(t){if(t.name!==`InlineCode`)return;let i=e.doc.sliceString(t.from,t.to),a=i.length-i.replace(/^`+/,``).length,o=i.length-i.replace(/`+$/,``).length,c=i.slice(a,i.length-o),l=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(c)?.[1];if(l!==void 0&&v(l)&&n!=null)return r.push(L.mark({class:n.has(l)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":l}}).range(t.from+a,t.to-o)),!1;let u=s.exec(c);if(u)return r.push(L.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":u[1]}}).range(t.from+a,t.to-o)),!1}});return r.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),L.set(r)}function Ue(e){let t=c(e);return t===null?[]:[k.fromClass(class{decorations;constructor(e){this.decorations=He(e.state,e.visibleRanges,Ve())}update(e){(e.docChanged||e.viewportChanged||M(e.startState)!==M(e.state))&&(this.decorations=He(e.view.state,e.view.visibleRanges,Ve()))}},{decorations:e=>e.decorations}),R.domEventHandlers({mousedown(n){let i=n.target?.closest?.(`[data-skill-ref]`),a=i instanceof HTMLElement?i.dataset.skillRef:void 0;if(a!==void 0){n.preventDefault();let e=r()?.get(a);return window.location.hash=e===void 0?D():E(O({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=o(t,e,c),!0)}})]}var We=L.line({attributes:{dir:`auto`}});function Ge(e){let t=new I;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,We),r=n.to+1}return t.finish()}var Ke=k.fromClass(class{decorations;constructor(e){this.decorations=Ge(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=Ge(e.view))}},{decorations:e=>e.decorations}),qe=[R.perLineTextDirection.of(!0),Ke],Je=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ye=`cm-lint-local-target`;function Xe(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 Ze(e,t){let n=H(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Je.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function Qe(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function $e(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=Ze(e,Xe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:Qe(i.severity),message:T(i),source:`${i.source}/${i.code}`,markClass:Ye})}return r}var et=N.define();function tt(e){let t={findings:[]};return[Me(e=>ne()?$e(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(et)))}),k.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:et.of(null)}),Le(n)},i=C(e,e=>{e.status===`loaded`&&r(e.findings)}),a=g(()=>r(t.findings));return{destroy(){i(),a()}}})]}function nt(e,t){return e.enabled?[Ne(),Me(async n=>rt(n.state.doc,await x(n.state.doc.toString(),e,t)),{delay:600})]:[]}function Q(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 rt(e,t){let n=[];for(let r of t){let t=Q(e,r.range.start),i=Q(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=it(r);o&&(a.actions=[o]),n.push(a)}return n}function it(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:Q(n,e.range.start),to:Q(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var at=[J(),K(),X(),xe(),Y(),W(),be.allowMultipleSelections.of(!0),A(),G(),De(),Te(),U(),q(),B(),je(),V.of([...we,...Ce,...Ie,...z,...Ee,...Fe])],ot=L.mark({class:`cm-link-ref-broken`}),st=/^\s{0,3}\[([^\]]+)\]:\s/,ct=/\[([^\]]*)\]\[([^\]]*)\]/g,lt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function $(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 M(e).iterate({enter(e){if(lt.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($(n.from,i))continue;let a=st.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!$(t.from,i)&&!st.test(t.text))for(ct.lastIndex=0;;){let e=ct.exec(t.text);if(!e)break;let r=t.from+e.index;if($(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(ot.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),L.set(a)}var ft=P.define({create(e){return dt(e)},update(e,t){return t.docChanged?dt(t.state):e},provide:e=>R.decorations.from(e)}),pt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,mt=L.mark({class:`cm-del`}),ht=L.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),gt=L.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=M(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=L.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=L.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),L.set(n)}var bt=class{decorations;constructor(e){this.decorations=yt(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||M(e.startState)!==M(e.state))&&(this.decorations=yt(e.view.state,e.view.visibleRanges))}},xt=k.fromClass(bt,{decorations:e=>e.decorations});function St(){return[xt,ft]}var Ct=t(),wt=N.define();function Tt(e,t,n){let r=w(e.state.doc)[t.index];r&&l(n,()=>{e.dispatch({selection:F.cursor(r.from),effects:R.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);l(r,()=>{e.dispatch({selection:F.cursor(a),effects:R.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);l(n,()=>{e.dispatch({selection:F.cursor(o),effects:R.scrollIntoView(o,{y:`start`})}),e.focus()})}function Ot(e){let t=(0,Be.c)(50),{docName:r,ytext:o,provider:s,placeholder:c,isSourceModeActive:l}=e,p=(0,Z.useRef)(null),h=(0,Z.useRef)(null),[g,ne]=(0,Z.useState)(null);if(g)throw g;let{resolvedTheme:_}=m(),{merged:v}=ce(),y=(0,Z.useRef)(l),b=v?.editor?.wordWrap??!0,{data:x}=Ae(r),S;t[0]!==x?.effective||t[1]!==v?(S=x?.effective??(v?.contentRules?oe(v.contentRules):se),t[0]=x?.effective,t[1]=v,t[2]=S):S=t[2];let C=S,w;t[3]===C?w=t[4]:(w=JSON.stringify(C),t[3]=C,t[4]=w);let T=w,E,D;t[5]===l?(E=t[6],D=t[7]):(E=()=>{y.current=l},D=[l],t[5]=l,t[6]=E,t[7]=D),(0,Z.useEffect)(E,D);let O=(0,Z.useRef)(null),k;t[8]!==r||t[9]!==C||t[10]!==c||t[11]!==s||t[12]!==_||t[13]!==b||t[14]!==o?(k=()=>{let e=p.current;if(!e)return;let t=s.configuration.name??``,l,m=At;try{l=f({docName:t,container:e,sizeStats:{viewCount:0,bytes:o.length},factory:e=>{let n=null,a=i({ydoc:s.document,ytext:o,docName:t}),l=new j,d=new j,f=new j,p=new j,h=new R({state:be.create({doc:o.toString(),extensions:[at,qe,Pe({scrollToMatch:e=>ee(t)?R.scrollIntoView(e,{y:`start`}):wt.of(null)}),V.of([Se]),ze(o,s.awareness),V.of(Re),...ie({themeCompartment:l,resolvedTheme:_,ydoc:s.document,wordWrapCompartment:d,wordWrap:b,currentDocName:t}),St(),Ue(t),le(),p.of(nt(C,r)),tt(r),a,R.updateListener.of(e=>{te(e)&&u(t)}),R.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,_e(t,`source`,me(e.view)),ke(t,`source`,Oe(e.view,t))},120))}),f.of(ye(c??``)),R.theme({"&":{height:`100%`}}),R.scrollMargins.of(kt)]}),parent:e});_e(t,`source`,me(h)),ke(t,`source`,Oe(h,t));let g=h.contentDOM;return g.addEventListener(`keydown`,m),g.addEventListener(`paste`,m),g.addEventListener(`drop`,m),g.addEventListener(`cut`,m),{view:h,ydoc:s.document,ytext:o,provider:s,themeCompartment:l,wordWrapCompartment:d,placeholderCompartment:f,lintCompartment:p}}}),O.current=l,h.current=l.view,a(r,l.view),ve()&&l.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),O.current=null,h.current=null,ne(t instanceof Error?t:Error(String(t)))}return()=>{let e=O.current;e&&(d(e),n(r,e.view)),O.current=null,h.current=null}},t[8]=r,t[9]=C,t[10]=c,t[11]=s,t[12]=_,t[13]=b,t[14]=o,t[15]=k):k=t[15];let A;t[16]!==s||t[17]!==o?(A=[o,s],t[16]=s,t[17]=o,t[18]=A):A=t[18],(0,Z.useEffect)(k,A);let M,N;t[19]===r?(M=t[20],N=t[21]):(M=()=>{},N=[r],t[19]=r,t[20]=M,t[21]=N),(0,Z.useEffect)(M,N);let P,F;t[22]===_?(P=t[23],F=t[24]):(F=()=>{let e=O.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(_===`dark`?re:ae)})},P=[_],t[22]=_,t[23]=P,t[24]=F),(0,Z.useEffect)(F,P);let I,L;t[25]===b?(I=t[26],L=t[27]):(I=()=>{let e=O.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(b?R.lineWrapping:[])})},L=[b],t[25]=b,t[26]=I,t[27]=L),(0,Z.useEffect)(I,L);let z,B;t[28]===c?(z=t[29],B=t[30]):(z=()=>{let e=O.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ye(c??``))})},B=[c],t[28]=c,t[29]=z,t[30]=B),(0,Z.useEffect)(z,B);let H;t[31]!==r||t[32]!==C?(H=()=>{let e=O.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(nt(C,r))})},t[31]=r,t[32]=C,t[33]=H):H=t[33];let U;t[34]===T?U=t[35]:(U=[T],t[34]=T,t[35]=U),(0,Z.useEffect)(H,U);let W,G;t[36]!==r||t[37]!==l?(W=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||t.mode!==`source`||!l)return;let n=h.current;n&&(Tt(n,t,r),he(r))};return window.addEventListener(ge,e),()=>window.removeEventListener(ge,e)},G=[r,l],t[36]=r,t[37]=l,t[38]=W,t[39]=G):(W=t[38],G=t[39]),(0,Z.useEffect)(W,G);let K,q;t[40]!==r||t[41]!==l?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||!l)return;let n=h.current;n&&(Dt(n,t,r),he(r))};return window.addEventListener(pe,e),()=>window.removeEventListener(pe,e)},q=[r,l],t[40]=r,t[41]=l,t[42]=K,t[43]=q):(K=t[42],q=t[43]),(0,Z.useEffect)(K,q);let J,Y;t[44]!==r||t[45]!==l||t[46]!==s?(J=()=>{if(!l)return;let e=h.current;if(!e)return;let t=fe(r);if(!t)return;if(t.kind!==`selection-offset`){ue(r),t.kind===`outline`?Tt(e,t.detail,r):t.kind===`lint`?Dt(e,t.detail,r):t.kind===`raw-mdx`&&Et(e,t.detail,()=>y.current,r);return}let n=!1,i=null;return queueMicrotask(()=>{if(n)return;let t=fe(r);t?.kind===`selection-offset`&&(i=de({view:e,docName:r,navigation:t,ydoc:s.document,transition:{from:`wysiwyg`,to:`source`}}),i&&ue(r))}),()=>{n=!0,i?.cancel(`mode-flip`)}},Y=[r,l,s],t[44]=r,t[45]=l,t[46]=s,t[47]=J,t[48]=Y):(J=t[47],Y=t[48]),(0,Z.useEffect)(J,Y);let X;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Ct.jsx)(`div`,{ref:p,className:`source-editor h-full pb-3`}),t[49]=X):X=t[49],X}function kt(){return{top:S()}}function At(){return _()}export{Ot as SourceEditor,Et as applyRawMdxNavigation};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{At as n,G as r,M as i,Ot as a,U as o,V as s,W as c,fn as l,lt as u,mt as d,pt as f,sn as ee,st as te}from"./DocumentContext-CDzXPsOB.js";import{t as p}from"./react-f2sANaYj.js";import{n as m}from"./dist-PQ5KMVDh.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{A as g,O as ne,S as _,a as re,i as ie,o as ae}from"./CodeMirrorPropInput-Br0HbEoO.js";import{Ao as v,Ji as oe,T as se,bo as y,mo as b,ri as x}from"./dist-0WeLsvey2.js";import{i as ce}from"./use-apply-config-theme-yjXI2GwT.js";import{H as S,L as le,M as ue,O as de,P as fe,S as C,d as w,f as pe,i as me,j as he,l as ge,r as _e,t as ve,w as T}from"./typing-burst-detector-hIE55MR9.js";import{f as E,g as D}from"./doc-paths-CiuwB0oU.js";import{J as O}from"./navigation-targets-Df3QXcjS.js";import"./config-provider-BHs4LyOQ.js";import{$ as k,D as A,Dt as j,F as M,It as N,Lt as P,Ot as F,Pt as I,Y as L,Z as R,b as z,ct as B,ft as V,g as H,gt as U,ht as ye,it as W,kt as be,l as G,lt as K,nt as q,pt as J,rt as Y,ut as X,v as xe}from"./dist-BL2TNIf3.js";import{a as Se,n as Ce}from"./cm-theme-CundV4JI.js";import{i as we,n as Te,o as Ee,r as De}from"./dist-DfNDNysF.js";import{o as Oe,r as ke}from"./selection-context-BHq5CXBh.js";import{l as Ae}from"./lint-config-client-B_Zy2yNf.js";import{a as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./dist-q2W-QRsN.js";import{n as Re,t as ze}from"./src-DAfekKTe.js";var Z=e(p(),1),Be=h();function Ve(){let e=r();return e===null?null:new Set(e.keys())}function He(e,t,n){let r=[],i=M(e);if(n!=null){let a=[];for(let{from:e,to:n}of t)i.iterate({from:e,to:n,enter(e){if(e.name===`InlineCode`||e.name===`FencedCode`)return a.push({from:e.from,to:e.to}),!1}});let o=(e,t)=>a.some(n=>e>=n.from&&t<=n.to);for(let{from:i,to:a}of t){let t=e.doc.sliceString(i,a);y.lastIndex=0;for(let e=y.exec(t);e!==null;e=y.exec(t)){let t=e[2];if(!v(t))continue;let a=i+(e.index??0)+e[1].length,s=a+t.length+1;o(a,s)||r.push(L.mark({class:n.has(t)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":t}}).range(a,s))}}}for(let{from:a,to:o}of t)i.iterate({from:a,to:o,enter(t){if(t.name!==`InlineCode`)return;let i=e.doc.sliceString(t.from,t.to),a=i.length-i.replace(/^`+/,``).length,o=i.length-i.replace(/`+$/,``).length,c=i.slice(a,i.length-o),l=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(c)?.[1];if(l!==void 0&&v(l)&&n!=null)return r.push(L.mark({class:n.has(l)?`cm-skill-ref`:`cm-skill-ref cm-skill-ref-missing`,attributes:{"data-skill-ref":l}}).range(t.from+a,t.to-o)),!1;let u=s.exec(c);if(u)return r.push(L.mark({class:`cm-skill-path-link`,attributes:{"data-skill-path":u[1]}}).range(t.from+a,t.to-o)),!1}});return r.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),L.set(r)}function Ue(e){let t=c(e);return t===null?[]:[k.fromClass(class{decorations;constructor(e){this.decorations=He(e.state,e.visibleRanges,Ve())}update(e){(e.docChanged||e.viewportChanged||M(e.startState)!==M(e.state))&&(this.decorations=He(e.view.state,e.view.visibleRanges,Ve()))}},{decorations:e=>e.decorations}),R.domEventHandlers({mousedown(n){let i=n.target?.closest?.(`[data-skill-ref]`),a=i instanceof HTMLElement?i.dataset.skillRef:void 0;if(a!==void 0){n.preventDefault();let e=r()?.get(a);return window.location.hash=e===void 0?D():E(O({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=o(t,e,c),!0)}})]}var We=L.line({attributes:{dir:`auto`}});function Ge(e){let t=new I;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,We),r=n.to+1}return t.finish()}var Ke=k.fromClass(class{decorations;constructor(e){this.decorations=Ge(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=Ge(e.view))}},{decorations:e=>e.decorations}),qe=[R.perLineTextDirection.of(!0),Ke],Je=new Set([`Link`,`Image`,`HTMLTag`,`HTMLBlock`]),Ye=`cm-lint-local-target`;function Xe(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 Ze(e,t){let n=H(e,t+1,100);if(n){let e=n.resolveInner(t,1);for(;e;){if(Je.has(e.name))return{from:e.from,to:e.to};e=e.parent}}return{from:t,to:t}}function Qe(e){return e===`error`?`error`:e===`info`?`info`:`warning`}function $e(e,t){let n=e.doc,r=[];for(let i of t){if(i.source!==`links`)continue;let t=Ze(e,Xe(n,i.range.start));r.push({from:t.from,to:Math.max(t.to,t.from),severity:Qe(i.severity),message:T(i),source:`${i.source}/${i.code}`,markClass:Ye})}return r}var et=N.define();function tt(e){let t={findings:[]};return[Me(e=>ne()?$e(e.state,t.findings):[],{delay:300,needsRefresh:e=>e.transactions.some(e=>e.effects.some(e=>e.is(et)))}),k.define(n=>{let r=e=>{t.findings=e,n.dispatch({effects:et.of(null)}),Le(n)},i=C(e,e=>{e.status===`loaded`&&r(e.findings)}),a=g(()=>r(t.findings));return{destroy(){i(),a()}}})]}function nt(e,t){return e.enabled?[Ne(),Me(async n=>rt(n.state.doc,await x(n.state.doc.toString(),e,t)),{delay:600})]:[]}function Q(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 rt(e,t){let n=[];for(let r of t){let t=Q(e,r.range.start),i=Q(e,r.range.end),a={from:t,to:Math.max(i,t),severity:r.severity,message:r.message,source:`${r.source}/${r.code}`},o=it(r);o&&(a.actions=[o]),n.push(a)}return n}function it(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:Q(n,e.range.start),to:Q(n,e.range.end),insert:e.newText})),userEvent:`input.complete`})}}}var at=[J(),K(),X(),xe(),Y(),W(),be.allowMultipleSelections.of(!0),A(),G(),De(),Te(),U(),q(),B(),je(),V.of([...we,...Ce,...Ie,...z,...Ee,...Fe])],ot=L.mark({class:`cm-link-ref-broken`}),st=/^\s{0,3}\[([^\]]+)\]:\s/,ct=/\[([^\]]*)\]\[([^\]]*)\]/g,lt=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function $(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 M(e).iterate({enter(e){if(lt.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($(n.from,i))continue;let a=st.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!$(t.from,i)&&!st.test(t.text))for(ct.lastIndex=0;;){let e=ct.exec(t.text);if(!e)break;let r=t.from+e.index;if($(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(ot.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),L.set(a)}var ft=P.define({create(e){return dt(e)},update(e,t){return t.docChanged?dt(t.state):e},provide:e=>R.decorations.from(e)}),pt=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,mt=L.mark({class:`cm-del`}),ht=L.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),gt=L.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=M(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=L.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=L.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),L.set(n)}var bt=class{decorations;constructor(e){this.decorations=yt(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||M(e.startState)!==M(e.state))&&(this.decorations=yt(e.view.state,e.view.visibleRanges))}},xt=k.fromClass(bt,{decorations:e=>e.decorations});function St(){return[xt,ft]}var Ct=t(),wt=N.define();function Tt(e,t,n){let r=w(e.state.doc)[t.index];r&&l(n,()=>{e.dispatch({selection:F.cursor(r.from),effects:R.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);l(r,()=>{e.dispatch({selection:F.cursor(a),effects:R.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);l(n,()=>{e.dispatch({selection:F.cursor(o),effects:R.scrollIntoView(o,{y:`start`})}),e.focus()})}function Ot(e){let t=(0,Be.c)(50),{docName:r,ytext:o,provider:s,placeholder:c,isSourceModeActive:l}=e,p=(0,Z.useRef)(null),h=(0,Z.useRef)(null),[g,ne]=(0,Z.useState)(null);if(g)throw g;let{resolvedTheme:_}=m(),{merged:v}=ce(),y=(0,Z.useRef)(l),b=v?.editor?.wordWrap??!0,{data:x}=Ae(r),S;t[0]!==x?.effective||t[1]!==v?(S=x?.effective??(v?.contentRules?oe(v.contentRules):se),t[0]=x?.effective,t[1]=v,t[2]=S):S=t[2];let C=S,w;t[3]===C?w=t[4]:(w=JSON.stringify(C),t[3]=C,t[4]=w);let T=w,E,D;t[5]===l?(E=t[6],D=t[7]):(E=()=>{y.current=l},D=[l],t[5]=l,t[6]=E,t[7]=D),(0,Z.useEffect)(E,D);let O=(0,Z.useRef)(null),k;t[8]!==r||t[9]!==C||t[10]!==c||t[11]!==s||t[12]!==_||t[13]!==b||t[14]!==o?(k=()=>{let e=p.current;if(!e)return;let t=s.configuration.name??``,l,m=At;try{l=f({docName:t,container:e,sizeStats:{viewCount:0,bytes:o.length},factory:e=>{let n=null,a=i({ydoc:s.document,ytext:o,docName:t}),l=new j,d=new j,f=new j,p=new j,h=new R({state:be.create({doc:o.toString(),extensions:[at,qe,Pe({scrollToMatch:e=>ee(t)?R.scrollIntoView(e,{y:`start`}):wt.of(null)}),V.of([Se]),ze(o,s.awareness),V.of(Re),...ie({themeCompartment:l,resolvedTheme:_,ydoc:s.document,wordWrapCompartment:d,wordWrap:b,currentDocName:t}),St(),Ue(t),le(),p.of(nt(C,r)),tt(r),a,R.updateListener.of(e=>{te(e)&&u(t)}),R.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,_e(t,`source`,me(e.view)),ke(t,`source`,Oe(e.view,t))},120))}),f.of(ye(c??``)),R.theme({"&":{height:`100%`}}),R.scrollMargins.of(kt)]}),parent:e});_e(t,`source`,me(h)),ke(t,`source`,Oe(h,t));let g=h.contentDOM;return g.addEventListener(`keydown`,m),g.addEventListener(`paste`,m),g.addEventListener(`drop`,m),g.addEventListener(`cut`,m),{view:h,ydoc:s.document,ytext:o,provider:s,themeCompartment:l,wordWrapCompartment:d,placeholderCompartment:f,lintCompartment:p}}}),O.current=l,h.current=l.view,a(r,l.view),ve()&&l.view.focus()}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),O.current=null,h.current=null,ne(t instanceof Error?t:Error(String(t)))}return()=>{let e=O.current;e&&(d(e),n(r,e.view)),O.current=null,h.current=null}},t[8]=r,t[9]=C,t[10]=c,t[11]=s,t[12]=_,t[13]=b,t[14]=o,t[15]=k):k=t[15];let A;t[16]!==s||t[17]!==o?(A=[o,s],t[16]=s,t[17]=o,t[18]=A):A=t[18],(0,Z.useEffect)(k,A);let M,N;t[19]===r?(M=t[20],N=t[21]):(M=()=>{},N=[r],t[19]=r,t[20]=M,t[21]=N),(0,Z.useEffect)(M,N);let P,F;t[22]===_?(P=t[23],F=t[24]):(F=()=>{let e=O.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(_===`dark`?re:ae)})},P=[_],t[22]=_,t[23]=P,t[24]=F),(0,Z.useEffect)(F,P);let I,L;t[25]===b?(I=t[26],L=t[27]):(I=()=>{let e=O.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(b?R.lineWrapping:[])})},L=[b],t[25]=b,t[26]=I,t[27]=L),(0,Z.useEffect)(I,L);let z,B;t[28]===c?(z=t[29],B=t[30]):(z=()=>{let e=O.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(ye(c??``))})},B=[c],t[28]=c,t[29]=z,t[30]=B),(0,Z.useEffect)(z,B);let H;t[31]!==r||t[32]!==C?(H=()=>{let e=O.current;e&&e.view.dispatch({effects:e.lintCompartment.reconfigure(nt(C,r))})},t[31]=r,t[32]=C,t[33]=H):H=t[33];let U;t[34]===T?U=t[35]:(U=[T],t[34]=T,t[35]=U),(0,Z.useEffect)(H,U);let W,G;t[36]!==r||t[37]!==l?(W=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||t.mode!==`source`||!l)return;let n=h.current;n&&(Tt(n,t,r),he(r))};return window.addEventListener(ge,e),()=>window.removeEventListener(ge,e)},G=[r,l],t[36]=r,t[37]=l,t[38]=W,t[39]=G):(W=t[38],G=t[39]),(0,Z.useEffect)(W,G);let K,q;t[40]!==r||t[41]!==l?(K=()=>{let e=function(e){let t=e.detail;if(!t||t.docName!==r||!l)return;let n=h.current;n&&(Dt(n,t,r),he(r))};return window.addEventListener(pe,e),()=>window.removeEventListener(pe,e)},q=[r,l],t[40]=r,t[41]=l,t[42]=K,t[43]=q):(K=t[42],q=t[43]),(0,Z.useEffect)(K,q);let J,Y;t[44]!==r||t[45]!==l||t[46]!==s?(J=()=>{if(!l)return;let e=h.current;if(!e)return;let t=fe(r);if(!t)return;if(t.kind!==`selection-offset`){ue(r),t.kind===`outline`?Tt(e,t.detail,r):t.kind===`lint`?Dt(e,t.detail,r):t.kind===`raw-mdx`&&Et(e,t.detail,()=>y.current,r);return}let n=!1,i=null;return queueMicrotask(()=>{if(n)return;let t=fe(r);t?.kind===`selection-offset`&&(i=de({view:e,docName:r,navigation:t,ydoc:s.document,transition:{from:`wysiwyg`,to:`source`}}),i&&ue(r))}),()=>{n=!0,i?.cancel(`mode-flip`)}},Y=[r,l,s],t[44]=r,t[45]=l,t[46]=s,t[47]=J,t[48]=Y):(J=t[47],Y=t[48]),(0,Z.useEffect)(J,Y);let X;return t[49]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,Ct.jsx)(`div`,{ref:p,className:`source-editor h-full pb-3`}),t[49]=X):X=t[49],X}function kt(){return{top:S()}}function At(){return _()}export{Ot as SourceEditor,Et as applyRawMdxNavigation};
|
|
@@ -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-BHs4LyOQ.js";import{t as o}from"./use-installed-clis-vg6izNL9.js";import{t as s}from"./use-live-xterm-theme-yIlEKfu7.js";import{SessionsHost as c}from"./SessionsHost-BL85wtJL.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-Br0HbEoO.js";import{as as s,dr as c,gs as l}from"./dist-0WeLsvey2.js";import{g as u}from"./config-provider-BHs4LyOQ.js";import{Dt as d,P as f,Z as p,kt as m}from"./dist-BL2TNIf3.js";import{t as h}from"./cm-theme-CundV4JI.js";import{t as g}from"./dist-CmGSr9O-.js";import{t as _}from"./text-viewer-languages-8mK7FOb6.js";import{t as v}from"./src-DAfekKTe.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[c(n)]??l(c(n)))!==null&&c(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=c(n)||null;return b&&_(b,s[b]??l(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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./code-highlighter-impl-CqBvFNiv.js","./lib-B3XVxNhx.js","./html-void-elements-XfxYgU9i.js","./chunk-CYidjpOJ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Dr as r,Fn as i,In as a,Ln as o,Nn as s,Wn as c,a as l,kn as u,lr as d}from"./DocumentContext-BRyLZId_.js";import{t as f}from"./react-f2sANaYj.js";import{n as p,r as m}from"./dist-Nvb76hAm.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{i as g,s as _}from"./local-menu-action-bus-IjTSMx8U.js";import{t as v}from"./utils-CPqDy6Hr.js";import{t as y}from"./mascot-outline-CtS592mc.js";import{t as b}from"./button-CA0dewJJ.js";import{i as x,n as S,t as C}from"./tooltip-DPvMEqsq.js";import{c as w,i as T,t as E}from"./dialog-CeTXzamA.js";import{st as D}from"./CodeMirrorPropInput-C4Sgk7Nu.js";import{a as O,c as k,d as A,f as j,l as M,m as N,n as P,o as F,p as I,r as L,t as ee}from"./dropdown-menu-C8skJt-Y.js";import{a as te,b as R,c as z,d as ne,f as re,i as ie,l as B,m as ae,n as oe,o as se,p as ce,r as le,s as ue,t as de,u as fe,x as pe,y as me}from"./progress-BCKE1cPj.js";import{n as V}from"./separator-DcX0NiAC.js";import{t as H}from"./switch-BeP1gMN6.js";import{Yr as U,ft as W}from"./dist-0WeLsvey2.js";import{n as he}from"./dist-CuH7ikCn.js";import{t as G}from"./dist-BIGNzOeF2.js";import{i as ge,t as _e}from"./history-CPr-xzs6.js";import{t as ve}from"./use-workspace-BZqaUk-j.js";import{t as ye}from"./createLucideIcon-IawHI4re.js";import{n as be,s as xe,u as Se}from"./Mermaid-C8sqPdnq.js";import{t as K}from"./RegisteredAgentIcon-9IP3tgIz.js";import{t as q}from"./check-DDzb-wrU.js";import{t as Ce}from"./chevron-down-DT2zmBir.js";import{t as J}from"./chevron-right-D8IV-Ph_.js";import{o as we,r as Te,s as Ee}from"./prop-types-NQri49lM.js";import{t as De}from"./download-BDEHPw74.js";import{t as Oe}from"./list-plus-Lm4FbPM9.js";import{t as ke}from"./spinner-BfQfD3gf.js";import{c as Ae,n as je,o as Me,s as Ne,t as Pe}from"./comment-chips-Df5Rd0T0.js";import{t as Fe}from"./square-pen-zbdpw5xR.js";import{t as Ie}from"./terminal-4WK7jXvy.js";import{t as Le}from"./trash-2-DfA0xAM7.js";import{t as Re}from"./wrench-Bx808FyC.js";import{t as ze}from"./x-C1LzPj_K.js";import{f as Be,s as Ve}from"./doc-paths-CiuwB0oU.js";import{t as He}from"./external-link-CxH7AG7J.js";import{t as Ue}from"./badge-Bb7mpvxU.js";import{t as We}from"./skeleton-DIxLroLR.js";import{t as Ge}from"./textarea-BtqZ3yY1.js";import{n as Ke}from"./agent-presence-3JajMNAq.js";import{i as qe,n as Je}from"./chunk-BO2N2NFS-BVKS5mdX.js";import{n as Ye}from"./libesm-B7m5uxaw.js";import{a as Xe,d as Ze,f as Qe,n as $e,p as et,r as tt,s as nt,u as rt}from"./thread-client-Ox08BqB2.js";import{n as it}from"./thread-draft-staging-D-3dp2ov.js";var at=ye(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),ot=ye(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),st=ye(`shuffle`,[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]),ct=ye(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Y=h(),lt=new RegExp([`bypass`,`acceptedits`,`fullaccess`,`autoedit`,`yolo`,`danger`,`fullauto`,`autoaccept`,`autoapprove`,`autorun`,`skippermission`,`noconfirm`,`noprompt`,`unrestricted`,`allowall`].join(`|`)),ut=new Set([`auto`]);function dt(e){return e.toLowerCase().replace(/[^a-z]/g,``)}function ft(e){let t=dt(e.id),n=dt(e.name??``);return ut.has(t)||ut.has(n)?!0:lt.test(t)||lt.test(n)}var pt={"claude-acp":`asks`,"codex-acp":`self-managed`,cursor:`self-managed`,"pi-acp":`autonomous`};function mt(e,t,n){let r=n??(t==null?null:t.availableModes.find(e=>e.id===t.currentModeId)??null),i=pt[e];return i===void 0?t!=null&&t.availableModes.length>0?`self-managed`:`unknown`:i===`asks`&&r!==null&&ft(r)?`self-managed`:i}var X=e(f(),1),Z=n();function ht({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=gt(_t(r,i),t);if(!n)return X.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!X.isValidElement(n))return null;let o=n.props,s={...gt(a,o),ref:bt(a.ref,o.ref)};return X.cloneElement(n,s)}function gt(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];n===`className`?t[n]=[i,r].filter(Boolean).join(` `):n===`style`?t[n]={...i,...r}:n===`ref`?t[n]=bt(i,r):yt(n)&&typeof i==`function`&&typeof r==`function`?t[n]=vt(r,i):t[n]=r}}return t}function _t(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function vt(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function yt(e){return/^on[A-Z]/.test(e)}function bt(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var xt=8,St=64,Ct=0,wt=.5,Tt=180,Et=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),Dt={start:!1,end:!1},Ot={currentAnchorId:null,visibleMessageIds:[]};function kt({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return Dt;let i=Vt({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function At({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return Ot;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of jt(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+wt&&(u=e)}return l.length===0&&u===null?Ot:{currentAnchorId:u,visibleMessageIds:l}}function jt(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function Mt(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function Nt(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function Pt(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function Ft(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function It({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of jt(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function Lt({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=Rt(t,i),o=t.getBoundingClientRect().height,s=Wt(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function Rt(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function zt(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function Bt({content:e,scrollTop:t,spacer:n,viewport:r}){let i=Vt({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function Vt({content:e,spacer:t,viewport:n}){let r=jt(e,t),i=Ut(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function Ht(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function Ut(e){let t=window.getComputedStyle(e);return{end:Kt(t.paddingBlockEnd||t.paddingBottom),start:Kt(t.paddingBlockStart||t.paddingTop)}}function Wt(e){let t=e?.parentElement;return t?Ut(t):{end:0,start:0}}function Gt(e){if(!e)return 0;let t=window.getComputedStyle(e);return Kt(t.rowGap===`normal`?t.gap:t.rowGap)}function Kt(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function qt({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:s,contentRef:c,defaultScrollPositionAppliedRef:l,itemCountRef:u,messageElementsRef:d,modeRef:f,pendingScrollToMessageRef:p,prependRestoreRef:m,scrollMarginRef:h,scrollPreviousItemPeekRef:g,spacerGapRef:_,spacerHeightRef:v,spacerRef:y,viewportRef:b}=e,x=X.useCallback(e=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),o.current!==e&&(o.current=e,t()),e&&(s.current=window.setTimeout(()=>{s.current=null,o.current=!1,t()},Tt))},[t]),S=X.useCallback(e=>{let t=y.current;if(!t)return;let n=Math.max(0,Math.ceil(e));v.current!==n&&(v.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-_.current}px`:``)},[]),C=X.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=b.current;if(!a)return;let o=Math.max(0,e);if(Math.abs(a.scrollTop-o)<=wt){a.scrollTop=o,t();return}i&&x(!0),a.scrollTo({top:o,behavior:r}),n()},[t,n,x]),w=X.useCallback(({behavior:e=`auto`}={})=>b.current?(S(0),i.current=null,f.current=`free-scrolling`,C(0,{behavior:e}),r(),!0):!1,[r,C,S]),T=X.useCallback(({behavior:e=`auto`}={})=>{let t=b.current;return t?(S(0),i.current=null,f.current=a.current?`following-bottom`:`free-scrolling`,C(Ht(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,C,S]),E=X.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=h.current}={},{keepPreviousPeek:o=!1}={})=>{let s=c.current,l=b.current;if(!s||!l||!s.contains(e))return!1;let u=Lt({align:t,element:e,scrollMargin:o?a+g.current:a,spacer:y.current,viewport:l});return S(Bt({content:s,scrollTop:u,spacer:y.current,viewport:l})),m.current={element:e,viewportTop:zt(e,l)},f.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,C(u,{behavior:n}),r(),!0},[r,C,S]),D=X.useCallback(()=>{let e=i.current;return!e||!e.isConnected||f.current!==`anchored-to-message`?!1:E(e,{align:`start`},{keepPreviousPeek:!0})},[E]),O=X.useCallback((e,t)=>{let n=d.current.get(e);return n?(l.current=!0,E(n,t)?(p.current=null,!0):(p.current={messageId:e,options:t},!0)):u.current===0?(p.current={messageId:e,options:t},l.current=!0,!0):!1},[E]);return{flushPendingScrollToMessage:X.useCallback(()=>{let e=p.current;if(!e)return!1;let t=d.current.get(e.messageId);return!t||!E(t,e.options)?!1:(p.current=null,l.current=!0,!0)},[E]),reanchorToAnchoredMessage:D,scrollToElement:E,scrollToEnd:T,scrollToMessage:O,scrollToStart:w}}function Jt(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function Yt(e,t){return Jt(e,t)}function Xt(){return Jt(Ot,Qt)}function Zt(e,t){return e.start===t.start&&e.end===t.end}function Qt(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function $t({autoScroll:e,scrollEdgeThreshold:t,scrollMargin:n,scrollPreviousItemPeek:r}){let i=X.useRef(e),a=X.useRef(!1),o=X.useRef(null),s=X.useRef(!1),c=X.useRef(t),l=X.useRef(0),u=X.useRef(null),d=X.useRef(0),f=X.useRef(e?`following-bottom`:`free-scrolling`),p=X.useRef(new Map),m=X.useRef(null),h=X.useRef(null),g=X.useRef(null),_=X.useRef(r),v=X.useRef(!0),y=X.useRef(null),b=X.useRef(n),x=X.useRef(null),S=X.useRef(0),C=X.useRef(0),w=X.useRef(null),T=X.useRef(null),E=X.useRef(null),D=X.useRef(null),O=X.useRef(null),k=X.useRef(null),A=X.useRef(null),j=X.useRef(null),M=X.useRef(new Set),N=X.useRef(new WeakSet);return E.current===null&&(E.current=Yt(Dt,Zt)),j.current===null&&(j.current=Xt()),i.current=e,c.current=t,b.current=n,_.current=r,{autoScrollRef:i,autoscrollingRef:a,autoscrollingTimeoutRef:D,streamingTurnRef:g,contentRef:o,defaultScrollPositionAppliedRef:s,firstItemRef:u,itemCountRef:l,lastScrollTopRef:d,messageElementsRef:p,modeRef:f,pendingScrollFrameRef:x,pendingScrollToMessageRef:m,prependRestoreRef:h,preserveScrollOnPrependRef:v,rootRef:y,scrollEdgeThresholdRef:c,scrollMarginRef:b,scrollPreviousItemPeekRef:_,spacerGapRef:S,spacerHeightRef:C,spacerRef:w,stateFrameRef:T,stateStore:E.current,viewportRef:O,visibilityFrameRef:k,visibilityObserverRef:A,visibilityStore:j.current,visibleMessageIdsRef:M,handledScrollAnchorsRef:N}}function en(e,t){return X.useCallback(n=>{e.current=n,n&&t()},[e,t])}function tn({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=xt,scrollPreviousItemPeek:r=St,scrollMargin:i=Ct}){let a=$t({autoScroll:e,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:o,autoScrollRef:s,autoscrollingRef:c,autoscrollingTimeoutRef:l,contentRef:u,defaultScrollPositionAppliedRef:d,firstItemRef:f,itemCountRef:p,lastScrollTopRef:m,messageElementsRef:h,modeRef:g,pendingScrollFrameRef:_,pendingScrollToMessageRef:v,prependRestoreRef:y,preserveScrollOnPrependRef:b,rootRef:x,scrollEdgeThresholdRef:S,scrollMarginRef:C,scrollPreviousItemPeekRef:w,spacerGapRef:T,spacerHeightRef:E,spacerRef:D,stateFrameRef:O,stateStore:k,viewportRef:A,visibilityFrameRef:j,visibilityObserverRef:M,visibilityStore:N,visibleMessageIdsRef:P,handledScrollAnchorsRef:F}=a,I=X.useRef(t);I.current!==t&&(I.current=t,d.current=!1);let L=X.useCallback(e=>{let t=x.current,n=A.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=c.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),ee=X.useCallback(e=>{let t=A.current?.scrollTop??0,n=t<m.current-wt;m.current=t,s.current&&!e.end&&g.current!==`settling-jump`&&g.current!==`anchored-to-message`?g.current=`following-bottom`:g.current===`following-bottom`&&e.end&&n&&!c.current&&(g.current=`free-scrolling`)},[]),te=X.useCallback(()=>{let e=kt({content:u.current,scrollEdgeThreshold:S.current,spacer:D.current,viewport:A.current});ee(e);let t=g.current===`following-bottom`?{...e,end:!1}:e;L(t),k.setSnapshot(t)},[ee,k,L]),R=X.useCallback(()=>{O.current===null&&(O.current=window.requestAnimationFrame(()=>{O.current=null,te()}))},[te]),z=X.useCallback(()=>{N.hasListeners()&&j.current===null&&(j.current=window.requestAnimationFrame(()=>{j.current=null,N.hasListeners()&&N.setSnapshot(At({content:u.current,scrollMargin:C.current,scrollPreviousItemPeek:w.current,spacer:D.current,viewport:A.current,visibleMessageIds:P.current}))}))},[N]),{flushPendingScrollToMessage:ne,reanchorToAnchoredMessage:re,scrollToElement:ie,scrollToEnd:B,scrollToMessage:ae,scrollToStart:oe}=qt({refs:a,commitScrollState:te,scheduleStateCommit:R,scheduleVisibilitySync:z}),se=X.useCallback(()=>{let e=y.current,t=A.current;if(!e||!t||!e.element.isConnected)return!1;let n=zt(e.element,t)-e.viewportTop;return Math.abs(n)<=wt?!1:(t.scrollTop+=n,e.viewportTop=zt(e.element,t),R(),z(),!0)},[R,z]),ce=X.useCallback(()=>{let e=u.current,t=A.current;if(!e||!t){y.current=null;return}let n=It({content:e,spacer:D.current,viewport:t});y.current=n?{element:n,viewportTop:zt(n,t)}:null},[]),le=X.useCallback(()=>{_.current===null&&(_.current=window.requestAnimationFrame(()=>{_.current=null,ne()&&ce()}))},[ce,ne]),ue=X.useCallback(()=>{if(!t||d.current||p.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=u.current,n=A.current,r=t&&n?Ft(jt(t,D.current)):null;if(!t||!n||!r)e=B({behavior:`auto`});else{let i=Rt(r,n);e=Vt({content:t,spacer:D.current,viewport:n})-i<=n.clientHeight?B({behavior:`auto`}):ie(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?B({behavior:`auto`}):oe({behavior:`auto`});return e?(d.current=!0,!0):!1},[t,ie,B,oe]),de=X.useCallback(()=>{let e=u.current;if(!e)return;let t=jt(e,D.current),n=p.current,r=f.current;p.current=t.length,f.current=t[0]??null,(()=>{if(ne())return;if(n===0){if(ue()||t.length>0&&s.current&&B({behavior:`auto`}))return;te(),z();return}let e=r?t.indexOf(r):-1;if(b.current&&e>0){se();return}if(t.length>n){let e=Mt(t,n);if(e){if(s.current&&g.current===`following-bottom`&&Pt(t,n)){B({behavior:`auto`});return}ie(e,{align:`start`},{keepPreviousPeek:!0}),F.current.add(e);return}}if(t.length===n){let e=Nt(t,F.current);if(e){ie(e,{align:`start`},{keepPreviousPeek:!0}),F.current.add(e);return}}g.current===`following-bottom`&&s.current?B({behavior:`auto`}):(te(),z())})(),ce()},[ue,ce,te,ne,se,z,ie,B]),fe=X.useCallback(()=>{if(g.current===`following-bottom`&&s.current){B({behavior:`auto`});return}let e=E.current;if(re()){s.current&&e>0&&E.current===0&&B({behavior:`auto`});return}R(),z()},[re,R,z,B]),pe=X.useCallback(()=>{let e=A.current;if(!(!e||!N.hasListeners())){if(typeof IntersectionObserver>`u`){z();return}M.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?P.current.add(e):P.current.delete(e))}z()},{root:e,rootMargin:`${-(C.current+w.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),h.current.forEach(e=>{M.current?.observe(e)}),z()}},[z,N]),me=X.useCallback(()=>{j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null),M.current?.disconnect(),M.current=null,P.current.clear(),N.setSnapshot(Ot)},[N]),V=X.useCallback((e,t,n)=>{if(t){h.current.set(e,t),M.current?.observe(t),z(),v.current?.messageId===e&&le();return}n&&h.current.get(e)===n&&(h.current.delete(e),P.current.delete(e),M.current?.unobserve(n),z())},[le,z]),H=X.useCallback(()=>{(g.current===`following-bottom`||g.current===`anchored-to-message`||g.current===`settling-jump`)&&(o.current=null,g.current=`free-scrolling`)},[]),U=X.useCallback(()=>L(k.getSnapshot()),[k,L]),W=en(x,U),he=en(A,U),G=X.useCallback(e=>{u.current=e},[]),ge=X.useCallback(e=>{D.current=e,T.current=Gt(e?.parentElement??null)},[]),_e=X.useCallback(()=>{te(),z(),ce()},[ce,te,z]),ve=X.useMemo(()=>({handleContentChange:de,handleResize:fe,observeVisibility:pe,preserveScrollOnPrependRef:b,scrollToEnd:B,scrollToMessage:ae,scrollToStart:oe,setContentElement:G,setRootElement:W,setSpacerElement:ge,setViewportElement:he,stateStore:k,syncAfterScroll:_e,unobserveVisibility:me,userScrollIntent:H,viewportRef:A,visibilityStore:N}),[de,fe,pe,B,ae,oe,G,W,ge,he,k,_e,me,H,N]);return X.useLayoutEffect(()=>{ue()},[ue]),X.useEffect(()=>()=>{O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),M.current?.disconnect(),M.current=null},[]),X.useLayoutEffect(()=>{if(e&&g.current===`following-bottom`&&p.current>0){B({behavior:`auto`});return}te()},[e,te,B]),{context:ve,registerMessage:V}}function nn(e){let t=X.useRef(e);return t.current=e,t}var rn=X.createContext(null),an=X.createContext(null);function on(){let e=X.useContext(rn);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function sn(){let e=X.useContext(an);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function cn(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=on();return X.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function ln({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=tn({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,Z.jsx)(rn.Provider,{value:o,children:(0,Z.jsx)(an.Provider,{value:s,children:t})})}function un({children:e,...t}){let{setRootElement:n}=on();return(0,Z.jsx)(`div`,{ref:n,...t,children:e})}function dn({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:o=!0,ref:s,role:c,tabIndex:l,...u}){let{handleResize:d,preserveScrollOnPrependRef:f,setViewportElement:p,syncAfterScroll:m,userScrollIntent:h,viewportRef:g}=on();f.current=o;let _=X.useCallback(e=>{p(e),bt(s)?.(e)},[s,p]);function v(e){m(),r?.(e)}function y(e){h(),a?.(e)}function b(e){h(),i?.(e)}function x(e){Et.has(e.key)&&h(),n?.(e)}return X.useEffect(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(d)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[d,g]),(0,Z.jsx)(`div`,{ref:_,role:c??`region`,"aria-label":e??`Messages`,tabIndex:l??0,onKeyDown:x,onScroll:v,onTouchMove:b,onWheel:y,...u,children:t})}function fn({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:o,handleResize:s,setContentElement:c,setSpacerElement:l}=on(),u=X.useRef(null),d=X.useCallback(e=>{u.current=e,c(e),bt(n)?.(e)},[n,c]);return X.useLayoutEffect(()=>{let e=u.current;if(!e||(o(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{o()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[o]),X.useEffect(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[s]),(0,Z.jsxs)(`div`,{ref:d,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,Z.jsx)(`div`,{ref:l,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function pn({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=sn(),a=X.useRef(null);return(0,Z.jsx)(`div`,{ref:X.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),bt(t)?.(n)},[e,t,i]),"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function mn({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:o=`button`,...s}){let{scrollToEnd:c,scrollToStart:l,stateStore:u}=on(),d=nn(r),f=X.useCallback(e=>u.subscribe(e),[u]),p=X.useCallback(()=>{let e=u.getSnapshot();return n===`start`?e.start:e.end},[n,u]),m=X.useSyncExternalStore(f,p,p),h=X.useCallback(t=>{m&&(d.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?l({behavior:e}):c({behavior:e})))},[e,n,m,d,c,l]);return ht({defaultTagName:`button`,props:gt({type:o,inert:!m,tabIndex:m?a:-1,children:t??(0,Z.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:h},s),render:i,state:{active:m,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var hn={Provider:ln,Root:un,Viewport:dn,Content:fn,Item:pn,Button:mn};function gn(e){let t=(0,Y.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(hn.Provider,{...e}),t[0]=e,t[1]=n),n}function _n(e){let t=(0,Y.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=v(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(hn.Root,{"data-slot":`message-scroller`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function vn(e){let t=(0,Y.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=v(`size-full min-h-0 min-w-0 scrollbar-thin overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(hn.Viewport,{"data-slot":`message-scroller-viewport`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function yn(e){let t=(0,Y.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=v(`flex h-max min-h-full flex-col gap-6`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(hn.Content,{"data-slot":`message-scroller-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bn(e){let t=(0,Y.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scrollAnchor:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?!1:i,o;t[4]===n?o=t[5]:(o=v(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(hn.Item,{"data-slot":`message-scroller-item`,scrollAnchor:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function xn(e){let t=(0,Y.c)(25),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({direction:o,className:r,children:n,render:a,variant:s,size:c,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=o===void 0?`end`:o,u=s===void 0?`secondary`:s,d=c===void 0?`icon-sm`:c,f;t[8]===r?f=t[9]:(f=v(`absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180`,r),t[8]=r,t[9]=f);let m;t[10]!==a||t[11]!==d||t[12]!==u?(m=a??(0,Z.jsx)(b,{variant:u,size:d}),t[10]=a,t[11]=d,t[12]=u,t[13]=m):m=t[13];let h;t[14]!==n||t[15]!==l?(h=n??(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Se,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:l===`end`?(0,Z.jsx)(p,{id:`EQXPXf`}):(0,Z.jsx)(p,{id:`b1FDss`})})]}),t[14]=n,t[15]=l,t[16]=h):h=t[16];let g;return t[17]!==l||t[18]!==i||t[19]!==d||t[20]!==f||t[21]!==m||t[22]!==h||t[23]!==u?(g=(0,Z.jsx)(hn.Button,{"data-slot":`message-scroller-button`,"data-direction":l,"data-variant":u,"data-size":d,direction:l,className:f,render:m,...i,children:h}),t[17]=l,t[18]=i,t[19]=d,t[20]=f,t[21]=m,t[22]=h,t[23]=u,t[24]=g):g=t[24],g}var Sn=new Map,Cn=0;function wn(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function Tn(){let e=wn();for(let[t,n]of Sn)t((e-n)/1e3);if(Sn.size===0){Cn=0;return}Cn=requestAnimationFrame(Tn)}function En(e){return Sn.set(e,wn()),Cn===0&&typeof requestAnimationFrame==`function`&&(Cn=requestAnimationFrame(Tn)),()=>{Sn.delete(e),Sn.size===0&&Cn!==0&&(cancelAnimationFrame(Cn),Cn=0)}}var Q=40,Dn=15,On=15,$=12.4,kn={blobby:0,triangle:1,square:2,sparkle:3,pentagon:4,hexagon:5,dot:6,star5:7,clover:8,star6:9,scallop:10,comma:11,diamond:12,cloud:13},An=`M15.34 2.91C15.96 2.77 16.69 2.65 17.33 2.63C17.97 2.62 18.72 2.71 19.36 2.84C20.00 2.97 20.79 3.10 21.33 3.44C21.88 3.79 22.38 4.46 22.75 5.01C23.12 5.56 23.42 6.30 23.66 6.89C23.90 7.49 24.06 8.18 24.26 8.73C24.45 9.28 24.66 9.84 24.89 10.34C25.12 10.84 25.39 11.36 25.68 11.85C25.97 12.34 26.46 12.87 26.71 13.41C26.96 13.94 27.12 14.61 27.26 15.21C27.39 15.80 27.54 16.52 27.55 17.14C27.56 17.76 27.43 18.47 27.30 19.09C27.16 19.71 26.99 20.43 26.72 21.01C26.46 21.58 26.05 22.20 25.64 22.69C25.22 23.17 24.65 23.63 24.15 24.02C23.66 24.41 23.09 24.82 22.55 25.14C22.02 25.45 21.39 25.74 20.84 25.99C20.28 26.25 19.65 26.52 19.08 26.70C18.50 26.89 17.83 27.05 17.23 27.15C16.63 27.26 15.95 27.34 15.34 27.37C14.73 27.39 14.03 27.40 13.42 27.33C12.81 27.26 12.12 27.10 11.54 26.92C10.95 26.73 10.30 26.47 9.75 26.18C9.20 25.90 8.62 25.51 8.11 25.15C7.61 24.80 7.06 24.37 6.60 23.94C6.15 23.52 5.68 23.00 5.28 22.52C4.89 22.03 4.47 21.45 4.13 20.92C3.79 20.38 3.41 19.75 3.16 19.16C2.91 18.57 2.68 17.86 2.56 17.23C2.45 16.60 2.42 15.85 2.45 15.21C2.48 14.56 2.60 13.83 2.76 13.22C2.93 12.60 3.18 11.91 3.47 11.35C3.77 10.80 4.24 10.23 4.63 9.75C5.01 9.27 5.45 8.74 5.89 8.34C6.34 7.95 6.93 7.61 7.40 7.27C7.88 6.94 8.38 6.57 8.83 6.25C9.29 5.93 9.79 5.56 10.27 5.25C10.75 4.95 11.29 4.61 11.81 4.33C12.32 4.05 12.92 3.74 13.49 3.52C14.05 3.29 14.73 3.05 15.34 2.91Z`,jn=2.26,Mn=`M76.4805 11.041C99.1124 7.04848 118.186 8.33731 134.31 14.4102C150.369 20.4588 164.177 31.5065 175.929 48.1846L176.446 48.9199C187.179 64.5695 195.653 90.2797 191.323 112.539C186.344 138.13 169.219 160.474 150.105 178.107C131.113 195.629 111.037 207.691 101.728 212.842C98.3779 214.693 93.3915 217.316 88.0508 217.316C85.74 217.316 83.6583 216.814 81.7607 215.855L81.3838 215.658C75.1451 212.251 73.9381 205.91 73.376 198.68L73.2705 197.222C72.953 192.5 72.5095 188.039 71.1416 184.247C69.5395 179.806 66.852 176.673 63.1406 174.227L63.1377 174.225C41.2846 159.832 21.8495 144.226 13.3828 121.439L13.3818 121.438L13.0146 120.427C5.46004 99.1404 7.95139 74.5467 20.4404 52.7568L20.4414 52.7549C33.2945 30.3176 54.4303 14.925 76.4785 11.041H76.4805Z`;function Nn(e){let t=t=>{let n=e[(t-1+Q)%Q],r=e[(t+1)%Q];return[(r[0]-n[0])*.16,(r[1]-n[1])*.16]},n=`M${e[0][0].toFixed(2)} ${e[0][1].toFixed(2)}`;for(let r=0;r<Q;r++){let i=e[r],a=e[(r+1)%Q],o=t(r),s=t((r+1)%Q);n+=`C${(i[0]+o[0]).toFixed(2)} ${(i[1]+o[1]).toFixed(2)} ${(a[0]-s[0]).toFixed(2)} ${(a[1]-s[1]).toFixed(2)} ${a[0].toFixed(2)} ${a[1].toFixed(2)}`}return`${n}Z`}function Pn(e,t){let n=e.map(e=>e[0]),r=e.map(e=>e[1]),i=Math.min(...n),a=Math.max(...n),o=Math.min(...r),s=Math.max(...r),c=t*2/Math.max(a-i,s-o);return e.map(e=>[Dn+(e[0]-(i+a)/2)*c,On+(e[1]-(o+s)/2)*c])}function Fn(e,t,n){let r=e;for(let e=0;e<t;e++){let e=r;r=e.map((t,r)=>{let i=e[(r-1+Q)%Q],a=e[(r+1)%Q];return[t[0]*(1-n)+(i[0]+a[0])/2*n,t[1]*(1-n)+(i[1]+a[1])/2*n]})}return r}function In(){if(typeof document>`u`)return null;let e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.style.position=`absolute`,e.style.visibility=`hidden`;let t=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);if(e.appendChild(t),document.body.appendChild(e),typeof t.getTotalLength!=`function`||typeof t.getPointAtLength!=`function`)return e.remove(),null;try{t.setAttribute(`d`,`M0 0L1 0`),t.getPointAtLength(0)}catch{return e.remove(),null}return t}function Ln(e){function t(t,n){e.setAttribute(`d`,t);let r=e.getTotalLength(),i=[];for(let t=0;t<n;t++){let a=e.getPointAtLength(r*t/n);i.push([a.x,a.y])}return i}function n(e){let t=0,n=0;for(let r of e)t+=r[0],n+=r[1];t/=e.length,n/=e.length;let r=Array(Q).fill(0),i=Array(Q).fill(1/0);for(let a of e){let e=Math.atan2(a[1]-n,a[0]-t),o=Math.hypot(a[0]-t,a[1]-n),s=Math.round((e+Math.PI/2)/(2*Math.PI)*Q);s=(s%Q+Q)%Q,o>r[s]&&(r[s]=o),o<i[s]&&(i[s]=o)}return{cx:t,cy:n,hi:r,lo:i}}function r(e,t,n){return e.map((e,r)=>{let i=-Math.PI/2+r*2*Math.PI/Q;return[t+Math.cos(i)*e,n+Math.sin(i)*e]})}function i(e,i){let{cx:a,cy:o,hi:s,lo:c}=n(t(e,1080)),l=s.map((e,t)=>(e+c[t])/2),u=s.reduce((e,t,n)=>e+(t-c[n]),0)/Q,d=r(l,a,o),f=d.map(e=>e[0]),p=d.map(e=>e[1]),m=i*2/Math.max(Math.max(...f)-Math.min(...f),Math.max(...p)-Math.min(...p));return{path:Nn(Pn(d,i)),strokeWidth:u*m}}function a(e,i){let{cx:a,cy:o,hi:s}=n(t(e,1400));return Nn(Pn(r(s.map((e,t)=>s[t]*.86+(s[(t-1+Q)%Q]+s[(t+1)%Q])*.07),a,o),i))}function o(e,n){return Nn(Pn(t(e,Q),n))}function s(e,n,r){return Nn(Fn(t(e,Q),n,r))}function c(e,n,r){return Nn(t(e,Q).map(e=>[Dn+(e[0]-Dn)*n,On+(e[1]-On)*r]))}function l(e,n,r=1){return Nn(t(e,Q).map((e,t)=>{let i=t*2*Math.PI/Q,a=1+r*(.035*Math.sin(i*3+n)+.025*Math.sin(i*5+n*2)+.018*Math.sin(i*2-n));return[Dn+(e[0]-Dn)*a,On+(e[1]-On)*a]}))}function u(e,t,n,r=0){let i=[];for(let n=0;n<e;n++){let a=-Math.PI/2+n*2*Math.PI/e+r;i.push([Dn+Math.cos(a)*t,On+Math.sin(a)*t])}let a=(e,t)=>{let n=t[0]-e[0],r=t[1]-e[1],i=Math.hypot(n,r);return[n/i,r/i]},o=``;for(let t=0;t<e;t++){let r=i[t],s=a(r,i[(t-1+e)%e]),c=a(r,i[(t+1)%e]),l=[r[0]+s[0]*n,r[1]+s[1]*n],u=[r[0]+c[0]*n,r[1]+c[1]*n];o+=`${t?`L`:`M`}${l[0].toFixed(2)} ${l[1].toFixed(2)}A${n} ${n} 0 0 1 ${u[0].toFixed(2)} ${u[1].toFixed(2)}`}return`${o}Z`}function d(e,n,r,i){let a=``;for(let t=0;t<e*2;t++){let i=-Math.PI/2+t*Math.PI/e,o=t%2?r:n;a+=`${t?`L`:`M`}${(Dn+Math.cos(i)*o).toFixed(2)} ${(On+Math.sin(i)*o).toFixed(2)}`}return Nn(Pn(Fn(t(`${a}Z`,Q),i,.3),n))}function f(e,n,r){let i=t=>{let n=-Math.PI/2+t*Math.PI/2;return[Dn+Math.cos(n)*e,On+Math.sin(n)*e]},a=`M${i(0)[0].toFixed(2)} ${i(0)[1].toFixed(2)}`;for(let e=0;e<4;e++){let t=-Math.PI/2+(e+.5)*Math.PI/2,r=[Dn+Math.cos(t)*n,On+Math.sin(t)*n],o=i((e+1)%4);a+=`Q${r[0].toFixed(2)} ${r[1].toFixed(2)} ${o[0].toFixed(2)} ${o[1].toFixed(2)}`}return Nn(Pn(Fn(t(`${a}Z`,Q),r,.34),e))}function p(e,t,n,r){let i=[];for(let a=0;a<Q;a++){let o=-Math.PI/2+a*2*Math.PI/Q,s=(1+Math.cos(e*(o+Math.PI/2)))/2,c=n+(t-n)*s**r;i.push([Dn+Math.cos(o)*c,On+Math.sin(o)*c])}return Nn(i)}function m(e){let t=[];for(let n=0;n<Q;n++){let r=-Math.PI/2+n*2*Math.PI/Q;t.push([Dn+Math.cos(r)*e,On+Math.sin(r)*e])}return Nn(t)}return{silhouette:i,hull:a,fit:o,soften:s,squeeze:c,wobble:l,poly:u,star:d,sparkle:f,lobed:p,dot:m,circle:(e,t,n)=>`M${e-n} ${t}a${n} ${n} 0 1 0 ${n*2} 0a${n} ${n} 0 1 0 ${-n*2} 0`}}function Rn(){let e=In();if(e===null)return null;try{let t=Ln(e),n=t.silhouette(y,12.55);return{paths:[n.path,t.wobble(t.poly(3,$*1.16,$*.5,.1),1.1),t.wobble(t.poly(4,$*1.02,$*.44),2.3),t.wobble(t.sparkle($*1.24,$*.1,3),3.7),t.wobble(t.poly(5,$*1,$*.38),4.9),t.wobble(t.poly(6,$*.98,$*.34),6.2),t.wobble(t.dot($*.34),2.8),t.wobble(t.star(5,$*1.14,$*.68,6),7.4),t.wobble(t.soften(t.lobed(4,$*1.16,$*.46,.5),3,.3),8.1),t.wobble(t.star(6,$*1.2,$*.42,4),9.3),t.wobble(t.lobed(8,$*1.06,$*.74,.6),10.5),t.wobble(t.soften(t.fit(Mn,$*1.12),3,.22),11.7,.3),t.wobble(t.squeeze(t.poly(4,$*1.3,$*.2),.84,1),12.9),t.wobble(t.hull(t.circle(10.2,16,4.3)+t.circle(15,12,5.5)+t.circle(20,15.4,4.4)+t.circle(15,17.4,5.2),12.4),13.6)],strokeWidth:n.strokeWidth}}finally{e.ownerSVGElement?.remove()}}var zn;function Bn(){return zn===void 0&&(zn=Rn()),zn}var Vn=/-?\d+(?:\.\d+)?/g;function Hn(e){return{fragments:e[0].split(Vn),numbers:e.map(e=>(e.match(Vn)??[]).map(Number))}}function Un(e,t){let n=``;for(let r=0;r<t.length;r++)n+=e[r]+t[r].toFixed(2);return n+e[t.length]}function Wn(e){return e<.5?2*e*e:1-2*(1-e)**2}var Gn=.58;function Kn(e,t,n,r){let i=t-1,a=n/i,o=e%n,s=Math.max(0,Math.min(i-1,Math.floor(o/a))),c=o%a/a;return{from:s,to:s+1,t:Wn(r?Math.min(1,c/Gn):c)}}var qn=kn,Jn=[qn.blobby,qn.triangle,qn.square,qn.sparkle,qn.comma,qn.pentagon,qn.hexagon,qn.blobby],Yn={[qn.comma]:-2.9},Xn={leftCx:10.9,rightCx:18.1,cy:16,rx:1.25,ry:1.9},Zn=20,Qn=8.4;function $n(e){let t=(0,Y.c)(22),{status:n,className:r,testId:i}=e,{_:a}=m(),o=(0,X.useRef)(null),s=(0,X.useRef)(null),c=be(),l,u;t[0]===c?(l=t[1],u=t[2]):(l=()=>{let e=o.current;if(e===null)return;if(c){e.setAttribute(`d`,An),e.setAttribute(`stroke-width`,String(jn)),s.current?.removeAttribute(`transform`);return}let t=Bn();if(t===null)return;e.setAttribute(`stroke-width`,t.strokeWidth.toFixed(2));let n=Hn(t.paths),r=NaN,i=``;return En(t=>{let{from:a,to:o,t:c}=Kn(t,Jn.length,Qn,!0),l=n.numbers[Jn[a]],u=n.numbers[Jn[o]],d=l.map((e,t)=>e+(u[t]-e)*c),f=Un(n.fragments,d);f!==i&&(i=f,e.setAttribute(`d`,f));let p=s.current;if(p===null)return;let m=Yn[Jn[a]]??0,h=m+((Yn[Jn[o]]??0)-m)*c;h!==r&&(r=h,p.setAttribute(`transform`,`translate(0 ${h.toFixed(2)})`))})},u=[c],t[0]=c,t[1]=l,t[2]=u),(0,X.useEffect)(l,u);let[d,f]=(0,X.useState)(``),p,h;t[3]===a?(p=t[4],h=t[5]):(p=()=>{f(a({id:`DCSSZt`}))},h=[a],t[3]=a,t[4]=p,t[5]=h),(0,X.useEffect)(p,h);let g;t[6]===r?g=t[7]:(g=v(`ok-working-enter flex items-center gap-2`,r),t[6]=r,t[7]=g);let _;t[8]===d?_=t[9]:(_=(0,Z.jsx)(`span`,{"aria-live":`polite`,className:`sr-only`,role:`status`,children:d}),t[8]=d,t[9]=_);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`path`,{ref:o,d:An,fill:`none`,stroke:`currentColor`,strokeWidth:jn,strokeLinejoin:`round`,strokeLinecap:`round`}),t[10]=y):y=t[10];let b;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(`span`,{className:`grid shrink-0 place-items-center text-muted-foreground/80`,children:(0,Z.jsx)(`svg`,{width:Zn,height:Zn,viewBox:`0 0 30 30`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,className:`ok-working-pop ok-working-squint block shrink-0 overflow-visible`,children:(0,Z.jsxs)(`g`,{className:`ok-working-group`,children:[y,(0,Z.jsxs)(`g`,{ref:s,children:[(0,Z.jsx)(`ellipse`,{className:`ok-working-eye`,cx:Xn.leftCx,cy:Xn.cy,rx:Xn.rx,ry:Xn.ry,fill:`currentColor`}),(0,Z.jsx)(`ellipse`,{className:`ok-working-eye`,cx:Xn.rightCx,cy:Xn.cy,rx:Xn.rx,ry:Xn.ry,fill:`currentColor`})]})]})})}),t[11]=b):b=t[11];let x;t[12]===n?x=t[13]:(x=(0,Z.jsx)(`span`,{className:`shimmer`,children:n}),t[12]=n,t[13]=x);let S;t[14]!==n||t[15]!==x?(S=(0,Z.jsx)(`span`,{className:`ok-working-status text-sm`,children:x},n),t[14]=n,t[15]=x,t[16]=S):S=t[16];let C;return t[17]!==S||t[18]!==g||t[19]!==_||t[20]!==i?(C=(0,Z.jsxs)(`div`,{className:g,"data-testid":i,children:[_,b,S]}),t[17]=S,t[18]=g,t[19]=_,t[20]=i,t[21]=C):C=t[21],C}function er(e){let t=[];for(let n of e.options)`value`in n?t.push(n):t.push(...n.options);return t}function tr(e){let t=er(e),n=t.find(t=>t.value===e.currentValue);if(n===void 0||n.value!==`default`||!n.description)return null;let r=t.find(e=>e.value!==n.value&&e.description===n.description);return r===void 0?null:G._({id:`GK5Ft_`,values:{0:r.name}})}function nr(e,t,n){return e===`claude-acp`&&t===`effort`&&n===`default`?G._({id:`3SWNP8`}):e===`codex-acp`&&t===`collaboration_mode`&&n===`default`?G._({id:`R6ABfU`}):null}var rr=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),ir=700*1024;function ar(e){if(e.kind===`unsupported-type`)return e.mimeType.startsWith(`image/`)?`Only PNG, JPEG, GIF, and WebP images are supported (got ${e.mimeType}).`:`Unsupported file type: ${e.mimeType||`unknown`}.`;if(e.kind===`outside-workspace`)return`${e.name} is outside the workspace. Move it into your project first.`;if(e.kind===`unknown-path`)return`${e.name} has no resolvable path — the agent can only read files inside the workspace.`;let t=(e.limitBytes/(1024*1024)).toFixed(1);return`File is too large (${(e.sizeBytes/(1024*1024)).toFixed(1)} MB) — max ${t} MB per attachment.`}async function or(e){let t=await new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`FileReader failed`)),r.onload=()=>{let e=r.result;if(typeof e!=`string`){n(Error(`FileReader returned non-string result`));return}t(e)},r.readAsDataURL(e)}),n=t.indexOf(`,`);return{data:n>=0?t.slice(n+1):t,mimeType:e.type||`application/octet-stream`,name:e.name||`image`,sizeBytes:e.size}}async function sr(e){let t=e.type||``;if(!rr.has(t))return{ok:!1,error:{kind:`unsupported-type`,mimeType:t}};if(e.size>716800)return{ok:!1,error:{kind:`too-large`,sizeBytes:e.size,limitBytes:ir}};let n=await or(e);return{ok:!0,part:{kind:`image`,data:n.data,mimeType:n.mimeType,name:n.name,sizeBytes:n.sizeBytes}}}function cr(e){return ur(e,e=>e.type.startsWith(`image/`))}function lr(e){return ur(e,e=>e.size>0)}function ur(e,t){if(e===null)return[];let n=new Set,r=[],i=e=>{if(e===null||!t(e))return;let i=`${e.name}|${e.size}|${e.lastModified??0}`;n.has(i)||(n.add(i),r.push(e))},a=e.items;if(a)for(let e=0;e<a.length;e+=1){let t=a[e];t&&t.kind===`file`&&i(t.getAsFile())}let o=e.files;if(o)for(let e=0;e<o.length;e+=1)i(o[e]??null);return r}function dr(e,t,n){let r=n===`\\`?e.toLowerCase():e,i=n===`\\`?t.toLowerCase():t,a=i.endsWith(n)?i:`${i}${n}`;if(r===i)return``;if(!r.startsWith(a))return null;let o=e.slice(a.length);return n===`\\`?o.replaceAll(`\\`,`/`):o}async function fr(e,t={}){if((e.type||``).startsWith(`image/`))return sr(e);let n=t.absPathOf,r=t.workspaceContentDir,i=t.pathSeparator??`/`,a=e.name||`attachment`;if(n===void 0||r===void 0||r===``)return{ok:!1,error:{kind:`unknown-path`,name:a}};let o=n(e);if(o===null||o===``)return{ok:!1,error:{kind:`unknown-path`,name:a}};let s=dr(o,r,i);return s===null?{ok:!1,error:{kind:`outside-workspace`,name:a}}:{ok:!0,part:{kind:`file`,path:s,name:a}}}var pr=3,mr=pr*2+2;function hr(e){let t=e.split(`
|
|
2
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Dr as r,Fn as i,In as a,Ln as o,Nn as s,Wn as c,a as l,kn as u,lr as d}from"./DocumentContext-CDzXPsOB.js";import{t as f}from"./react-f2sANaYj.js";import{n as p,r as m}from"./dist-Nvb76hAm.js";import{t as h}from"./compiler-runtime-BfE3aGVn.js";import{i as g,s as _}from"./local-menu-action-bus-IjTSMx8U.js";import{t as v}from"./utils-CPqDy6Hr.js";import{t as y}from"./mascot-outline-CtS592mc.js";import{t as b}from"./button-CA0dewJJ.js";import{i as x,n as S,t as C}from"./tooltip-DPvMEqsq.js";import{c as w,i as T,t as E}from"./dialog-CeTXzamA.js";import{st as D}from"./CodeMirrorPropInput-Br0HbEoO.js";import{a as O,c as k,d as A,f as j,l as M,m as N,n as P,o as F,p as I,r as L,t as ee}from"./dropdown-menu-C8skJt-Y.js";import{a as te,b as R,c as z,d as ne,f as re,i as ie,l as B,m as ae,n as oe,o as se,p as ce,r as le,s as ue,t as de,u as fe,x as pe,y as me}from"./progress-BNUUReLc.js";import{n as V}from"./separator-DcX0NiAC.js";import{t as H}from"./switch-BeP1gMN6.js";import{Yr as U,ft as W}from"./dist-0WeLsvey2.js";import{n as he}from"./dist-CuH7ikCn.js";import{t as G}from"./dist-BIGNzOeF2.js";import{i as ge,t as _e}from"./history-CPr-xzs6.js";import{t as ve}from"./use-workspace-BZqaUk-j.js";import{t as ye}from"./createLucideIcon-IawHI4re.js";import{n as be,s as xe,u as Se}from"./Mermaid-C8sqPdnq.js";import{t as K}from"./RegisteredAgentIcon-9IP3tgIz.js";import{t as q}from"./check-DDzb-wrU.js";import{t as Ce}from"./chevron-down-DT2zmBir.js";import{t as J}from"./chevron-right-D8IV-Ph_.js";import{o as we,r as Te,s as Ee}from"./prop-types-NQri49lM.js";import{t as De}from"./download-BDEHPw74.js";import{t as Oe}from"./list-plus-Lm4FbPM9.js";import{t as ke}from"./spinner-BfQfD3gf.js";import{c as Ae,n as je,o as Me,s as Ne,t as Pe}from"./comment-chips-DUZfnEGs.js";import{t as Fe}from"./square-pen-zbdpw5xR.js";import{t as Ie}from"./terminal-4WK7jXvy.js";import{t as Le}from"./trash-2-DfA0xAM7.js";import{t as Re}from"./wrench-Bx808FyC.js";import{t as ze}from"./x-C1LzPj_K.js";import{f as Be,s as Ve}from"./doc-paths-CiuwB0oU.js";import{t as He}from"./external-link-CxH7AG7J.js";import{t as Ue}from"./badge-Bb7mpvxU.js";import{t as We}from"./skeleton-DIxLroLR.js";import{t as Ge}from"./textarea-BtqZ3yY1.js";import{n as Ke}from"./agent-presence-3JajMNAq.js";import{i as qe,n as Je}from"./chunk-BO2N2NFS-BVKS5mdX.js";import{n as Ye}from"./libesm-B7m5uxaw.js";import{a as Xe,d as Ze,f as Qe,n as $e,p as et,r as tt,s as nt,u as rt}from"./thread-client-Ox08BqB2.js";import{n as it}from"./thread-draft-staging-D-3dp2ov.js";var at=ye(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),ot=ye(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),st=ye(`shuffle`,[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]),ct=ye(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Y=h(),lt=new RegExp([`bypass`,`acceptedits`,`fullaccess`,`autoedit`,`yolo`,`danger`,`fullauto`,`autoaccept`,`autoapprove`,`autorun`,`skippermission`,`noconfirm`,`noprompt`,`unrestricted`,`allowall`].join(`|`)),ut=new Set([`auto`]);function dt(e){return e.toLowerCase().replace(/[^a-z]/g,``)}function ft(e){let t=dt(e.id),n=dt(e.name??``);return ut.has(t)||ut.has(n)?!0:lt.test(t)||lt.test(n)}var pt={"claude-acp":`asks`,"codex-acp":`self-managed`,cursor:`self-managed`,"pi-acp":`autonomous`};function mt(e,t,n){let r=n??(t==null?null:t.availableModes.find(e=>e.id===t.currentModeId)??null),i=pt[e];return i===void 0?t!=null&&t.availableModes.length>0?`self-managed`:`unknown`:i===`asks`&&r!==null&&ft(r)?`self-managed`:i}var X=e(f(),1),Z=n();function ht({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=gt(_t(r,i),t);if(!n)return X.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!X.isValidElement(n))return null;let o=n.props,s={...gt(a,o),ref:bt(a.ref,o.ref)};return X.cloneElement(n,s)}function gt(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];n===`className`?t[n]=[i,r].filter(Boolean).join(` `):n===`style`?t[n]={...i,...r}:n===`ref`?t[n]=bt(i,r):yt(n)&&typeof i==`function`&&typeof r==`function`?t[n]=vt(r,i):t[n]=r}}return t}function _t(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function vt(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function yt(e){return/^on[A-Z]/.test(e)}function bt(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var xt=8,St=64,Ct=0,wt=.5,Tt=180,Et=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),Dt={start:!1,end:!1},Ot={currentAnchorId:null,visibleMessageIds:[]};function kt({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return Dt;let i=Vt({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function At({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return Ot;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of jt(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+wt&&(u=e)}return l.length===0&&u===null?Ot:{currentAnchorId:u,visibleMessageIds:l}}function jt(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function Mt(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function Nt(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function Pt(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function Ft(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function It({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of jt(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function Lt({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=Rt(t,i),o=t.getBoundingClientRect().height,s=Wt(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function Rt(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function zt(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function Bt({content:e,scrollTop:t,spacer:n,viewport:r}){let i=Vt({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function Vt({content:e,spacer:t,viewport:n}){let r=jt(e,t),i=Ut(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function Ht(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function Ut(e){let t=window.getComputedStyle(e);return{end:Kt(t.paddingBlockEnd||t.paddingBottom),start:Kt(t.paddingBlockStart||t.paddingTop)}}function Wt(e){let t=e?.parentElement;return t?Ut(t):{end:0,start:0}}function Gt(e){if(!e)return 0;let t=window.getComputedStyle(e);return Kt(t.rowGap===`normal`?t.gap:t.rowGap)}function Kt(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function qt({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:s,contentRef:c,defaultScrollPositionAppliedRef:l,itemCountRef:u,messageElementsRef:d,modeRef:f,pendingScrollToMessageRef:p,prependRestoreRef:m,scrollMarginRef:h,scrollPreviousItemPeekRef:g,spacerGapRef:_,spacerHeightRef:v,spacerRef:y,viewportRef:b}=e,x=X.useCallback(e=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),o.current!==e&&(o.current=e,t()),e&&(s.current=window.setTimeout(()=>{s.current=null,o.current=!1,t()},Tt))},[t]),S=X.useCallback(e=>{let t=y.current;if(!t)return;let n=Math.max(0,Math.ceil(e));v.current!==n&&(v.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-_.current}px`:``)},[]),C=X.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=b.current;if(!a)return;let o=Math.max(0,e);if(Math.abs(a.scrollTop-o)<=wt){a.scrollTop=o,t();return}i&&x(!0),a.scrollTo({top:o,behavior:r}),n()},[t,n,x]),w=X.useCallback(({behavior:e=`auto`}={})=>b.current?(S(0),i.current=null,f.current=`free-scrolling`,C(0,{behavior:e}),r(),!0):!1,[r,C,S]),T=X.useCallback(({behavior:e=`auto`}={})=>{let t=b.current;return t?(S(0),i.current=null,f.current=a.current?`following-bottom`:`free-scrolling`,C(Ht(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,C,S]),E=X.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=h.current}={},{keepPreviousPeek:o=!1}={})=>{let s=c.current,l=b.current;if(!s||!l||!s.contains(e))return!1;let u=Lt({align:t,element:e,scrollMargin:o?a+g.current:a,spacer:y.current,viewport:l});return S(Bt({content:s,scrollTop:u,spacer:y.current,viewport:l})),m.current={element:e,viewportTop:zt(e,l)},f.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,C(u,{behavior:n}),r(),!0},[r,C,S]),D=X.useCallback(()=>{let e=i.current;return!e||!e.isConnected||f.current!==`anchored-to-message`?!1:E(e,{align:`start`},{keepPreviousPeek:!0})},[E]),O=X.useCallback((e,t)=>{let n=d.current.get(e);return n?(l.current=!0,E(n,t)?(p.current=null,!0):(p.current={messageId:e,options:t},!0)):u.current===0?(p.current={messageId:e,options:t},l.current=!0,!0):!1},[E]);return{flushPendingScrollToMessage:X.useCallback(()=>{let e=p.current;if(!e)return!1;let t=d.current.get(e.messageId);return!t||!E(t,e.options)?!1:(p.current=null,l.current=!0,!0)},[E]),reanchorToAnchoredMessage:D,scrollToElement:E,scrollToEnd:T,scrollToMessage:O,scrollToStart:w}}function Jt(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function Yt(e,t){return Jt(e,t)}function Xt(){return Jt(Ot,Qt)}function Zt(e,t){return e.start===t.start&&e.end===t.end}function Qt(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function $t({autoScroll:e,scrollEdgeThreshold:t,scrollMargin:n,scrollPreviousItemPeek:r}){let i=X.useRef(e),a=X.useRef(!1),o=X.useRef(null),s=X.useRef(!1),c=X.useRef(t),l=X.useRef(0),u=X.useRef(null),d=X.useRef(0),f=X.useRef(e?`following-bottom`:`free-scrolling`),p=X.useRef(new Map),m=X.useRef(null),h=X.useRef(null),g=X.useRef(null),_=X.useRef(r),v=X.useRef(!0),y=X.useRef(null),b=X.useRef(n),x=X.useRef(null),S=X.useRef(0),C=X.useRef(0),w=X.useRef(null),T=X.useRef(null),E=X.useRef(null),D=X.useRef(null),O=X.useRef(null),k=X.useRef(null),A=X.useRef(null),j=X.useRef(null),M=X.useRef(new Set),N=X.useRef(new WeakSet);return E.current===null&&(E.current=Yt(Dt,Zt)),j.current===null&&(j.current=Xt()),i.current=e,c.current=t,b.current=n,_.current=r,{autoScrollRef:i,autoscrollingRef:a,autoscrollingTimeoutRef:D,streamingTurnRef:g,contentRef:o,defaultScrollPositionAppliedRef:s,firstItemRef:u,itemCountRef:l,lastScrollTopRef:d,messageElementsRef:p,modeRef:f,pendingScrollFrameRef:x,pendingScrollToMessageRef:m,prependRestoreRef:h,preserveScrollOnPrependRef:v,rootRef:y,scrollEdgeThresholdRef:c,scrollMarginRef:b,scrollPreviousItemPeekRef:_,spacerGapRef:S,spacerHeightRef:C,spacerRef:w,stateFrameRef:T,stateStore:E.current,viewportRef:O,visibilityFrameRef:k,visibilityObserverRef:A,visibilityStore:j.current,visibleMessageIdsRef:M,handledScrollAnchorsRef:N}}function en(e,t){return X.useCallback(n=>{e.current=n,n&&t()},[e,t])}function tn({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=xt,scrollPreviousItemPeek:r=St,scrollMargin:i=Ct}){let a=$t({autoScroll:e,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:o,autoScrollRef:s,autoscrollingRef:c,autoscrollingTimeoutRef:l,contentRef:u,defaultScrollPositionAppliedRef:d,firstItemRef:f,itemCountRef:p,lastScrollTopRef:m,messageElementsRef:h,modeRef:g,pendingScrollFrameRef:_,pendingScrollToMessageRef:v,prependRestoreRef:y,preserveScrollOnPrependRef:b,rootRef:x,scrollEdgeThresholdRef:S,scrollMarginRef:C,scrollPreviousItemPeekRef:w,spacerGapRef:T,spacerHeightRef:E,spacerRef:D,stateFrameRef:O,stateStore:k,viewportRef:A,visibilityFrameRef:j,visibilityObserverRef:M,visibilityStore:N,visibleMessageIdsRef:P,handledScrollAnchorsRef:F}=a,I=X.useRef(t);I.current!==t&&(I.current=t,d.current=!1);let L=X.useCallback(e=>{let t=x.current,n=A.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=c.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),ee=X.useCallback(e=>{let t=A.current?.scrollTop??0,n=t<m.current-wt;m.current=t,s.current&&!e.end&&g.current!==`settling-jump`&&g.current!==`anchored-to-message`?g.current=`following-bottom`:g.current===`following-bottom`&&e.end&&n&&!c.current&&(g.current=`free-scrolling`)},[]),te=X.useCallback(()=>{let e=kt({content:u.current,scrollEdgeThreshold:S.current,spacer:D.current,viewport:A.current});ee(e);let t=g.current===`following-bottom`?{...e,end:!1}:e;L(t),k.setSnapshot(t)},[ee,k,L]),R=X.useCallback(()=>{O.current===null&&(O.current=window.requestAnimationFrame(()=>{O.current=null,te()}))},[te]),z=X.useCallback(()=>{N.hasListeners()&&j.current===null&&(j.current=window.requestAnimationFrame(()=>{j.current=null,N.hasListeners()&&N.setSnapshot(At({content:u.current,scrollMargin:C.current,scrollPreviousItemPeek:w.current,spacer:D.current,viewport:A.current,visibleMessageIds:P.current}))}))},[N]),{flushPendingScrollToMessage:ne,reanchorToAnchoredMessage:re,scrollToElement:ie,scrollToEnd:B,scrollToMessage:ae,scrollToStart:oe}=qt({refs:a,commitScrollState:te,scheduleStateCommit:R,scheduleVisibilitySync:z}),se=X.useCallback(()=>{let e=y.current,t=A.current;if(!e||!t||!e.element.isConnected)return!1;let n=zt(e.element,t)-e.viewportTop;return Math.abs(n)<=wt?!1:(t.scrollTop+=n,e.viewportTop=zt(e.element,t),R(),z(),!0)},[R,z]),ce=X.useCallback(()=>{let e=u.current,t=A.current;if(!e||!t){y.current=null;return}let n=It({content:e,spacer:D.current,viewport:t});y.current=n?{element:n,viewportTop:zt(n,t)}:null},[]),le=X.useCallback(()=>{_.current===null&&(_.current=window.requestAnimationFrame(()=>{_.current=null,ne()&&ce()}))},[ce,ne]),ue=X.useCallback(()=>{if(!t||d.current||p.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=u.current,n=A.current,r=t&&n?Ft(jt(t,D.current)):null;if(!t||!n||!r)e=B({behavior:`auto`});else{let i=Rt(r,n);e=Vt({content:t,spacer:D.current,viewport:n})-i<=n.clientHeight?B({behavior:`auto`}):ie(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?B({behavior:`auto`}):oe({behavior:`auto`});return e?(d.current=!0,!0):!1},[t,ie,B,oe]),de=X.useCallback(()=>{let e=u.current;if(!e)return;let t=jt(e,D.current),n=p.current,r=f.current;p.current=t.length,f.current=t[0]??null,(()=>{if(ne())return;if(n===0){if(ue()||t.length>0&&s.current&&B({behavior:`auto`}))return;te(),z();return}let e=r?t.indexOf(r):-1;if(b.current&&e>0){se();return}if(t.length>n){let e=Mt(t,n);if(e){if(s.current&&g.current===`following-bottom`&&Pt(t,n)){B({behavior:`auto`});return}ie(e,{align:`start`},{keepPreviousPeek:!0}),F.current.add(e);return}}if(t.length===n){let e=Nt(t,F.current);if(e){ie(e,{align:`start`},{keepPreviousPeek:!0}),F.current.add(e);return}}g.current===`following-bottom`&&s.current?B({behavior:`auto`}):(te(),z())})(),ce()},[ue,ce,te,ne,se,z,ie,B]),fe=X.useCallback(()=>{if(g.current===`following-bottom`&&s.current){B({behavior:`auto`});return}let e=E.current;if(re()){s.current&&e>0&&E.current===0&&B({behavior:`auto`});return}R(),z()},[re,R,z,B]),pe=X.useCallback(()=>{let e=A.current;if(!(!e||!N.hasListeners())){if(typeof IntersectionObserver>`u`){z();return}M.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?P.current.add(e):P.current.delete(e))}z()},{root:e,rootMargin:`${-(C.current+w.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),h.current.forEach(e=>{M.current?.observe(e)}),z()}},[z,N]),me=X.useCallback(()=>{j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null),M.current?.disconnect(),M.current=null,P.current.clear(),N.setSnapshot(Ot)},[N]),V=X.useCallback((e,t,n)=>{if(t){h.current.set(e,t),M.current?.observe(t),z(),v.current?.messageId===e&&le();return}n&&h.current.get(e)===n&&(h.current.delete(e),P.current.delete(e),M.current?.unobserve(n),z())},[le,z]),H=X.useCallback(()=>{(g.current===`following-bottom`||g.current===`anchored-to-message`||g.current===`settling-jump`)&&(o.current=null,g.current=`free-scrolling`)},[]),U=X.useCallback(()=>L(k.getSnapshot()),[k,L]),W=en(x,U),he=en(A,U),G=X.useCallback(e=>{u.current=e},[]),ge=X.useCallback(e=>{D.current=e,T.current=Gt(e?.parentElement??null)},[]),_e=X.useCallback(()=>{te(),z(),ce()},[ce,te,z]),ve=X.useMemo(()=>({handleContentChange:de,handleResize:fe,observeVisibility:pe,preserveScrollOnPrependRef:b,scrollToEnd:B,scrollToMessage:ae,scrollToStart:oe,setContentElement:G,setRootElement:W,setSpacerElement:ge,setViewportElement:he,stateStore:k,syncAfterScroll:_e,unobserveVisibility:me,userScrollIntent:H,viewportRef:A,visibilityStore:N}),[de,fe,pe,B,ae,oe,G,W,ge,he,k,_e,me,H,N]);return X.useLayoutEffect(()=>{ue()},[ue]),X.useEffect(()=>()=>{O.current!==null&&(window.cancelAnimationFrame(O.current),O.current=null),j.current!==null&&(window.cancelAnimationFrame(j.current),j.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),M.current?.disconnect(),M.current=null},[]),X.useLayoutEffect(()=>{if(e&&g.current===`following-bottom`&&p.current>0){B({behavior:`auto`});return}te()},[e,te,B]),{context:ve,registerMessage:V}}function nn(e){let t=X.useRef(e);return t.current=e,t}var rn=X.createContext(null),an=X.createContext(null);function on(){let e=X.useContext(rn);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function sn(){let e=X.useContext(an);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function cn(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=on();return X.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function ln({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=tn({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,Z.jsx)(rn.Provider,{value:o,children:(0,Z.jsx)(an.Provider,{value:s,children:t})})}function un({children:e,...t}){let{setRootElement:n}=on();return(0,Z.jsx)(`div`,{ref:n,...t,children:e})}function dn({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:o=!0,ref:s,role:c,tabIndex:l,...u}){let{handleResize:d,preserveScrollOnPrependRef:f,setViewportElement:p,syncAfterScroll:m,userScrollIntent:h,viewportRef:g}=on();f.current=o;let _=X.useCallback(e=>{p(e),bt(s)?.(e)},[s,p]);function v(e){m(),r?.(e)}function y(e){h(),a?.(e)}function b(e){h(),i?.(e)}function x(e){Et.has(e.key)&&h(),n?.(e)}return X.useEffect(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(d)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[d,g]),(0,Z.jsx)(`div`,{ref:_,role:c??`region`,"aria-label":e??`Messages`,tabIndex:l??0,onKeyDown:x,onScroll:v,onTouchMove:b,onWheel:y,...u,children:t})}function fn({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:o,handleResize:s,setContentElement:c,setSpacerElement:l}=on(),u=X.useRef(null),d=X.useCallback(e=>{u.current=e,c(e),bt(n)?.(e)},[n,c]);return X.useLayoutEffect(()=>{let e=u.current;if(!e||(o(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{o()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[o]),X.useEffect(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[s]),(0,Z.jsxs)(`div`,{ref:d,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,Z.jsx)(`div`,{ref:l,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function pn({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=sn(),a=X.useRef(null);return(0,Z.jsx)(`div`,{ref:X.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),bt(t)?.(n)},[e,t,i]),"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function mn({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:o=`button`,...s}){let{scrollToEnd:c,scrollToStart:l,stateStore:u}=on(),d=nn(r),f=X.useCallback(e=>u.subscribe(e),[u]),p=X.useCallback(()=>{let e=u.getSnapshot();return n===`start`?e.start:e.end},[n,u]),m=X.useSyncExternalStore(f,p,p),h=X.useCallback(t=>{m&&(d.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?l({behavior:e}):c({behavior:e})))},[e,n,m,d,c,l]);return ht({defaultTagName:`button`,props:gt({type:o,inert:!m,tabIndex:m?a:-1,children:t??(0,Z.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:h},s),render:i,state:{active:m,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var hn={Provider:ln,Root:un,Viewport:dn,Content:fn,Item:pn,Button:mn};function gn(e){let t=(0,Y.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(hn.Provider,{...e}),t[0]=e,t[1]=n),n}function _n(e){let t=(0,Y.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=v(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(hn.Root,{"data-slot":`message-scroller`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function vn(e){let t=(0,Y.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=v(`size-full min-h-0 min-w-0 scrollbar-thin overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(hn.Viewport,{"data-slot":`message-scroller-viewport`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function yn(e){let t=(0,Y.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=v(`flex h-max min-h-full flex-col gap-6`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(hn.Content,{"data-slot":`message-scroller-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bn(e){let t=(0,Y.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scrollAnchor:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?!1:i,o;t[4]===n?o=t[5]:(o=v(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(hn.Item,{"data-slot":`message-scroller-item`,scrollAnchor:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function xn(e){let t=(0,Y.c)(25),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({direction:o,className:r,children:n,render:a,variant:s,size:c,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=o===void 0?`end`:o,u=s===void 0?`secondary`:s,d=c===void 0?`icon-sm`:c,f;t[8]===r?f=t[9]:(f=v(`absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180`,r),t[8]=r,t[9]=f);let m;t[10]!==a||t[11]!==d||t[12]!==u?(m=a??(0,Z.jsx)(b,{variant:u,size:d}),t[10]=a,t[11]=d,t[12]=u,t[13]=m):m=t[13];let h;t[14]!==n||t[15]!==l?(h=n??(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Se,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:l===`end`?(0,Z.jsx)(p,{id:`EQXPXf`}):(0,Z.jsx)(p,{id:`b1FDss`})})]}),t[14]=n,t[15]=l,t[16]=h):h=t[16];let g;return t[17]!==l||t[18]!==i||t[19]!==d||t[20]!==f||t[21]!==m||t[22]!==h||t[23]!==u?(g=(0,Z.jsx)(hn.Button,{"data-slot":`message-scroller-button`,"data-direction":l,"data-variant":u,"data-size":d,direction:l,className:f,render:m,...i,children:h}),t[17]=l,t[18]=i,t[19]=d,t[20]=f,t[21]=m,t[22]=h,t[23]=u,t[24]=g):g=t[24],g}var Sn=new Map,Cn=0;function wn(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function Tn(){let e=wn();for(let[t,n]of Sn)t((e-n)/1e3);if(Sn.size===0){Cn=0;return}Cn=requestAnimationFrame(Tn)}function En(e){return Sn.set(e,wn()),Cn===0&&typeof requestAnimationFrame==`function`&&(Cn=requestAnimationFrame(Tn)),()=>{Sn.delete(e),Sn.size===0&&Cn!==0&&(cancelAnimationFrame(Cn),Cn=0)}}var Q=40,Dn=15,On=15,$=12.4,kn={blobby:0,triangle:1,square:2,sparkle:3,pentagon:4,hexagon:5,dot:6,star5:7,clover:8,star6:9,scallop:10,comma:11,diamond:12,cloud:13},An=`M15.34 2.91C15.96 2.77 16.69 2.65 17.33 2.63C17.97 2.62 18.72 2.71 19.36 2.84C20.00 2.97 20.79 3.10 21.33 3.44C21.88 3.79 22.38 4.46 22.75 5.01C23.12 5.56 23.42 6.30 23.66 6.89C23.90 7.49 24.06 8.18 24.26 8.73C24.45 9.28 24.66 9.84 24.89 10.34C25.12 10.84 25.39 11.36 25.68 11.85C25.97 12.34 26.46 12.87 26.71 13.41C26.96 13.94 27.12 14.61 27.26 15.21C27.39 15.80 27.54 16.52 27.55 17.14C27.56 17.76 27.43 18.47 27.30 19.09C27.16 19.71 26.99 20.43 26.72 21.01C26.46 21.58 26.05 22.20 25.64 22.69C25.22 23.17 24.65 23.63 24.15 24.02C23.66 24.41 23.09 24.82 22.55 25.14C22.02 25.45 21.39 25.74 20.84 25.99C20.28 26.25 19.65 26.52 19.08 26.70C18.50 26.89 17.83 27.05 17.23 27.15C16.63 27.26 15.95 27.34 15.34 27.37C14.73 27.39 14.03 27.40 13.42 27.33C12.81 27.26 12.12 27.10 11.54 26.92C10.95 26.73 10.30 26.47 9.75 26.18C9.20 25.90 8.62 25.51 8.11 25.15C7.61 24.80 7.06 24.37 6.60 23.94C6.15 23.52 5.68 23.00 5.28 22.52C4.89 22.03 4.47 21.45 4.13 20.92C3.79 20.38 3.41 19.75 3.16 19.16C2.91 18.57 2.68 17.86 2.56 17.23C2.45 16.60 2.42 15.85 2.45 15.21C2.48 14.56 2.60 13.83 2.76 13.22C2.93 12.60 3.18 11.91 3.47 11.35C3.77 10.80 4.24 10.23 4.63 9.75C5.01 9.27 5.45 8.74 5.89 8.34C6.34 7.95 6.93 7.61 7.40 7.27C7.88 6.94 8.38 6.57 8.83 6.25C9.29 5.93 9.79 5.56 10.27 5.25C10.75 4.95 11.29 4.61 11.81 4.33C12.32 4.05 12.92 3.74 13.49 3.52C14.05 3.29 14.73 3.05 15.34 2.91Z`,jn=2.26,Mn=`M76.4805 11.041C99.1124 7.04848 118.186 8.33731 134.31 14.4102C150.369 20.4588 164.177 31.5065 175.929 48.1846L176.446 48.9199C187.179 64.5695 195.653 90.2797 191.323 112.539C186.344 138.13 169.219 160.474 150.105 178.107C131.113 195.629 111.037 207.691 101.728 212.842C98.3779 214.693 93.3915 217.316 88.0508 217.316C85.74 217.316 83.6583 216.814 81.7607 215.855L81.3838 215.658C75.1451 212.251 73.9381 205.91 73.376 198.68L73.2705 197.222C72.953 192.5 72.5095 188.039 71.1416 184.247C69.5395 179.806 66.852 176.673 63.1406 174.227L63.1377 174.225C41.2846 159.832 21.8495 144.226 13.3828 121.439L13.3818 121.438L13.0146 120.427C5.46004 99.1404 7.95139 74.5467 20.4404 52.7568L20.4414 52.7549C33.2945 30.3176 54.4303 14.925 76.4785 11.041H76.4805Z`;function Nn(e){let t=t=>{let n=e[(t-1+Q)%Q],r=e[(t+1)%Q];return[(r[0]-n[0])*.16,(r[1]-n[1])*.16]},n=`M${e[0][0].toFixed(2)} ${e[0][1].toFixed(2)}`;for(let r=0;r<Q;r++){let i=e[r],a=e[(r+1)%Q],o=t(r),s=t((r+1)%Q);n+=`C${(i[0]+o[0]).toFixed(2)} ${(i[1]+o[1]).toFixed(2)} ${(a[0]-s[0]).toFixed(2)} ${(a[1]-s[1]).toFixed(2)} ${a[0].toFixed(2)} ${a[1].toFixed(2)}`}return`${n}Z`}function Pn(e,t){let n=e.map(e=>e[0]),r=e.map(e=>e[1]),i=Math.min(...n),a=Math.max(...n),o=Math.min(...r),s=Math.max(...r),c=t*2/Math.max(a-i,s-o);return e.map(e=>[Dn+(e[0]-(i+a)/2)*c,On+(e[1]-(o+s)/2)*c])}function Fn(e,t,n){let r=e;for(let e=0;e<t;e++){let e=r;r=e.map((t,r)=>{let i=e[(r-1+Q)%Q],a=e[(r+1)%Q];return[t[0]*(1-n)+(i[0]+a[0])/2*n,t[1]*(1-n)+(i[1]+a[1])/2*n]})}return r}function In(){if(typeof document>`u`)return null;let e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.style.position=`absolute`,e.style.visibility=`hidden`;let t=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);if(e.appendChild(t),document.body.appendChild(e),typeof t.getTotalLength!=`function`||typeof t.getPointAtLength!=`function`)return e.remove(),null;try{t.setAttribute(`d`,`M0 0L1 0`),t.getPointAtLength(0)}catch{return e.remove(),null}return t}function Ln(e){function t(t,n){e.setAttribute(`d`,t);let r=e.getTotalLength(),i=[];for(let t=0;t<n;t++){let a=e.getPointAtLength(r*t/n);i.push([a.x,a.y])}return i}function n(e){let t=0,n=0;for(let r of e)t+=r[0],n+=r[1];t/=e.length,n/=e.length;let r=Array(Q).fill(0),i=Array(Q).fill(1/0);for(let a of e){let e=Math.atan2(a[1]-n,a[0]-t),o=Math.hypot(a[0]-t,a[1]-n),s=Math.round((e+Math.PI/2)/(2*Math.PI)*Q);s=(s%Q+Q)%Q,o>r[s]&&(r[s]=o),o<i[s]&&(i[s]=o)}return{cx:t,cy:n,hi:r,lo:i}}function r(e,t,n){return e.map((e,r)=>{let i=-Math.PI/2+r*2*Math.PI/Q;return[t+Math.cos(i)*e,n+Math.sin(i)*e]})}function i(e,i){let{cx:a,cy:o,hi:s,lo:c}=n(t(e,1080)),l=s.map((e,t)=>(e+c[t])/2),u=s.reduce((e,t,n)=>e+(t-c[n]),0)/Q,d=r(l,a,o),f=d.map(e=>e[0]),p=d.map(e=>e[1]),m=i*2/Math.max(Math.max(...f)-Math.min(...f),Math.max(...p)-Math.min(...p));return{path:Nn(Pn(d,i)),strokeWidth:u*m}}function a(e,i){let{cx:a,cy:o,hi:s}=n(t(e,1400));return Nn(Pn(r(s.map((e,t)=>s[t]*.86+(s[(t-1+Q)%Q]+s[(t+1)%Q])*.07),a,o),i))}function o(e,n){return Nn(Pn(t(e,Q),n))}function s(e,n,r){return Nn(Fn(t(e,Q),n,r))}function c(e,n,r){return Nn(t(e,Q).map(e=>[Dn+(e[0]-Dn)*n,On+(e[1]-On)*r]))}function l(e,n,r=1){return Nn(t(e,Q).map((e,t)=>{let i=t*2*Math.PI/Q,a=1+r*(.035*Math.sin(i*3+n)+.025*Math.sin(i*5+n*2)+.018*Math.sin(i*2-n));return[Dn+(e[0]-Dn)*a,On+(e[1]-On)*a]}))}function u(e,t,n,r=0){let i=[];for(let n=0;n<e;n++){let a=-Math.PI/2+n*2*Math.PI/e+r;i.push([Dn+Math.cos(a)*t,On+Math.sin(a)*t])}let a=(e,t)=>{let n=t[0]-e[0],r=t[1]-e[1],i=Math.hypot(n,r);return[n/i,r/i]},o=``;for(let t=0;t<e;t++){let r=i[t],s=a(r,i[(t-1+e)%e]),c=a(r,i[(t+1)%e]),l=[r[0]+s[0]*n,r[1]+s[1]*n],u=[r[0]+c[0]*n,r[1]+c[1]*n];o+=`${t?`L`:`M`}${l[0].toFixed(2)} ${l[1].toFixed(2)}A${n} ${n} 0 0 1 ${u[0].toFixed(2)} ${u[1].toFixed(2)}`}return`${o}Z`}function d(e,n,r,i){let a=``;for(let t=0;t<e*2;t++){let i=-Math.PI/2+t*Math.PI/e,o=t%2?r:n;a+=`${t?`L`:`M`}${(Dn+Math.cos(i)*o).toFixed(2)} ${(On+Math.sin(i)*o).toFixed(2)}`}return Nn(Pn(Fn(t(`${a}Z`,Q),i,.3),n))}function f(e,n,r){let i=t=>{let n=-Math.PI/2+t*Math.PI/2;return[Dn+Math.cos(n)*e,On+Math.sin(n)*e]},a=`M${i(0)[0].toFixed(2)} ${i(0)[1].toFixed(2)}`;for(let e=0;e<4;e++){let t=-Math.PI/2+(e+.5)*Math.PI/2,r=[Dn+Math.cos(t)*n,On+Math.sin(t)*n],o=i((e+1)%4);a+=`Q${r[0].toFixed(2)} ${r[1].toFixed(2)} ${o[0].toFixed(2)} ${o[1].toFixed(2)}`}return Nn(Pn(Fn(t(`${a}Z`,Q),r,.34),e))}function p(e,t,n,r){let i=[];for(let a=0;a<Q;a++){let o=-Math.PI/2+a*2*Math.PI/Q,s=(1+Math.cos(e*(o+Math.PI/2)))/2,c=n+(t-n)*s**r;i.push([Dn+Math.cos(o)*c,On+Math.sin(o)*c])}return Nn(i)}function m(e){let t=[];for(let n=0;n<Q;n++){let r=-Math.PI/2+n*2*Math.PI/Q;t.push([Dn+Math.cos(r)*e,On+Math.sin(r)*e])}return Nn(t)}return{silhouette:i,hull:a,fit:o,soften:s,squeeze:c,wobble:l,poly:u,star:d,sparkle:f,lobed:p,dot:m,circle:(e,t,n)=>`M${e-n} ${t}a${n} ${n} 0 1 0 ${n*2} 0a${n} ${n} 0 1 0 ${-n*2} 0`}}function Rn(){let e=In();if(e===null)return null;try{let t=Ln(e),n=t.silhouette(y,12.55);return{paths:[n.path,t.wobble(t.poly(3,$*1.16,$*.5,.1),1.1),t.wobble(t.poly(4,$*1.02,$*.44),2.3),t.wobble(t.sparkle($*1.24,$*.1,3),3.7),t.wobble(t.poly(5,$*1,$*.38),4.9),t.wobble(t.poly(6,$*.98,$*.34),6.2),t.wobble(t.dot($*.34),2.8),t.wobble(t.star(5,$*1.14,$*.68,6),7.4),t.wobble(t.soften(t.lobed(4,$*1.16,$*.46,.5),3,.3),8.1),t.wobble(t.star(6,$*1.2,$*.42,4),9.3),t.wobble(t.lobed(8,$*1.06,$*.74,.6),10.5),t.wobble(t.soften(t.fit(Mn,$*1.12),3,.22),11.7,.3),t.wobble(t.squeeze(t.poly(4,$*1.3,$*.2),.84,1),12.9),t.wobble(t.hull(t.circle(10.2,16,4.3)+t.circle(15,12,5.5)+t.circle(20,15.4,4.4)+t.circle(15,17.4,5.2),12.4),13.6)],strokeWidth:n.strokeWidth}}finally{e.ownerSVGElement?.remove()}}var zn;function Bn(){return zn===void 0&&(zn=Rn()),zn}var Vn=/-?\d+(?:\.\d+)?/g;function Hn(e){return{fragments:e[0].split(Vn),numbers:e.map(e=>(e.match(Vn)??[]).map(Number))}}function Un(e,t){let n=``;for(let r=0;r<t.length;r++)n+=e[r]+t[r].toFixed(2);return n+e[t.length]}function Wn(e){return e<.5?2*e*e:1-2*(1-e)**2}var Gn=.58;function Kn(e,t,n,r){let i=t-1,a=n/i,o=e%n,s=Math.max(0,Math.min(i-1,Math.floor(o/a))),c=o%a/a;return{from:s,to:s+1,t:Wn(r?Math.min(1,c/Gn):c)}}var qn=kn,Jn=[qn.blobby,qn.triangle,qn.square,qn.sparkle,qn.comma,qn.pentagon,qn.hexagon,qn.blobby],Yn={[qn.comma]:-2.9},Xn={leftCx:10.9,rightCx:18.1,cy:16,rx:1.25,ry:1.9},Zn=20,Qn=8.4;function $n(e){let t=(0,Y.c)(22),{status:n,className:r,testId:i}=e,{_:a}=m(),o=(0,X.useRef)(null),s=(0,X.useRef)(null),c=be(),l,u;t[0]===c?(l=t[1],u=t[2]):(l=()=>{let e=o.current;if(e===null)return;if(c){e.setAttribute(`d`,An),e.setAttribute(`stroke-width`,String(jn)),s.current?.removeAttribute(`transform`);return}let t=Bn();if(t===null)return;e.setAttribute(`stroke-width`,t.strokeWidth.toFixed(2));let n=Hn(t.paths),r=NaN,i=``;return En(t=>{let{from:a,to:o,t:c}=Kn(t,Jn.length,Qn,!0),l=n.numbers[Jn[a]],u=n.numbers[Jn[o]],d=l.map((e,t)=>e+(u[t]-e)*c),f=Un(n.fragments,d);f!==i&&(i=f,e.setAttribute(`d`,f));let p=s.current;if(p===null)return;let m=Yn[Jn[a]]??0,h=m+((Yn[Jn[o]]??0)-m)*c;h!==r&&(r=h,p.setAttribute(`transform`,`translate(0 ${h.toFixed(2)})`))})},u=[c],t[0]=c,t[1]=l,t[2]=u),(0,X.useEffect)(l,u);let[d,f]=(0,X.useState)(``),p,h;t[3]===a?(p=t[4],h=t[5]):(p=()=>{f(a({id:`DCSSZt`}))},h=[a],t[3]=a,t[4]=p,t[5]=h),(0,X.useEffect)(p,h);let g;t[6]===r?g=t[7]:(g=v(`ok-working-enter flex items-center gap-2`,r),t[6]=r,t[7]=g);let _;t[8]===d?_=t[9]:(_=(0,Z.jsx)(`span`,{"aria-live":`polite`,className:`sr-only`,role:`status`,children:d}),t[8]=d,t[9]=_);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`path`,{ref:o,d:An,fill:`none`,stroke:`currentColor`,strokeWidth:jn,strokeLinejoin:`round`,strokeLinecap:`round`}),t[10]=y):y=t[10];let b;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(`span`,{className:`grid shrink-0 place-items-center text-muted-foreground/80`,children:(0,Z.jsx)(`svg`,{width:Zn,height:Zn,viewBox:`0 0 30 30`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,className:`ok-working-pop ok-working-squint block shrink-0 overflow-visible`,children:(0,Z.jsxs)(`g`,{className:`ok-working-group`,children:[y,(0,Z.jsxs)(`g`,{ref:s,children:[(0,Z.jsx)(`ellipse`,{className:`ok-working-eye`,cx:Xn.leftCx,cy:Xn.cy,rx:Xn.rx,ry:Xn.ry,fill:`currentColor`}),(0,Z.jsx)(`ellipse`,{className:`ok-working-eye`,cx:Xn.rightCx,cy:Xn.cy,rx:Xn.rx,ry:Xn.ry,fill:`currentColor`})]})]})})}),t[11]=b):b=t[11];let x;t[12]===n?x=t[13]:(x=(0,Z.jsx)(`span`,{className:`shimmer`,children:n}),t[12]=n,t[13]=x);let S;t[14]!==n||t[15]!==x?(S=(0,Z.jsx)(`span`,{className:`ok-working-status text-sm`,children:x},n),t[14]=n,t[15]=x,t[16]=S):S=t[16];let C;return t[17]!==S||t[18]!==g||t[19]!==_||t[20]!==i?(C=(0,Z.jsxs)(`div`,{className:g,"data-testid":i,children:[_,b,S]}),t[17]=S,t[18]=g,t[19]=_,t[20]=i,t[21]=C):C=t[21],C}function er(e){let t=[];for(let n of e.options)`value`in n?t.push(n):t.push(...n.options);return t}function tr(e){let t=er(e),n=t.find(t=>t.value===e.currentValue);if(n===void 0||n.value!==`default`||!n.description)return null;let r=t.find(e=>e.value!==n.value&&e.description===n.description);return r===void 0?null:G._({id:`GK5Ft_`,values:{0:r.name}})}function nr(e,t,n){return e===`claude-acp`&&t===`effort`&&n===`default`?G._({id:`3SWNP8`}):e===`codex-acp`&&t===`collaboration_mode`&&n===`default`?G._({id:`R6ABfU`}):null}var rr=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),ir=700*1024;function ar(e){if(e.kind===`unsupported-type`)return e.mimeType.startsWith(`image/`)?`Only PNG, JPEG, GIF, and WebP images are supported (got ${e.mimeType}).`:`Unsupported file type: ${e.mimeType||`unknown`}.`;if(e.kind===`outside-workspace`)return`${e.name} is outside the workspace. Move it into your project first.`;if(e.kind===`unknown-path`)return`${e.name} has no resolvable path — the agent can only read files inside the workspace.`;let t=(e.limitBytes/(1024*1024)).toFixed(1);return`File is too large (${(e.sizeBytes/(1024*1024)).toFixed(1)} MB) — max ${t} MB per attachment.`}async function or(e){let t=await new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`FileReader failed`)),r.onload=()=>{let e=r.result;if(typeof e!=`string`){n(Error(`FileReader returned non-string result`));return}t(e)},r.readAsDataURL(e)}),n=t.indexOf(`,`);return{data:n>=0?t.slice(n+1):t,mimeType:e.type||`application/octet-stream`,name:e.name||`image`,sizeBytes:e.size}}async function sr(e){let t=e.type||``;if(!rr.has(t))return{ok:!1,error:{kind:`unsupported-type`,mimeType:t}};if(e.size>716800)return{ok:!1,error:{kind:`too-large`,sizeBytes:e.size,limitBytes:ir}};let n=await or(e);return{ok:!0,part:{kind:`image`,data:n.data,mimeType:n.mimeType,name:n.name,sizeBytes:n.sizeBytes}}}function cr(e){return ur(e,e=>e.type.startsWith(`image/`))}function lr(e){return ur(e,e=>e.size>0)}function ur(e,t){if(e===null)return[];let n=new Set,r=[],i=e=>{if(e===null||!t(e))return;let i=`${e.name}|${e.size}|${e.lastModified??0}`;n.has(i)||(n.add(i),r.push(e))},a=e.items;if(a)for(let e=0;e<a.length;e+=1){let t=a[e];t&&t.kind===`file`&&i(t.getAsFile())}let o=e.files;if(o)for(let e=0;e<o.length;e+=1)i(o[e]??null);return r}function dr(e,t,n){let r=n===`\\`?e.toLowerCase():e,i=n===`\\`?t.toLowerCase():t,a=i.endsWith(n)?i:`${i}${n}`;if(r===i)return``;if(!r.startsWith(a))return null;let o=e.slice(a.length);return n===`\\`?o.replaceAll(`\\`,`/`):o}async function fr(e,t={}){if((e.type||``).startsWith(`image/`))return sr(e);let n=t.absPathOf,r=t.workspaceContentDir,i=t.pathSeparator??`/`,a=e.name||`attachment`;if(n===void 0||r===void 0||r===``)return{ok:!1,error:{kind:`unknown-path`,name:a}};let o=n(e);if(o===null||o===``)return{ok:!1,error:{kind:`unknown-path`,name:a}};let s=dr(o,r,i);return s===null?{ok:!1,error:{kind:`outside-workspace`,name:a}}:{ok:!0,part:{kind:`file`,path:s,name:a}}}var pr=3,mr=pr*2+2;function hr(e){let t=e.split(`
|
|
3
3
|
`);return t[t.length-1]===``&&t.pop(),t}function gr(e,t){if(e===null)return hr(t).map(e=>({type:`add`,text:e}));let n=[],r=Ye(e,t);for(let[e,t]of r.entries()){let i=hr(t.value);if(t.added){for(let e of i)n.push({type:`add`,text:e});continue}if(t.removed){for(let e of i)n.push({type:`del`,text:e});continue}if(i.length<=mr){for(let e of i)n.push({type:`ctx`,text:e});continue}let a=e>0?i.slice(0,pr):[],o=e<r.length-1?i.slice(-pr):[];for(let e of a)n.push({type:`ctx`,text:e});n.push({type:`gap`,count:i.length-a.length-o.length});for(let e of o)n.push({type:`ctx`,text:e})}return n}var _r=/^\[[^\]]{1,32}\]\s*/,vr=/\bhttps?:\/\/\S+/,yr=/\b[A-Z0-9]{3,8}(?:-[A-Z0-9]{3,8})+\b/;function br(e){try{let t=new URL(e);return`${t.host}${t.pathname===`/`?``:t.pathname}`}catch{return e}}function xr(e){let t,n,r=[];for(let i of e){let e=i.replace(_r,``).trim();if(e===``)continue;let a=e.match(vr);if(n===void 0&&a!==null){n=a[0].replace(/[).,]+$/,``);let e=new URLSearchParams(n.split(`?`)[1]??``).get(`user_code`);e!==null&&e!==``&&(t=e)}if(t===void 0){let n=e.match(yr);n!==null&&(t=n[0])}let o=t!==void 0&&e.includes(t),s=n!==void 0&&e.includes(n);!o&&!s&&r.push(e)}return{...t===void 0?{}:{code:t},...n===void 0?{}:{url:n},lines:r}}var Sr=/\x1b\[[0-9;?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-Z\\-_]/g;function Cr(e){return e.replace(Sr,``)}function wr(e){return Cr(e).split(`
|
|
4
4
|
`).map(e=>{let t=e.replace(/\r+$/,``),n=t.lastIndexOf(`\r`);return n===-1?t:t.slice(n+1)}).join(`
|
|
5
5
|
`)}var Tr=new Set(W),Er=/^(?:open[-_ ]?knowledge|ok)$/,Dr=/^(?:mcp[^a-z0-9]+)?(?:open[-_ ]?knowledge|ok)[^a-z0-9]+([a-z_]+)$/;function Or(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function kr(e){return Dr.exec(e.trim().toLowerCase())?.[1]??null}function Ar(e,t){let n=fe(Or(t),`server`);if(n!==null&&!Er.test(n.toLowerCase()))return null;let r=ne(t),i=[kr(e),r?.tool??null].find(e=>e!==null&&Tr.has(e));return i===void 0?null:{tool:i,args:r?.args??{}}}function jr(e){return typeof e==`string`?e.trim()===``?[]:[e.trim()]:Array.isArray(e)?e.flatMap(jr):typeof e==`object`&&e?jr(e.path):[]}var Mr=[`document`,`documents`,`folder`,`file`,`template`,`asset`,`path`,`from`,`name`];function Nr(e){for(let t of Mr){let n=jr(e[t]);if(n.length>0)return n}return[]}function Pr(e){return e.replace(/\.mdx?$/i,``)}var Fr=120;function Ir(e){if(typeof e!=`string`)return null;let t=e.replace(/\s+/g,` `).trim();return t===``?null:t.length>Fr?`${t.slice(0,Fr-1)}…`:t}function Lr(e,t){let n=Nr(t),r=n[0],i=n.length>1?G._({id:`C7waqI`,values:{0:n.length}}):r===void 0?null:Pr(r);switch(e){case`write`:return{glyph:`edit`,text:i===null?G._({id:`tLX6LY`}):G._({id:`MvWBwz`,values:{subject:i}})};case`edit`:return{glyph:`edit`,text:i===null?G._({id:`Fx9aOF`}):G._({id:`7aNk5D`,values:{subject:i}})};case`delete`:return{glyph:`delete`,text:i===null?G._({id:`DcFr-y`}):G._({id:`Gb_h4G`,values:{subject:i}})};case`move`:{let e=jr(t.to)[0];if(i===null||e===void 0)return{glyph:`move`,text:G._({id:`RGptDW`})};let n=Pr(e);return{glyph:`move`,text:G._({id:`pbyEp3`,values:{subject:i,destination:n}})}}case`search`:{let e=Ir(t.query);return{glyph:`search`,text:e===null?G._({id:`EvXKHE`}):G._({id:`yWfjqS`,values:{query:e}})}}case`exec`:{let e=Ir(t.command);return{glyph:`execute`,text:e===null?G._({id:`FS4Udk`}):G._({id:`a5gwRt`,values:{command:e}})}}case`lint`:case`audit`:return{glyph:`check`,text:i===null?G._({id:`7S7FNA`}):G._({id:`TEJiKw`,values:{subject:i}})};case`links`:return{glyph:`link`,text:i===null?G._({id:`vallqD`}):G._({id:`KDrbNG`,values:{subject:i}})};case`history`:return{glyph:`history`,text:i===null?G._({id:`Ug2xzC`}):G._({id:`90-wKT`,values:{subject:i}})};case`config`:{let e=Ir(t.key);return{glyph:`settings`,text:e===null?G._({id:`ZwpggY`}):G._({id:`-oHckY`,values:{key:e}})}}case`skills`:return{glyph:`read`,text:G._({id:`4mp6Tv`})};case`install`:return{glyph:`install`,text:i===null?G._({id:`4ErgAf`}):G._({id:`WbWtif`,values:{subject:i}})};case`import`:{let e=Ir(t.skill)??Ir(t.source);return{glyph:`install`,text:e===null?G._({id:`DhT_PK`}):G._({id:`hCattk`,values:{source:e}})}}case`palette`:return{glyph:`read`,text:G._({id:`7czmD1`})};case`preview_url`:return{glyph:`fetch`,text:G._({id:`UL-9ej`})};case`share_link`:return{glyph:`share`,text:i===null?G._({id:`ABq-cq`}):G._({id:`ibE3-O`,values:{subject:i}})};case`checkpoint`:return{glyph:`history`,text:G._({id:`5b3WD-`})};case`conflicts`:return{glyph:`check`,text:G._({id:`i94lQe`})};case`resolve_conflict`:return{glyph:`edit`,text:i===null?G._({id:`_YWqV2`}):G._({id:`AeLo3p`,values:{subject:i}})};case`restore_version`:return{glyph:`restore`,text:i===null?G._({id:`caiyaU`}):G._({id:`hS0wC4`,values:{subject:i}})};default:return{glyph:`other`,text:G._({id:`vhGTWU`,values:{tool:e}})}}}var Rr={read:`read`,edit:`edit`,delete:`delete`,move:`move`,search:`search`,execute:`execute`,think:`think`,fetch:`fetch`,switch_mode:`switch_mode`};function zr(e){let t=Ar(e.title,e.rawInput);return t===null?{text:e.title,glyph:Rr[e.toolKind]??`other`}:Lr(t.tool,t.args)}var Br=new Map([{id:`shellscript`,aliases:[`bash`,`sh`,`shell`,`zsh`]},{id:`tsx`,aliases:[`typescript`,`ts`,`jsx`]},{id:`javascript`,aliases:[`js`]},{id:`json`,aliases:[`jsonc`]},{id:`python`,aliases:[`py`]},{id:`rust`,aliases:[`rs`]},{id:`go`,aliases:[]},{id:`css`,aliases:[]},{id:`html`,aliases:[]},{id:`markdown`,aliases:[`md`]},{id:`yaml`,aliases:[`yml`]},{id:`toml`,aliases:[]},{id:`sql`,aliases:[]},{id:`diff`,aliases:[]},{id:`dockerfile`,aliases:[`docker`]}].flatMap(e=>[[e.id,e.id],...e.aliases.map(t=>[t,e.id])])),Vr=[`github-light`,`github-dark`],Hr=400,Ur=new Map,Wr=new Map;function Gr(e,t){return`${t}:${e.length}:${e.slice(0,100)}:${e.length>100?e.slice(-100):``}`}var Kr={name:`shiki`,type:`code-highlighter`,getSupportedLanguages:()=>Array.from(Br.keys()),supportsLanguage:e=>Br.has(e),getThemes:()=>Vr,highlight(e,n){let r=Br.get(e.language)??`text`,i=Gr(e.code,r),a=Ur.get(i);if(a!==void 0)return a;if(n!==void 0){let e=Wr.get(i)??new Set;e.add(n),Wr.set(i,e)}return t(async()=>{let{tokenize:e}=await import(`./code-highlighter-impl-CqBvFNiv.js`);return{tokenize:e}},__vite__mapDeps([0,1,2,3]),import.meta.url).then(async({tokenize:t})=>{let n=await t(e.code,r);if(Ur.size>=Hr){let e=Math.floor(Ur.size/2);for(let t of Ur.keys()){if(e===0)break;Ur.delete(t),--e}}Ur.set(i,n);let a=Wr.get(i);if(a!==void 0){Wr.delete(i);for(let e of a)e(n)}}).catch(e=>{Wr.delete(i),console.warn(`[code-highlighter] highlight failed, leaving plain text`,e)}),null}};function qr(){return e=>{Jr(e)}}function Jr(e){let t=e.children;if(t===void 0)return;let n=[];for(let e of t){if(e.type===`text`&&e.value!==void 0&&e.value.includes(`
|