@puddle-code/cli 0.0.28 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +6 -23
  2. package/dist/index.js +9 -3
  3. package/dist/public/assets/Dashboard-C3WvNQZm.js +1 -0
  4. package/dist/public/assets/{EditorTabClose-Bzwr4ZGh.js → EditorTabClose-B9fEd9D9.js} +1 -1
  5. package/dist/public/assets/{LazyTerminal-C5KE5tms.js → LazyTerminal-BNKlV3ik.js} +2 -2
  6. package/dist/public/assets/{ModelRefcount-Beb0I8k4.js → ModelRefcount-BNGUY0T3.js} +1 -1
  7. package/dist/public/assets/{PaneEditorBody-Dj_WvSOc.js → PaneEditorBody-Cw7QvWd7.js} +1 -1
  8. package/dist/public/assets/SettingsDialog--9U-efVU.js +1 -0
  9. package/dist/public/assets/{Terminal-Cw2V2Mk3.js → Terminal-D1eGlRYN.js} +17 -17
  10. package/dist/public/assets/Workspace-BzML0R8G.js +7 -0
  11. package/dist/public/assets/{api-B3lAdmrV.js → api-BJeOJuGe.js} +1 -1
  12. package/dist/public/assets/{buffer-store-B9nuo0xJ.js → buffer-store-BUxk5YP-.js} +2 -2
  13. package/dist/public/assets/{context-menu-DWtwpCZ1.js → context-menu-BW-kh-7_.js} +1 -1
  14. package/dist/public/assets/{cssMode-LgRzjYet.js → cssMode-BwI2t1Xb.js} +1 -1
  15. package/dist/public/assets/{editor-context-KBgMME_u.js → editor-context-CkjrPbVW.js} +1 -1
  16. package/dist/public/assets/{editor-sync-bA-3XbRL.js → editor-sync-BQ7kr55o.js} +1 -1
  17. package/dist/public/assets/{hotkeys-C4tM1SjP.js → hotkeys-qOqg9LFd.js} +1 -1
  18. package/dist/public/assets/{htmlMode-DPSIjFb_.js → htmlMode-DMBt4SND.js} +1 -1
  19. package/dist/public/assets/{index-DKJ3ig-N.css → index-CqjHKPtJ.css} +1 -1
  20. package/dist/public/assets/index-o0lu1P9z.js +10 -0
  21. package/dist/public/assets/{jsonMode-rSlgJ5R4.js → jsonMode-D5lVqFv_.js} +1 -1
  22. package/dist/public/assets/{session-seed-d2xOIe7z.js → session-seed-Bk937CpU.js} +1 -1
  23. package/dist/public/assets/ssh-mode-Q0zAbzxn.js +1 -0
  24. package/dist/public/assets/{tsMode-D3JJV7ob.js → tsMode-C4iOvDaN.js} +1 -1
  25. package/dist/public/index.html +5 -5
  26. package/package.json +1 -1
  27. package/dist/public/assets/Dashboard-CJbeNM4a.js +0 -1
  28. package/dist/public/assets/SettingsDialog-Df-shEgG.js +0 -1
  29. package/dist/public/assets/Workspace-C25gGbE9.js +0 -7
  30. package/dist/public/assets/index-DtbA89da.js +0 -10
  31. package/dist/public/assets/ssh-mode-IdY12_F4.js +0 -1
@@ -1,4 +1,4 @@
1
- import{h as e,p as t}from"./editor.api2-4X9Vh9Zw.js";import{m as n}from"./buffer-store-B9nuo0xJ.js";import{_ as r,a as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b}from"./lspLanguageFeatures-x2nWJpem.js";var x=120*1e3,S=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>x&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=n({moduleId:`vs/language/json/jsonWorker`,createWorker:()=>new Worker(new URL(`/assets/json.worker-Oa9UrkKE.js`,``+import.meta.url),{type:`module`}),label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}};function C(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&E(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&E(e.charCodeAt(r)))for(r++;r<e.length&&E(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&E(e.charCodeAt(r))){for(r++;r<e.length&&E(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
1
+ import{h as e,p as t}from"./editor.api2-4X9Vh9Zw.js";import{m as n}from"./buffer-store-BUxk5YP-.js";import{_ as r,a as i,c as a,d as o,f as s,g as c,h as l,i as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b}from"./lspLanguageFeatures-x2nWJpem.js";var x=120*1e3,S=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>x&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=n({moduleId:`vs/language/json/jsonWorker`,createWorker:()=>new Worker(new URL(`/assets/json.worker-Oa9UrkKE.js`,``+import.meta.url),{type:`module`}),label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}};function C(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&E(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&E(e.charCodeAt(r)))for(r++;r<e.length&&E(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&E(e.charCodeAt(r))){for(r++;r<e.length&&E(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
2
2
  `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(T(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(w(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(w(t));return o=15}if(T(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
3
3
  `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!T(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,T(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!E(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(w(e)||T(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function w(e){return e===32||e===9}function T(e){return e===10||e===13}function E(e){return e>=48&&e<=57}var D;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(D||={}),Array(20).fill(0).map((e,t)=>` `.repeat(t));var O=200;Array(O).fill(0).map((e,t)=>`
4
4
  `+` `.repeat(t)),Array(O).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(O).fill(0).map((e,t)=>`\r
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{A as i,C as a,E as o,O as s,S as c,_ as l,b as u,d,f,j as p,m,p as h,v as g,w as _,x as v,y}from"./dialog-B43iKmfK.js";import{_t as b,ft as x,gt as S,ht as C,mt as w,pt as T,ut as E,vt as D}from"./LazyTerminal-C5KE5tms.js";import{t as O}from"./utils-B6KiDbIe.js";import{t as k}from"./createLucideIcon-DyMAgLa3.js";import{n as A,t as j}from"./dist-i-QevsUb.js";import{R as ee,jt as te}from"./index-DtbA89da.js";var M=k(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),N=k(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),P=e(t(),1),F=e(n(),1);function I(e,[t,n]){return Math.min(n,Math.max(t,e))}var L=r(),R=[` `,`Enter`,`ArrowUp`,`ArrowDown`],z=[` `,`Enter`],B=`Select`,[V,H,U]=A(B),[W,ne]=s(B,[U,D]),G=D(),[re,K]=W(B),[ie,q]=W(B),ae=`SelectProvider`;function oe(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g,internal_do_not_use_render:_}=e,v=G(t),[y,x]=P.useState(null),[S,C]=P.useState(null),[w,T]=P.useState(!1),E=j(d),[D,O]=l({prop:r,defaultProp:i??!1,onChange:a,caller:B}),[k,A]=l({prop:o,defaultProp:s,onChange:c,caller:B}),ee=P.useRef(null),te=P.useRef(k);P.useEffect(()=>{let e=g?y?.ownerDocument.getElementById(g):y?.form;if(e instanceof HTMLFormElement){let t=()=>A(te.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,y,A]);let M=!y||!!g||!!y.closest(`form`),[N,F]=P.useState(new Set),I=u(),R=Array.from(N).map(e=>e.props.value).join(`;`),z=P.useCallback(e=>{F(t=>new Set(t).add(e))},[]),H=P.useCallback(e=>{F(t=>{let n=new Set(t);return n.delete(e),n})},[]),U={required:h,trigger:y,onTriggerChange:x,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:I,value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:ee,disabled:m,name:f,autoComplete:p,form:g,nativeOptions:N,nativeSelectKey:R,isFormControl:M};return(0,L.jsx)(b,{...v,children:(0,L.jsx)(re,{scope:t,...U,children:(0,L.jsx)(V.Provider,{scope:t,children:(0,L.jsx)(ie,{scope:t,onNativeOptionAdd:z,onNativeOptionRemove:H,children:tt(_)?_(U):n})})})})}oe.displayName=ae;var se=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,L.jsx)(oe,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[n,e?(0,L.jsx)(et,{__scopeSelect:t}):null]})})};se.displayName=B;var ce=`SelectTrigger`,le=P.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...a}=e,o=G(n),s=K(ce,n),c=s.disabled||r,l=i(t,s.onTriggerChange),u=H(n),d=P.useRef(`touch`),[f,m,h]=nt(e=>{let t=u().filter(e=>!e.disabled),n=rt(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),g=e=>{c||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,L.jsx)(w,{asChild:!0,...o,children:(0,L.jsx)(_.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":$(s.value)?``:void 0,...a,ref:l,onClick:p(a.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&g(e)}),onPointerDown:p(a.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:p(a.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&R.includes(e.key)&&(g(),e.preventDefault())})})})});le.displayName=ce;var ue=`SelectValue`,de=P.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:a,children:o,placeholder:s=``,...c}=e,l=K(ue,n),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=i(t,l.onValueNodeChange);v(()=>{u(d)},[u,d]);let p=$(l.value);return(0,L.jsx)(_.span,{...c,asChild:!p&&c.asChild,ref:f,style:{pointerEvents:`none`},children:(0,L.jsx)(P.Fragment,{children:p?s:o},p?`placeholder`:`value`)})});de.displayName=ue;var fe=`SelectIcon`,pe=P.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,L.jsx)(_.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});pe.displayName=fe;var me=`SelectPortal`,[he,ge]=W(me,{forceMount:void 0}),_e=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,L.jsx)(he,{scope:e.__scopeSelect,forceMount:n,children:(0,L.jsx)(y,{asChild:!0,...r})})};_e.displayName=me;var J=`SelectContent`,ve=P.forwardRef((e,t)=>{let n=ge(J,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=K(J,e.__scopeSelect),[o,s]=P.useState();return v(()=>{s(new DocumentFragment)},[]),(0,L.jsx)(g,{present:r||a.open,children:({present:e})=>e?(0,L.jsx)(Ce,{...i,ref:t}):(0,L.jsx)(ye,{...i,fragment:o})})});ve.displayName=J;var ye=P.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?F.createPortal((0,L.jsx)(be,{scope:n,children:(0,L.jsx)(V.Slot,{scope:n,children:(0,L.jsx)(`div`,{ref:t,children:r})})}),i):null});ye.displayName=`SelectContentFragment`;var Y=10,[be,X]=W(J),xe=`SelectContentImpl`,Se=o(`SelectContent.RemoveScroll`),Ce=P.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:u,align:g,alignOffset:_,arrowPadding:v,collisionBoundary:y,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C,...w}=e,T=K(J,n),[E,D]=P.useState(null),[O,k]=P.useState(null),A=i(t,D),[j,ee]=P.useState(null),[te,M]=P.useState(null),N=H(n),[F,I]=P.useState(!1),R=P.useRef(!1);P.useEffect(()=>{if(E)return d(E)},[E]),h();let z=P.useCallback(e=>{let[t,...n]=N().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[N,O]),B=P.useCallback(()=>z([j,E]),[z,j,E]);P.useEffect(()=>{F&&B()},[F,B]);let{onOpenChange:V,triggerPointerDownPosRef:U}=T;P.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(U.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||V(!1),document.removeEventListener(`pointermove`,t),U.current=null};return U.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,V,U]),P.useEffect(()=>{let e=()=>V(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[V]);let[W,ne]=nt(e=>{let t=N().filter(e=>!e.disabled),n=rt(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),G=P.useCallback((e,t,n)=>{let r=!R.current&&!n;(T.value!==void 0&&T.value===t||r)&&(ee(e),r&&(R.current=!0))},[T.value]),re=P.useCallback(()=>E?.focus(),[E]),ie=P.useCallback((e,t,n)=>{let r=!R.current&&!n;(T.value!==void 0&&T.value===t||r)&&M(e)},[T.value]),q=r===`popper`?De:Te,ae=q===De?{side:l,sideOffset:u,align:g,alignOffset:_,arrowPadding:v,collisionBoundary:y,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C}:{};return(0,L.jsx)(be,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:G,selectedItem:j,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:B,selectedItemText:te,position:r,isPositioned:F,searchRef:W,children:(0,L.jsx)(f,{as:Se,allowPinchZoom:!0,children:(0,L.jsx)(m,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:p(a,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,L.jsx)(c,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,L.jsx)(q,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...ae,onPlaced:()=>I(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:p(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>z(t)),e.preventDefault()}})})})})})})});Ce.displayName=xe;var we=`SelectItemAlignedPosition`,Te=P.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...a}=e,o=K(J,n),s=X(J,n),[c,l]=P.useState(null),[u,d]=P.useState(null),f=i(t,d),p=H(n),m=P.useRef(!1),h=P.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=P.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&u&&g&&y&&b){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(o.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Y,d=I(a,[Y,Math.max(Y,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Y,d=I(a,[Y,Math.max(Y,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=p(),s=window.innerHeight-Y*2,l=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),_=parseInt(d.borderBottomWidth,10),v=parseInt(d.paddingBottom,10),x=f+h+l+v+_,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Y,D=s-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+h+k,j=x-A;if(A<=E){let e=a.length>0&&y===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+_);c.style.height=n+`px`}else{let e=a.length>0&&y===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+g.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}c.style.margin=`${Y}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,c,u,g,y,b,o.dir,r]);v(()=>S(),[S]);let[C,w]=P.useState();return v(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]),(0,L.jsx)(Oe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:P.useCallback(e=>{e&&h.current===!0&&(S(),x?.(),h.current=!1)},[S,x]),children:(0,L.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,L.jsx)(_.div,{...a,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});Te.displayName=we;var Ee=`SelectPopperPosition`,De=P.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=G(n);return(0,L.jsx)(S,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});De.displayName=Ee;var[Oe,ke]=W(J,{}),Ae=`SelectViewport`,je=P.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...a}=e,o=X(Ae,n),s=ke(Ae,n),c=i(t,o.onViewportChange),l=P.useRef(0);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,L.jsx)(V.Slot,{scope:n,children:(0,L.jsx)(_.div,{"data-radix-select-viewport":``,role:`presentation`,...a,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...a.style},onScroll:p(a.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});je.displayName=Ae;var Me=`SelectGroup`,[Ne,Pe]=W(Me),Fe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=u();return(0,L.jsx)(Ne,{scope:n,id:i,children:(0,L.jsx)(_.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Fe.displayName=Me;var Ie=`SelectLabel`,Le=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Pe(Ie,n);return(0,L.jsx)(_.div,{id:i.id,...r,ref:t})});Le.displayName=Ie;var Z=`SelectItem`,[Re,ze]=W(Z),Be=P.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...c}=e,l=K(Z,n),d=X(Z,n),f=l.value===r,[m,h]=P.useState(s??``),[g,v]=P.useState(!1),y=i(t,a(e=>d.itemRefCallback?.(e,r,o))),b=u(),x=P.useRef(`touch`),S=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};return(0,L.jsx)(Re,{scope:n,value:r,disabled:o,textId:b,isSelected:f,onItemTextChange:P.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,L.jsx)(V.ItemSlot,{scope:n,value:r,disabled:o,textValue:m,children:(0,L.jsx)(_.div,{role:`option`,"aria-labelledby":b,"data-highlighted":g?``:void 0,"aria-selected":f&&g,"data-state":f?`checked`:`unchecked`,"aria-disabled":o||void 0,"data-disabled":o?``:void 0,tabIndex:o?void 0:-1,...c,ref:y,onFocus:p(c.onFocus,()=>v(!0)),onBlur:p(c.onBlur,()=>v(!1)),onClick:p(c.onClick,()=>{x.current!==`mouse`&&S()}),onPointerUp:p(c.onPointerUp,()=>{x.current===`mouse`&&S()}),onPointerDown:p(c.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:p(c.onPointerMove,e=>{x.current=e.pointerType,o?d.onItemLeave?.():x.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:p(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:p(c.onKeyDown,e=>{o||e.target!==e.currentTarget||d.searchRef?.current!==``&&e.key===` `||(z.includes(e.key)&&S(),e.key===` `&&e.preventDefault())})})})})});Be.displayName=Z;var Q=`SelectItemText`,Ve=P.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:o,...s}=e,c=K(Q,n),l=X(Q,n),u=ze(Q,n),d=q(Q,n),[f,p]=P.useState(null),m=a(e=>l.itemTextRefCallback?.(e,u.value,u.disabled)),h=i(t,p,u.onItemTextChange,m),g=f?.textContent,y=P.useMemo(()=>(0,L.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=d;return v(()=>(b(y),()=>x(y)),[b,x,y]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(_.span,{id:u.textId,...s,ref:h}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!$(c.value)?F.createPortal(s.children,c.valueNode):null]})});Ve.displayName=Q;var He=`SelectItemIndicator`,Ue=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return ze(He,n).isSelected?(0,L.jsx)(_.span,{"aria-hidden":!0,...r,ref:t}):null});Ue.displayName=He;var We=`SelectScrollUpButton`,Ge=P.forwardRef((e,t)=>{let n=X(We,e.__scopeSelect),r=ke(We,e.__scopeSelect),[a,o]=P.useState(!1),s=i(t,r.onScrollButtonChange);return v(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;o(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,L.jsx)(Je,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ge.displayName=We;var Ke=`SelectScrollDownButton`,qe=P.forwardRef((e,t)=>{let n=X(Ke,e.__scopeSelect),r=ke(Ke,e.__scopeSelect),[a,o]=P.useState(!1),s=i(t,r.onScrollButtonChange);return v(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,L.jsx)(Je,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});qe.displayName=Ke;var Je=P.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=X(`SelectScrollButton`,n),o=P.useRef(null),s=H(n),c=P.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return P.useEffect(()=>()=>c(),[c]),v(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,L.jsx)(_.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:p(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:p(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:p(i.onPointerLeave,()=>{c()})})}),Ye=`SelectSeparator`,Xe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,L.jsx)(_.div,{"aria-hidden":!0,...r,ref:t})});Xe.displayName=Ye;var Ze=`SelectArrow`,Qe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=G(n);return X(Ze,n).position===`popper`?(0,L.jsx)(C,{...i,...r,ref:t}):null});Qe.displayName=Ze;var $e=`SelectBubbleInput`,et=P.forwardRef(({__scopeSelect:e,...t},n)=>{let r=K($e,e),{value:a,onValueChange:o,required:s,disabled:c,name:l,autoComplete:u,form:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,m=P.useRef(null),h=i(n,m),g=a??``,v=ee(g),y=Array.from(f).some(e=>(e.props.value??``)===``);return P.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[v,g]),(0,L.jsxs)(_.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>o(e.target.value),...t,style:{...te,...t.style},ref:h,defaultValue:g,children:[$(a)&&!y?(0,L.jsx)(`option`,{value:``}):null,Array.from(f)]},p)});et.displayName=$e;function tt(e){return typeof e==`function`}function $(e){return e===``||e===void 0}function nt(e){let t=a(e),n=P.useRef(``),r=P.useRef(0),i=P.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),o=P.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function rt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=it(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function it(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var at=se,ot=de;function st({className:e,children:t,...n}){return(0,L.jsxs)(le,{className:O(`flex h-8 w-full cursor-pointer items-center justify-between gap-2 px-2.5 [&>span]:truncate`,E,e),...n,children:[t,(0,L.jsx)(pe,{asChild:!0,children:(0,L.jsx)(N,{className:`size-3.5 shrink-0 text-fg-muted`})})]})}function ct({className:e,children:t,position:n=`popper`,...r}){return(0,L.jsx)(_e,{children:(0,L.jsx)(ve,{position:n,sideOffset:4,className:O(`z-50 max-h-72 min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-content-available-width)] overflow-y-auto rounded-md bg-elevated p-1 shadow-xl`,e),...r,children:(0,L.jsx)(je,{children:t})})})}function lt({className:e,children:t,detail:n,...r}){return(0,L.jsxs)(Be,{className:O(T,x,`py-1.5 pl-7 pr-2`,e),...r,children:[(0,L.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,L.jsx)(Ue,{children:(0,L.jsx)(M,{className:`size-3.5`})})}),(0,L.jsx)(Ve,{children:t}),n]})}var ut={agent:{baseBranch:``,separateBranch:!1,separateWorktree:!1},terminal:{baseBranch:``,separateBranch:!1,separateWorktree:!1}};function dt(e,t){let n=t?.sessionDefaults?.[e],r=ut[e],i=n?.separateBranch??r.separateBranch;return{baseBranch:n?.baseBranch??r.baseBranch,separateBranch:i,separateWorktree:i?!0:n?.separateWorktree??r.separateWorktree}}export{st as a,lt as i,at as n,ot as o,ct as r,N as s,dt as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{A as i,C as a,E as o,O as s,S as c,_ as l,b as u,d,f,j as p,m,p as h,v as g,w as _,x as v,y}from"./dialog-B43iKmfK.js";import{_t as b,ft as x,gt as S,ht as C,mt as w,pt as T,ut as E,vt as D}from"./LazyTerminal-BNKlV3ik.js";import{t as O}from"./utils-B6KiDbIe.js";import{t as k}from"./createLucideIcon-DyMAgLa3.js";import{n as A,t as j}from"./dist-i-QevsUb.js";import{R as ee,jt as te}from"./index-o0lu1P9z.js";var M=k(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),N=k(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),P=e(t(),1),F=e(n(),1);function I(e,[t,n]){return Math.min(n,Math.max(t,e))}var L=r(),R=[` `,`Enter`,`ArrowUp`,`ArrowDown`],z=[` `,`Enter`],B=`Select`,[V,H,U]=A(B),[W,ne]=s(B,[U,D]),G=D(),[re,K]=W(B),[ie,q]=W(B),ae=`SelectProvider`;function oe(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g,internal_do_not_use_render:_}=e,v=G(t),[y,x]=P.useState(null),[S,C]=P.useState(null),[w,T]=P.useState(!1),E=j(d),[D,O]=l({prop:r,defaultProp:i??!1,onChange:a,caller:B}),[k,A]=l({prop:o,defaultProp:s,onChange:c,caller:B}),ee=P.useRef(null),te=P.useRef(k);P.useEffect(()=>{let e=g?y?.ownerDocument.getElementById(g):y?.form;if(e instanceof HTMLFormElement){let t=()=>A(te.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,y,A]);let M=!y||!!g||!!y.closest(`form`),[N,F]=P.useState(new Set),I=u(),R=Array.from(N).map(e=>e.props.value).join(`;`),z=P.useCallback(e=>{F(t=>new Set(t).add(e))},[]),H=P.useCallback(e=>{F(t=>{let n=new Set(t);return n.delete(e),n})},[]),U={required:h,trigger:y,onTriggerChange:x,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:I,value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:ee,disabled:m,name:f,autoComplete:p,form:g,nativeOptions:N,nativeSelectKey:R,isFormControl:M};return(0,L.jsx)(b,{...v,children:(0,L.jsx)(re,{scope:t,...U,children:(0,L.jsx)(V.Provider,{scope:t,children:(0,L.jsx)(ie,{scope:t,onNativeOptionAdd:z,onNativeOptionRemove:H,children:tt(_)?_(U):n})})})})}oe.displayName=ae;var se=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,L.jsx)(oe,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[n,e?(0,L.jsx)(et,{__scopeSelect:t}):null]})})};se.displayName=B;var ce=`SelectTrigger`,le=P.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...a}=e,o=G(n),s=K(ce,n),c=s.disabled||r,l=i(t,s.onTriggerChange),u=H(n),d=P.useRef(`touch`),[f,m,h]=nt(e=>{let t=u().filter(e=>!e.disabled),n=rt(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),g=e=>{c||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,L.jsx)(w,{asChild:!0,...o,children:(0,L.jsx)(_.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":$(s.value)?``:void 0,...a,ref:l,onClick:p(a.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&g(e)}),onPointerDown:p(a.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:p(a.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&R.includes(e.key)&&(g(),e.preventDefault())})})})});le.displayName=ce;var ue=`SelectValue`,de=P.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:a,children:o,placeholder:s=``,...c}=e,l=K(ue,n),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=i(t,l.onValueNodeChange);v(()=>{u(d)},[u,d]);let p=$(l.value);return(0,L.jsx)(_.span,{...c,asChild:!p&&c.asChild,ref:f,style:{pointerEvents:`none`},children:(0,L.jsx)(P.Fragment,{children:p?s:o},p?`placeholder`:`value`)})});de.displayName=ue;var fe=`SelectIcon`,pe=P.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,L.jsx)(_.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});pe.displayName=fe;var me=`SelectPortal`,[he,ge]=W(me,{forceMount:void 0}),_e=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,L.jsx)(he,{scope:e.__scopeSelect,forceMount:n,children:(0,L.jsx)(y,{asChild:!0,...r})})};_e.displayName=me;var J=`SelectContent`,ve=P.forwardRef((e,t)=>{let n=ge(J,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=K(J,e.__scopeSelect),[o,s]=P.useState();return v(()=>{s(new DocumentFragment)},[]),(0,L.jsx)(g,{present:r||a.open,children:({present:e})=>e?(0,L.jsx)(Ce,{...i,ref:t}):(0,L.jsx)(ye,{...i,fragment:o})})});ve.displayName=J;var ye=P.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?F.createPortal((0,L.jsx)(be,{scope:n,children:(0,L.jsx)(V.Slot,{scope:n,children:(0,L.jsx)(`div`,{ref:t,children:r})})}),i):null});ye.displayName=`SelectContentFragment`;var Y=10,[be,X]=W(J),xe=`SelectContentImpl`,Se=o(`SelectContent.RemoveScroll`),Ce=P.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:u,align:g,alignOffset:_,arrowPadding:v,collisionBoundary:y,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C,...w}=e,T=K(J,n),[E,D]=P.useState(null),[O,k]=P.useState(null),A=i(t,D),[j,ee]=P.useState(null),[te,M]=P.useState(null),N=H(n),[F,I]=P.useState(!1),R=P.useRef(!1);P.useEffect(()=>{if(E)return d(E)},[E]),h();let z=P.useCallback(e=>{let[t,...n]=N().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[N,O]),B=P.useCallback(()=>z([j,E]),[z,j,E]);P.useEffect(()=>{F&&B()},[F,B]);let{onOpenChange:V,triggerPointerDownPosRef:U}=T;P.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(U.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||V(!1),document.removeEventListener(`pointermove`,t),U.current=null};return U.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,V,U]),P.useEffect(()=>{let e=()=>V(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[V]);let[W,ne]=nt(e=>{let t=N().filter(e=>!e.disabled),n=rt(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),G=P.useCallback((e,t,n)=>{let r=!R.current&&!n;(T.value!==void 0&&T.value===t||r)&&(ee(e),r&&(R.current=!0))},[T.value]),re=P.useCallback(()=>E?.focus(),[E]),ie=P.useCallback((e,t,n)=>{let r=!R.current&&!n;(T.value!==void 0&&T.value===t||r)&&M(e)},[T.value]),q=r===`popper`?De:Te,ae=q===De?{side:l,sideOffset:u,align:g,alignOffset:_,arrowPadding:v,collisionBoundary:y,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C}:{};return(0,L.jsx)(be,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:G,selectedItem:j,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:B,selectedItemText:te,position:r,isPositioned:F,searchRef:W,children:(0,L.jsx)(f,{as:Se,allowPinchZoom:!0,children:(0,L.jsx)(m,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:p(a,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,L.jsx)(c,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,L.jsx)(q,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...ae,onPlaced:()=>I(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:p(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>z(t)),e.preventDefault()}})})})})})})});Ce.displayName=xe;var we=`SelectItemAlignedPosition`,Te=P.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...a}=e,o=K(J,n),s=X(J,n),[c,l]=P.useState(null),[u,d]=P.useState(null),f=i(t,d),p=H(n),m=P.useRef(!1),h=P.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=P.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&u&&g&&y&&b){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(o.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Y,d=I(a,[Y,Math.max(Y,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Y,d=I(a,[Y,Math.max(Y,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=p(),s=window.innerHeight-Y*2,l=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),_=parseInt(d.borderBottomWidth,10),v=parseInt(d.paddingBottom,10),x=f+h+l+v+_,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Y,D=s-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+h+k,j=x-A;if(A<=E){let e=a.length>0&&y===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+_);c.style.height=n+`px`}else{let e=a.length>0&&y===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+g.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}c.style.margin=`${Y}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,c,u,g,y,b,o.dir,r]);v(()=>S(),[S]);let[C,w]=P.useState();return v(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]),(0,L.jsx)(Oe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:P.useCallback(e=>{e&&h.current===!0&&(S(),x?.(),h.current=!1)},[S,x]),children:(0,L.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,L.jsx)(_.div,{...a,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});Te.displayName=we;var Ee=`SelectPopperPosition`,De=P.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=G(n);return(0,L.jsx)(S,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});De.displayName=Ee;var[Oe,ke]=W(J,{}),Ae=`SelectViewport`,je=P.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...a}=e,o=X(Ae,n),s=ke(Ae,n),c=i(t,o.onViewportChange),l=P.useRef(0);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,L.jsx)(V.Slot,{scope:n,children:(0,L.jsx)(_.div,{"data-radix-select-viewport":``,role:`presentation`,...a,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...a.style},onScroll:p(a.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});je.displayName=Ae;var Me=`SelectGroup`,[Ne,Pe]=W(Me),Fe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=u();return(0,L.jsx)(Ne,{scope:n,id:i,children:(0,L.jsx)(_.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Fe.displayName=Me;var Ie=`SelectLabel`,Le=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Pe(Ie,n);return(0,L.jsx)(_.div,{id:i.id,...r,ref:t})});Le.displayName=Ie;var Z=`SelectItem`,[Re,ze]=W(Z),Be=P.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...c}=e,l=K(Z,n),d=X(Z,n),f=l.value===r,[m,h]=P.useState(s??``),[g,v]=P.useState(!1),y=i(t,a(e=>d.itemRefCallback?.(e,r,o))),b=u(),x=P.useRef(`touch`),S=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};return(0,L.jsx)(Re,{scope:n,value:r,disabled:o,textId:b,isSelected:f,onItemTextChange:P.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,L.jsx)(V.ItemSlot,{scope:n,value:r,disabled:o,textValue:m,children:(0,L.jsx)(_.div,{role:`option`,"aria-labelledby":b,"data-highlighted":g?``:void 0,"aria-selected":f&&g,"data-state":f?`checked`:`unchecked`,"aria-disabled":o||void 0,"data-disabled":o?``:void 0,tabIndex:o?void 0:-1,...c,ref:y,onFocus:p(c.onFocus,()=>v(!0)),onBlur:p(c.onBlur,()=>v(!1)),onClick:p(c.onClick,()=>{x.current!==`mouse`&&S()}),onPointerUp:p(c.onPointerUp,()=>{x.current===`mouse`&&S()}),onPointerDown:p(c.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:p(c.onPointerMove,e=>{x.current=e.pointerType,o?d.onItemLeave?.():x.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:p(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:p(c.onKeyDown,e=>{o||e.target!==e.currentTarget||d.searchRef?.current!==``&&e.key===` `||(z.includes(e.key)&&S(),e.key===` `&&e.preventDefault())})})})})});Be.displayName=Z;var Q=`SelectItemText`,Ve=P.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:o,...s}=e,c=K(Q,n),l=X(Q,n),u=ze(Q,n),d=q(Q,n),[f,p]=P.useState(null),m=a(e=>l.itemTextRefCallback?.(e,u.value,u.disabled)),h=i(t,p,u.onItemTextChange,m),g=f?.textContent,y=P.useMemo(()=>(0,L.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=d;return v(()=>(b(y),()=>x(y)),[b,x,y]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(_.span,{id:u.textId,...s,ref:h}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!$(c.value)?F.createPortal(s.children,c.valueNode):null]})});Ve.displayName=Q;var He=`SelectItemIndicator`,Ue=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return ze(He,n).isSelected?(0,L.jsx)(_.span,{"aria-hidden":!0,...r,ref:t}):null});Ue.displayName=He;var We=`SelectScrollUpButton`,Ge=P.forwardRef((e,t)=>{let n=X(We,e.__scopeSelect),r=ke(We,e.__scopeSelect),[a,o]=P.useState(!1),s=i(t,r.onScrollButtonChange);return v(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;o(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,L.jsx)(Je,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ge.displayName=We;var Ke=`SelectScrollDownButton`,qe=P.forwardRef((e,t)=>{let n=X(Ke,e.__scopeSelect),r=ke(Ke,e.__scopeSelect),[a,o]=P.useState(!1),s=i(t,r.onScrollButtonChange);return v(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),a?(0,L.jsx)(Je,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});qe.displayName=Ke;var Je=P.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=X(`SelectScrollButton`,n),o=P.useRef(null),s=H(n),c=P.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return P.useEffect(()=>()=>c(),[c]),v(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,L.jsx)(_.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:p(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:p(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:p(i.onPointerLeave,()=>{c()})})}),Ye=`SelectSeparator`,Xe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,L.jsx)(_.div,{"aria-hidden":!0,...r,ref:t})});Xe.displayName=Ye;var Ze=`SelectArrow`,Qe=P.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=G(n);return X(Ze,n).position===`popper`?(0,L.jsx)(C,{...i,...r,ref:t}):null});Qe.displayName=Ze;var $e=`SelectBubbleInput`,et=P.forwardRef(({__scopeSelect:e,...t},n)=>{let r=K($e,e),{value:a,onValueChange:o,required:s,disabled:c,name:l,autoComplete:u,form:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,m=P.useRef(null),h=i(n,m),g=a??``,v=ee(g),y=Array.from(f).some(e=>(e.props.value??``)===``);return P.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[v,g]),(0,L.jsxs)(_.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>o(e.target.value),...t,style:{...te,...t.style},ref:h,defaultValue:g,children:[$(a)&&!y?(0,L.jsx)(`option`,{value:``}):null,Array.from(f)]},p)});et.displayName=$e;function tt(e){return typeof e==`function`}function $(e){return e===``||e===void 0}function nt(e){let t=a(e),n=P.useRef(``),r=P.useRef(0),i=P.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),o=P.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function rt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=it(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function it(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var at=se,ot=de;function st({className:e,children:t,...n}){return(0,L.jsxs)(le,{className:O(`flex h-8 w-full cursor-pointer items-center justify-between gap-2 px-2.5 [&>span]:truncate`,E,e),...n,children:[t,(0,L.jsx)(pe,{asChild:!0,children:(0,L.jsx)(N,{className:`size-3.5 shrink-0 text-fg-muted`})})]})}function ct({className:e,children:t,position:n=`popper`,...r}){return(0,L.jsx)(_e,{children:(0,L.jsx)(ve,{position:n,sideOffset:4,className:O(`z-50 max-h-72 min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-content-available-width)] overflow-y-auto rounded-md bg-elevated p-1 shadow-xl`,e),...r,children:(0,L.jsx)(je,{children:t})})})}function lt({className:e,children:t,detail:n,...r}){return(0,L.jsxs)(Be,{className:O(T,x,`py-1.5 pl-7 pr-2`,e),...r,children:[(0,L.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,L.jsx)(Ue,{children:(0,L.jsx)(M,{className:`size-3.5`})})}),(0,L.jsx)(Ve,{children:t}),n]})}var ut={agent:{baseBranch:``,separateBranch:!1,separateWorktree:!1},terminal:{baseBranch:``,separateBranch:!1,separateWorktree:!1}};function dt(e,t){let n=t?.sessionDefaults?.[e],r=ut[e],i=n?.separateBranch??r.separateBranch;return{baseBranch:n?.baseBranch??r.baseBranch,separateBranch:i,separateWorktree:i?!0:n?.separateWorktree??r.separateWorktree}}export{st as a,lt as i,at as n,ot as o,ct as r,N as s,dt as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./index-o0lu1P9z.js";function t(){return e.get()}export{t};
@@ -1,4 +1,4 @@
1
- import{a as e,c as t,f as n,h as r,o as i,p as a}from"./editor.api2-4X9Vh9Zw.js";import{m as o,p as s}from"./buffer-store-B9nuo0xJ.js";var c=class{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;let e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||=(async()=>(this._worker=o({moduleId:`vs/language/typescript/tsWorker`,createWorker:()=>new Worker(new URL(`/assets/ts.worker-BtjBFNHX.js`,``+import.meta.url),{type:`module`}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(a.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))(),this._client}async getLanguageServiceWorker(...e){let t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}},l={};l[`lib.d.ts`]=!0,l[`lib.decorators.d.ts`]=!0,l[`lib.decorators.legacy.d.ts`]=!0,l[`lib.dom.asynciterable.d.ts`]=!0,l[`lib.dom.d.ts`]=!0,l[`lib.dom.iterable.d.ts`]=!0,l[`lib.es2015.collection.d.ts`]=!0,l[`lib.es2015.core.d.ts`]=!0,l[`lib.es2015.d.ts`]=!0,l[`lib.es2015.generator.d.ts`]=!0,l[`lib.es2015.iterable.d.ts`]=!0,l[`lib.es2015.promise.d.ts`]=!0,l[`lib.es2015.proxy.d.ts`]=!0,l[`lib.es2015.reflect.d.ts`]=!0,l[`lib.es2015.symbol.d.ts`]=!0,l[`lib.es2015.symbol.wellknown.d.ts`]=!0,l[`lib.es2016.array.include.d.ts`]=!0,l[`lib.es2016.d.ts`]=!0,l[`lib.es2016.full.d.ts`]=!0,l[`lib.es2016.intl.d.ts`]=!0,l[`lib.es2017.arraybuffer.d.ts`]=!0,l[`lib.es2017.d.ts`]=!0,l[`lib.es2017.date.d.ts`]=!0,l[`lib.es2017.full.d.ts`]=!0,l[`lib.es2017.intl.d.ts`]=!0,l[`lib.es2017.object.d.ts`]=!0,l[`lib.es2017.sharedmemory.d.ts`]=!0,l[`lib.es2017.string.d.ts`]=!0,l[`lib.es2017.typedarrays.d.ts`]=!0,l[`lib.es2018.asyncgenerator.d.ts`]=!0,l[`lib.es2018.asynciterable.d.ts`]=!0,l[`lib.es2018.d.ts`]=!0,l[`lib.es2018.full.d.ts`]=!0,l[`lib.es2018.intl.d.ts`]=!0,l[`lib.es2018.promise.d.ts`]=!0,l[`lib.es2018.regexp.d.ts`]=!0,l[`lib.es2019.array.d.ts`]=!0,l[`lib.es2019.d.ts`]=!0,l[`lib.es2019.full.d.ts`]=!0,l[`lib.es2019.intl.d.ts`]=!0,l[`lib.es2019.object.d.ts`]=!0,l[`lib.es2019.string.d.ts`]=!0,l[`lib.es2019.symbol.d.ts`]=!0,l[`lib.es2020.bigint.d.ts`]=!0,l[`lib.es2020.d.ts`]=!0,l[`lib.es2020.date.d.ts`]=!0,l[`lib.es2020.full.d.ts`]=!0,l[`lib.es2020.intl.d.ts`]=!0,l[`lib.es2020.number.d.ts`]=!0,l[`lib.es2020.promise.d.ts`]=!0,l[`lib.es2020.sharedmemory.d.ts`]=!0,l[`lib.es2020.string.d.ts`]=!0,l[`lib.es2020.symbol.wellknown.d.ts`]=!0,l[`lib.es2021.d.ts`]=!0,l[`lib.es2021.full.d.ts`]=!0,l[`lib.es2021.intl.d.ts`]=!0,l[`lib.es2021.promise.d.ts`]=!0,l[`lib.es2021.string.d.ts`]=!0,l[`lib.es2021.weakref.d.ts`]=!0,l[`lib.es2022.array.d.ts`]=!0,l[`lib.es2022.d.ts`]=!0,l[`lib.es2022.error.d.ts`]=!0,l[`lib.es2022.full.d.ts`]=!0,l[`lib.es2022.intl.d.ts`]=!0,l[`lib.es2022.object.d.ts`]=!0,l[`lib.es2022.regexp.d.ts`]=!0,l[`lib.es2022.string.d.ts`]=!0,l[`lib.es2023.array.d.ts`]=!0,l[`lib.es2023.collection.d.ts`]=!0,l[`lib.es2023.d.ts`]=!0,l[`lib.es2023.full.d.ts`]=!0,l[`lib.es2023.intl.d.ts`]=!0,l[`lib.es2024.arraybuffer.d.ts`]=!0,l[`lib.es2024.collection.d.ts`]=!0,l[`lib.es2024.d.ts`]=!0,l[`lib.es2024.full.d.ts`]=!0,l[`lib.es2024.object.d.ts`]=!0,l[`lib.es2024.promise.d.ts`]=!0,l[`lib.es2024.regexp.d.ts`]=!0,l[`lib.es2024.sharedmemory.d.ts`]=!0,l[`lib.es2024.string.d.ts`]=!0,l[`lib.es5.d.ts`]=!0,l[`lib.es6.d.ts`]=!0,l[`lib.esnext.array.d.ts`]=!0,l[`lib.esnext.collection.d.ts`]=!0,l[`lib.esnext.d.ts`]=!0,l[`lib.esnext.decorators.d.ts`]=!0,l[`lib.esnext.disposable.d.ts`]=!0,l[`lib.esnext.error.d.ts`]=!0,l[`lib.esnext.float16.d.ts`]=!0,l[`lib.esnext.full.d.ts`]=!0,l[`lib.esnext.intl.d.ts`]=!0,l[`lib.esnext.iterator.d.ts`]=!0,l[`lib.esnext.promise.d.ts`]=!0,l[`lib.esnext.sharedmemory.d.ts`]=!0,l[`lib.scripthost.d.ts`]=!0,l[`lib.webworker.asynciterable.d.ts`]=!0,l[`lib.webworker.d.ts`]=!0,l[`lib.webworker.importscripts.d.ts`]=!0,l[`lib.webworker.iterable.d.ts`]=!0;function u(e,t,n=0){if(typeof e==`string`)return e;if(e===void 0)return``;let r=``;if(n){r+=t;for(let e=0;e<n;e++)r+=` `}if(r+=e.messageText,n++,e.next)for(let i of e.next)r+=u(i,t,n);return r}function d(e){return e?e.map(e=>e.text).join(``):``}var f=class{constructor(e){this._worker=e}_textSpanToRange(e,t){let n=e.getPositionAt(t.start),r=e.getPositionAt(t.start+t.length),{lineNumber:i,column:a}=n,{lineNumber:o,column:s}=r;return{startLineNumber:i,startColumn:a,endLineNumber:o,endColumn:s}}},p=class{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e?e.path.indexOf(`/lib.`)===0&&!!l[e.path.slice(1)]:!1}getOrCreateModel(e){let t=n.parse(e),r=a.getModel(t);if(r)return r;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return a.createModel(this._libFiles[t.path.slice(1)],`typescript`,t);let i=s.getExtraLibs()[e];return i?a.createModel(i.content,`typescript`,t):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e}),this._fetchLibFilesPromise}},m=class extends f{constructor(e,t,n,r){super(r),this._libFiles=e,this._defaults=t,this._selector=n,this._disposables=[],this._listener=Object.create(null);let i=e=>{if(e.getLanguageId()!==n)return;let t=()=>{let{onlyVisible:t}=this._defaults.getDiagnosticsOptions();t?e.isAttachedToEditor()&&this._doValidate(e):this._doValidate(e)},r,i=e.onDidChangeContent(()=>{clearTimeout(r),r=window.setTimeout(t,500)}),o=e.onDidChangeAttached(()=>{let{onlyVisible:n}=this._defaults.getDiagnosticsOptions();n&&(e.isAttachedToEditor()?t():a.setModelMarkers(e,this._selector,[]))});this._listener[e.uri.toString()]={dispose(){i.dispose(),o.dispose(),clearTimeout(r)}},t()},o=e=>{a.setModelMarkers(e,this._selector,[]);let t=e.uri.toString();this._listener[t]&&(this._listener[t].dispose(),delete this._listener[t])};this._disposables.push(a.onDidCreateModel(e=>i(e))),this._disposables.push(a.onWillDisposeModel(o)),this._disposables.push(a.onDidChangeModelLanguage(e=>{o(e.model),i(e.model)})),this._disposables.push({dispose(){for(let e of a.getModels())o(e)}});let s=()=>{for(let e of a.getModels())o(e),i(e)};this._disposables.push(this._defaults.onDidChange(s)),this._disposables.push(this._defaults.onDidExtraLibsChange(s)),a.getModels().forEach(e=>i(e))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){let t=await this._worker(e.uri);if(e.isDisposed())return;let r=[],{noSyntaxValidation:i,noSemanticValidation:o,noSuggestionDiagnostics:s}=this._defaults.getDiagnosticsOptions();i||r.push(t.getSyntacticDiagnostics(e.uri.toString())),o||r.push(t.getSemanticDiagnostics(e.uri.toString())),s||r.push(t.getSuggestionDiagnostics(e.uri.toString()));let c=await Promise.all(r);if(!c||e.isDisposed())return;let l=c.reduce((e,t)=>t.concat(e),[]).filter(e=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(e.code)===-1),u=l.map(e=>e.relatedInformation||[]).reduce((e,t)=>t.concat(e),[]).map(e=>e.file?n.parse(e.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(u),!e.isDisposed()&&a.setModelMarkers(e,this._selector,l.map(t=>this._convertDiagnostics(e,t)))}_convertDiagnostics(e,t){let n=t.start||0,r=t.length||1,{lineNumber:a,column:o}=e.getPositionAt(n),{lineNumber:s,column:c}=e.getPositionAt(n+r),l=[];return t.reportsUnnecessary&&l.push(i.Unnecessary),t.reportsDeprecated&&l.push(i.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:a,startColumn:o,endLineNumber:s,endColumn:c,message:u(t.messageText,`
1
+ import{a as e,c as t,f as n,h as r,o as i,p as a}from"./editor.api2-4X9Vh9Zw.js";import{m as o,p as s}from"./buffer-store-BUxk5YP-.js";var c=class{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;let e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||=(async()=>(this._worker=o({moduleId:`vs/language/typescript/tsWorker`,createWorker:()=>new Worker(new URL(`/assets/ts.worker-BtjBFNHX.js`,``+import.meta.url),{type:`module`}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(a.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))(),this._client}async getLanguageServiceWorker(...e){let t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}},l={};l[`lib.d.ts`]=!0,l[`lib.decorators.d.ts`]=!0,l[`lib.decorators.legacy.d.ts`]=!0,l[`lib.dom.asynciterable.d.ts`]=!0,l[`lib.dom.d.ts`]=!0,l[`lib.dom.iterable.d.ts`]=!0,l[`lib.es2015.collection.d.ts`]=!0,l[`lib.es2015.core.d.ts`]=!0,l[`lib.es2015.d.ts`]=!0,l[`lib.es2015.generator.d.ts`]=!0,l[`lib.es2015.iterable.d.ts`]=!0,l[`lib.es2015.promise.d.ts`]=!0,l[`lib.es2015.proxy.d.ts`]=!0,l[`lib.es2015.reflect.d.ts`]=!0,l[`lib.es2015.symbol.d.ts`]=!0,l[`lib.es2015.symbol.wellknown.d.ts`]=!0,l[`lib.es2016.array.include.d.ts`]=!0,l[`lib.es2016.d.ts`]=!0,l[`lib.es2016.full.d.ts`]=!0,l[`lib.es2016.intl.d.ts`]=!0,l[`lib.es2017.arraybuffer.d.ts`]=!0,l[`lib.es2017.d.ts`]=!0,l[`lib.es2017.date.d.ts`]=!0,l[`lib.es2017.full.d.ts`]=!0,l[`lib.es2017.intl.d.ts`]=!0,l[`lib.es2017.object.d.ts`]=!0,l[`lib.es2017.sharedmemory.d.ts`]=!0,l[`lib.es2017.string.d.ts`]=!0,l[`lib.es2017.typedarrays.d.ts`]=!0,l[`lib.es2018.asyncgenerator.d.ts`]=!0,l[`lib.es2018.asynciterable.d.ts`]=!0,l[`lib.es2018.d.ts`]=!0,l[`lib.es2018.full.d.ts`]=!0,l[`lib.es2018.intl.d.ts`]=!0,l[`lib.es2018.promise.d.ts`]=!0,l[`lib.es2018.regexp.d.ts`]=!0,l[`lib.es2019.array.d.ts`]=!0,l[`lib.es2019.d.ts`]=!0,l[`lib.es2019.full.d.ts`]=!0,l[`lib.es2019.intl.d.ts`]=!0,l[`lib.es2019.object.d.ts`]=!0,l[`lib.es2019.string.d.ts`]=!0,l[`lib.es2019.symbol.d.ts`]=!0,l[`lib.es2020.bigint.d.ts`]=!0,l[`lib.es2020.d.ts`]=!0,l[`lib.es2020.date.d.ts`]=!0,l[`lib.es2020.full.d.ts`]=!0,l[`lib.es2020.intl.d.ts`]=!0,l[`lib.es2020.number.d.ts`]=!0,l[`lib.es2020.promise.d.ts`]=!0,l[`lib.es2020.sharedmemory.d.ts`]=!0,l[`lib.es2020.string.d.ts`]=!0,l[`lib.es2020.symbol.wellknown.d.ts`]=!0,l[`lib.es2021.d.ts`]=!0,l[`lib.es2021.full.d.ts`]=!0,l[`lib.es2021.intl.d.ts`]=!0,l[`lib.es2021.promise.d.ts`]=!0,l[`lib.es2021.string.d.ts`]=!0,l[`lib.es2021.weakref.d.ts`]=!0,l[`lib.es2022.array.d.ts`]=!0,l[`lib.es2022.d.ts`]=!0,l[`lib.es2022.error.d.ts`]=!0,l[`lib.es2022.full.d.ts`]=!0,l[`lib.es2022.intl.d.ts`]=!0,l[`lib.es2022.object.d.ts`]=!0,l[`lib.es2022.regexp.d.ts`]=!0,l[`lib.es2022.string.d.ts`]=!0,l[`lib.es2023.array.d.ts`]=!0,l[`lib.es2023.collection.d.ts`]=!0,l[`lib.es2023.d.ts`]=!0,l[`lib.es2023.full.d.ts`]=!0,l[`lib.es2023.intl.d.ts`]=!0,l[`lib.es2024.arraybuffer.d.ts`]=!0,l[`lib.es2024.collection.d.ts`]=!0,l[`lib.es2024.d.ts`]=!0,l[`lib.es2024.full.d.ts`]=!0,l[`lib.es2024.object.d.ts`]=!0,l[`lib.es2024.promise.d.ts`]=!0,l[`lib.es2024.regexp.d.ts`]=!0,l[`lib.es2024.sharedmemory.d.ts`]=!0,l[`lib.es2024.string.d.ts`]=!0,l[`lib.es5.d.ts`]=!0,l[`lib.es6.d.ts`]=!0,l[`lib.esnext.array.d.ts`]=!0,l[`lib.esnext.collection.d.ts`]=!0,l[`lib.esnext.d.ts`]=!0,l[`lib.esnext.decorators.d.ts`]=!0,l[`lib.esnext.disposable.d.ts`]=!0,l[`lib.esnext.error.d.ts`]=!0,l[`lib.esnext.float16.d.ts`]=!0,l[`lib.esnext.full.d.ts`]=!0,l[`lib.esnext.intl.d.ts`]=!0,l[`lib.esnext.iterator.d.ts`]=!0,l[`lib.esnext.promise.d.ts`]=!0,l[`lib.esnext.sharedmemory.d.ts`]=!0,l[`lib.scripthost.d.ts`]=!0,l[`lib.webworker.asynciterable.d.ts`]=!0,l[`lib.webworker.d.ts`]=!0,l[`lib.webworker.importscripts.d.ts`]=!0,l[`lib.webworker.iterable.d.ts`]=!0;function u(e,t,n=0){if(typeof e==`string`)return e;if(e===void 0)return``;let r=``;if(n){r+=t;for(let e=0;e<n;e++)r+=` `}if(r+=e.messageText,n++,e.next)for(let i of e.next)r+=u(i,t,n);return r}function d(e){return e?e.map(e=>e.text).join(``):``}var f=class{constructor(e){this._worker=e}_textSpanToRange(e,t){let n=e.getPositionAt(t.start),r=e.getPositionAt(t.start+t.length),{lineNumber:i,column:a}=n,{lineNumber:o,column:s}=r;return{startLineNumber:i,startColumn:a,endLineNumber:o,endColumn:s}}},p=class{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e?e.path.indexOf(`/lib.`)===0&&!!l[e.path.slice(1)]:!1}getOrCreateModel(e){let t=n.parse(e),r=a.getModel(t);if(r)return r;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return a.createModel(this._libFiles[t.path.slice(1)],`typescript`,t);let i=s.getExtraLibs()[e];return i?a.createModel(i.content,`typescript`,t):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e}),this._fetchLibFilesPromise}},m=class extends f{constructor(e,t,n,r){super(r),this._libFiles=e,this._defaults=t,this._selector=n,this._disposables=[],this._listener=Object.create(null);let i=e=>{if(e.getLanguageId()!==n)return;let t=()=>{let{onlyVisible:t}=this._defaults.getDiagnosticsOptions();t?e.isAttachedToEditor()&&this._doValidate(e):this._doValidate(e)},r,i=e.onDidChangeContent(()=>{clearTimeout(r),r=window.setTimeout(t,500)}),o=e.onDidChangeAttached(()=>{let{onlyVisible:n}=this._defaults.getDiagnosticsOptions();n&&(e.isAttachedToEditor()?t():a.setModelMarkers(e,this._selector,[]))});this._listener[e.uri.toString()]={dispose(){i.dispose(),o.dispose(),clearTimeout(r)}},t()},o=e=>{a.setModelMarkers(e,this._selector,[]);let t=e.uri.toString();this._listener[t]&&(this._listener[t].dispose(),delete this._listener[t])};this._disposables.push(a.onDidCreateModel(e=>i(e))),this._disposables.push(a.onWillDisposeModel(o)),this._disposables.push(a.onDidChangeModelLanguage(e=>{o(e.model),i(e.model)})),this._disposables.push({dispose(){for(let e of a.getModels())o(e)}});let s=()=>{for(let e of a.getModels())o(e),i(e)};this._disposables.push(this._defaults.onDidChange(s)),this._disposables.push(this._defaults.onDidExtraLibsChange(s)),a.getModels().forEach(e=>i(e))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){let t=await this._worker(e.uri);if(e.isDisposed())return;let r=[],{noSyntaxValidation:i,noSemanticValidation:o,noSuggestionDiagnostics:s}=this._defaults.getDiagnosticsOptions();i||r.push(t.getSyntacticDiagnostics(e.uri.toString())),o||r.push(t.getSemanticDiagnostics(e.uri.toString())),s||r.push(t.getSuggestionDiagnostics(e.uri.toString()));let c=await Promise.all(r);if(!c||e.isDisposed())return;let l=c.reduce((e,t)=>t.concat(e),[]).filter(e=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(e.code)===-1),u=l.map(e=>e.relatedInformation||[]).reduce((e,t)=>t.concat(e),[]).map(e=>e.file?n.parse(e.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(u),!e.isDisposed()&&a.setModelMarkers(e,this._selector,l.map(t=>this._convertDiagnostics(e,t)))}_convertDiagnostics(e,t){let n=t.start||0,r=t.length||1,{lineNumber:a,column:o}=e.getPositionAt(n),{lineNumber:s,column:c}=e.getPositionAt(n+r),l=[];return t.reportsUnnecessary&&l.push(i.Unnecessary),t.reportsDeprecated&&l.push(i.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:a,startColumn:o,endLineNumber:s,endColumn:c,message:u(t.messageText,`
2
2
  `),code:t.code.toString(),tags:l,relatedInformation:this._convertRelatedInformation(e,t.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];let n=[];return t.forEach(t=>{let r=e;if(t.file&&(r=this._libFiles.getOrCreateModel(t.file.fileName)),!r)return;let i=t.start||0,a=t.length||1,{lineNumber:o,column:s}=r.getPositionAt(i),{lineNumber:c,column:l}=r.getPositionAt(i+a);n.push({resource:r.uri,startLineNumber:o,startColumn:s,endLineNumber:c,endColumn:l,message:u(t.messageText,`
3
3
  `)})}),n}_tsDiagnosticCategoryToMarkerSeverity(t){switch(t){case 1:return e.Error;case 3:return e.Info;case 0:return e.Warning;case 2:return e.Hint}return e.Info}},h=class e extends f{get triggerCharacters(){return[`.`]}async provideCompletionItems(n,i,a,o){let s=n.getWordUntilPosition(i),c=new t(i.lineNumber,s.startColumn,i.lineNumber,s.endColumn),l=n.uri,u=n.getOffsetAt(i),d=await this._worker(l);if(n.isDisposed())return;let f=await d.getCompletionsAtPosition(l.toString(),u);if(!(!f||n.isDisposed()))return{suggestions:f.entries.map(a=>{let o=c;if(a.replacementSpan){let e=n.getPositionAt(a.replacementSpan.start),r=n.getPositionAt(a.replacementSpan.start+a.replacementSpan.length);o=new t(e.lineNumber,e.column,r.lineNumber,r.column)}let s=[];return a.kindModifiers!==void 0&&a.kindModifiers.indexOf(`deprecated`)!==-1&&s.push(r.CompletionItemTag.Deprecated),{uri:l,position:i,offset:u,range:o,label:a.name,insertText:a.name,sortText:a.sortText,kind:e.convertKind(a.kind),tags:s}})}}async resolveCompletionItem(t,n){let r=t,i=r.uri,a=r.position,o=r.offset,s=await(await this._worker(i)).getCompletionEntryDetails(i.toString(),o,r.label);return s?{uri:i,position:a,label:s.name,kind:e.convertKind(s.kind),detail:d(s.displayParts),documentation:{value:e.createDocumentationString(s)}}:r}static convertKind(e){switch(e){case C.primitiveType:case C.keyword:return r.CompletionItemKind.Keyword;case C.variable:case C.localVariable:return r.CompletionItemKind.Variable;case C.memberVariable:case C.memberGetAccessor:case C.memberSetAccessor:return r.CompletionItemKind.Field;case C.function:case C.memberFunction:case C.constructSignature:case C.callSignature:case C.indexSignature:return r.CompletionItemKind.Function;case C.enum:return r.CompletionItemKind.Enum;case C.module:return r.CompletionItemKind.Module;case C.class:return r.CompletionItemKind.Class;case C.interface:return r.CompletionItemKind.Interface;case C.warning:return r.CompletionItemKind.File}return r.CompletionItemKind.Property}static createDocumentationString(e){let t=d(e.documentation);if(e.tags)for(let n of e.tags)t+=`
4
4
 
@@ -42,18 +42,18 @@
42
42
  // Storage disabled or unreadable: the module's own init still runs.
43
43
  }
44
44
  </script>
45
- <script type="module" crossorigin src="/assets/index-DtbA89da.js"></script>
45
+ <script type="module" crossorigin src="/assets/index-o0lu1P9z.js"></script>
46
46
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
47
47
  <link rel="modulepreload" crossorigin href="/assets/react-CZI7_Jkm.js">
48
48
  <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-ffCh33zF.js">
49
- <link rel="modulepreload" crossorigin href="/assets/api-B3lAdmrV.js">
50
- <link rel="modulepreload" crossorigin href="/assets/hotkeys-C4tM1SjP.js">
49
+ <link rel="modulepreload" crossorigin href="/assets/api-BJeOJuGe.js">
50
+ <link rel="modulepreload" crossorigin href="/assets/hotkeys-qOqg9LFd.js">
51
51
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
52
52
  <link rel="modulepreload" crossorigin href="/assets/utils-B6KiDbIe.js">
53
53
  <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-DyMAgLa3.js">
54
54
  <link rel="modulepreload" crossorigin href="/assets/dialog-B43iKmfK.js">
55
- <link rel="modulepreload" crossorigin href="/assets/LazyTerminal-C5KE5tms.js">
56
- <link rel="stylesheet" crossorigin href="/assets/index-DKJ3ig-N.css">
55
+ <link rel="modulepreload" crossorigin href="/assets/LazyTerminal-BNKlV3ik.js">
56
+ <link rel="stylesheet" crossorigin href="/assets/index-CqjHKPtJ.css">
57
57
  </head>
58
58
  <body>
59
59
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puddle-code/cli",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "puddle — self-hosted orchestrator for CLI coding agents: serves the cockpit UI and connects it to local or SSH hosts.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/PerceptronV/puddle-code#readme",
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{_ as r,f as i}from"./hotkeys-C4tM1SjP.js";import{a}from"./api-B3lAdmrV.js";import{a as o,g as s,i as c,n as l,o as u,t as d}from"./dialog-B43iKmfK.js";import{H as f,K as p,U as m,Y as h,a as g,at as _,ct as v,et as y,i as b,o as x,st as S,t as C}from"./LazyTerminal-C5KE5tms.js";import{t as w}from"./utils-B6KiDbIe.js";import{A as T,M as E,c as D,j as O,k,n as A,r as j,t as M}from"./context-menu-DWtwpCZ1.js";import{r as N}from"./dist-i-QevsUb.js";import{Rt as P,Tt as F,ct as I,it as L,ot as R,st as z,yt as B}from"./index-DtbA89da.js";var V=e(t(),1),H=n(),U=!1;function W(){let[e,t]=(0,V.useState)(U),[n,r]=(0,V.useState)(null);(0,V.useEffect)(()=>{if(!e)return;let t=!1;return I.spawnShell(a).then(e=>{t||r(e)}),()=>{t=!0}},[e]);let i=()=>{U=!1,t(!1),r(null)};return{open:e,term:n,toggle:()=>{e?(n&&I.killShell(a,n),i()):(U=!0,t(!0))},onExit:i}}function G({term:e,onExit:t}){return(0,H.jsx)(`div`,{className:`h-72 shrink-0 pb-6`,children:(0,H.jsx)(`div`,{className:`mx-auto size-full max-w-4xl px-6`,children:e!==null&&(0,H.jsx)(C,{stream:`home`,term:e,onExit:t})})})}var K=[{status:`running`,colour:`bg-running`},{status:`waiting_input`,colour:`bg-waiting`},{status:`interrupted`,colour:`bg-interrupted`}];function q({projectId:e}){let t=_(e),n=(0,V.useMemo)(()=>{let e=new Map;for(let n of t.data??[])e.set(n.status,(e.get(n.status)??0)+1);return e},[t.data]),r=(t.data??[]).filter(e=>e.status!==`archived`).length;return(0,H.jsxs)(`div`,{className:`flex items-center gap-3 text-2xs text-fg-muted tabular-nums`,children:[(0,H.jsxs)(`span`,{children:[r,` session`,r===1?``:`s`]}),K.map(({status:e,colour:t})=>{let r=n.get(e)??0;return r===0?null:(0,H.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`size-1.5 rounded-full ${t}`}),r,` `,e.replace(`_`,` `)]},e)})]})}function J({icon:e,label:t,onClick:n}){return(0,H.jsx)(`button`,{type:`button`,"aria-label":t,title:t,onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},className:`flex items-center rounded-md p-1.5 text-fg-muted transition-colors hover:bg-ground hover:text-fg`,children:(0,H.jsx)(e,{className:`size-4`})})}function Y({project:e,repoPath:t,draggable:n,dragging:r,onDragStart:i,onDragEnd:a,onDragOver:f}){let p=m(),[h,_]=(0,V.useState)(!1),[y,x]=(0,V.useState)(e.name),[C,T]=(0,V.useState)(z(e)),k=t=>p.mutate({id:e.id,archived:t},{onError:e=>b(e)}),N=()=>{x(e.name),T(z(e)),_(!0)},F=()=>{let t=y.trim(),n=R(C);if(!t){_(!1);return}let r={...t===e.name?{}:{name:t},...n&&n!==z(e)?{abbrev:n}:{}};if(Object.keys(r).length===0){_(!1);return}p.mutate({id:e.id,...r},{onSuccess:()=>_(!1),onError:e=>b(e)})};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(M,{children:[(0,H.jsx)(D,{asChild:!0,children:(0,H.jsxs)(`div`,{draggable:n,onDragStart:i,onDragEnd:a,onDragOver:f,className:w(`group relative transition-opacity`,r&&`opacity-50`),children:[(0,H.jsxs)(P,{draggable:!1,to:`/project/${e.id}`,className:`block rounded-lg bg-surface p-4 transition-colors hover:bg-elevated`,children:[(0,H.jsx)(`h2`,{className:`truncate pr-16 text-base font-semibold text-fg group-hover:text-accent`,children:e.name}),(0,H.jsx)(`p`,{className:`mt-1 truncate font-mono text-2xs text-fg-muted`,children:t??`…`}),(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(q,{projectId:e.id})})]}),(0,H.jsx)(`div`,{className:`absolute right-2 top-2 hidden gap-0.5 group-hover:flex has-[[data-state=open]]:flex pointer-coarse:flex`,children:e.archived?(0,H.jsx)(J,{icon:E,label:`Reopen project`,onClick:()=>k(!1)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(J,{icon:g,label:`Edit project`,onClick:N}),(0,H.jsx)(J,{icon:O,label:`Archive project`,onClick:()=>k(!0)})]})})]})}),(0,H.jsx)(A,{children:e.archived?(0,H.jsxs)(j,{onSelect:()=>k(!1),children:[(0,H.jsx)(E,{}),` Reopen`]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(j,{onSelect:N,children:[(0,H.jsx)(g,{}),` Edit`]}),(0,H.jsxs)(j,{onSelect:()=>k(!0),children:[(0,H.jsx)(O,{}),` Archive`]})]})})]}),(0,H.jsx)(d,{open:h,onOpenChange:_,children:(0,H.jsxs)(l,{children:[(0,H.jsx)(o,{children:(0,H.jsx)(u,{children:`Edit project`})}),(0,H.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),F()},children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(S,{htmlFor:`project-name-${e.id}`,children:`Name`}),(0,H.jsx)(v,{id:`project-name-${e.id}`,value:y,onChange:e=>x(e.target.value),autoFocus:!0})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(S,{htmlFor:`project-abbrev-${e.id}`,children:`Abbreviation`}),(0,H.jsx)(v,{id:`project-abbrev-${e.id}`,maxLength:5,value:C,onChange:e=>T(R(e.target.value)),className:`w-24 font-mono uppercase`}),(0,H.jsxs)(`p`,{className:`text-2xs text-fg-muted`,children:[`Up to `,5,` characters — the label on the collapsed sidebar rail.`]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(S,{className:`text-fg-muted`,children:`Path`}),(0,H.jsx)(`p`,{className:`truncate font-mono text-2xs text-fg-muted`,children:t??`…`})]}),(0,H.jsxs)(c,{children:[(0,H.jsx)(s,{type:`button`,variant:`ghost`,onClick:()=>_(!1),children:`Cancel`}),(0,H.jsx)(s,{type:`submit`,disabled:!y.trim()||p.isPending,children:`Save`})]})]})]})})]})}function X({icon:e,label:t,hint:n,onClick:r}){return(0,H.jsxs)(`button`,{type:`button`,onClick:r,className:`group flex flex-col rounded-lg bg-surface p-4 text-left transition-colors hover:bg-elevated`,children:[(0,H.jsxs)(`h2`,{className:`flex items-center gap-2 truncate text-base font-semibold text-fg group-hover:text-accent`,children:[(0,H.jsx)(e,{className:`size-4 shrink-0`}),t]}),(0,H.jsx)(`p`,{className:`mt-1 truncate text-2xs text-fg-muted`,children:n})]})}function Z(){let e=r(),t=h(e??void 0),n=y(),a=p(e??void 0),o=f(e??``),[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(null),[d,m]=(0,V.useState)(!1),g=W(),_=i(`palette.toggle`),v=e=>n.data?.find(t=>t.id===e)?.path,b=t.data??[],S=a.data?.projectOrder??[],C=k(b.filter(e=>!e.archived),S),E=b.filter(e=>e.archived),D=(e,t)=>{e!==t&&o.mutate({projectOrder:T(C.map(e=>e.id),e,t)})};return(0,H.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,H.jsxs)(`div`,{className:`mx-auto max-w-4xl p-6`,children:[b.length===0&&(0,H.jsxs)(`div`,{className:`mb-8 mt-16 flex flex-col items-center gap-3 text-center`,children:[(0,H.jsx)(x,{className:`size-8 text-fg-muted`}),(0,H.jsxs)(`p`,{className:`text-sm text-fg-secondary`,children:[`No projects yet — open one below, or press `,_,`.`]})]}),(0,H.jsxs)(`div`,{className:`grid auto-rows-fr grid-cols-1 gap-3 sm:grid-cols-2`,children:[C.map(e=>(0,H.jsx)(Y,{project:e,repoPath:v(e.repo_id),draggable:!0,dragging:l===e.id,onDragStart:()=>u(e.id),onDragEnd:()=>u(null),onDragOver:t=>{t.preventDefault(),l&&l!==e.id&&D(l,e.id)}},e.id)),(0,H.jsx)(X,{icon:F,label:`Open project`,hint:`Point at a repository on this host`,onClick:()=>c(!0)}),(0,H.jsx)(X,{icon:B,label:g.open?`Close terminal`:`Open terminal`,hint:g.open?`End the shell below`:`A shell at ~ for cloning repositories`,onClick:g.toggle})]}),E.length>0&&(0,H.jsxs)(`div`,{className:`mt-6`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>m(e=>!e),className:`flex items-center gap-1.5 px-1 py-1.5 text-2xs uppercase tracking-wide text-fg-muted transition-colors hover:text-fg`,children:[(0,H.jsx)(N,{className:w(`size-3 transition-transform`,d&&`rotate-90`)}),(0,H.jsx)(O,{className:`size-3`}),(0,H.jsx)(`span`,{children:`Archived`}),(0,H.jsx)(`span`,{className:`tabular-nums`,children:E.length})]}),d&&(0,H.jsx)(`div`,{className:`mt-2 grid grid-cols-1 gap-3 sm:grid-cols-2`,children:E.map(e=>(0,H.jsx)(Y,{project:e,repoPath:v(e.repo_id),draggable:!1,dragging:!1,onDragStart:()=>{},onDragEnd:()=>{},onDragOver:()=>{}},e.id))})]})]})}),g.open&&(0,H.jsx)(G,{term:g.term,onExit:g.onExit}),e!==null&&(0,H.jsx)(L,{profileId:e,open:s,onOpenChange:c})]})}export{Z as Dashboard};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{_ as r,a as i,d as a,h as o,i as s,n as c,t as l}from"./hotkeys-C4tM1SjP.js";import{S as u,_ as d,f,g as p,h as m,m as h,p as g}from"./api-B3lAdmrV.js";import{a as _,g as v,i as y,n as b,o as x,r as S,t as C}from"./dialog-B43iKmfK.js";import{C as w,E as T,H as E,I as D,K as O,M as ee,P as k,R as te,V as ne,W as re,Y as ie,_ as ae,ct as A,et as oe,f as se,i as j,j as ce,k as le,lt as M,o as ue,p as de,q as N,r as fe,st as pe,tt as me,v as he,z as ge}from"./LazyTerminal-C5KE5tms.js";import{t as P}from"./utils-B6KiDbIe.js";import{t as F}from"./createLucideIcon-DyMAgLa3.js";import{a as I,i as L,n as R,o as z,r as B,s as _e,t as ve}from"./session-seed-d2xOIe7z.js";import{r as ye}from"./dist-i-QevsUb.js";import{$ as be,B as V,Ct as xe,G as Se,H as Ce,It as we,J as H,K as Te,L as U,Mt as Ee,Q as De,St as Oe,U as ke,V as Ae,W as je,Y as W,Z as Me,_t as Ne,at as Pe,dt as Fe,et as Ie,gt as Le,ht as Re,lt as ze,mt as Be,nt as Ve,q as He,r as Ue,ut as We,vt as Ge,wt as Ke,xt as qe}from"./index-DtbA89da.js";var Je=F(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Ye=F(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Xe=F(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),Ze=F(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Qe=F(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),$e=F(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),et=F(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),tt=F(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),G=e(t(),1),K=n();function q({id:e,value:t,min:n,max:r,step:i,className:a,onCommit:o}){let[s,c]=(0,G.useState)(String(t));return(0,G.useEffect)(()=>c(String(t)),[t]),(0,K.jsx)(A,{id:e,type:`number`,min:n,max:r,step:i,className:a,value:s,onChange:e=>c(e.target.value),onBlur:()=>{let e=Number(s);if(s.trim()===``||!Number.isFinite(e)){c(String(t));return}let i=Math.min(r??e,Math.max(n??e,e));c(String(i)),i!==t&&o(i)},onKeyDown:e=>{e.key===`Enter`&&e.target.blur()}})}function J({label:e,description:t,descriptionClassName:n,htmlFor:r,children:i,className:a}){return(0,K.jsxs)(`div`,{className:P(`flex items-center gap-4 py-2.5`,a),children:[(0,K.jsxs)(`label`,{htmlFor:r,className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,K.jsx)(`span`,{className:`text-sm text-fg`,children:e}),t&&(0,K.jsx)(`span`,{className:P(`text-xs text-fg-muted`,n),children:t})]}),(0,K.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:i})]})}function Y({children:e,note:t}){return(0,K.jsxs)(`div`,{className:`mb-2 flex flex-col gap-0.5`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:e}),t&&(0,K.jsx)(`span`,{className:`text-xs text-fg-muted`,children:t})]})}function nt(){let e=W(),[t,n]=(0,G.useState)(we());return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Y,{children:`Appearance`}),(0,K.jsx)(J,{label:`Theme`,children:(0,K.jsxs)(R,{value:t,onValueChange:e=>{n(e),Ee(e)},children:[(0,K.jsx)(I,{className:`w-32`,children:(0,K.jsx)(z,{})}),(0,K.jsxs)(B,{children:[(0,K.jsx)(L,{value:`dark`,children:`Dark`}),(0,K.jsx)(L,{value:`light`,children:`Light`}),(0,K.jsx)(L,{value:`system`,children:`System`})]})]})}),(0,K.jsx)(J,{label:`UI font size`,htmlFor:`ui-font-size`,children:(0,K.jsx)(q,{id:`ui-font-size`,min:12,max:24,step:.5,className:`w-20 tabular-nums`,value:e.uiFontSize,onCommit:e=>H({uiFontSize:e})})}),(0,K.jsx)(J,{label:`Terminal font size`,htmlFor:`terminal-font-size`,children:(0,K.jsx)(q,{id:`terminal-font-size`,min:9,max:24,className:`w-20 tabular-nums`,value:e.terminalFontSize,onCommit:e=>H({terminalFontSize:e})})}),(0,K.jsx)(J,{label:`Editor font size`,htmlFor:`editor-font-size`,children:(0,K.jsx)(q,{id:`editor-font-size`,min:9,max:32,step:.5,className:`w-20 tabular-nums`,value:e.editorFontSize,onCommit:e=>H({editorFontSize:e})})}),(0,K.jsx)(J,{label:`Density`,children:(0,K.jsxs)(R,{value:e.density,onValueChange:e=>H({density:e}),children:[(0,K.jsx)(I,{className:`w-36`,children:(0,K.jsx)(z,{})}),(0,K.jsxs)(B,{children:[(0,K.jsx)(L,{value:`compact`,children:`Compact`}),(0,K.jsx)(L,{value:`comfortable`,children:`Comfortable`})]})]})}),(0,K.jsx)(J,{label:`Project-based layout`,description:`Editor layouts are separated across projects.`,htmlFor:`project-based-layout`,children:(0,K.jsx)(U,{id:`project-based-layout`,checked:e.projectBasedLayout,onCheckedChange:e=>H({projectBasedLayout:e})})}),(0,K.jsx)(J,{label:`All projects in the session list`,description:`Right sidebar displays sessions from all projects.`,htmlFor:`show-all-project-sessions`,children:(0,K.jsx)(U,{id:`show-all-project-sessions`,checked:e.showAllProjectSessions,onCheckedChange:e=>H({showAllProjectSessions:e})})})]})}function rt({profile:e}){let t=ne(),[n,r]=(0,G.useState)(!1),i=n=>{t.mutate({id:e.id,icon:n},{onError:e=>j(e)}),r(!1)},a=n=>t.mutate({id:e.id,icon_colour:n},{onError:e=>j(e)});return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(J,{label:`Icon`,children:(0,K.jsxs)(De,{open:n,onOpenChange:r,children:[(0,K.jsx)(Ie,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,className:`flex size-9 items-center justify-center rounded-md text-fg-gold transition-colors hover:bg-elevated hover:text-fg`,children:[(0,K.jsx)(Be,{icon:e.icon,colour:e.icon_colour,className:`size-5`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Choose an icon`})]})}),(0,K.jsx)(be,{align:`end`,className:`w-72`,children:(0,K.jsxs)(`div`,{className:`grid grid-cols-8 gap-1`,children:[(0,K.jsx)(`button`,{type:`button`,title:`Default`,onClick:()=>i(null),className:P(`flex h-8 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-elevated hover:text-fg`,!e.icon&&`bg-elevated text-fg`),children:(0,K.jsx)(Be,{icon:null,colour:null,className:`size-4`})}),Le.map(({name:t,Icon:n})=>(0,K.jsx)(`button`,{type:`button`,title:t,onClick:()=>i(t),className:P(`flex h-8 items-center justify-center rounded-md text-fg-secondary transition-colors hover:bg-elevated hover:text-fg`,e.icon===t&&`bg-elevated text-fg`),children:(0,K.jsx)(n,{className:`size-4`})},t))]})})]})}),(0,K.jsx)(J,{label:`Icon colour`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[(0,K.jsxs)(`button`,{type:`button`,title:`Default`,onClick:()=>a(null),className:P(`flex size-7 items-center justify-center rounded-md transition-colors hover:bg-elevated`,!e.icon_colour&&`bg-elevated`),children:[(0,K.jsx)(`span`,{className:`size-3.5 rounded-full bg-fg-muted`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Default colour`})]}),p.map(t=>(0,K.jsxs)(`button`,{type:`button`,title:t,onClick:()=>a(t),className:P(`flex size-7 items-center justify-center rounded-md transition-colors hover:bg-elevated`,e.icon_colour===t&&`bg-elevated`),children:[(0,K.jsx)(`span`,{className:P(`size-3.5 rounded-full bg-current`,Re(t))}),(0,K.jsx)(`span`,{className:`sr-only`,children:t})]},t))]})})]})}var X=`__none__`;function it(){let e=r(),t=N().data?.find(t=>t.id===e),n=se(e??void 0),i=O(e??void 0),a=ne(),s=E(e??``),c=le(),[l,u]=(0,G.useState)(``),[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(``);if((0,G.useEffect)(()=>{t&&(u(t.name),f(t.branch_prefix))},[t]),!t)return null;let w=i.data?.default_account_id;return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Y,{children:`Profile`}),(0,K.jsxs)(J,{label:`Name`,description:`Letters, digits, dot, underscore and hyphen.`,htmlFor:`profile-name`,children:[(0,K.jsx)(A,{id:`profile-name`,value:l,onChange:e=>u(e.target.value),className:`w-44 font-mono`}),(0,K.jsx)(v,{size:`sm`,variant:`secondary`,disabled:l===t.name||l.trim()===``||a.isPending,onClick:()=>a.mutate({id:t.id,name:l},{onError:e=>j(e)}),children:`Save`})]}),(0,K.jsxs)(J,{label:`Branch prefix`,description:`Session branches become <prefix><slug(title)>.`,htmlFor:`branch-prefix`,children:[(0,K.jsx)(A,{id:`branch-prefix`,value:d,onChange:e=>f(e.target.value),placeholder:`no prefix`,className:`w-44 font-mono`}),(0,K.jsx)(v,{size:`sm`,variant:`secondary`,disabled:d===t.branch_prefix||a.isPending,onClick:()=>a.mutate({id:t.id,branch_prefix:d},{onError:e=>j(e)}),children:`Save`})]}),(0,K.jsx)(rt,{profile:t}),(0,K.jsx)(J,{label:`Default account`,description:`Preselected in the new-session modal.`,children:(0,K.jsxs)(R,{value:typeof w==`number`?String(w):X,onValueChange:e=>s.mutate({default_account_id:e===X?null:Number(e)},{onError:e=>j(e)}),children:[(0,K.jsx)(I,{className:`w-56`,children:(0,K.jsx)(z,{})}),(0,K.jsxs)(B,{children:[(0,K.jsx)(L,{value:X,children:`First available`}),n.data?.map(e=>(0,K.jsx)(L,{value:String(e.id),children:(0,K.jsxs)(`span`,{className:`font-mono`,children:[e.agent_type,`/`,e.label]})},e.id))]})]})}),(0,K.jsx)(J,{label:`Delete profile`,description:`Non-archived sessions block deletion.`,className:`mt-4`,children:(0,K.jsx)(v,{variant:`danger`,size:`sm`,onClick:()=>m(!0),children:`Delete…`})}),(0,K.jsx)(C,{open:p,onOpenChange:e=>{e||(m(!1),g(``))},children:(0,K.jsxs)(b,{children:[(0,K.jsxs)(_,{children:[(0,K.jsxs)(x,{children:[`Delete profile `,(0,K.jsx)(`span`,{className:`font-mono`,children:t.name}),`?`]}),(0,K.jsx)(S,{children:`Everything this profile owns goes with it: projects, workspace layouts, accounts and their credential directories, and archived session history. Branches, repositories, and terminal logs on disk are untouched. This cannot be undone.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsxs)(pe,{htmlFor:`delete-confirm-name`,children:[`Type `,(0,K.jsx)(`span`,{className:`font-mono text-fg`,children:t.name}),` to confirm`]}),(0,K.jsx)(A,{id:`delete-confirm-name`,value:h,onChange:e=>g(e.target.value),className:`font-mono`,autoFocus:!0})]}),(0,K.jsxs)(y,{children:[(0,K.jsx)(v,{variant:`ghost`,onClick:()=>{m(!1),g(``)},children:`Cancel`}),(0,K.jsx)(v,{variant:`danger`,disabled:h!==t.name||c.isPending,onClick:()=>c.mutate(t.id,{onSuccess:()=>{ze(),o.set(null)},onError:e=>{m(!1),g(``),j(e)}}),children:`Delete profile`})]})]})})]})}function at({agent:e,profileId:t,onClose:n,onCreated:r}){let i=he(),[a,o]=(0,G.useState)(``),[s,c]=(0,G.useState)(``),l=ce(Pe(s,150)),u=s.trim(),d=u===``||u.startsWith(`/`)||u.startsWith(`~`),f=a.trim()!==``&&d,p=()=>{!f||i.isPending||i.mutate({profile_id:t,agent_type:e.id,label:a.trim(),...u===``?{}:{import_dir:u}},{onSuccess:e=>{n(),r(e,u!==``)},onError:e=>j(e)})};return(0,K.jsx)(C,{open:!0,onOpenChange:e=>!e&&n(),children:(0,K.jsxs)(b,{children:[(0,K.jsxs)(_,{children:[(0,K.jsxs)(x,{children:[`Add a `,e.display_name,` account`]}),(0,K.jsxs)(S,{children:[`Accounts are isolated config dirs under this profile. Naming one is enough — Puddle creates it and takes you straight to `,e.display_name,`’s login. To reuse an account you already have on this machine, give its config directory: it is copied in and the original is never touched.`]})]}),(0,K.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),p()},children:[(0,K.jsx)(A,{autoFocus:!0,placeholder:`label, e.g. personal`,value:a,onChange:e=>o(e.target.value),className:`font-mono`}),(0,K.jsx)(fe,{value:s,onValueChange:c,placeholder:`(optional) existing config dir, e.g. ~/.claude`,hints:(l.data?.entries??[]).map(e=>({value:e.path,label:e.name})),className:`font-mono`})]}),(0,K.jsxs)(y,{children:[(0,K.jsx)(v,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,K.jsxs)(v,{disabled:!f||i.isPending,onClick:p,children:[(0,K.jsx)(Oe,{}),`Add account`]})]})]})})}function ot({account:e,gateOpen:t,installed:n}){let r=D(),i=te(),a=T(),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(!1),[u,d]=(0,G.useState)(e.label);return(0,G.useEffect)(()=>d(e.label),[e.label]),(0,K.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md bg-surface px-3 py-2`,children:[(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),onBlur:()=>{let t=u.trim();if(t!==e.label){if(t===``){d(e.label);return}i.mutate({id:e.id,label:t},{onError:t=>{j(t),d(e.label)}})}},onKeyDown:t=>{t.key===`Enter`?t.currentTarget.blur():t.key===`Escape`&&(d(e.label),t.currentTarget.blur())},"aria-label":`Account name`,className:`-mx-1 block w-full truncate rounded-sm bg-transparent px-1 py-0.5 font-mono text-sm text-fg transition-colors hover:bg-elevated focus:bg-elevated focus:outline-none`}),(0,K.jsx)(`span`,{className:`text-2xs ${e.logged_in?`text-success`:`text-warning`}`,children:e.logged_in?`logged in`:`not logged in`})]}),t&&(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg-secondary`,children:[`skip prompts`,(0,K.jsx)(U,{checked:e.skip_permissions_default,onCheckedChange:t=>i.mutate({id:e.id,skip_permissions_default:t},{onError:e=>j(e)})})]}),(0,K.jsxs)(v,{size:`sm`,variant:`secondary`,disabled:r.isPending||!n,onClick:()=>r.mutate(e.id,{onSuccess:e=>s(e.stream),onError:e=>j(e)}),children:[(0,K.jsx)(Ke,{}),e.logged_in?`Re-login`:`Login`]}),(0,K.jsxs)(v,{size:`icon`,variant:`ghost`,className:`size-7 text-fg-muted hover:text-danger`,onClick:()=>l(!0),children:[(0,K.jsx)(Ge,{}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Delete account`})]}),o&&(0,K.jsx)(Me,{stream:o,label:`${e.agent_type}/${e.label}`,onClose:()=>s(null)}),(0,K.jsx)(C,{open:c,onOpenChange:l,children:(0,K.jsxs)(b,{children:[(0,K.jsxs)(_,{children:[(0,K.jsxs)(x,{children:[`Delete `,(0,K.jsx)(`span`,{className:`font-mono`,children:e.label}),`?`]}),(0,K.jsx)(S,{children:`Removes the account, its archived session history, and its credential directory — this logs the account out. Non-archived sessions block deletion.`})]}),(0,K.jsxs)(y,{children:[(0,K.jsx)(v,{variant:`ghost`,onClick:()=>l(!1),children:`Cancel`}),(0,K.jsx)(v,{variant:`danger`,disabled:a.isPending,onClick:()=>a.mutate(e.id,{onSuccess:()=>l(!1),onError:e=>{l(!1),j(e)}}),children:`Delete account`})]})]})})]})}function st(){let e=r(),t=de(),n=se(e??void 0),i=O(e??void 0),a=D(),[o,s]=(0,G.useState)(null),[c,l]=(0,G.useState)(null),d=i.data?.allowSkipPermissions===!0;return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Y,{children:`Accounts`}),t.data?.map(e=>{let t=n.data?.filter(t=>t.agent_type===e.id)??[],r=e.available!==!1;return(0,K.jsxs)(`div`,{className:`mb-5`,children:[(0,K.jsx)(J,{label:e.display_name,description:r?`Accounts are initialised in config dirs owned by this profile.`:`No ${e.binary??e.id} on the daemon’s PATH. Install it or add its directory to the agent search path in Sessions.`,className:`py-1`,children:(0,K.jsx)(`span`,{className:`font-mono text-2xs text-fg-muted`,children:e.id})}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[t.map(t=>(0,K.jsx)(ot,{account:t,gateOpen:d&&e.capabilities.skip_permissions,installed:r},t.id)),(0,K.jsx)(`div`,{className:`flex`,children:(0,K.jsxs)(v,{type:`button`,size:`sm`,variant:`secondary`,disabled:!r,onClick:()=>l(e),children:[(0,K.jsx)(Oe,{}),`Add account`]})})]})]},e.id)}),o&&(0,K.jsx)(Me,{stream:o.stream,label:o.label,onClose:()=>s(null)}),c!==null&&e!==null&&(0,K.jsx)(at,{agent:c,profileId:e,onClose:()=>l(null),onCreated:(e,t)=>{if(t){e.logged_in||u.info(`Imported without credentials — press Login to authenticate.`);return}a.mutate(e.id,{onSuccess:t=>s({stream:t.stream,label:`${e.agent_type}/${e.label}`}),onError:e=>j(e)})}})]})}function ct(){let e=ae(),t=ge(),[n,r]=(0,G.useState)(``);return(0,G.useEffect)(()=>{e.data&&r(e.data.agentPath)},[e.data]),(0,K.jsx)(J,{label:`Agent search path (host-wide)`,description:`Colon-separated dirs the daemon prepends to PATH; helps find agent CLIs like claude (e.g. ~/.local/bin).`,htmlFor:`agent-path`,children:(0,K.jsx)(A,{id:`agent-path`,type:`text`,className:`w-64 font-mono text-2xs`,value:n,onChange:e=>r(e.target.value),onBlur:()=>{e.data&&n!==e.data.agentPath&&t.mutate({agentPath:n})}})})}function lt({kind:e,heading:t,settings:n,onSave:r,pending:i}){let a=ve(e,n),o=n.sessionDefaults??{},[s,c]=(0,G.useState)(a.baseBranch),l=t=>r({...o,[e]:{...o[e],...t}});return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`mb-1 mt-4 text-xs font-medium uppercase tracking-wide text-fg-gold`,children:t}),(0,K.jsx)(J,{label:`Base branch`,description:`Blank = the repository's default base branch.`,htmlFor:`${e}-default-base`,children:(0,K.jsx)(A,{id:`${e}-default-base`,type:`text`,placeholder:`repository default`,className:`w-48 font-mono`,value:s,onChange:e=>c(e.target.value),onBlur:()=>{s.trim()!==a.baseBranch&&l({baseBranch:s.trim()})}})}),(0,K.jsx)(J,{label:`Separate branch`,description:`Start on a fresh branch off the base, in its own directory.`,htmlFor:`${e}-default-branch`,children:(0,K.jsx)(U,{id:`${e}-default-branch`,checked:a.separateBranch,disabled:i,onCheckedChange:e=>l({separateBranch:e})})}),(0,K.jsx)(J,{label:`Separate directory`,description:a.separateBranch?`Always on while a separate branch is used.`:`Start on working copy of the selected branch instead of sharing one directory.`,htmlFor:`${e}-default-dir`,children:(0,K.jsx)(U,{id:`${e}-default-dir`,checked:a.separateWorktree,disabled:i||a.separateBranch,onCheckedChange:e=>l({separateWorktree:e})})})]})}function ut(){return(0,K.jsx)(J,{label:`Terminal scrollback`,htmlFor:`scrollback`,children:(0,K.jsx)(q,{id:`scrollback`,min:500,max:1e5,step:500,className:`w-28 tabular-nums`,value:W().terminalScrollback,onCommit:e=>H({terminalScrollback:e})})})}function dt({id:e,label:t,description:n,initial:r,defaultText:i,onSave:a,pending:o}){let[s,c]=(0,G.useState)(r);return(0,K.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[(0,K.jsxs)(`label`,{htmlFor:e,className:`flex flex-col gap-0.5 text-sm text-fg`,children:[t,(0,K.jsx)(`span`,{className:`text-xs text-fg-muted`,children:n})]}),(0,K.jsx)(M,{id:e,value:s,onChange:e=>c(e.target.value),rows:6,className:`font-mono`}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(v,{size:`sm`,variant:`secondary`,disabled:s===r||o,onClick:()=>a(s),children:`Save`}),(0,K.jsx)(v,{size:`sm`,variant:`ghost`,disabled:s===i||o,onClick:()=>{c(i),a(i)},children:`Reset to default`})]})]})}var ft={id:`4f3c2b1a-7e6d-5c4b-3a2f-1e0d9c8b7a6f`,title:null,agent_title:`Refactor the auth flow`,osc_title:`claude`,branch:`alice/refactor-auth`,worktree_path:`/home/alice/code/app--refactor-auth`,status:`waiting_input`,agent_type:`claude-code`};function pt({initial:e,onSave:t,pending:n}){let[r,i]=(0,G.useState)(e),a=r.length>0?r:m;return(0,K.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[(0,K.jsxs)(`label`,{htmlFor:`tab-title-template`,className:`flex flex-col gap-0.5 text-sm text-fg`,children:[`Template`,(0,K.jsx)(`span`,{className:`text-xs text-fg-muted`,children:`Compose the label from the parts below. Empty falls back to the default.`})]}),(0,K.jsx)(A,{id:`tab-title-template`,value:r,onChange:e=>i(e.target.value),className:`font-mono`,placeholder:m}),(0,K.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[`Preview`,` `,(0,K.jsx)(`span`,{className:`ml-1 font-sans text-fg`,children:Ve(ft,a)})]}),(0,K.jsx)(`dl`,{className:`mt-1 flex flex-col gap-0.5 text-xs`,children:d.map(([e,t])=>(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`dt`,{className:`w-24 shrink-0 font-mono text-fg-secondary`,children:`\${${e}}`}),(0,K.jsx)(`dd`,{className:`text-fg-muted`,children:t})]},e))}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(v,{size:`sm`,variant:`secondary`,disabled:r===e||n,onClick:()=>t(r),children:`Save`}),(0,K.jsx)(v,{size:`sm`,variant:`ghost`,disabled:r==="${name}"||n,onClick:()=>{i(m),t(m)},children:`Reset to default`})]})]})}function mt(){let e=r(),t=N().data?.find(t=>t.id===e),n=O(e??void 0),i=E(e??``),[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(``),l=n.data?.allowSkipPermissions===!0,u=e=>i.mutate({allowSkipPermissions:e},{onSuccess:()=>{o(!1),c(``)},onError:e=>j(e)}),d=e=>t=>i.mutate({[e]:t},{onError:e=>j(e)});return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Y,{children:`Sessions`}),(0,K.jsx)(J,{label:`Skip permission prompts`,htmlFor:`gate`,children:(0,K.jsx)(U,{id:`gate`,checked:l,onCheckedChange:e=>{e?o(!0):u(!1)}})}),(0,K.jsx)(J,{label:`Capture exported env variables`,description:n.data?.captureSessionEnv===!1?`No variables are captured or injected; already-captured variabless are kept for when this is re-enabled.`:`Variables exported in a session persist and are re-injected upon terminal and agent restarts.`,htmlFor:`capture-env`,children:(0,K.jsx)(U,{id:`capture-env`,checked:n.data?.captureSessionEnv!==!1,disabled:i.isPending,onCheckedChange:e=>i.mutate({captureSessionEnv:e},{onError:e=>j(e)})})}),(0,K.jsx)(ct,{}),(0,K.jsx)(ut,{}),(0,K.jsxs)(`div`,{className:`mt-5`,children:[(0,K.jsx)(Y,{children:`New session defaults`}),n.data&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(lt,{kind:`agent`,heading:`New agents`,settings:n.data,onSave:e=>i.mutate({sessionDefaults:e},{onError:e=>j(e)}),pending:i.isPending},`${e}:agent-seed`),(0,K.jsx)(lt,{kind:`terminal`,heading:`New terminals`,settings:n.data,onSave:e=>i.mutate({sessionDefaults:e},{onError:e=>j(e)}),pending:i.isPending},`${e}:terminal-seed`)]})]}),(0,K.jsxs)(`div`,{className:`mt-5`,children:[(0,K.jsx)(Y,{note:`Sent to agent as opening message when a session (re)starts. You can make this empty.`,children:`Launch text`}),n.data&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(dt,{id:`onboarding-template`,label:`New worktree`,description:`Use {{rules}} where the repo's onboarding notes should appear.`,initial:n.data.onboardingTemplate??g,defaultText:g,onSave:d(`onboardingTemplate`),pending:i.isPending},`${e}:onboarding`),(0,K.jsx)(dt,{id:`concurrent-template`,label:`Existing / shared worktree`,description:`For a session joining a worktree other agents may already be working in.`,initial:n.data.concurrentTemplate??f,defaultText:f,onSave:d(`concurrentTemplate`),pending:i.isPending},`${e}:concurrent`),(0,K.jsx)(dt,{id:`restart-template`,label:`Resume after restart`,description:`Sent when a session resumes after a daemon restart or machine reboot.`,initial:n.data.restartTemplate??h,defaultText:h,onSave:d(`restartTemplate`),pending:i.isPending},`${e}:restart`)]})]}),(0,K.jsxs)(`div`,{className:`mt-5`,children:[(0,K.jsx)(Y,{children:`Tab title`}),n.data&&(0,K.jsx)(pt,{initial:n.data.tabTitleTemplate||"${name}",onSave:d(`tabTitleTemplate`),pending:i.isPending},`${e}:tab-title`)]}),(0,K.jsx)(C,{open:a,onOpenChange:e=>{e||(o(!1),c(``))},children:(0,K.jsxs)(b,{children:[(0,K.jsxs)(_,{children:[(0,K.jsxs)(x,{className:`flex items-center gap-2`,children:[(0,K.jsx)($e,{className:`size-5 text-danger`}),`Run agents without permission prompts?`]}),(0,K.jsx)(S,{asChild:!0,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,K.jsx)(`p`,{children:`A prompt-free agent acts unattended, with your credentials, inside its worktree — and nothing technically stops a shell command from reaching outside it. It can:`}),(0,K.jsxs)(`ul`,{className:`list-disc pl-5 text-fg-secondary`,children:[(0,K.jsx)(`li`,{children:`run any shell command without asking first,`}),(0,K.jsx)(`li`,{children:`modify, delete, or exfiltrate files your user can reach,`}),(0,K.jsx)(`li`,{children:`install dependencies and execute the network requests they make,`}),(0,K.jsx)(`li`,{children:`push branches or call remote APIs with the credentials it finds.`})]}),(0,K.jsx)(`p`,{children:`Only open this gate if every account you opt in runs work you would trust a colleague to run unsupervised on this machine.`}),(0,K.jsx)(`p`,{className:`text-fg-muted`,children:`Opening it also records the agent’s own bypass-permissions acceptance for this profile’s accounts, so the skip actually takes effect.`})]})})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsxs)(pe,{htmlFor:`confirm-name`,children:[`Type `,(0,K.jsx)(`span`,{className:`font-mono text-fg`,children:t?.name}),` to confirm`]}),(0,K.jsx)(A,{id:`confirm-name`,value:s,onChange:e=>c(e.target.value),className:`font-mono`,autoFocus:!0})]}),(0,K.jsxs)(y,{children:[(0,K.jsx)(v,{variant:`ghost`,onClick:()=>{o(!1),c(``)},children:`Cancel`}),(0,K.jsx)(v,{variant:`danger`,disabled:s!==t?.name||i.isPending,onClick:()=>u(!0),children:`Open the gate`})]})]})})]})}var ht={desktop:!0,sound:!1,muted_projects:[]};function gt(){let[e,t]=(0,G.useState)(V);return(0,G.useEffect)(()=>{let e=()=>t(V());return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[]),[e,()=>t(V())]}function _t({permission:e,onRequest:t}){return e===`granted`?null:(0,K.jsxs)(`p`,{className:`pb-2 text-xs text-warning`,children:[e==="default"&&(0,K.jsxs)(K.Fragment,{children:[`The browser has not been asked for permission yet, so nothing will show —`,` `,(0,K.jsx)(`button`,{type:`button`,onClick:t,className:`underline underline-offset-2 transition-colors hover:text-fg`,children:`request it now`}),`.`]}),e===`denied`&&`Blocked by the browser — allow notifications for this site in its site settings, then return here.`,e===`unsupported`&&`This browser cannot show desktop notifications.`]})}function vt(){let e=r(),t=O(e??void 0),n=E(e??``),i=ie(e??void 0),[a,o]=gt(),s={...ht,...t.data?.notifications??{}},c=e=>n.mutate({notifications:e},{onError:e=>j(e)}),l=()=>{typeof Notification>`u`||Notification.requestPermission().then(o)};return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Y,{children:`Notifications`}),(0,K.jsx)(J,{label:`Desktop notification on waiting`,htmlFor:`notify-desktop`,children:(0,K.jsx)(U,{id:`notify-desktop`,checked:s.desktop,onCheckedChange:e=>{e&&l(),c({...s,desktop:e})}})}),s.desktop&&(0,K.jsx)(_t,{permission:a,onRequest:l}),(0,K.jsx)(J,{label:`Sound`,htmlFor:`notify-sound`,children:(0,K.jsx)(U,{id:`notify-sound`,checked:s.sound,onCheckedChange:e=>c({...s,sound:e})})}),(0,K.jsx)(J,{label:`Muted projects`,description:`No notifications from these projects.`,children:(0,K.jsxs)(`span`,{className:`text-2xs text-fg-muted tabular-nums`,children:[s.muted_projects.length,` muted`]})}),(0,K.jsx)(`div`,{className:`flex flex-col gap-1`,children:i.data?.map(e=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-secondary hover:bg-elevated`,children:[(0,K.jsx)(U,{checked:s.muted_projects.includes(e.id),onCheckedChange:t=>c({...s,muted_projects:t?[...s.muted_projects,e.id]:s.muted_projects.filter(t=>t!==e.id)})}),e.name]},e.id))})]})}function yt(){let e=W();return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Y,{children:`Editor`}),(0,K.jsx)(J,{label:`Tab size`,description:`Spaces per indent level.`,htmlFor:`tab-size`,children:(0,K.jsx)(q,{id:`tab-size`,min:1,max:8,className:`w-20 tabular-nums`,value:e.editorTabSize,onCommit:e=>H({editorTabSize:e})})}),(0,K.jsx)(J,{label:`Word wrap`,htmlFor:`word-wrap`,children:(0,K.jsx)(U,{id:`word-wrap`,checked:e.editorWordWrap,onCheckedChange:e=>H({editorWordWrap:e})})}),(0,K.jsx)(J,{label:`SSH host for editor links`,description:`Used for vscode:// and cursor:// remote links until the CLI supplies it automatically.`,htmlFor:`editor-link-host`,children:(0,K.jsx)(A,{id:`editor-link-host`,type:`text`,placeholder:Ue.get()??`user@host`,className:`w-48`,value:e.editorLinkSshHost,onChange:e=>H({editorLinkSshHost:e.target.value})})})]})}function bt({value:e,isDefault:t,onRecord:n,onReset:r}){let[a,o]=(0,G.useState)(!1);return(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>o(!0),onBlur:()=>o(!1),onKeyDown:e=>{if(!a)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){o(!1);return}let t=s(e.nativeEvent);t&&(n(t),o(!1))},className:P(`min-w-24 rounded-md px-2 py-1 text-center font-mono text-xs transition-colors`,a?`bg-action text-action-ink`:`bg-elevated text-fg hover:bg-border/70`),children:a?`Press keys…`:i(e)}),!t&&(0,K.jsxs)(`button`,{type:`button`,title:`Reset to default`,onClick:r,className:`rounded-md p-1 text-fg-gold transition-colors hover:bg-elevated hover:text-fg`,children:[(0,K.jsx)(Ze,{className:`size-3.5`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Reset to default`})]})]})}function xt(){let e=r(),t=O(e??void 0),n=E(e??``),i=t.data?.hotkeys??{},o=(e,t)=>i[e]||t,s=new Map;for(let e of l){let t=o(e.id,a(e));s.set(t,(s.get(t)??0)+1)}let u=(e,t)=>n.mutate({hotkeys:{...i,[e]:t}},{onError:e=>j(e)}),d=e=>{let t={...i};delete t[e],n.mutate({hotkeys:t},{onError:e=>j(e)})};return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Y,{children:`Hotkeys`}),(0,K.jsx)(`p`,{className:`mb-4 text-xs text-fg-muted`,children:`Per-profile keyboard shortcuts. Filetree navigation and terminal line-edits are fixed.`}),c.map(e=>{let t=l.filter(t=>t.group===e);return t.length===0?null:(0,K.jsxs)(`div`,{className:`mb-5`,children:[(0,K.jsx)(`div`,{className:`mb-1 text-2xs font-medium uppercase tracking-wide text-fg-gold`,children:e}),t.map(e=>{let t=o(e.id,a(e)),n=(s.get(t)??0)>1?`Conflicts with another shortcut.`:void 0;return(0,K.jsx)(J,{label:e.label,description:n,descriptionClassName:n?`text-interrupted`:void 0,children:(0,K.jsx)(bt,{value:t,isDefault:!i[e.id],onRecord:t=>u(e.id,t),onReset:()=>d(e.id)})},e.id)})]},e)})]})}var St=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,Z=65,Q=Object.fromEntries([...St].map((e,t)=>[e,t])),Ct=`H`,wt=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t+=1){let n=t;for(let e=0;e<8;e+=1)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function Tt(e){let t=4294967295;for(let n of e)t=wt[(t^n)&255]^t>>>8;return((t^4294967295)>>>0).toString(16).padStart(8,`0`)}function Et(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)}function Dt(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)n[e]=t.charCodeAt(e);return n}async function Ot(e){let t=new Blob([new TextEncoder().encode(e)]).stream().pipeThrough(new CompressionStream(`gzip`));return new Uint8Array(await new Response(t).arrayBuffer())}async function kt(e){let t=new Blob([e]).stream().pipeThrough(new DecompressionStream(`gzip`));return new Response(t).text()}function At(e,t){let n=(t%Z+Z)%Z,r=``;for(let t of e){let e=Q[t];r+=e===void 0?t:St[(e+n)%Z]}return r}async function jt(e){let t=await Ot(JSON.stringify(e));return At(Et(t)+Tt(t),1+Math.floor(Math.random()*(Z-1)))}async function Mt(e){let t=e.trim(),n=t[0];if(!n||Q[n]===void 0)throw Error(`Not a settings export.`);let r=At(t,-((Q[n]-Q[Ct]+Z)%Z));if(r.length<9||r[0]!==Ct)throw Error(`Not a settings export.`);let i=r.slice(0,-8),a=r.slice(-8),o=Dt(i);if(Tt(o)!==a)throw Error(`Settings export is corrupt (checksum mismatch).`);return JSON.parse(await kt(o))}var Nt=`puddle.sync-selection`;function Pt(){try{let e=JSON.parse(localStorage.getItem(Nt)??`null`);if(Array.isArray(e))return e.filter(e=>typeof e==`string`)}catch{}return je.map(e=>e.id)}function Ft({selected:e,onToggle:t}){return(0,K.jsx)(`div`,{className:`flex flex-col gap-2 pl-1`,children:je.map(n=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(U,{checked:e.includes(n.id),onCheckedChange:e=>t(n.id,e)}),n.label]},n.id))})}function It(){let e=r(),t=O(e??void 0),n=N().data?.find(t=>t.id===e),i=me(e??void 0,void 0),a=E(e??``),o=ne(),s=w(),c=Ce(),l=ke(),[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(``),[h,g]=(0,G.useState)(!1),[_,y]=(0,G.useState)(!1),[b,x]=(0,G.useState)(Pt),S=n&&c.data?Ae(c.data.file,n.name):void 0,C=S?.enabled===!0,T=C&&S?S.groups:b,D=()=>({client:He(),theme:we(),profileSettings:t.data??{},profile:n??{},scratchpad:i.data??[]}),ee={setClient:e=>H(e),setTheme:e=>{typeof e==`string`&&Ee(e)},patchProfileSettings:e=>a.mutate(e,{onError:e=>j(e)}),patchProfileColumns:t=>{e&&o.mutate({id:e,...t},{onError:e=>j(e)})},createScratchpad:t=>{if(e)for(let n of t)s.mutate({profile_id:e,scope:`profile`,title:n.title??void 0,body:n.body,tags:n.tags,agent_type:n.agent_type??void 0})}},k=(e,t)=>{n&&l.mutate({profile:n.name,entry:{enabled:e.enabled??C,groups:t,doc:Te(t,D()),updatedAt:new Date().toISOString()}},{onError:e=>j(e)})},te=(e,t)=>{let n=t?[...T,e]:T.filter(t=>t!==e);x(n),localStorage.setItem(Nt,JSON.stringify(n)),C&&k({},n)},re=async()=>{y(!0);try{let e=Se(await Mt(d.trim()),ee,{profileSettings:t.data??{},scratchpad:i.data??[]});e.length===0?u.error(`Nothing recognised to import.`):(u.success(`Imported ${e.join(`, `)}.`),f(``))}catch(e){u.error(e.message)}finally{y(!1)}},ie=async()=>{y(!0);try{let e=await jt(Te(T,D()));m(e),await navigator.clipboard?.writeText(e),u.success(`Copied to clipboard`)}finally{y(!1)}};return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Y,{children:`Sync`}),(0,K.jsx)(`p`,{className:`mb-5 text-xs text-fg-muted`,children:`Carry your settings between machines. Accounts, repositories, and anything host-specific are never included. Applies to this profile.`}),(0,K.jsxs)(`div`,{className:`mb-6`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:`Sync locally`}),c.data?.available===!1?(0,K.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:`Not available in this cockpit — start the UI with the Puddle CLI to sync across windows.`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`p`,{className:`mb-2 mt-1 text-xs text-fg-muted`,children:[`Sync selected groups through this machine’s`,` `,(0,K.jsx)(`span`,{className:`font-mono`,children:`~/.puddle`}),`, so every Puddle window stays in step for profiles named `,(0,K.jsx)(`span`,{className:`font-mono`,children:n?.name??`…`}),`.`]}),(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-fg`,children:[(0,K.jsx)(U,{checked:C,disabled:!n||c.isLoading||l.isPending,onCheckedChange:e=>k({enabled:e},T)}),`Sync locally`]})]})]}),(0,K.jsxs)(`div`,{className:`mb-6`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>g(e=>!e),className:`flex items-center gap-1 text-xs text-fg-secondary transition-colors hover:text-fg`,children:[h?(0,K.jsx)(_e,{className:`size-3.5`}):(0,K.jsx)(ye,{className:`size-3.5`}),`Choose what to sync`]}),h&&(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(Ft,{selected:T,onToggle:te})})]}),(0,K.jsxs)(`div`,{className:`mb-6`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:`Export`}),(0,K.jsx)(`p`,{className:`mb-2 mt-1 text-xs text-fg-muted`,children:`Builds a Puddle magic string that encodes settings from the checklist above.`}),(0,K.jsx)(v,{size:`sm`,disabled:_,onClick:()=>void ie(),children:`Export & copy`}),p&&(0,K.jsx)(M,{readOnly:!0,value:p,rows:3,spellCheck:!1,onFocus:e=>e.currentTarget.select(),className:`mt-2 resize-y font-mono text-xs`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:`Import`}),(0,K.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:`Paste a Puddle magic string to import its settings.`}),(0,K.jsx)(M,{value:d,onChange:e=>f(e.target.value),onKeyDown:e=>e.stopPropagation(),placeholder:`Paste a settings export…`,rows:3,spellCheck:!1,className:`resize-y font-mono text-xs`}),(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(v,{size:`sm`,disabled:!d.trim()||_,onClick:()=>void re(),children:`Import`})})]})]})}function Lt({repo:e}){let t=re(),n=ee(),[r,i]=(0,G.useState)(e.default_base_branch),[a,o]=(0,G.useState)(e.onboarding_notes??``),s=e=>j(e);return(0,K.jsxs)(`div`,{className:`mb-4 rounded-lg bg-surface p-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-sm text-fg`,children:e.path}),(0,K.jsx)(`span`,{className:`shrink-0 text-2xs text-fg-muted tabular-nums`,children:e.last_fetched_at?`fetched ${new Date(e.last_fetched_at).toLocaleString()}`:`never fetched`}),(0,K.jsxs)(v,{size:`sm`,variant:`ghost`,disabled:n.isPending,onClick:()=>n.mutate(e.id,{onSuccess:()=>u.success(`Fetched.`),onError:s}),children:[(0,K.jsx)(qe,{}),`Fetch now`]})]}),(0,K.jsxs)(J,{label:`Default base branch`,htmlFor:`base-${e.id}`,className:`py-1.5`,children:[(0,K.jsx)(A,{id:`base-${e.id}`,value:r,onChange:e=>i(e.target.value),className:`w-40 font-mono`}),(0,K.jsx)(v,{size:`sm`,variant:`secondary`,disabled:r===e.default_base_branch||t.isPending,onClick:()=>t.mutate({id:e.id,default_base_branch:r},{onError:s}),children:`Save`})]}),(0,K.jsx)(J,{label:`Periodic fetch`,description:`Fetched on open and on the daemon's interval while sessions are active.`,htmlFor:`fetch-${e.id}`,className:`py-1.5`,children:(0,K.jsx)(U,{id:`fetch-${e.id}`,checked:e.fetch_enabled,onCheckedChange:n=>t.mutate({id:e.id,fetch_enabled:n},{onError:s})})}),(0,K.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1.5`,children:[(0,K.jsxs)(`label`,{htmlFor:`notes-${e.id}`,className:`flex flex-col gap-0.5 text-sm text-fg`,children:[`Onboarding notes`,(0,K.jsx)(`span`,{className:`text-xs text-fg-muted`,children:`Standing setup rules, injected into every fresh worktree. Agents update them via .puddle/onboarding-notes.md.`})]}),(0,K.jsx)(M,{id:`notes-${e.id}`,value:a,onChange:e=>o(e.target.value),rows:4,className:`font-mono`}),(0,K.jsx)(`div`,{children:(0,K.jsx)(v,{size:`sm`,variant:`secondary`,disabled:a===(e.onboarding_notes??``)||t.isPending,onClick:()=>t.mutate({id:e.id,onboarding_notes:a},{onError:s}),children:`Save notes`})})]}),e.orphan_worktrees.length>0&&(0,K.jsxs)(`div`,{className:`mt-3 rounded-md bg-elevated p-2`,children:[(0,K.jsx)(`p`,{className:`text-xs text-fg-secondary`,children:`Orphan worktrees — directories no session claims. Puddle never deletes these automatically; remove them by hand if unwanted.`}),(0,K.jsx)(`ul`,{className:`mt-1 flex flex-col gap-0.5`,children:e.orphan_worktrees.map(e=>(0,K.jsx)(`li`,{className:`truncate font-mono text-2xs text-fg-muted`,children:e},e))})]})]})}function Rt(){let e=oe();return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Y,{children:`Projects`}),e.data?.length===0&&(0,K.jsx)(`p`,{className:`text-sm text-fg-muted`,children:`No projects yet — create one from the dashboard, pointing at a repository.`}),e.data?.map(e=>(0,K.jsx)(Lt,{repo:e},e.id))]})}function $({label:e,description:t,field:n,config:r,min:i,step:a=1}){let o=ge();return(0,K.jsx)(J,{label:e,description:t,htmlFor:`host-${n}`,children:(0,K.jsx)(A,{id:`host-${n}`,type:`number`,min:i,step:a,className:`w-32 tabular-nums`,defaultValue:r[n],onBlur:e=>{if(e.target.value.trim()===``){e.target.value=String(r[n]);return}let t=Number(e.target.value);Number.isFinite(t)&&t!==r[n]&&o.mutate({[n]:t},{onError:e=>j(e)})}})})}function zt(){let e=ae(),t=ge(),n=k();return e.data?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(Y,{note:`Affects all profiles on this host`,children:`Host`}),(0,K.jsx)(J,{label:`Display name`,description:`Shown in place of the hostname across the UI. Leave blank for the hostname.`,htmlFor:`host-displayName`,children:(0,K.jsx)(A,{id:`host-displayName`,type:`text`,maxLength:64,className:`w-48`,placeholder:n.data?.hostname,defaultValue:e.data.displayName,onBlur:n=>{let r=n.target.value.trim();r!==e.data.displayName&&t.mutate({displayName:r},{onError:e=>j(e)})}})}),(0,K.jsx)($,{label:`Fetch interval (minutes)`,description:`Periodic git fetch for repos with active sessions.`,field:`fetchIntervalMinutes`,config:e.data,min:1}),(0,K.jsx)($,{label:`Log size cap (bytes)`,description:`Per-terminal on-disk log cap.`,field:`logMaxBytes`,config:e.data,min:65536,step:1048576}),(0,K.jsx)($,{label:`Replay size (bytes)`,description:`Log tail sent to a terminal on attach.`,field:`replayBytes`,config:e.data,min:1024,step:65536}),(0,K.jsx)($,{label:`UI-state retention (days)`,description:`Stale workspace snapshots are swept at boot.`,field:`uiStateRetentionDays`,config:e.data,min:1}),(0,K.jsx)(J,{label:`Auto-resume`,description:`Resume interrupted sessions automatically after a daemon restart.`,htmlFor:`host-autoResume`,children:(0,K.jsx)(U,{id:`host-autoResume`,checked:e.data.autoResume,onCheckedChange:e=>t.mutate({autoResume:e},{onError:e=>j(e)})})})]}):null}var Bt=[{id:`appearance`,label:`Appearance`,icon:xe,render:()=>(0,K.jsx)(nt,{})},{id:`profile`,label:`Profile`,icon:Ne,render:()=>(0,K.jsx)(it,{})},{id:`accounts`,label:`Accounts`,icon:tt,render:()=>(0,K.jsx)(st,{})},{id:`sessions`,label:`Sessions`,icon:et,render:()=>(0,K.jsx)(mt,{})},{id:`editor`,label:`Editor`,icon:Ye,render:()=>(0,K.jsx)(yt,{})},{id:`hotkeys`,label:`Hotkeys`,icon:Xe,render:()=>(0,K.jsx)(xt,{})},{id:`notifications`,label:`Notifications`,icon:Je,render:()=>(0,K.jsx)(vt,{})},{id:`projects`,label:`Projects`,icon:ue,render:()=>(0,K.jsx)(Rt,{})},{id:`host`,label:`Host`,icon:Qe,render:()=>(0,K.jsx)(zt,{})},{id:`sync`,label:`Sync`,icon:qe,render:()=>(0,K.jsx)(It,{})}],Vt={terminal:`sessions`,repositories:`projects`};function Ht(){let e=Fe(),t=e===null?null:Vt[e]??e,n=Bt.find(e=>e.id===t)??Bt[0];return(0,K.jsx)(C,{open:e!==null,onOpenChange:e=>!e&&ze(),children:(0,K.jsxs)(b,{wide:!0,className:`grid h-[34rem] grid-cols-[14rem_1fr] gap-0 overflow-hidden p-0`,children:[(0,K.jsx)(x,{className:`sr-only`,children:`Settings`}),(0,K.jsxs)(`nav`,{className:`flex flex-col gap-1 bg-surface p-2.5 pr-6`,children:[(0,K.jsx)(`span`,{className:`px-2.5 py-2 text-2xs font-medium uppercase tracking-wide text-fg-muted`,children:`Settings`}),Bt.map(({id:e,label:t,icon:r})=>(0,K.jsxs)(`button`,{onClick:()=>We(e),className:P(`flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors`,e===n.id?`bg-elevated text-fg`:`text-fg-secondary hover:bg-elevated hover:text-fg`),children:[(0,K.jsx)(r,{className:`size-4 shrink-0`}),t]},e))]}),(0,K.jsx)(`div`,{className:`overflow-y-auto p-5`,children:n.render()})]})})}export{Ht as SettingsDialog};