@lemoncat7/dsh-ssh 1.3.11 → 1.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client-api.d.ts +1 -0
- package/lib/client-api.d.ts.map +1 -1
- package/lib/client-api.js.map +1 -1
- package/lib/client.js +169 -48
- package/lib/client.js.map +3 -3
- package/lib/domain.d.ts +2 -0
- package/lib/domain.d.ts.map +1 -1
- package/lib/domain.js +1 -0
- package/lib/domain.js.map +1 -1
- package/lib/ftp-profile-editor.js +9 -6
- package/lib/ftp-profile-editor.js.map +1 -1
- package/lib/gist-sync.js +1 -1
- package/lib/gist-sync.js.map +1 -1
- package/lib/profile-editor.d.ts.map +1 -1
- package/lib/profile-editor.js +5 -3
- package/lib/profile-editor.js.map +1 -1
- package/lib/remote-workspace-tree.d.ts.map +1 -1
- package/lib/remote-workspace-tree.js +31 -19
- package/lib/remote-workspace-tree.js.map +1 -1
- package/lib/store.js +17 -1
- package/lib/store.js.map +1 -1
- package/lib/ui-components.d.ts +13 -1
- package/lib/ui-components.d.ts.map +1 -1
- package/lib/ui-components.js +105 -2
- package/lib/ui-components.js.map +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
window.__ModuleLoader__.load({ id: "@lemoncat7/dsh-ssh", factory: (require) => { var module = { exports: {} }; var exports = module.exports;
|
|
2
|
-
"use strict";var
|
|
3
|
-
`,
|
|
2
|
+
"use strict";var ff=Object.create;var yi=Object.defineProperty;var mf=Object.getOwnPropertyDescriptor;var gf=Object.getOwnPropertyNames;var vf=Object.getPrototypeOf,bf=Object.prototype.hasOwnProperty;var Ls=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$n=(e,t)=>{for(var s in t)yi(e,s,{get:t[s],enumerable:!0})},Bl=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of gf(t))!bf.call(e,o)&&o!==s&&yi(e,o,{get:()=>t[o],enumerable:!(r=mf(t,o))||r.enumerable});return e};var Fr=(e,t,s)=>(s=e!=null?ff(vf(e)):{},Bl(t||!e||!e.__esModule?yi(s,"default",{value:e,enumerable:!0}):s,e)),_f=e=>Bl(yi({},"__esModule",{value:!0}),e);var Vn=Ls((wi,Un)=>{(function(e,t){typeof wi=="object"&&typeof Un=="object"?Un.exports=t():typeof define=="function"&&define.amd?define([],t):typeof wi=="object"?wi.FitAddon=t():e.FitAddon=t()})(self,(()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){let s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;let r=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(r._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let s=this._terminal._core,r=s._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;let o=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),a=Math.max(0,parseInt(i.getPropertyValue("width"))),h=window.getComputedStyle(this._terminal.element),l=n-(parseInt(h.getPropertyValue("padding-top"))+parseInt(h.getPropertyValue("padding-bottom"))),c=a-(parseInt(h.getPropertyValue("padding-right"))+parseInt(h.getPropertyValue("padding-left")))-o;return{cols:Math.max(2,Math.floor(c/r.css.cell.width)),rows:Math.max(1,Math.floor(l/r.css.cell.height))}}}})(),e})()))});var Rh=Ls((bw,Dh)=>{"use strict";var Ch=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Df=/\n/g,Rf=/^\s*/,Af=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,If=/^:\s*/,Lf=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Of=/^[;\s]*/,Mf=/^\s+|\s+$/g,Ff=`
|
|
3
|
+
`,Eh="/",Th="*",Fs="",Bf="comment",Nf="declaration";function zf(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var s=1,r=1;function o(u){var d=u.match(Df);d&&(s+=d.length);var m=u.lastIndexOf(Ff);r=~m?u.length-m:r+u.length}function i(){var u={line:s,column:r};return function(d){return d.position=new n(u),l(),d}}function n(u){this.start=u,this.end={line:s,column:r},this.source=t.source}n.prototype.content=e;function a(u){var d=new Error(t.source+":"+s+":"+r+": "+u);if(d.reason=u,d.filename=t.source,d.line=s,d.column=r,d.source=e,!t.silent)throw d}function h(u){var d=u.exec(e);if(d){var m=d[0];return o(m),e=e.slice(m.length),d}}function l(){h(Rf)}function c(u){var d;for(u=u||[];d=f();)d!==!1&&u.push(d);return u}function f(){var u=i();if(!(Eh!=e.charAt(0)||Th!=e.charAt(1))){for(var d=2;Fs!=e.charAt(d)&&(Th!=e.charAt(d)||Eh!=e.charAt(d+1));)++d;if(d+=2,Fs===e.charAt(d-1))return a("End of comment missing");var m=e.slice(2,d-2);return r+=2,o(m),e=e.slice(d),r+=2,u({type:Bf,comment:m})}}function v(){var u=i(),d=h(Af);if(d){if(f(),!h(If))return a("property missing ':'");var m=h(Lf),p=u({type:Nf,property:Ph(d[0].replace(Ch,Fs)),value:m?Ph(m[0].replace(Ch,Fs)):Fs});return h(Of),p}}function g(){var u=[];c(u);for(var d;d=v();)d!==!1&&(u.push(d),c(u));return u}return l(),g()}function Ph(e){return e?e.replace(Mf,Fs):Fs}Dh.exports=zf});var Ah=Ls($r=>{"use strict";var Hf=$r&&$r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($r,"__esModule",{value:!0});$r.default=Uf;var $f=Hf(Rh());function Uf(e,t){let s=null;if(!e||typeof e!="string")return s;let r=(0,$f.default)(e),o=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;let{property:n,value:a}=i;o?t(n,a,i):a&&(s=s||{},s[n]=a)}),s}});var Lh=Ls(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.camelCase=void 0;var Vf=/^--[a-zA-Z0-9_-]+$/,jf=/-([a-z])/g,Wf=/^[^-]+$/,qf=/^-(webkit|moz|ms|o|khtml)-/,Kf=/^-(ms)-/,Gf=function(e){return!e||Wf.test(e)||Vf.test(e)},Xf=function(e,t){return t.toUpperCase()},Ih=function(e,t){return"".concat(t,"-")},Jf=function(e,t){return t===void 0&&(t={}),Gf(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Kf,Ih):e=e.replace(qf,Ih),e.replace(jf,Xf))};Ri.camelCase=Jf});var Mh=Ls((so,Oh)=>{"use strict";var Yf=so&&so.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Qf=Yf(Ah()),Zf=Lh();function to(e,t){var s={};return!e||typeof e!="string"||(0,Qf.default)(e,function(r,o){r&&o&&(s[(0,Zf.camelCase)(r,t)]=o)}),s}to.default=to;Oh.exports=to});var od=Ls((G2,nd)=>{"use strict";var en=Object.prototype.hasOwnProperty,id=Object.prototype.toString,Qc=Object.defineProperty,Zc=Object.getOwnPropertyDescriptor,ed=function(t){return typeof Array.isArray=="function"?Array.isArray(t):id.call(t)==="[object Array]"},td=function(t){if(!t||id.call(t)!=="[object Object]")return!1;var s=en.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&en.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!s&&!r)return!1;var o;for(o in t);return typeof o>"u"||en.call(t,o)},sd=function(t,s){Qc&&s.name==="__proto__"?Qc(t,s.name,{enumerable:!0,configurable:!0,value:s.newValue,writable:!0}):t[s.name]=s.newValue},rd=function(t,s){if(s==="__proto__")if(en.call(t,s)){if(Zc)return Zc(t,s).value}else return;return t[s]};nd.exports=function e(){var t,s,r,o,i,n,a=arguments[0],h=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},h=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});h<l;++h)if(t=arguments[h],t!=null)for(s in t)r=rd(a,s),o=rd(t,s),a!==o&&(c&&o&&(td(o)||(i=ed(o)))?(i?(i=!1,n=r&&ed(r)?r:[]):n=r&&td(r)?r:{},sd(a,{name:s,newValue:e(c,n,o)})):typeof o<"u"&&sd(a,{name:s,newValue:o}));return a}});var Tp=Ls((In,El)=>{(function(e,t){if(typeof In=="object"&&typeof El=="object")El.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var s=t();for(var r in s)(typeof In=="object"?In:e)[r]=s[r]}})(globalThis,(()=>(()=>{"use strict";var e={4567:function(o,i,n){var a=this&&this.__decorate||function(m,p,b,x){var y,S=arguments.length,_=S<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(m,p,b,x);else for(var w=m.length-1;w>=0;w--)(y=m[w])&&(_=(S<3?y(_):S>3?y(p,b,_):y(p,b))||_);return S>3&&_&&Object.defineProperty(p,b,_),_},h=this&&this.__param||function(m,p){return function(b,x){p(b,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;let l=n(9042),c=n(9924),f=n(844),v=n(4725),g=n(2585),u=n(3656),d=i.AccessibilityManager=class extends f.Disposable{constructor(m,p,b,x){super(),this._terminal=m,this._coreBrowserService=b,this._renderService=x,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new c.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((y=>this._handleResize(y.rows)))),this.register(this._terminal.onRender((y=>this._refreshRows(y.start,y.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((y=>this._handleChar(y)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
4
4
|
`)))),this.register(this._terminal.onA11yTab((y=>this._handleTab(y)))),this.register(this._terminal.onKey((y=>this._handleKey(y.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,u.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,f.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(m){for(let p=0;p<m;p++)this._handleChar(" ")}_handleChar(m){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==m&&(this._charsToAnnounce+=m):this._charsToAnnounce+=m,m===`
|
|
5
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(m){this._clearLiveRegion(),/\p{Control}/u.test(m)||this._charsToConsume.push(m)}_refreshRows(m,p){this._liveRegionDebouncer.refresh(m,p,this._terminal.rows)}_renderRows(m,p){let b=this._terminal.buffer,x=b.lines.length.toString();for(let y=m;y<=p;y++){let w=b.lines.get(b.ydisp+y),_=[],S=w?.translateToString(!0,void 0,void 0,_)||"",T=(b.ydisp+y+1).toString(),D=this._rowElements[y];D&&(S.length===0?(D.innerText="\xA0",this._rowColumns.set(D,[0,1])):(D.textContent=S,this._rowColumns.set(D,_)),D.setAttribute("aria-posinset",T),D.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(m,p){let b=m.target,x=this._rowElements[p===0?1:this._rowElements.length-2];if(b.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||m.relatedTarget!==x)return;let y,w;if(p===0?(y=b,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(y=this._rowElements.shift(),w=b,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),p===0){let _=this._createAccessibilityTreeNode();this._rowElements.unshift(_),this._rowContainer.insertAdjacentElement("afterbegin",_)}else{let _=this._createAccessibilityTreeNode();this._rowElements.push(_),this._rowContainer.appendChild(_)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(p===0?-1:1),this._rowElements[p===0?1:this._rowElements.length-2].focus(),m.preventDefault(),m.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let m=document.getSelection();if(!m)return;if(m.isCollapsed)return void(this._rowContainer.contains(m.anchorNode)&&this._terminal.clearSelection());if(!m.anchorNode||!m.focusNode)return void console.error("anchorNode and/or focusNode are null");let p={node:m.anchorNode,offset:m.anchorOffset},b={node:m.focusNode,offset:m.focusOffset};if((p.node.compareDocumentPosition(b.node)&Node.DOCUMENT_POSITION_PRECEDING||p.node===b.node&&p.offset>b.offset)&&([p,b]=[b,p]),p.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(p={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(p.node))return;let x=this._rowElements.slice(-1)[0];if(b.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(b={node:x,offset:x.textContent?.length??0}),!this._rowContainer.contains(b.node))return;let y=({node:S,offset:T})=>{let D=S instanceof Text?S.parentNode:S,P=parseInt(D?.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;let A=this._rowColumns.get(D);if(!A)return console.warn("columns is null. Race condition?"),null;let F=T<A.length?A[T]:A.slice(-1)[0]+1;return F>=this._terminal.cols&&(++P,F=0),{row:P,column:F}},w=y(p),_=y(b);if(w&&_){if(w.row>_.row||w.row===_.row&&w.column>=_.column)throw new Error("invalid range");this._terminal.select(w.column,w.row,(_.row-w.row)*this._terminal.cols-w.column+_.column)}}_handleResize(m){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let p=this._rowContainer.children.length;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);for(;this._rowElements.length>m;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let m=this._coreBrowserService.mainDocument.createElement("div");return m.setAttribute("role","listitem"),m.tabIndex=-1,this._refreshRowDimensions(m),m}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let m=0;m<this._terminal.rows;m++)this._refreshRowDimensions(this._rowElements[m])}}_refreshRowDimensions(m){m.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=d=a([h(1,g.IInstantiationService),h(2,v.ICoreBrowserService),h(3,v.IRenderService)],d)},3614:(o,i)=>{function n(c){return c.replace(/\r?\n/g,"\r")}function a(c,f){return f?"\x1B[200~"+c+"\x1B[201~":c}function h(c,f,v,g){c=a(c=n(c),v.decPrivateModes.bracketedPasteMode&&g.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(c,!0),f.value=""}function l(c,f,v){let g=v.getBoundingClientRect(),u=c.clientX-g.left-10,d=c.clientY-g.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${u}px`,f.style.top=`${d}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=n,i.bracketTextForPaste=a,i.copyHandler=function(c,f){c.clipboardData&&c.clipboardData.setData("text/plain",f.selectionText),c.preventDefault()},i.handlePasteEvent=function(c,f,v,g){c.stopPropagation(),c.clipboardData&&h(c.clipboardData.getData("text/plain"),f,v,g)},i.paste=h,i.moveTextAreaUnderMouseCursor=l,i.rightClickHandler=function(c,f,v,g,u){l(c,f,v),u&&g.rightClickSelect(c),f.value=g.selectionText,f.select()}},7239:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;let a=n(1505);i.ColorContrastCache=class{constructor(){this._color=new a.TwoKeyMap,this._css=new a.TwoKeyMap}setCss(h,l,c){this._css.set(h,l,c)}getCss(h,l){return this._css.get(h,l)}setColor(h,l,c){this._color.set(h,l,c)}getColor(h,l){return this._color.get(h,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(n,a,h,l){n.addEventListener(a,h,l);let c=!1;return{dispose:()=>{c||(c=!0,n.removeEventListener(a,h,l))}}}},3551:function(o,i,n){var a=this&&this.__decorate||function(d,m,p,b){var x,y=arguments.length,w=y<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,m,p,b);else for(var _=d.length-1;_>=0;_--)(x=d[_])&&(w=(y<3?x(w):y>3?x(m,p,w):x(m,p))||w);return y>3&&w&&Object.defineProperty(m,p,w),w},h=this&&this.__param||function(d,m){return function(p,b){m(p,b,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;let l=n(3656),c=n(8460),f=n(844),v=n(2585),g=n(4725),u=i.Linkifier=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(d,m,p,b,x){super(),this._element=d,this._mouseService=m,this._renderService=p,this._bufferService=b,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new c.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new c.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(d){this._lastMouseEvent=d;let m=this._positionFromMouseEvent(d,this._element,this._mouseService);if(!m)return;this._isMouseOut=!1;let p=d.composedPath();for(let b=0;b<p.length;b++){let x=p[b];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&m.x===this._lastBufferCell.x&&m.y===this._lastBufferCell.y||(this._handleHover(m),this._lastBufferCell=m)}_handleHover(d){if(this._activeLine!==d.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(d,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,d)||(this._clearCurrentLink(),this._askForLink(d,!0))}_askForLink(d,m){this._activeProviderReplies&&m||(this._activeProviderReplies?.forEach((b=>{b?.forEach((x=>{x.link.dispose&&x.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=d.y);let p=!1;for(let[b,x]of this._linkProviderService.linkProviders.entries())m?this._activeProviderReplies?.get(b)&&(p=this._checkLinkProviderResult(b,d,p)):x.provideLinks(d.y,(y=>{if(this._isMouseOut)return;let w=y?.map((_=>({link:_})));this._activeProviderReplies?.set(b,w),p=this._checkLinkProviderResult(b,d,p),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(d.y,this._activeProviderReplies)}))}_removeIntersectingLinks(d,m){let p=new Set;for(let b=0;b<m.size;b++){let x=m.get(b);if(x)for(let y=0;y<x.length;y++){let w=x[y],_=w.link.range.start.y<d?0:w.link.range.start.x,S=w.link.range.end.y>d?this._bufferService.cols:w.link.range.end.x;for(let T=_;T<=S;T++){if(p.has(T)){x.splice(y--,1);break}p.add(T)}}}}_checkLinkProviderResult(d,m,p){if(!this._activeProviderReplies)return p;let b=this._activeProviderReplies.get(d),x=!1;for(let y=0;y<d;y++)this._activeProviderReplies.has(y)&&!this._activeProviderReplies.get(y)||(x=!0);if(!x&&b){let y=b.find((w=>this._linkAtPosition(w.link,m)));y&&(p=!0,this._handleNewLink(y))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!p)for(let y=0;y<this._activeProviderReplies.size;y++){let w=this._activeProviderReplies.get(y)?.find((_=>this._linkAtPosition(_.link,m)));if(w){p=!0,this._handleNewLink(w);break}}return p}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(d){if(!this._currentLink)return;let m=this._positionFromMouseEvent(d,this._element,this._mouseService);m&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,m)&&this._currentLink.link.activate(d,this._currentLink.link.text)}_clearCurrentLink(d,m){this._currentLink&&this._lastMouseEvent&&(!d||!m||this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=m)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(d){if(!this._lastMouseEvent)return;let m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._linkAtPosition(d.link,m)&&(this._currentLink=d,this._currentLink.state={decorations:{underline:d.link.decorations===void 0||d.link.decorations.underline,pointerCursor:d.link.decorations===void 0||d.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,d.link,this._lastMouseEvent),d.link.decorations={},Object.defineProperties(d.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:p=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==p&&(this._currentLink.state.decorations.pointerCursor=p,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",p))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:p=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==p&&(this._currentLink.state.decorations.underline=p,this._currentLink.state.isHovered&&this._fireUnderlineEvent(d.link,p))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((p=>{if(!this._currentLink)return;let b=p.start===0?0:p.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+p.end;if(this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(b,x),this._lastMouseEvent)){let y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}}))))}_linkHover(d,m,p){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!0),this._currentLink.state.decorations.pointerCursor&&d.classList.add("xterm-cursor-pointer")),m.hover&&m.hover(p,m.text)}_fireUnderlineEvent(d,m){let p=d.range,b=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(p.start.x-1,p.start.y-b-1,p.end.x,p.end.y-b-1,void 0);(m?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(d,m,p){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!1),this._currentLink.state.decorations.pointerCursor&&d.classList.remove("xterm-cursor-pointer")),m.leave&&m.leave(p,m.text)}_linkAtPosition(d,m){let p=d.range.start.y*this._bufferService.cols+d.range.start.x,b=d.range.end.y*this._bufferService.cols+d.range.end.x,x=m.y*this._bufferService.cols+m.x;return p<=x&&x<=b}_positionFromMouseEvent(d,m,p){let b=p.getCoords(d,m,this._bufferService.cols,this._bufferService.rows);if(b)return{x:b[0],y:b[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(d,m,p,b,x){return{x1:d,y1:m,x2:p,y2:b,cols:this._bufferService.cols,fg:x}}};i.Linkifier=u=a([h(1,g.IMouseService),h(2,g.IRenderService),h(3,v.IBufferService),h(4,g.ILinkProviderService)],u)},9042:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(o,i,n){var a=this&&this.__decorate||function(g,u,d,m){var p,b=arguments.length,x=b<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,u,d,m);else for(var y=g.length-1;y>=0;y--)(p=g[y])&&(x=(b<3?p(x):b>3?p(u,d,x):p(u,d))||x);return b>3&&x&&Object.defineProperty(u,d,x),x},h=this&&this.__param||function(g,u){return function(d,m){u(d,m,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;let l=n(511),c=n(2585),f=i.OscLinkProvider=class{constructor(g,u,d){this._bufferService=g,this._optionsService=u,this._oscLinkService=d}provideLinks(g,u){let d=this._bufferService.buffer.lines.get(g-1);if(!d)return void u(void 0);let m=[],p=this._optionsService.rawOptions.linkHandler,b=new l.CellData,x=d.getTrimmedLength(),y=-1,w=-1,_=!1;for(let S=0;S<x;S++)if(w!==-1||d.hasContent(S)){if(d.loadCell(S,b),b.hasExtendedAttrs()&&b.extended.urlId){if(w===-1){w=S,y=b.extended.urlId;continue}_=b.extended.urlId!==y}else w!==-1&&(_=!0);if(_||w!==-1&&S===x-1){let T=this._oscLinkService.getLinkData(y)?.uri;if(T){let D={start:{x:w+1,y:g},end:{x:S+(_||S!==x-1?0:1),y:g}},P=!1;if(!p?.allowNonHttpProtocols)try{let A=new URL(T);["http:","https:"].includes(A.protocol)||(P=!0)}catch{P=!0}P||m.push({text:T,range:D,activate:(A,F)=>p?p.activate(A,F,D):v(0,F),hover:(A,F)=>p?.hover?.(A,F,D),leave:(A,F)=>p?.leave?.(A,F,D)})}_=!1,b.hasExtendedAttrs()&&b.extended.urlId?(w=S,y=b.extended.urlId):(w=-1,y=-1)}}u(m)}};function v(g,u){if(confirm(`Do you want to navigate to ${u}?
|
|
5
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(m){this._clearLiveRegion(),/\p{Control}/u.test(m)||this._charsToConsume.push(m)}_refreshRows(m,p){this._liveRegionDebouncer.refresh(m,p,this._terminal.rows)}_renderRows(m,p){let b=this._terminal.buffer,x=b.lines.length.toString();for(let y=m;y<=p;y++){let S=b.lines.get(b.ydisp+y),_=[],w=S?.translateToString(!0,void 0,void 0,_)||"",C=(b.ydisp+y+1).toString(),P=this._rowElements[y];P&&(w.length===0?(P.innerText="\xA0",this._rowColumns.set(P,[0,1])):(P.textContent=w,this._rowColumns.set(P,_)),P.setAttribute("aria-posinset",C),P.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(m,p){let b=m.target,x=this._rowElements[p===0?1:this._rowElements.length-2];if(b.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||m.relatedTarget!==x)return;let y,S;if(p===0?(y=b,S=this._rowElements.pop(),this._rowContainer.removeChild(S)):(y=this._rowElements.shift(),S=b,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),S.removeEventListener("focus",this._bottomBoundaryFocusListener),p===0){let _=this._createAccessibilityTreeNode();this._rowElements.unshift(_),this._rowContainer.insertAdjacentElement("afterbegin",_)}else{let _=this._createAccessibilityTreeNode();this._rowElements.push(_),this._rowContainer.appendChild(_)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(p===0?-1:1),this._rowElements[p===0?1:this._rowElements.length-2].focus(),m.preventDefault(),m.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let m=document.getSelection();if(!m)return;if(m.isCollapsed)return void(this._rowContainer.contains(m.anchorNode)&&this._terminal.clearSelection());if(!m.anchorNode||!m.focusNode)return void console.error("anchorNode and/or focusNode are null");let p={node:m.anchorNode,offset:m.anchorOffset},b={node:m.focusNode,offset:m.focusOffset};if((p.node.compareDocumentPosition(b.node)&Node.DOCUMENT_POSITION_PRECEDING||p.node===b.node&&p.offset>b.offset)&&([p,b]=[b,p]),p.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(p={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(p.node))return;let x=this._rowElements.slice(-1)[0];if(b.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(b={node:x,offset:x.textContent?.length??0}),!this._rowContainer.contains(b.node))return;let y=({node:w,offset:C})=>{let P=w instanceof Text?w.parentNode:w,T=parseInt(P?.getAttribute("aria-posinset"),10)-1;if(isNaN(T))return console.warn("row is invalid. Race condition?"),null;let A=this._rowColumns.get(P);if(!A)return console.warn("columns is null. Race condition?"),null;let F=C<A.length?A[C]:A.slice(-1)[0]+1;return F>=this._terminal.cols&&(++T,F=0),{row:T,column:F}},S=y(p),_=y(b);if(S&&_){if(S.row>_.row||S.row===_.row&&S.column>=_.column)throw new Error("invalid range");this._terminal.select(S.column,S.row,(_.row-S.row)*this._terminal.cols-S.column+_.column)}}_handleResize(m){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let p=this._rowContainer.children.length;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);for(;this._rowElements.length>m;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let m=this._coreBrowserService.mainDocument.createElement("div");return m.setAttribute("role","listitem"),m.tabIndex=-1,this._refreshRowDimensions(m),m}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let m=0;m<this._terminal.rows;m++)this._refreshRowDimensions(this._rowElements[m])}}_refreshRowDimensions(m){m.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=d=a([h(1,g.IInstantiationService),h(2,v.ICoreBrowserService),h(3,v.IRenderService)],d)},3614:(o,i)=>{function n(c){return c.replace(/\r?\n/g,"\r")}function a(c,f){return f?"\x1B[200~"+c+"\x1B[201~":c}function h(c,f,v,g){c=a(c=n(c),v.decPrivateModes.bracketedPasteMode&&g.rawOptions.ignoreBracketedPasteMode!==!0),v.triggerDataEvent(c,!0),f.value=""}function l(c,f,v){let g=v.getBoundingClientRect(),u=c.clientX-g.left-10,d=c.clientY-g.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${u}px`,f.style.top=`${d}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=n,i.bracketTextForPaste=a,i.copyHandler=function(c,f){c.clipboardData&&c.clipboardData.setData("text/plain",f.selectionText),c.preventDefault()},i.handlePasteEvent=function(c,f,v,g){c.stopPropagation(),c.clipboardData&&h(c.clipboardData.getData("text/plain"),f,v,g)},i.paste=h,i.moveTextAreaUnderMouseCursor=l,i.rightClickHandler=function(c,f,v,g,u){l(c,f,v),u&&g.rightClickSelect(c),f.value=g.selectionText,f.select()}},7239:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;let a=n(1505);i.ColorContrastCache=class{constructor(){this._color=new a.TwoKeyMap,this._css=new a.TwoKeyMap}setCss(h,l,c){this._css.set(h,l,c)}getCss(h,l){return this._css.get(h,l)}setColor(h,l,c){this._color.set(h,l,c)}getColor(h,l){return this._color.get(h,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(n,a,h,l){n.addEventListener(a,h,l);let c=!1;return{dispose:()=>{c||(c=!0,n.removeEventListener(a,h,l))}}}},3551:function(o,i,n){var a=this&&this.__decorate||function(d,m,p,b){var x,y=arguments.length,S=y<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,m,p,b);else for(var _=d.length-1;_>=0;_--)(x=d[_])&&(S=(y<3?x(S):y>3?x(m,p,S):x(m,p))||S);return y>3&&S&&Object.defineProperty(m,p,S),S},h=this&&this.__param||function(d,m){return function(p,b){m(p,b,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;let l=n(3656),c=n(8460),f=n(844),v=n(2585),g=n(4725),u=i.Linkifier=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(d,m,p,b,x){super(),this._element=d,this._mouseService=m,this._renderService=p,this._bufferService=b,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new c.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new c.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(d){this._lastMouseEvent=d;let m=this._positionFromMouseEvent(d,this._element,this._mouseService);if(!m)return;this._isMouseOut=!1;let p=d.composedPath();for(let b=0;b<p.length;b++){let x=p[b];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&m.x===this._lastBufferCell.x&&m.y===this._lastBufferCell.y||(this._handleHover(m),this._lastBufferCell=m)}_handleHover(d){if(this._activeLine!==d.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(d,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,d)||(this._clearCurrentLink(),this._askForLink(d,!0))}_askForLink(d,m){this._activeProviderReplies&&m||(this._activeProviderReplies?.forEach((b=>{b?.forEach((x=>{x.link.dispose&&x.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=d.y);let p=!1;for(let[b,x]of this._linkProviderService.linkProviders.entries())m?this._activeProviderReplies?.get(b)&&(p=this._checkLinkProviderResult(b,d,p)):x.provideLinks(d.y,(y=>{if(this._isMouseOut)return;let S=y?.map((_=>({link:_})));this._activeProviderReplies?.set(b,S),p=this._checkLinkProviderResult(b,d,p),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(d.y,this._activeProviderReplies)}))}_removeIntersectingLinks(d,m){let p=new Set;for(let b=0;b<m.size;b++){let x=m.get(b);if(x)for(let y=0;y<x.length;y++){let S=x[y],_=S.link.range.start.y<d?0:S.link.range.start.x,w=S.link.range.end.y>d?this._bufferService.cols:S.link.range.end.x;for(let C=_;C<=w;C++){if(p.has(C)){x.splice(y--,1);break}p.add(C)}}}}_checkLinkProviderResult(d,m,p){if(!this._activeProviderReplies)return p;let b=this._activeProviderReplies.get(d),x=!1;for(let y=0;y<d;y++)this._activeProviderReplies.has(y)&&!this._activeProviderReplies.get(y)||(x=!0);if(!x&&b){let y=b.find((S=>this._linkAtPosition(S.link,m)));y&&(p=!0,this._handleNewLink(y))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!p)for(let y=0;y<this._activeProviderReplies.size;y++){let S=this._activeProviderReplies.get(y)?.find((_=>this._linkAtPosition(_.link,m)));if(S){p=!0,this._handleNewLink(S);break}}return p}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(d){if(!this._currentLink)return;let m=this._positionFromMouseEvent(d,this._element,this._mouseService);m&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,m)&&this._currentLink.link.activate(d,this._currentLink.link.text)}_clearCurrentLink(d,m){this._currentLink&&this._lastMouseEvent&&(!d||!m||this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=m)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(d){if(!this._lastMouseEvent)return;let m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._linkAtPosition(d.link,m)&&(this._currentLink=d,this._currentLink.state={decorations:{underline:d.link.decorations===void 0||d.link.decorations.underline,pointerCursor:d.link.decorations===void 0||d.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,d.link,this._lastMouseEvent),d.link.decorations={},Object.defineProperties(d.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:p=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==p&&(this._currentLink.state.decorations.pointerCursor=p,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",p))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:p=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==p&&(this._currentLink.state.decorations.underline=p,this._currentLink.state.isHovered&&this._fireUnderlineEvent(d.link,p))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((p=>{if(!this._currentLink)return;let b=p.start===0?0:p.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+p.end;if(this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(b,x),this._lastMouseEvent)){let y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}}))))}_linkHover(d,m,p){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!0),this._currentLink.state.decorations.pointerCursor&&d.classList.add("xterm-cursor-pointer")),m.hover&&m.hover(p,m.text)}_fireUnderlineEvent(d,m){let p=d.range,b=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(p.start.x-1,p.start.y-b-1,p.end.x,p.end.y-b-1,void 0);(m?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(d,m,p){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!1),this._currentLink.state.decorations.pointerCursor&&d.classList.remove("xterm-cursor-pointer")),m.leave&&m.leave(p,m.text)}_linkAtPosition(d,m){let p=d.range.start.y*this._bufferService.cols+d.range.start.x,b=d.range.end.y*this._bufferService.cols+d.range.end.x,x=m.y*this._bufferService.cols+m.x;return p<=x&&x<=b}_positionFromMouseEvent(d,m,p){let b=p.getCoords(d,m,this._bufferService.cols,this._bufferService.rows);if(b)return{x:b[0],y:b[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(d,m,p,b,x){return{x1:d,y1:m,x2:p,y2:b,cols:this._bufferService.cols,fg:x}}};i.Linkifier=u=a([h(1,g.IMouseService),h(2,g.IRenderService),h(3,v.IBufferService),h(4,g.ILinkProviderService)],u)},9042:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(o,i,n){var a=this&&this.__decorate||function(g,u,d,m){var p,b=arguments.length,x=b<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,u,d,m);else for(var y=g.length-1;y>=0;y--)(p=g[y])&&(x=(b<3?p(x):b>3?p(u,d,x):p(u,d))||x);return b>3&&x&&Object.defineProperty(u,d,x),x},h=this&&this.__param||function(g,u){return function(d,m){u(d,m,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;let l=n(511),c=n(2585),f=i.OscLinkProvider=class{constructor(g,u,d){this._bufferService=g,this._optionsService=u,this._oscLinkService=d}provideLinks(g,u){let d=this._bufferService.buffer.lines.get(g-1);if(!d)return void u(void 0);let m=[],p=this._optionsService.rawOptions.linkHandler,b=new l.CellData,x=d.getTrimmedLength(),y=-1,S=-1,_=!1;for(let w=0;w<x;w++)if(S!==-1||d.hasContent(w)){if(d.loadCell(w,b),b.hasExtendedAttrs()&&b.extended.urlId){if(S===-1){S=w,y=b.extended.urlId;continue}_=b.extended.urlId!==y}else S!==-1&&(_=!0);if(_||S!==-1&&w===x-1){let C=this._oscLinkService.getLinkData(y)?.uri;if(C){let P={start:{x:S+1,y:g},end:{x:w+(_||w!==x-1?0:1),y:g}},T=!1;if(!p?.allowNonHttpProtocols)try{let A=new URL(C);["http:","https:"].includes(A.protocol)||(T=!0)}catch{T=!0}T||m.push({text:C,range:P,activate:(A,F)=>p?p.activate(A,F,P):v(0,F),hover:(A,F)=>p?.hover?.(A,F,P),leave:(A,F)=>p?.leave?.(A,F,P)})}_=!1,b.hasExtendedAttrs()&&b.extended.urlId?(S=w,y=b.extended.urlId):(S=-1,y=-1)}}u(m)}};function v(g,u){if(confirm(`Do you want to navigate to ${u}?
|
|
6
6
|
|
|
7
|
-
WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){try{d.opener=null}catch{}d.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=f=a([h(0,c.IBufferService),h(1,c.IOptionsService),h(2,c.IOscLinkService)],f)},6193:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(n,a){this._renderCallback=n,this._coreBrowserService=a,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(n){return this._refreshCallbacks.push(n),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(n,a,h){this._rowCount=h,n=n!==void 0?n:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,n):n,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,a):a,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();let n=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,a),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let n of this._refreshCallbacks)n(0);this._refreshCallbacks=[]}}},3236:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;let a=n(3614),h=n(3656),l=n(3551),c=n(9042),f=n(3730),v=n(1680),g=n(3107),u=n(5744),d=n(2950),m=n(1296),p=n(428),b=n(4269),x=n(5114),y=n(8934),w=n(3230),_=n(9312),S=n(4725),T=n(6731),D=n(8055),P=n(8969),A=n(8460),F=n(844),B=n(6114),$=n(8437),z=n(2584),H=n(7399),C=n(5941),R=n(9074),L=n(2585),k=n(5435),U=n(4567),X=n(779);class O extends P.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(N={}){super(N),this.browser=B,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(R.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(X.LinkProviderService),this._instantiationService.setService(S.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((I,J)=>this.refresh(I,J)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((I=>this._reportWindowsOptions(I)))),this.register(this._inputHandler.onColor((I=>this._handleColorEvent(I)))),this.register((0,A.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,A.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((I=>this._afterResize(I.cols,I.rows)))),this.register((0,F.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(N){if(this._themeService)for(let I of N){let J,Y="";switch(I.index){case 256:J="foreground",Y="10";break;case 257:J="background",Y="11";break;case 258:J="cursor",Y="12";break;default:J="ansi",Y="4;"+I.index}switch(I.type){case 0:let V=D.color.toColorRGB(J==="ansi"?this._themeService.colors.ansi[I.index]:this._themeService.colors[J]);this.coreService.triggerDataEvent(`${z.C0.ESC}]${Y};${(0,C.toRgbString)(V)}${z.C1_ESCAPED.ST}`);break;case 1:if(J==="ansi")this._themeService.modifyColors((Q=>Q.ansi[I.index]=D.channels.toColor(...I.color)));else{let Q=J;this._themeService.modifyColors((W=>W[Q]=D.channels.toColor(...I.color)))}break;case 2:this._themeService.restoreColor(I.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(N){N?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(N){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let N=this.buffer.ybase+this.buffer.y,I=this.buffer.lines.get(N);if(!I)return;let J=Math.min(this.buffer.x,this.cols-1),Y=this._renderService.dimensions.css.cell.height,V=I.getWidth(J),Q=this._renderService.dimensions.css.cell.width*V,W=this.buffer.y*this._renderService.dimensions.css.cell.height,ae=J*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ae+"px",this.textarea.style.top=W+"px",this.textarea.style.width=Q+"px",this.textarea.style.height=Y+"px",this.textarea.style.lineHeight=Y+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,h.addDisposableDomListener)(this.element,"copy",(I=>{this.hasSelection()&&(0,a.copyHandler)(I,this._selectionService)})));let N=I=>(0,a.handlePasteEvent)(I,this.textarea,this.coreService,this.optionsService);this.register((0,h.addDisposableDomListener)(this.textarea,"paste",N)),this.register((0,h.addDisposableDomListener)(this.element,"paste",N)),B.isFirefox?this.register((0,h.addDisposableDomListener)(this.element,"mousedown",(I=>{I.button===2&&(0,a.rightClickHandler)(I,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,h.addDisposableDomListener)(this.element,"contextmenu",(I=>{(0,a.rightClickHandler)(I,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),B.isLinux&&this.register((0,h.addDisposableDomListener)(this.element,"auxclick",(I=>{I.button===1&&(0,a.moveTextAreaUnderMouseCursor)(I,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,h.addDisposableDomListener)(this.textarea,"keyup",(N=>this._keyUp(N)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keydown",(N=>this._keyDown(N)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keypress",(N=>this._keyPress(N)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionupdate",(N=>this._compositionHelper.compositionupdate(N)))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,h.addDisposableDomListener)(this.textarea,"input",(N=>this._inputEvent(N)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(N){if(!N)throw new Error("Terminal requires a parent element.");if(N.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=N.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),N.appendChild(this.element);let I=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),I.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,h.addDisposableDomListener)(this.screenElement,"mousemove",(J=>this.updateCursorStyle(J)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),I.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",c.promptLabel),B.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(x.CoreBrowserService,this.textarea,N.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(S.ICoreBrowserService,this._coreBrowserService),this.register((0,h.addDisposableDomListener)(this.textarea,"focus",(J=>this._handleTextAreaFocus(J)))),this.register((0,h.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(S.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(S.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(S.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(S.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((J=>this._onRender.fire(J)))),this.onResize((J=>this._renderService.resize(J.cols,J.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(S.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(I);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(v.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((J=>this.scrollLines(J.amount,J.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(_.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(S.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((J=>this.scrollLines(J.amount,J.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((J=>this._renderService.handleSelectionChanged(J.start,J.end,J.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((J=>{this.textarea.value=J,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((J=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(g.BufferDecorationRenderer,this.screenElement)),this.register((0,h.addDisposableDomListener)(this.element,"mousedown",(J=>this._selectionService.handleMouseDown(J)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(J=>this._handleScreenReaderModeOptionChange(J)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(J=>{!this._overviewRulerRenderer&&J&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(m.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let N=this,I=this.element;function J(Q){let W=N._mouseService.getMouseReportCoords(Q,N.screenElement);if(!W)return!1;let ae,me;switch(Q.overrideType||Q.type){case"mousemove":me=32,Q.buttons===void 0?(ae=3,Q.button!==void 0&&(ae=Q.button<3?Q.button:3)):ae=1&Q.buttons?0:4&Q.buttons?1:2&Q.buttons?2:3;break;case"mouseup":me=0,ae=Q.button<3?Q.button:3;break;case"mousedown":me=1,ae=Q.button<3?Q.button:3;break;case"wheel":if(N._customWheelEventHandler&&N._customWheelEventHandler(Q)===!1||N.viewport.getLinesScrolled(Q)===0)return!1;me=Q.deltaY<0?0:1,ae=4;break;default:return!1}return!(me===void 0||ae===void 0||ae>4)&&N.coreMouseService.triggerMouseEvent({col:W.col,row:W.row,x:W.x,y:W.y,button:ae,action:me,ctrl:Q.ctrlKey,alt:Q.altKey,shift:Q.shiftKey})}let Y={mouseup:null,wheel:null,mousedrag:null,mousemove:null},V={mouseup:Q=>(J(Q),Q.buttons||(this._document.removeEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.removeEventListener("mousemove",Y.mousedrag)),this.cancel(Q)),wheel:Q=>(J(Q),this.cancel(Q,!0)),mousedrag:Q=>{Q.buttons&&J(Q)},mousemove:Q=>{Q.buttons||J(Q)}};this.register(this.coreMouseService.onProtocolChange((Q=>{Q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Q)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&Q?Y.mousemove||(I.addEventListener("mousemove",V.mousemove),Y.mousemove=V.mousemove):(I.removeEventListener("mousemove",Y.mousemove),Y.mousemove=null),16&Q?Y.wheel||(I.addEventListener("wheel",V.wheel,{passive:!1}),Y.wheel=V.wheel):(I.removeEventListener("wheel",Y.wheel),Y.wheel=null),2&Q?Y.mouseup||(Y.mouseup=V.mouseup):(this._document.removeEventListener("mouseup",Y.mouseup),Y.mouseup=null),4&Q?Y.mousedrag||(Y.mousedrag=V.mousedrag):(this._document.removeEventListener("mousemove",Y.mousedrag),Y.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,h.addDisposableDomListener)(I,"mousedown",(Q=>{if(Q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Q))return J(Q),Y.mouseup&&this._document.addEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.addEventListener("mousemove",Y.mousedrag),this.cancel(Q)}))),this.register((0,h.addDisposableDomListener)(I,"wheel",(Q=>{if(!Y.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Q)===!1)return!1;if(!this.buffer.hasScrollback){let W=this.viewport.getLinesScrolled(Q);if(W===0)return;let ae=z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Q.deltaY<0?"A":"B"),me="";for(let De=0;De<Math.abs(W);De++)me+=ae;return this.coreService.triggerDataEvent(me,!0),this.cancel(Q,!0)}return this.viewport.handleWheel(Q)?this.cancel(Q):void 0}}),{passive:!1})),this.register((0,h.addDisposableDomListener)(I,"touchstart",(Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Q),this.cancel(Q)}),{passive:!0})),this.register((0,h.addDisposableDomListener)(I,"touchmove",(Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Q)?void 0:this.cancel(Q)}),{passive:!1}))}refresh(N,I){this._renderService?.refreshRows(N,I)}updateCursorStyle(N){this._selectionService?.shouldColumnSelect(N)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(N,I,J=0){J===1?(super.scrollLines(N,I,J),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(N)}paste(N){(0,a.paste)(N,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(N){this._customKeyEventHandler=N}attachCustomWheelEventHandler(N){this._customWheelEventHandler=N}registerLinkProvider(N){return this._linkProviderService.registerLinkProvider(N)}registerCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let I=this._characterJoinerService.register(N);return this.refresh(0,this.rows-1),I}deregisterCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(N)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(N){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+N)}registerDecoration(N){return this._decorationService.registerDecoration(N)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(N,I,J){this._selectionService.setSelection(N,I,J)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(N,I){this._selectionService?.selectLines(N,I)}_keyDown(N){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;let I=this.browser.isMac&&this.options.macOptionIsMeta&&N.altKey;if(!I&&!this._compositionHelper.keydown(N))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;I||N.key!=="Dead"&&N.key!=="AltGraph"||(this._unprocessedDeadKey=!0);let J=(0,H.evaluateKeyboardEvent)(N,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(N),J.type===3||J.type===2){let Y=this.rows-1;return this.scrollLines(J.type===2?-Y:Y),this.cancel(N,!0)}return J.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,N)||(J.cancel&&this.cancel(N,!0),!J.key||!!(N.key&&!N.ctrlKey&&!N.altKey&&!N.metaKey&&N.key.length===1&&N.key.charCodeAt(0)>=65&&N.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(J.key!==z.C0.ETX&&J.key!==z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:J.key,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(J.key,!0),!this.optionsService.rawOptions.screenReaderMode||N.altKey||N.ctrlKey?this.cancel(N,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(N,I){let J=N.isMac&&!this.options.macOptionIsMeta&&I.altKey&&!I.ctrlKey&&!I.metaKey||N.isWindows&&I.altKey&&I.ctrlKey&&!I.metaKey||N.isWindows&&I.getModifierState("AltGraph");return I.type==="keypress"?J:J&&(!I.keyCode||I.keyCode>47)}_keyUp(N){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1||((function(I){return I.keyCode===16||I.keyCode===17||I.keyCode===18})(N)||this.focus(),this.updateCursorStyle(N),this._keyPressHandled=!1)}_keyPress(N){let I;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;if(this.cancel(N),N.charCode)I=N.charCode;else if(N.which===null||N.which===void 0)I=N.keyCode;else{if(N.which===0||N.charCode===0)return!1;I=N.which}return!(!I||(N.altKey||N.ctrlKey||N.metaKey)&&!this._isThirdLevelShift(this.browser,N)||(I=String.fromCharCode(I),this._onKey.fire({key:I,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(I,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(N){if(N.data&&N.inputType==="insertText"&&(!N.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let I=N.data;return this.coreService.triggerDataEvent(I,!0),this.cancel(N),!0}return!1}resize(N,I){N!==this.cols||I!==this.rows?super.resize(N,I):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(N,I){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let N=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=N,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(z.C0.ESC+"[I"):this.coreService.triggerDataEvent(z.C0.ESC+"[O")}_reportWindowsOptions(N){if(this._renderService)switch(N){case k.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let I=this._renderService.dimensions.css.canvas.width.toFixed(0),J=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[4;${J};${I}t`);break;case k.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let Y=this._renderService.dimensions.css.cell.width.toFixed(0),V=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[6;${V};${Y}t`)}}cancel(N,I){if(this.options.cancelEvents||I)return N.preventDefault(),N.stopPropagation(),!1}}i.Terminal=O},9924:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(n,a=1e3){this._renderCallback=n,this._debounceThresholdMS=a,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(n,a,h){this._rowCount=h,n=n!==void 0?n:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,n):n,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,a):a;let l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){let c=l-this._lastRefreshMs,f=this._debounceThresholdMS-c;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),f)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let n=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,a)}}},1680:function(o,i,n){var a=this&&this.__decorate||function(d,m,p,b){var x,y=arguments.length,w=y<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,m,p,b);else for(var _=d.length-1;_>=0;_--)(x=d[_])&&(w=(y<3?x(w):y>3?x(m,p,w):x(m,p))||w);return y>3&&w&&Object.defineProperty(m,p,w),w},h=this&&this.__param||function(d,m){return function(p,b){m(p,b,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;let l=n(3656),c=n(4725),f=n(8460),v=n(844),g=n(2585),u=i.Viewport=class extends v.Disposable{constructor(d,m,p,b,x,y,w,_){super(),this._viewportElement=d,this._scrollArea=m,this._bufferService=p,this._optionsService=b,this._charSizeService=x,this._renderService=y,this._coreBrowserService=w,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((S=>this._activeBuffer=S.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((S=>this._renderDimensions=S))),this._handleThemeChange(_.colors),this.register(_.onChangeColors((S=>this._handleThemeChange(S)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(d){this._viewportElement.style.backgroundColor=d.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(d){if(d)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let m=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==m&&(this._lastRecordedBufferHeight=m,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}let d=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==d&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=d),this._refreshAnimationFrame=null}syncScrollArea(d=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(d);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(d)}_handleScroll(d){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});let m=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let d=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(d*(this._smoothScrollState.target-this._smoothScrollState.origin)),d<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(d,m){let p=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(m<0&&this._viewportElement.scrollTop!==0||m>0&&p<this._lastRecordedBufferHeight)||(d.cancelable&&d.preventDefault(),!1)}handleWheel(d){let m=this._getPixelsScrolled(d);return m!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+m:this._smoothScrollState.target+=m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=m,this._bubbleScroll(d,m))}scrollLines(d){if(d!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let m=d*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!1})}_getPixelsScrolled(d){if(d.deltaY===0||d.shiftKey)return 0;let m=this._applyScrollModifier(d.deltaY,d);return d.deltaMode===WheelEvent.DOM_DELTA_LINE?m*=this._currentRowHeight:d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._currentRowHeight*this._bufferService.rows),m}getBufferElements(d,m){let p,b="",x=[],y=m??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let _=d;_<y;_++){let S=w.get(_);if(!S)continue;let T=w.get(_+1)?.isWrapped;if(b+=S.translateToString(!T),!T||_===w.length-1){let D=document.createElement("div");D.textContent=b,x.push(D),b.length>0&&(p=D),b=""}}return{bufferElements:x,cursorElement:p}}getLinesScrolled(d){if(d.deltaY===0||d.shiftKey)return 0;let m=this._applyScrollModifier(d.deltaY,d);return d.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(m/=this._currentRowHeight+0,this._wheelPartialScroll+=m,m=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._bufferService.rows),m}_applyScrollModifier(d,m){let p=this._optionsService.rawOptions.fastScrollModifier;return p==="alt"&&m.altKey||p==="ctrl"&&m.ctrlKey||p==="shift"&&m.shiftKey?d*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:d*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(d){this._lastTouchY=d.touches[0].pageY}handleTouchMove(d){let m=this._lastTouchY-d.touches[0].pageY;return this._lastTouchY=d.touches[0].pageY,m!==0&&(this._viewportElement.scrollTop+=m,this._bubbleScroll(d,m))}};i.Viewport=u=a([h(2,g.IBufferService),h(3,g.IOptionsService),h(4,c.ICharSizeService),h(5,c.IRenderService),h(6,c.ICoreBrowserService),h(7,c.IThemeService)],u)},3107:function(o,i,n){var a=this&&this.__decorate||function(g,u,d,m){var p,b=arguments.length,x=b<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,u,d,m);else for(var y=g.length-1;y>=0;y--)(p=g[y])&&(x=(b<3?p(x):b>3?p(u,d,x):p(u,d))||x);return b>3&&x&&Object.defineProperty(u,d,x),x},h=this&&this.__param||function(g,u){return function(d,m){u(d,m,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;let l=n(4725),c=n(844),f=n(2585),v=i.BufferDecorationRenderer=class extends c.Disposable{constructor(g,u,d,m,p){super(),this._screenElement=g,this._bufferService=u,this._coreBrowserService=d,this._decorationService=m,this._renderService=p,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((b=>this._removeDecoration(b)))),this.register((0,c.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(let g of this._decorationService.decorations)this._renderDecoration(g);this._dimensionsChanged=!1}_renderDecoration(g){this._refreshStyle(g),this._dimensionsChanged&&this._refreshXPosition(g)}_createElement(g){let u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",g?.options?.layer==="top"),u.style.width=`${Math.round((g.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(g.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(g.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let d=g.options.x??0;return d&&d>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(g,u),u}_refreshStyle(g){let u=g.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)g.element&&(g.element.style.display="none",g.onRenderEmitter.fire(g.element));else{let d=this._decorationElements.get(g);d||(d=this._createElement(g),g.element=d,this._decorationElements.set(g,d),this._container.appendChild(d),g.onDispose((()=>{this._decorationElements.delete(g),d.remove()}))),d.style.top=u*this._renderService.dimensions.css.cell.height+"px",d.style.display=this._altBufferIsActive?"none":"block",g.onRenderEmitter.fire(d)}}_refreshXPosition(g,u=g.element){if(!u)return;let d=g.options.x??0;(g.options.anchor||"left")==="right"?u.style.right=d?d*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=d?d*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(g){this._decorationElements.get(g)?.remove(),this._decorationElements.delete(g),g.dispose()}};i.BufferDecorationRenderer=v=a([h(1,f.IBufferService),h(2,l.ICoreBrowserService),h(3,f.IDecorationService),h(4,l.IRenderService)],v)},5871:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(n){if(n.options.overviewRulerOptions){for(let a of this._zones)if(a.color===n.options.overviewRulerOptions.color&&a.position===n.options.overviewRulerOptions.position){if(this._lineIntersectsZone(a,n.marker.line))return;if(this._lineAdjacentToZone(a,n.marker.line,n.options.overviewRulerOptions.position))return void this._addLineToZone(a,n.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=n.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=n.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=n.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=n.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:n.options.overviewRulerOptions.color,position:n.options.overviewRulerOptions.position,startBufferLine:n.marker.line,endBufferLine:n.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(n){this._linePadding=n}_lineIntersectsZone(n,a){return a>=n.startBufferLine&&a<=n.endBufferLine}_lineAdjacentToZone(n,a,h){return a>=n.startBufferLine-this._linePadding[h||"full"]&&a<=n.endBufferLine+this._linePadding[h||"full"]}_addLineToZone(n,a){n.startBufferLine=Math.min(n.startBufferLine,a),n.endBufferLine=Math.max(n.endBufferLine,a)}}},5744:function(o,i,n){var a=this&&this.__decorate||function(p,b,x,y){var w,_=arguments.length,S=_<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(p,b,x,y);else for(var T=p.length-1;T>=0;T--)(w=p[T])&&(S=(_<3?w(S):_>3?w(b,x,S):w(b,x))||S);return _>3&&S&&Object.defineProperty(b,x,S),S},h=this&&this.__param||function(p,b){return function(x,y){b(x,y,p)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;let l=n(5871),c=n(4725),f=n(844),v=n(2585),g={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},m=i.OverviewRulerRenderer=class extends f.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(p,b,x,y,w,_,S){super(),this._viewportElement=p,this._screenElement=b,this._bufferService=x,this._decorationService=y,this._renderService=w,this._optionsService=_,this._coreBrowserService=S,this._colorZoneStore=new l.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);let T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,f.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){let p=Math.floor(this._canvas.width/3),b=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=p,u.center=b,u.right=p,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=u.left,d.right=u.left+u.center}_refreshDrawHeightConstants(){g.full=Math.round(2*this._coreBrowserService.dpr);let p=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(p,12),6)*this._coreBrowserService.dpr);g.left=b,g.center=b,g.right=b}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;let p=this._colorZoneStore.zones;for(let b of p)b.position!=="full"&&this._renderColorZone(b);for(let b of p)b.position==="full"&&this._renderColorZone(b);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(p){this._ctx.fillStyle=p.color,this._ctx.fillRect(d[p.position||"full"],Math.round((this._canvas.height-1)*(p.startBufferLine/this._bufferService.buffers.active.lines.length)-g[p.position||"full"]/2),u[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+g[p.position||"full"]))}_queueRefresh(p,b){this._shouldUpdateDimensions=p||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};i.OverviewRulerRenderer=m=a([h(2,v.IBufferService),h(3,v.IDecorationService),h(4,c.IRenderService),h(5,v.IOptionsService),h(6,c.ICoreBrowserService)],m)},2950:function(o,i,n){var a=this&&this.__decorate||function(g,u,d,m){var p,b=arguments.length,x=b<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,u,d,m);else for(var y=g.length-1;y>=0;y--)(p=g[y])&&(x=(b<3?p(x):b>3?p(u,d,x):p(u,d))||x);return b>3&&x&&Object.defineProperty(u,d,x),x},h=this&&this.__param||function(g,u){return function(d,m){u(d,m,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;let l=n(4725),c=n(2585),f=n(2584),v=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(g,u,d,m,p,b){this._textarea=g,this._compositionView=u,this._bufferService=d,this._optionsService=m,this._coreService=p,this._renderService=b,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(g){this._compositionView.textContent=g.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(g){if(this._isComposing||this._isSendingComposition){if(g.keyCode===229||g.keyCode===16||g.keyCode===17||g.keyCode===18)return!1;this._finalizeComposition(!1)}return g.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(g){if(this._compositionView.classList.remove("active"),this._isComposing=!1,g){let u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let d;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,d=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),d.length>0&&this._coreService.triggerDataEvent(d,!0)}}),0)}else{this._isSendingComposition=!1;let u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){let g=this._textarea.value;setTimeout((()=>{if(!this._isComposing){let u=this._textarea.value,d=u.replace(g,"");this._dataAlreadySent=d,u.length>g.length?this._coreService.triggerDataEvent(d,!0):u.length<g.length?this._coreService.triggerDataEvent(`${f.C0.DEL}`,!0):u.length===g.length&&u!==g&&this._coreService.triggerDataEvent(u,!0)}}),0)}updateCompositionElements(g){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),d=this._renderService.dimensions.css.cell.height,m=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,p=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=p+"px",this._compositionView.style.top=m+"px",this._compositionView.style.height=d+"px",this._compositionView.style.lineHeight=d+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let b=this._compositionView.getBoundingClientRect();this._textarea.style.left=p+"px",this._textarea.style.top=m+"px",this._textarea.style.width=Math.max(b.width,1)+"px",this._textarea.style.height=Math.max(b.height,1)+"px",this._textarea.style.lineHeight=b.height+"px"}g||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=v=a([h(2,c.IBufferService),h(3,c.IOptionsService),h(4,c.ICoreService),h(5,l.IRenderService)],v)},9806:(o,i)=>{function n(a,h,l){let c=l.getBoundingClientRect(),f=a.getComputedStyle(l),v=parseInt(f.getPropertyValue("padding-left")),g=parseInt(f.getPropertyValue("padding-top"));return[h.clientX-c.left-v,h.clientY-c.top-g]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=n,i.getCoords=function(a,h,l,c,f,v,g,u,d){if(!v)return;let m=n(a,h,l);return m?(m[0]=Math.ceil((m[0]+(d?g/2:0))/g),m[1]=Math.ceil(m[1]/u),m[0]=Math.min(Math.max(m[0],1),c+(d?1:0)),m[1]=Math.min(Math.max(m[1],1),f),m):void 0}},9504:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;let a=n(2584);function h(u,d,m,p){let b=u-l(u,m),x=d-l(d,m),y=Math.abs(b-x)-(function(w,_,S){let T=0,D=w-l(w,S),P=_-l(_,S);for(let A=0;A<Math.abs(D-P);A++){let F=c(w,_)==="A"?-1:1;S.buffer.lines.get(D+F*A)?.isWrapped&&T++}return T})(u,d,m);return g(y,v(c(u,d),p))}function l(u,d){let m=0,p=d.buffer.lines.get(u),b=p?.isWrapped;for(;b&&u>=0&&u<d.rows;)m++,p=d.buffer.lines.get(--u),b=p?.isWrapped;return m}function c(u,d){return u>d?"A":"B"}function f(u,d,m,p,b,x){let y=u,w=d,_="";for(;y!==m||w!==p;)y+=b?1:-1,b&&y>x.cols-1?(_+=x.buffer.translateBufferLineToString(w,!1,u,y),y=0,u=0,w++):!b&&y<0&&(_+=x.buffer.translateBufferLineToString(w,!1,0,u+1),y=x.cols-1,u=y,w--);return _+x.buffer.translateBufferLineToString(w,!1,u,y)}function v(u,d){let m=d?"O":"[";return a.C0.ESC+m+u}function g(u,d){u=Math.floor(u);let m="";for(let p=0;p<u;p++)m+=d;return m}i.moveToCellSequence=function(u,d,m,p){let b=m.buffer.x,x=m.buffer.y;if(!m.buffer.hasScrollback)return(function(_,S,T,D,P,A){return h(S,D,P,A).length===0?"":g(f(_,S,_,S-l(S,P),!1,P).length,v("D",A))})(b,x,0,d,m,p)+h(x,d,m,p)+(function(_,S,T,D,P,A){let F;F=h(S,D,P,A).length>0?D-l(D,P):S;let B=D,$=(function(z,H,C,R,L,k){let U;return U=h(C,R,L,k).length>0?R-l(R,L):H,z<C&&U<=R||z>=C&&U<R?"C":"D"})(_,S,T,D,P,A);return g(f(_,F,T,B,$==="C",P).length,v($,A))})(b,x,u,d,m,p);let y;if(x===d)return y=b>u?"D":"C",g(Math.abs(b-u),v(y,p));y=x>d?"D":"C";let w=Math.abs(x-d);return g((function(_,S){return S.cols-_})(x>d?u:b,m)+(w-1)*m.cols+1+((x>d?b:u)-1),v(y,p))}},1296:function(o,i,n){var a=this&&this.__decorate||function(A,F,B,$){var z,H=arguments.length,C=H<3?F:$===null?$=Object.getOwnPropertyDescriptor(F,B):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(A,F,B,$);else for(var R=A.length-1;R>=0;R--)(z=A[R])&&(C=(H<3?z(C):H>3?z(F,B,C):z(F,B))||C);return H>3&&C&&Object.defineProperty(F,B,C),C},h=this&&this.__param||function(A,F){return function(B,$){F(B,$,A)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;let l=n(3787),c=n(2550),f=n(2223),v=n(6171),g=n(6052),u=n(4725),d=n(8055),m=n(8460),p=n(844),b=n(2585),x="xterm-dom-renderer-owner-",y="xterm-rows",w="xterm-fg-",_="xterm-bg-",S="xterm-focus",T="xterm-selection",D=1,P=i.DomRenderer=class extends p.Disposable{constructor(A,F,B,$,z,H,C,R,L,k,U,X,O){super(),this._terminal=A,this._document=F,this._element=B,this._screenElement=$,this._viewportElement=z,this._helperContainer=H,this._linkifier2=C,this._charSizeService=L,this._optionsService=k,this._bufferService=U,this._coreBrowserService=X,this._themeService=O,this._terminalClass=D++,this._rowElements=[],this._selectionRenderModel=(0,g.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new m.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,v.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((te=>this._injectCss(te)))),this._injectCss(this._themeService.colors),this._rowFactory=R.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((te=>this._handleLinkHover(te)))),this.register(this._linkifier2.onHideLinkUnderline((te=>this._handleLinkLeave(te)))),this.register((0,p.toDisposable)((()=>{this._element.classList.remove(x+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new c.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let B of this._rowElements)B.style.width=`${this.dimensions.css.canvas.width}px`,B.style.height=`${this.dimensions.css.cell.height}px`,B.style.lineHeight=`${this.dimensions.css.cell.height}px`,B.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let F=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(A){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${y} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${y} .xterm-dim { color: ${d.color.multiplyOpacity(A.foreground,.5).css};}`,F+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let B=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,z=`blink_block_${this._terminalClass}`;F+=`@keyframes ${B} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${$} { 50% { box-shadow: none; }}`,F+=`@keyframes ${z} { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,F+=`${this._terminalSelector} .${y}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${y}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${y}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${A.cursor.css} !important; color: ${A.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(let[H,C]of A.ansi.entries())F+=`${this._terminalSelector} .${w}${H} { color: ${C.css}; }${this._terminalSelector} .${w}${H}.xterm-dim { color: ${d.color.multiplyOpacity(C,.5).css}; }${this._terminalSelector} .${_}${H} { background-color: ${C.css}; }`;F+=`${this._terminalSelector} .${w}${f.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(A.background).css}; }${this._terminalSelector} .${w}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${_}${f.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){let A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,F){for(let B=this._rowElements.length;B<=F;B++){let $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,F){this._refreshRowElements(A,F),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,F,B){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,F,B),this.renderRows(0,this._bufferService.rows-1),!A||!F)return;this._selectionRenderModel.update(this._terminal,A,F,B);let $=this._selectionRenderModel.viewportStartRow,z=this._selectionRenderModel.viewportEndRow,H=this._selectionRenderModel.viewportCappedStartRow,C=this._selectionRenderModel.viewportCappedEndRow;if(H>=this._bufferService.rows||C<0)return;let R=this._document.createDocumentFragment();if(B){let L=A[0]>F[0];R.appendChild(this._createSelectionElement(H,L?F[0]:A[0],L?A[0]:F[0],C-H+1))}else{let L=$===H?A[0]:0,k=H===z?F[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(H,L,k));let U=C-H-1;if(R.appendChild(this._createSelectionElement(H+1,0,this._bufferService.cols,U)),H!==C){let X=z===C?F[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(C,0,X))}}this._selectionContainer.appendChild(R)}_createSelectionElement(A,F,B,$=1){let z=this._document.createElement("div"),H=F*this.dimensions.css.cell.width,C=this.dimensions.css.cell.width*(B-F);return H+C>this.dimensions.css.canvas.width&&(C=this.dimensions.css.canvas.width-H),z.style.height=$*this.dimensions.css.cell.height+"px",z.style.top=A*this.dimensions.css.cell.height+"px",z.style.left=`${H}px`,z.style.width=`${C}px`,z}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let A of this._rowElements)A.replaceChildren()}renderRows(A,F){let B=this._bufferService.buffer,$=B.ybase+B.y,z=Math.min(B.x,this._bufferService.cols-1),H=this._optionsService.rawOptions.cursorBlink,C=this._optionsService.rawOptions.cursorStyle,R=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=A;L<=F;L++){let k=L+B.ydisp,U=this._rowElements[L],X=B.lines.get(k);if(!U||!X)break;U.replaceChildren(...this._rowFactory.createRow(X,k,k===$,C,R,z,H,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,F,B,$,z,H){B<0&&(A=0),$<0&&(F=0);let C=this._bufferService.rows-1;B=Math.max(Math.min(B,C),0),$=Math.max(Math.min($,C),0),z=Math.min(z,this._bufferService.cols);let R=this._bufferService.buffer,L=R.ybase+R.y,k=Math.min(R.x,z-1),U=this._optionsService.rawOptions.cursorBlink,X=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let te=B;te<=$;++te){let N=te+R.ydisp,I=this._rowElements[te],J=R.lines.get(N);if(!I||!J)break;I.replaceChildren(...this._rowFactory.createRow(J,N,N===L,X,O,k,U,this.dimensions.css.cell.width,this._widthCache,H?te===B?A:0:-1,H?(te===$?F:z)-1:-1))}}};i.DomRenderer=P=a([h(7,b.IInstantiationService),h(8,u.ICharSizeService),h(9,b.IOptionsService),h(10,b.IBufferService),h(11,u.ICoreBrowserService),h(12,u.IThemeService)],P)},3787:function(o,i,n){var a=this&&this.__decorate||function(y,w,_,S){var T,D=arguments.length,P=D<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(y,w,_,S);else for(var A=y.length-1;A>=0;A--)(T=y[A])&&(P=(D<3?T(P):D>3?T(w,_,P):T(w,_))||P);return D>3&&P&&Object.defineProperty(w,_,P),P},h=this&&this.__param||function(y,w){return function(_,S){w(_,S,y)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;let l=n(2223),c=n(643),f=n(511),v=n(2585),g=n(8055),u=n(4725),d=n(4269),m=n(6171),p=n(3734),b=i.DomRendererRowFactory=class{constructor(y,w,_,S,T,D,P){this._document=y,this._characterJoinerService=w,this._optionsService=_,this._coreBrowserService=S,this._coreService=T,this._decorationService=D,this._themeService=P,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,w,_){this._selectionStart=y,this._selectionEnd=w,this._columnSelectMode=_}createRow(y,w,_,S,T,D,P,A,F,B,$){let z=[],H=this._characterJoinerService.getJoinedCharacters(w),C=this._themeService.colors,R,L=y.getNoBgTrimmedLength();_&&L<D+1&&(L=D+1);let k=0,U="",X=0,O=0,te=0,N=!1,I=0,J=!1,Y=0,V=[],Q=B!==-1&&$!==-1;for(let W=0;W<L;W++){y.loadCell(W,this._workCell);let ae=this._workCell.getWidth();if(ae===0)continue;let me=!1,De=W,se=this._workCell;if(H.length>0&&W===H[0][0]){me=!0;let pe=H.shift();se=new d.JoinedCellData(this._workCell,y.translateToString(!0,pe[0],pe[1]),pe[1]-pe[0]),De=pe[1]-1,ae=se.getWidth()}let Te=this._isCellInSelection(W,w),ft=_&&W===D,ar=Q&&W>=B&&W<=$,Ot=!1;this._decorationService.forEachDecorationAtCell(W,w,void 0,(pe=>{Ot=!0}));let Tr=se.getChars()||c.WHITESPACE_CELL_CHAR;if(Tr===" "&&(se.isUnderline()||se.isOverline())&&(Tr="\xA0"),Y=ae*A-F.get(Tr,se.isBold(),se.isItalic()),R){if(k&&(Te&&J||!Te&&!J&&se.bg===X)&&(Te&&J&&C.selectionForeground||se.fg===O)&&se.extended.ext===te&&ar===N&&Y===I&&!ft&&!me&&!Ot){se.isInvisible()?U+=c.WHITESPACE_CELL_CHAR:U+=Tr,k++;continue}k&&(R.textContent=U),R=this._document.createElement("span"),k=0,U=""}else R=this._document.createElement("span");if(X=se.bg,O=se.fg,te=se.extended.ext,N=ar,I=Y,J=Te,me&&D>=W&&D<=De&&(D=W),!this._coreService.isCursorHidden&&ft&&this._coreService.isCursorInitialized){if(V.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&V.push("xterm-cursor-blink"),V.push(S==="bar"?"xterm-cursor-bar":S==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":V.push("xterm-cursor-outline");break;case"block":V.push("xterm-cursor-block");break;case"bar":V.push("xterm-cursor-bar");break;case"underline":V.push("xterm-cursor-underline")}}if(se.isBold()&&V.push("xterm-bold"),se.isItalic()&&V.push("xterm-italic"),se.isDim()&&V.push("xterm-dim"),U=se.isInvisible()?c.WHITESPACE_CELL_CHAR:se.getChars()||c.WHITESPACE_CELL_CHAR,se.isUnderline()&&(V.push(`xterm-underline-${se.extended.underlineStyle}`),U===" "&&(U="\xA0"),!se.isUnderlineColorDefault()))if(se.isUnderlineColorRGB())R.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(se.getUnderlineColor()).join(",")})`;else{let pe=se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&se.isBold()&&pe<8&&(pe+=8),R.style.textDecorationColor=C.ansi[pe].css}se.isOverline()&&(V.push("xterm-overline"),U===" "&&(U="\xA0")),se.isStrikethrough()&&V.push("xterm-strikethrough"),ar&&(R.style.textDecoration="underline");let ot=se.getFgColor(),Pr=se.getFgColorMode(),kt=se.getBgColor(),Dr=se.getBgColorMode(),Is=!!se.isInverse();if(Is){let pe=ot;ot=kt,kt=pe;let mt=Pr;Pr=Dr,Dr=mt}let q,ee,de,ve=!1;switch(this._decorationService.forEachDecorationAtCell(W,w,void 0,(pe=>{pe.options.layer!=="top"&&ve||(pe.backgroundColorRGB&&(Dr=50331648,kt=pe.backgroundColorRGB.rgba>>8&16777215,q=pe.backgroundColorRGB),pe.foregroundColorRGB&&(Pr=50331648,ot=pe.foregroundColorRGB.rgba>>8&16777215,ee=pe.foregroundColorRGB),ve=pe.options.layer==="top")})),!ve&&Te&&(q=this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque,kt=q.rgba>>8&16777215,Dr=50331648,ve=!0,C.selectionForeground&&(Pr=50331648,ot=C.selectionForeground.rgba>>8&16777215,ee=C.selectionForeground)),ve&&V.push("xterm-decoration-top"),Dr){case 16777216:case 33554432:de=C.ansi[kt],V.push(`xterm-bg-${kt}`);break;case 50331648:de=g.channels.toColor(kt>>16,kt>>8&255,255&kt),this._addStyle(R,`background-color:#${x((kt>>>0).toString(16),"0",6)}`);break;default:Is?(de=C.foreground,V.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):de=C.background}switch(q||se.isDim()&&(q=g.color.multiplyOpacity(de,.5)),Pr){case 16777216:case 33554432:se.isBold()&&ot<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ot+=8),this._applyMinimumContrast(R,de,C.ansi[ot],se,q,void 0)||V.push(`xterm-fg-${ot}`);break;case 50331648:let pe=g.channels.toColor(ot>>16&255,ot>>8&255,255&ot);this._applyMinimumContrast(R,de,pe,se,q,ee)||this._addStyle(R,`color:#${x(ot.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(R,de,C.foreground,se,q,ee)||Is&&V.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}V.length&&(R.className=V.join(" "),V.length=0),ft||me||Ot?R.textContent=U:k++,Y!==this.defaultSpacing&&(R.style.letterSpacing=`${Y}px`),z.push(R),W=De}return R&&k&&(R.textContent=U),z}_applyMinimumContrast(y,w,_,S,T,D){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,m.treatGlyphAsBackgroundColor)(S.getCode()))return!1;let P=this._getContrastCache(S),A;if(T||D||(A=P.getColor(w.rgba,_.rgba)),A===void 0){let F=this._optionsService.rawOptions.minimumContrastRatio/(S.isDim()?2:1);A=g.color.ensureContrastRatio(T||w,D||_,F),P.setColor((T||w).rgba,(D||_).rgba,A??null)}return!!A&&(this._addStyle(y,`color:${A.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,w){y.setAttribute("style",`${y.getAttribute("style")||""}${w};`)}_isCellInSelection(y,w){let _=this._selectionStart,S=this._selectionEnd;return!(!_||!S)&&(this._columnSelectMode?_[0]<=S[0]?y>=_[0]&&w>=_[1]&&y<S[0]&&w<=S[1]:y<_[0]&&w>=_[1]&&y>=S[0]&&w<=S[1]:w>_[1]&&w<S[1]||_[1]===S[1]&&w===_[1]&&y>=_[0]&&y<S[0]||_[1]<S[1]&&w===S[1]&&y<S[0]||_[1]<S[1]&&w===_[1]&&y>=_[0])}};function x(y,w,_){for(;y.length<_;)y=w+y;return y}i.DomRendererRowFactory=b=a([h(1,u.ICharacterJoinerService),h(2,v.IOptionsService),h(3,u.ICoreBrowserService),h(4,v.ICoreService),h(5,v.IDecorationService),h(6,u.IThemeService)],b)},2550:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(n,a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=n.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let h=n.createElement("span");h.classList.add("xterm-char-measure-element");let l=n.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";let c=n.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontStyle="italic";let f=n.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold",f.style.fontStyle="italic",this._measureElements=[h,l,c,f],this._container.appendChild(h),this._container.appendChild(l),this._container.appendChild(c),this._container.appendChild(f),a.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(n,a,h,l){n===this._font&&a===this._fontSize&&h===this._weight&&l===this._weightBold||(this._font=n,this._fontSize=a,this._weight=h,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${h}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${h}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(n,a,h){let l=0;if(!a&&!h&&n.length===1&&(l=n.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];let v=this._measure(n,0);return v>0&&(this._flat[l]=v),v}let c=n;a&&(c+="B"),h&&(c+="I");let f=this._holey.get(c);if(f===void 0){let v=0;a&&(v|=1),h&&(v|=2),f=this._measure(n,v),f>0&&this._holey.set(c,f)}return f}_measure(n,a){let h=this._measureElements[a];return h.textContent=n.repeat(32),h.offsetWidth/32}}},2223:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;let a=n(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=a.isFirefox||a.isLegacyEdge?"bottom":"ideographic"},6171:(o,i)=>{function n(h){return 57508<=h&&h<=57558}function a(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},i.isPowerlineGlyph=n,i.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},i.isEmoji=a,i.allowRescaling=function(h,l,c,f){return l===1&&c>Math.ceil(1.5*f)&&h!==void 0&&h>255&&!a(h)&&!n(h)&&!(function(v){return 57344<=v&&v<=63743})(h)},i.treatGlyphAsBackgroundColor=function(h){return n(h)||(function(l){return 9472<=l&&l<=9631})(h)},i.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},i.computeNextVariantOffset=function(h,l,c=0){return(h-(2*Math.round(l)-c))%(2*Math.round(l))}},6052:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class n{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(h,l,c,f=!1){if(this.selectionStart=l,this.selectionEnd=c,!l||!c||l[0]===c[0]&&l[1]===c[1])return void this.clear();let v=h.buffers.active.ydisp,g=l[1]-v,u=c[1]-v,d=Math.max(g,0),m=Math.min(u,h.rows-1);d>=h.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=g,this.viewportEndRow=u,this.viewportCappedStartRow=d,this.viewportCappedEndRow=m,this.startCol=l[0],this.endCol=c[0])}isCellSelected(h,l,c){return!!this.hasSelection&&(c-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&c>=this.viewportCappedStartRow&&l<this.endCol&&c<=this.viewportCappedEndRow:l<this.startCol&&c>=this.viewportCappedStartRow&&l>=this.endCol&&c<=this.viewportCappedEndRow:c>this.viewportStartRow&&c<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&c===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportStartRow&&l>=this.startCol)}}i.createSelectionRenderModel=function(){return new n}},456:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(n){this._bufferService=n,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let n=this.selectionStart[0]+this.selectionStartLength;return n>this._bufferService.cols?n%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)-1]:[n%this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)]:[n,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let n=this.selectionStart[0]+this.selectionStartLength;return n>this._bufferService.cols?[n%this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)]:[Math.max(n,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let n=this.selectionStart,a=this.selectionEnd;return!(!n||!a)&&(n[1]>a[1]||n[1]===a[1]&&n[0]>a[0])}handleTrim(n){return this.selectionStart&&(this.selectionStart[1]-=n),this.selectionEnd&&(this.selectionEnd[1]-=n),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(o,i,n){var a=this&&this.__decorate||function(m,p,b,x){var y,w=arguments.length,_=w<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(m,p,b,x);else for(var S=m.length-1;S>=0;S--)(y=m[S])&&(_=(w<3?y(_):w>3?y(p,b,_):y(p,b))||_);return w>3&&_&&Object.defineProperty(p,b,_),_},h=this&&this.__param||function(m,p){return function(b,x){p(b,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;let l=n(2585),c=n(8460),f=n(844),v=i.CharSizeService=class extends f.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,p,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new c.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new d(this._optionsService))}catch{this._measureStrategy=this.register(new u(m,p,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){let m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};i.CharSizeService=v=a([h(2,l.IOptionsService)],v);class g extends f.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(p,b){p!==void 0&&p>0&&b!==void 0&&b>0&&(this._result.width=p,this._result.height=b)}}class u extends g{constructor(p,b,x){super(),this._document=p,this._parentElement=b,this._optionsService=x,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class d extends g{constructor(p){super(),this._optionsService=p,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let b=this._ctx.measureText("W");if(!("width"in b&&"fontBoundingBoxAscent"in b&&"fontBoundingBoxDescent"in b))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let p=this._ctx.measureText("W");return this._validateAndSet(p.width,p.fontBoundingBoxAscent+p.fontBoundingBoxDescent),this._result}}},4269:function(o,i,n){var a=this&&this.__decorate||function(d,m,p,b){var x,y=arguments.length,w=y<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,m,p,b);else for(var _=d.length-1;_>=0;_--)(x=d[_])&&(w=(y<3?x(w):y>3?x(m,p,w):x(m,p))||w);return y>3&&w&&Object.defineProperty(m,p,w),w},h=this&&this.__param||function(d,m){return function(p,b){m(p,b,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;let l=n(3734),c=n(643),f=n(511),v=n(2585);class g extends l.AttributeData{constructor(m,p,b){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=p,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=g;let u=i.CharacterJoinerService=class yp{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(m){let p={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(p),p.id}deregister(m){for(let p=0;p<this._characterJoiners.length;p++)if(this._characterJoiners[p].id===m)return this._characterJoiners.splice(p,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];let p=this._bufferService.buffer.lines.get(m);if(!p||p.length===0)return[];let b=[],x=p.translateToString(!0),y=0,w=0,_=0,S=p.getFg(0),T=p.getBg(0);for(let D=0;D<p.getTrimmedLength();D++)if(p.loadCell(D,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==S||this._workCell.bg!==T){if(D-y>1){let P=this._getJoinedRanges(x,_,w,p,y);for(let A=0;A<P.length;A++)b.push(P[A])}y=D,_=w,S=this._workCell.fg,T=this._workCell.bg}w+=this._workCell.getChars().length||c.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){let D=this._getJoinedRanges(x,_,w,p,y);for(let P=0;P<D.length;P++)b.push(D[P])}return b}_getJoinedRanges(m,p,b,x,y){let w=m.substring(p,b),_=[];try{_=this._characterJoiners[0].handler(w)}catch(S){console.error(S)}for(let S=1;S<this._characterJoiners.length;S++)try{let T=this._characterJoiners[S].handler(w);for(let D=0;D<T.length;D++)yp._mergeRanges(_,T[D])}catch(T){console.error(T)}return this._stringRangesToCellRanges(_,x,y),_}_stringRangesToCellRanges(m,p,b){let x=0,y=!1,w=0,_=m[x];if(_){for(let S=b;S<this._bufferService.cols;S++){let T=p.getWidth(S),D=p.getString(S).length||c.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&_[0]<=w&&(_[0]=S,y=!0),_[1]<=w){if(_[1]=S,_=m[++x],!_)break;_[0]<=w?(_[0]=S,y=!0):y=!1}w+=D}}_&&(_[1]=this._bufferService.cols)}}static _mergeRanges(m,p){let b=!1;for(let x=0;x<m.length;x++){let y=m[x];if(b){if(p[1]<=y[0])return m[x-1][1]=p[1],m;if(p[1]<=y[1])return m[x-1][1]=Math.max(p[1],y[1]),m.splice(x,1),m;m.splice(x,1),x--}else{if(p[1]<=y[0])return m.splice(x,0,p),m;if(p[1]<=y[1])return y[0]=Math.min(p[0],y[0]),m;p[0]<y[1]&&(y[0]=Math.min(p[0],y[0]),b=!0)}}return b?m[m.length-1][1]=p[1]:m.push(p),m}};i.CharacterJoinerService=u=a([h(0,v.IBufferService)],u)},5114:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;let a=n(844),h=n(8460),l=n(3656);class c extends a.Disposable{constructor(g,u,d){super(),this._textarea=g,this._window=u,this.mainDocument=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new f(this._window),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new h.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((m=>this._screenDprMonitor.setWindow(m)))),this.register((0,h.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(g){this._window!==g&&(this._window=g,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}i.CoreBrowserService=c;class f extends a.Disposable{constructor(g){super(),this._parentWindow=g,this._windowResizeListener=this.register(new a.MutableDisposable),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,a.toDisposable)((()=>this.clearListener())))}setWindow(g){this._parentWindow=g,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;let a=n(844);class h extends a.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,a.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(c){return this.linkProviders.push(c),{dispose:()=>{let f=this.linkProviders.indexOf(c);f!==-1&&this.linkProviders.splice(f,1)}}}}i.LinkProviderService=h},8934:function(o,i,n){var a=this&&this.__decorate||function(v,g,u,d){var m,p=arguments.length,b=p<3?g:d===null?d=Object.getOwnPropertyDescriptor(g,u):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,g,u,d);else for(var x=v.length-1;x>=0;x--)(m=v[x])&&(b=(p<3?m(b):p>3?m(g,u,b):m(g,u))||b);return p>3&&b&&Object.defineProperty(g,u,b),b},h=this&&this.__param||function(v,g){return function(u,d){g(u,d,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;let l=n(4725),c=n(9806),f=i.MouseService=class{constructor(v,g){this._renderService=v,this._charSizeService=g}getCoords(v,g,u,d,m){return(0,c.getCoords)(window,v,g,u,d,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,m)}getMouseReportCoords(v,g){let u=(0,c.getCoordsRelativeToElement)(window,v,g);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};i.MouseService=f=a([h(0,l.IRenderService),h(1,l.ICharSizeService)],f)},3230:function(o,i,n){var a=this&&this.__decorate||function(m,p,b,x){var y,w=arguments.length,_=w<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(m,p,b,x);else for(var S=m.length-1;S>=0;S--)(y=m[S])&&(_=(w<3?y(_):w>3?y(p,b,_):y(p,b))||_);return w>3&&_&&Object.defineProperty(p,b,_),_},h=this&&this.__param||function(m,p){return function(b,x){p(b,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;let l=n(6193),c=n(4725),f=n(8460),v=n(844),g=n(7226),u=n(2585),d=i.RenderService=class extends v.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,p,b,x,y,w,_,S){super(),this._rowCount=m,this._charSizeService=x,this._renderer=this.register(new v.MutableDisposable),this._pausedResizeTask=new g.DebouncedIdleTask,this._observerDisposable=this.register(new v.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((T,D)=>this._renderRows(T,D)),_),this.register(this._renderDebouncer),this.register(_.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(w.onResize((()=>this._fullRefresh()))),this.register(w.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(b.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()}))),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(w.buffer.y,w.buffer.y,!0)))),this.register(S.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(_.window,p),this.register(_.onWindowChange((T=>this._registerIntersectionObserver(T,p))))}_registerIntersectionObserver(m,p){if("IntersectionObserver"in m){let b=new m.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});b.observe(p),this._observerDisposable.value=(0,v.toDisposable)((()=>b.disconnect()))}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(m,p,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,p,this._rowCount))}_renderRows(m,p){this._renderer.value&&(m=Math.min(m,this._rowCount-1),p=Math.min(p,this._rowCount-1),this._renderer.value.renderRows(m,p),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:m,end:p}),this._onRender.fire({start:m,end:p}),this._isNextRenderRedrawOnly=!0)}resize(m,p){this._rowCount=p,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(m){this._renderer.value=m,this._renderer.value&&(this._renderer.value.onRequestRedraw((p=>this.refreshRows(p.start,p.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,p){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(m,p))):this._renderer.value.handleResize(m,p),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(m,p,b){this._selectionState.start=m,this._selectionState.end=p,this._selectionState.columnSelectMode=b,this._renderer.value?.handleSelectionChanged(m,p,b)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};i.RenderService=d=a([h(2,u.IOptionsService),h(3,c.ICharSizeService),h(4,u.IDecorationService),h(5,u.IBufferService),h(6,c.ICoreBrowserService),h(7,c.IThemeService)],d)},9312:function(o,i,n){var a=this&&this.__decorate||function(_,S,T,D){var P,A=arguments.length,F=A<3?S:D===null?D=Object.getOwnPropertyDescriptor(S,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(_,S,T,D);else for(var B=_.length-1;B>=0;B--)(P=_[B])&&(F=(A<3?P(F):A>3?P(S,T,F):P(S,T))||F);return A>3&&F&&Object.defineProperty(S,T,F),F},h=this&&this.__param||function(_,S){return function(T,D){S(T,D,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;let l=n(9806),c=n(9504),f=n(456),v=n(4725),g=n(8460),u=n(844),d=n(6114),m=n(4841),p=n(511),b=n(2585),x="\xA0",y=new RegExp(x,"g"),w=i.SelectionService=class extends u.Disposable{constructor(_,S,T,D,P,A,F,B,$){super(),this._element=_,this._screenElement=S,this._linkifier=T,this._bufferService=D,this._coreService=P,this._mouseService=A,this._optionsService=F,this._renderService=B,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new g.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new g.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=z=>this._handleMouseMove(z),this._mouseUpListener=z=>this._handleMouseUp(z),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((z=>this._handleTrim(z))),this.register(this._bufferService.buffers.onBufferActivate((z=>this._handleBufferActivate(z)))),this.enable(),this._model=new f.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let _=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!_||!S||_[0]===S[0]&&_[1]===S[1])}get selectionText(){let _=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!_||!S)return"";let T=this._bufferService.buffer,D=[];if(this._activeSelectionMode===3){if(_[0]===S[0])return"";let P=_[0]<S[0]?_[0]:S[0],A=_[0]<S[0]?S[0]:_[0];for(let F=_[1];F<=S[1];F++){let B=T.translateBufferLineToString(F,!0,P,A);D.push(B)}}else{let P=_[1]===S[1]?S[0]:void 0;D.push(T.translateBufferLineToString(_[1],!0,_[0],P));for(let A=_[1]+1;A<=S[1]-1;A++){let F=T.lines.get(A),B=T.translateBufferLineToString(A,!0);F?.isWrapped?D[D.length-1]+=B:D.push(B)}if(_[1]!==S[1]){let A=T.lines.get(S[1]),F=T.translateBufferLineToString(S[1],!0,0,S[0]);A&&A.isWrapped?D[D.length-1]+=F:D.push(F)}}return D.map((P=>P.replace(y," "))).join(d.isWindows?`\r
|
|
7
|
+
WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){try{d.opener=null}catch{}d.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=f=a([h(0,c.IBufferService),h(1,c.IOptionsService),h(2,c.IOscLinkService)],f)},6193:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(n,a){this._renderCallback=n,this._coreBrowserService=a,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(n){return this._refreshCallbacks.push(n),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(n,a,h){this._rowCount=h,n=n!==void 0?n:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,n):n,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,a):a,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();let n=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,a),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let n of this._refreshCallbacks)n(0);this._refreshCallbacks=[]}}},3236:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;let a=n(3614),h=n(3656),l=n(3551),c=n(9042),f=n(3730),v=n(1680),g=n(3107),u=n(5744),d=n(2950),m=n(1296),p=n(428),b=n(4269),x=n(5114),y=n(8934),S=n(3230),_=n(9312),w=n(4725),C=n(6731),P=n(8055),T=n(8969),A=n(8460),F=n(844),B=n(6114),U=n(8437),N=n(2584),H=n(7399),E=n(5941),R=n(9074),L=n(2585),k=n(5435),$=n(4567),X=n(779);class O extends T.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(z={}){super(z),this.browser=B,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(R.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(X.LinkProviderService),this._instantiationService.setService(w.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((I,J)=>this.refresh(I,J)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((I=>this._reportWindowsOptions(I)))),this.register(this._inputHandler.onColor((I=>this._handleColorEvent(I)))),this.register((0,A.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,A.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((I=>this._afterResize(I.cols,I.rows)))),this.register((0,F.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(z){if(this._themeService)for(let I of z){let J,Y="";switch(I.index){case 256:J="foreground",Y="10";break;case 257:J="background",Y="11";break;case 258:J="cursor",Y="12";break;default:J="ansi",Y="4;"+I.index}switch(I.type){case 0:let V=P.color.toColorRGB(J==="ansi"?this._themeService.colors.ansi[I.index]:this._themeService.colors[J]);this.coreService.triggerDataEvent(`${N.C0.ESC}]${Y};${(0,E.toRgbString)(V)}${N.C1_ESCAPED.ST}`);break;case 1:if(J==="ansi")this._themeService.modifyColors((Q=>Q.ansi[I.index]=P.channels.toColor(...I.color)));else{let Q=J;this._themeService.modifyColors((W=>W[Q]=P.channels.toColor(...I.color)))}break;case 2:this._themeService.restoreColor(I.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(z){z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance($.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(N.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(N.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let z=this.buffer.ybase+this.buffer.y,I=this.buffer.lines.get(z);if(!I)return;let J=Math.min(this.buffer.x,this.cols-1),Y=this._renderService.dimensions.css.cell.height,V=I.getWidth(J),Q=this._renderService.dimensions.css.cell.width*V,W=this.buffer.y*this._renderService.dimensions.css.cell.height,ae=J*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ae+"px",this.textarea.style.top=W+"px",this.textarea.style.width=Q+"px",this.textarea.style.height=Y+"px",this.textarea.style.lineHeight=Y+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,h.addDisposableDomListener)(this.element,"copy",(I=>{this.hasSelection()&&(0,a.copyHandler)(I,this._selectionService)})));let z=I=>(0,a.handlePasteEvent)(I,this.textarea,this.coreService,this.optionsService);this.register((0,h.addDisposableDomListener)(this.textarea,"paste",z)),this.register((0,h.addDisposableDomListener)(this.element,"paste",z)),B.isFirefox?this.register((0,h.addDisposableDomListener)(this.element,"mousedown",(I=>{I.button===2&&(0,a.rightClickHandler)(I,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,h.addDisposableDomListener)(this.element,"contextmenu",(I=>{(0,a.rightClickHandler)(I,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),B.isLinux&&this.register((0,h.addDisposableDomListener)(this.element,"auxclick",(I=>{I.button===1&&(0,a.moveTextAreaUnderMouseCursor)(I,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,h.addDisposableDomListener)(this.textarea,"keyup",(z=>this._keyUp(z)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keydown",(z=>this._keyDown(z)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keypress",(z=>this._keyPress(z)),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionupdate",(z=>this._compositionHelper.compositionupdate(z)))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,h.addDisposableDomListener)(this.textarea,"input",(z=>this._inputEvent(z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(z){if(!z)throw new Error("Terminal requires a parent element.");if(z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=z.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),z.appendChild(this.element);let I=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),I.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,h.addDisposableDomListener)(this.screenElement,"mousemove",(J=>this.updateCursorStyle(J)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),I.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",c.promptLabel),B.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(x.CoreBrowserService,this.textarea,z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(w.ICoreBrowserService,this._coreBrowserService),this.register((0,h.addDisposableDomListener)(this.textarea,"focus",(J=>this._handleTextAreaFocus(J)))),this.register((0,h.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(w.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(C.ThemeService),this._instantiationService.setService(w.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(w.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(S.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(w.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((J=>this._onRender.fire(J)))),this.onResize((J=>this._renderService.resize(J.cols,J.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(w.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(I);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(v.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((J=>this.scrollLines(J.amount,J.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(_.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(w.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((J=>this.scrollLines(J.amount,J.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((J=>this._renderService.handleSelectionChanged(J.start,J.end,J.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((J=>{this.textarea.value=J,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((J=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(g.BufferDecorationRenderer,this.screenElement)),this.register((0,h.addDisposableDomListener)(this.element,"mousedown",(J=>this._selectionService.handleMouseDown(J)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance($.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(J=>this._handleScreenReaderModeOptionChange(J)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(J=>{!this._overviewRulerRenderer&&J&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(m.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let z=this,I=this.element;function J(Q){let W=z._mouseService.getMouseReportCoords(Q,z.screenElement);if(!W)return!1;let ae,me;switch(Q.overrideType||Q.type){case"mousemove":me=32,Q.buttons===void 0?(ae=3,Q.button!==void 0&&(ae=Q.button<3?Q.button:3)):ae=1&Q.buttons?0:4&Q.buttons?1:2&Q.buttons?2:3;break;case"mouseup":me=0,ae=Q.button<3?Q.button:3;break;case"mousedown":me=1,ae=Q.button<3?Q.button:3;break;case"wheel":if(z._customWheelEventHandler&&z._customWheelEventHandler(Q)===!1||z.viewport.getLinesScrolled(Q)===0)return!1;me=Q.deltaY<0?0:1,ae=4;break;default:return!1}return!(me===void 0||ae===void 0||ae>4)&&z.coreMouseService.triggerMouseEvent({col:W.col,row:W.row,x:W.x,y:W.y,button:ae,action:me,ctrl:Q.ctrlKey,alt:Q.altKey,shift:Q.shiftKey})}let Y={mouseup:null,wheel:null,mousedrag:null,mousemove:null},V={mouseup:Q=>(J(Q),Q.buttons||(this._document.removeEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.removeEventListener("mousemove",Y.mousedrag)),this.cancel(Q)),wheel:Q=>(J(Q),this.cancel(Q,!0)),mousedrag:Q=>{Q.buttons&&J(Q)},mousemove:Q=>{Q.buttons||J(Q)}};this.register(this.coreMouseService.onProtocolChange((Q=>{Q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Q)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&Q?Y.mousemove||(I.addEventListener("mousemove",V.mousemove),Y.mousemove=V.mousemove):(I.removeEventListener("mousemove",Y.mousemove),Y.mousemove=null),16&Q?Y.wheel||(I.addEventListener("wheel",V.wheel,{passive:!1}),Y.wheel=V.wheel):(I.removeEventListener("wheel",Y.wheel),Y.wheel=null),2&Q?Y.mouseup||(Y.mouseup=V.mouseup):(this._document.removeEventListener("mouseup",Y.mouseup),Y.mouseup=null),4&Q?Y.mousedrag||(Y.mousedrag=V.mousedrag):(this._document.removeEventListener("mousemove",Y.mousedrag),Y.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,h.addDisposableDomListener)(I,"mousedown",(Q=>{if(Q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Q))return J(Q),Y.mouseup&&this._document.addEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.addEventListener("mousemove",Y.mousedrag),this.cancel(Q)}))),this.register((0,h.addDisposableDomListener)(I,"wheel",(Q=>{if(!Y.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Q)===!1)return!1;if(!this.buffer.hasScrollback){let W=this.viewport.getLinesScrolled(Q);if(W===0)return;let ae=N.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Q.deltaY<0?"A":"B"),me="";for(let Re=0;Re<Math.abs(W);Re++)me+=ae;return this.coreService.triggerDataEvent(me,!0),this.cancel(Q,!0)}return this.viewport.handleWheel(Q)?this.cancel(Q):void 0}}),{passive:!1})),this.register((0,h.addDisposableDomListener)(I,"touchstart",(Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Q),this.cancel(Q)}),{passive:!0})),this.register((0,h.addDisposableDomListener)(I,"touchmove",(Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Q)?void 0:this.cancel(Q)}),{passive:!1}))}refresh(z,I){this._renderService?.refreshRows(z,I)}updateCursorStyle(z){this._selectionService?.shouldColumnSelect(z)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(z,I,J=0){J===1?(super.scrollLines(z,I,J),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(z)}paste(z){(0,a.paste)(z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(z){this._customKeyEventHandler=z}attachCustomWheelEventHandler(z){this._customWheelEventHandler=z}registerLinkProvider(z){return this._linkProviderService.registerLinkProvider(z)}registerCharacterJoiner(z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let I=this._characterJoinerService.register(z);return this.refresh(0,this.rows-1),I}deregisterCharacterJoiner(z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+z)}registerDecoration(z){return this._decorationService.registerDecoration(z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(z,I,J){this._selectionService.setSelection(z,I,J)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(z,I){this._selectionService?.selectLines(z,I)}_keyDown(z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1)return!1;let I=this.browser.isMac&&this.options.macOptionIsMeta&&z.altKey;if(!I&&!this._compositionHelper.keydown(z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;I||z.key!=="Dead"&&z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);let J=(0,H.evaluateKeyboardEvent)(z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(z),J.type===3||J.type===2){let Y=this.rows-1;return this.scrollLines(J.type===2?-Y:Y),this.cancel(z,!0)}return J.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,z)||(J.cancel&&this.cancel(z,!0),!J.key||!!(z.key&&!z.ctrlKey&&!z.altKey&&!z.metaKey&&z.key.length===1&&z.key.charCodeAt(0)>=65&&z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(J.key!==N.C0.ETX&&J.key!==N.C0.CR||(this.textarea.value=""),this._onKey.fire({key:J.key,domEvent:z}),this._showCursor(),this.coreService.triggerDataEvent(J.key,!0),!this.optionsService.rawOptions.screenReaderMode||z.altKey||z.ctrlKey?this.cancel(z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(z,I){let J=z.isMac&&!this.options.macOptionIsMeta&&I.altKey&&!I.ctrlKey&&!I.metaKey||z.isWindows&&I.altKey&&I.ctrlKey&&!I.metaKey||z.isWindows&&I.getModifierState("AltGraph");return I.type==="keypress"?J:J&&(!I.keyCode||I.keyCode>47)}_keyUp(z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1||((function(I){return I.keyCode===16||I.keyCode===17||I.keyCode===18})(z)||this.focus(),this.updateCursorStyle(z),this._keyPressHandled=!1)}_keyPress(z){let I;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1)return!1;if(this.cancel(z),z.charCode)I=z.charCode;else if(z.which===null||z.which===void 0)I=z.keyCode;else{if(z.which===0||z.charCode===0)return!1;I=z.which}return!(!I||(z.altKey||z.ctrlKey||z.metaKey)&&!this._isThirdLevelShift(this.browser,z)||(I=String.fromCharCode(I),this._onKey.fire({key:I,domEvent:z}),this._showCursor(),this.coreService.triggerDataEvent(I,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(z){if(z.data&&z.inputType==="insertText"&&(!z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let I=z.data;return this.coreService.triggerDataEvent(I,!0),this.cancel(z),!0}return!1}resize(z,I){z!==this.cols||I!==this.rows?super.resize(z,I):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(z,I){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let z=1;z<this.rows;z++)this.buffer.lines.push(this.buffer.getBlankLine(U.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let z=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=z,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(N.C0.ESC+"[I"):this.coreService.triggerDataEvent(N.C0.ESC+"[O")}_reportWindowsOptions(z){if(this._renderService)switch(z){case k.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let I=this._renderService.dimensions.css.canvas.width.toFixed(0),J=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${N.C0.ESC}[4;${J};${I}t`);break;case k.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let Y=this._renderService.dimensions.css.cell.width.toFixed(0),V=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${N.C0.ESC}[6;${V};${Y}t`)}}cancel(z,I){if(this.options.cancelEvents||I)return z.preventDefault(),z.stopPropagation(),!1}}i.Terminal=O},9924:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(n,a=1e3){this._renderCallback=n,this._debounceThresholdMS=a,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(n,a,h){this._rowCount=h,n=n!==void 0?n:0,a=a!==void 0?a:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,n):n,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,a):a;let l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){let c=l-this._lastRefreshMs,f=this._debounceThresholdMS-c;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),f)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let n=Math.max(this._rowStart,0),a=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(n,a)}}},1680:function(o,i,n){var a=this&&this.__decorate||function(d,m,p,b){var x,y=arguments.length,S=y<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,m,p,b);else for(var _=d.length-1;_>=0;_--)(x=d[_])&&(S=(y<3?x(S):y>3?x(m,p,S):x(m,p))||S);return y>3&&S&&Object.defineProperty(m,p,S),S},h=this&&this.__param||function(d,m){return function(p,b){m(p,b,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;let l=n(3656),c=n(4725),f=n(8460),v=n(844),g=n(2585),u=i.Viewport=class extends v.Disposable{constructor(d,m,p,b,x,y,S,_){super(),this._viewportElement=d,this._scrollArea=m,this._bufferService=p,this._optionsService=b,this._charSizeService=x,this._renderService=y,this._coreBrowserService=S,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((w=>this._activeBuffer=w.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((w=>this._renderDimensions=w))),this._handleThemeChange(_.colors),this.register(_.onChangeColors((w=>this._handleThemeChange(w)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(d){this._viewportElement.style.backgroundColor=d.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(d){if(d)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let m=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==m&&(this._lastRecordedBufferHeight=m,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}let d=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==d&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=d),this._refreshAnimationFrame=null}syncScrollArea(d=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(d);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(d)}_handleScroll(d){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});let m=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let d=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(d*(this._smoothScrollState.target-this._smoothScrollState.origin)),d<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(d,m){let p=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(m<0&&this._viewportElement.scrollTop!==0||m>0&&p<this._lastRecordedBufferHeight)||(d.cancelable&&d.preventDefault(),!1)}handleWheel(d){let m=this._getPixelsScrolled(d);return m!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+m:this._smoothScrollState.target+=m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=m,this._bubbleScroll(d,m))}scrollLines(d){if(d!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let m=d*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!1})}_getPixelsScrolled(d){if(d.deltaY===0||d.shiftKey)return 0;let m=this._applyScrollModifier(d.deltaY,d);return d.deltaMode===WheelEvent.DOM_DELTA_LINE?m*=this._currentRowHeight:d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._currentRowHeight*this._bufferService.rows),m}getBufferElements(d,m){let p,b="",x=[],y=m??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let _=d;_<y;_++){let w=S.get(_);if(!w)continue;let C=S.get(_+1)?.isWrapped;if(b+=w.translateToString(!C),!C||_===S.length-1){let P=document.createElement("div");P.textContent=b,x.push(P),b.length>0&&(p=P),b=""}}return{bufferElements:x,cursorElement:p}}getLinesScrolled(d){if(d.deltaY===0||d.shiftKey)return 0;let m=this._applyScrollModifier(d.deltaY,d);return d.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(m/=this._currentRowHeight+0,this._wheelPartialScroll+=m,m=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._bufferService.rows),m}_applyScrollModifier(d,m){let p=this._optionsService.rawOptions.fastScrollModifier;return p==="alt"&&m.altKey||p==="ctrl"&&m.ctrlKey||p==="shift"&&m.shiftKey?d*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:d*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(d){this._lastTouchY=d.touches[0].pageY}handleTouchMove(d){let m=this._lastTouchY-d.touches[0].pageY;return this._lastTouchY=d.touches[0].pageY,m!==0&&(this._viewportElement.scrollTop+=m,this._bubbleScroll(d,m))}};i.Viewport=u=a([h(2,g.IBufferService),h(3,g.IOptionsService),h(4,c.ICharSizeService),h(5,c.IRenderService),h(6,c.ICoreBrowserService),h(7,c.IThemeService)],u)},3107:function(o,i,n){var a=this&&this.__decorate||function(g,u,d,m){var p,b=arguments.length,x=b<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,u,d,m);else for(var y=g.length-1;y>=0;y--)(p=g[y])&&(x=(b<3?p(x):b>3?p(u,d,x):p(u,d))||x);return b>3&&x&&Object.defineProperty(u,d,x),x},h=this&&this.__param||function(g,u){return function(d,m){u(d,m,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;let l=n(4725),c=n(844),f=n(2585),v=i.BufferDecorationRenderer=class extends c.Disposable{constructor(g,u,d,m,p){super(),this._screenElement=g,this._bufferService=u,this._coreBrowserService=d,this._decorationService=m,this._renderService=p,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((b=>this._removeDecoration(b)))),this.register((0,c.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(let g of this._decorationService.decorations)this._renderDecoration(g);this._dimensionsChanged=!1}_renderDecoration(g){this._refreshStyle(g),this._dimensionsChanged&&this._refreshXPosition(g)}_createElement(g){let u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",g?.options?.layer==="top"),u.style.width=`${Math.round((g.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(g.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(g.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let d=g.options.x??0;return d&&d>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(g,u),u}_refreshStyle(g){let u=g.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)g.element&&(g.element.style.display="none",g.onRenderEmitter.fire(g.element));else{let d=this._decorationElements.get(g);d||(d=this._createElement(g),g.element=d,this._decorationElements.set(g,d),this._container.appendChild(d),g.onDispose((()=>{this._decorationElements.delete(g),d.remove()}))),d.style.top=u*this._renderService.dimensions.css.cell.height+"px",d.style.display=this._altBufferIsActive?"none":"block",g.onRenderEmitter.fire(d)}}_refreshXPosition(g,u=g.element){if(!u)return;let d=g.options.x??0;(g.options.anchor||"left")==="right"?u.style.right=d?d*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=d?d*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(g){this._decorationElements.get(g)?.remove(),this._decorationElements.delete(g),g.dispose()}};i.BufferDecorationRenderer=v=a([h(1,f.IBufferService),h(2,l.ICoreBrowserService),h(3,f.IDecorationService),h(4,l.IRenderService)],v)},5871:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(n){if(n.options.overviewRulerOptions){for(let a of this._zones)if(a.color===n.options.overviewRulerOptions.color&&a.position===n.options.overviewRulerOptions.position){if(this._lineIntersectsZone(a,n.marker.line))return;if(this._lineAdjacentToZone(a,n.marker.line,n.options.overviewRulerOptions.position))return void this._addLineToZone(a,n.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=n.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=n.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=n.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=n.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:n.options.overviewRulerOptions.color,position:n.options.overviewRulerOptions.position,startBufferLine:n.marker.line,endBufferLine:n.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(n){this._linePadding=n}_lineIntersectsZone(n,a){return a>=n.startBufferLine&&a<=n.endBufferLine}_lineAdjacentToZone(n,a,h){return a>=n.startBufferLine-this._linePadding[h||"full"]&&a<=n.endBufferLine+this._linePadding[h||"full"]}_addLineToZone(n,a){n.startBufferLine=Math.min(n.startBufferLine,a),n.endBufferLine=Math.max(n.endBufferLine,a)}}},5744:function(o,i,n){var a=this&&this.__decorate||function(p,b,x,y){var S,_=arguments.length,w=_<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(p,b,x,y);else for(var C=p.length-1;C>=0;C--)(S=p[C])&&(w=(_<3?S(w):_>3?S(b,x,w):S(b,x))||w);return _>3&&w&&Object.defineProperty(b,x,w),w},h=this&&this.__param||function(p,b){return function(x,y){b(x,y,p)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;let l=n(5871),c=n(4725),f=n(844),v=n(2585),g={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},m=i.OverviewRulerRenderer=class extends f.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(p,b,x,y,S,_,w){super(),this._viewportElement=p,this._screenElement=b,this._bufferService=x,this._decorationService=y,this._renderService=S,this._optionsService=_,this._coreBrowserService=w,this._colorZoneStore=new l.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);let C=this._canvas.getContext("2d");if(!C)throw new Error("Ctx cannot be null");this._ctx=C,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,f.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){let p=Math.floor(this._canvas.width/3),b=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=p,u.center=b,u.right=p,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=u.left,d.right=u.left+u.center}_refreshDrawHeightConstants(){g.full=Math.round(2*this._coreBrowserService.dpr);let p=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(p,12),6)*this._coreBrowserService.dpr);g.left=b,g.center=b,g.right=b}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;let p=this._colorZoneStore.zones;for(let b of p)b.position!=="full"&&this._renderColorZone(b);for(let b of p)b.position==="full"&&this._renderColorZone(b);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(p){this._ctx.fillStyle=p.color,this._ctx.fillRect(d[p.position||"full"],Math.round((this._canvas.height-1)*(p.startBufferLine/this._bufferService.buffers.active.lines.length)-g[p.position||"full"]/2),u[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+g[p.position||"full"]))}_queueRefresh(p,b){this._shouldUpdateDimensions=p||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};i.OverviewRulerRenderer=m=a([h(2,v.IBufferService),h(3,v.IDecorationService),h(4,c.IRenderService),h(5,v.IOptionsService),h(6,c.ICoreBrowserService)],m)},2950:function(o,i,n){var a=this&&this.__decorate||function(g,u,d,m){var p,b=arguments.length,x=b<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,d):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,u,d,m);else for(var y=g.length-1;y>=0;y--)(p=g[y])&&(x=(b<3?p(x):b>3?p(u,d,x):p(u,d))||x);return b>3&&x&&Object.defineProperty(u,d,x),x},h=this&&this.__param||function(g,u){return function(d,m){u(d,m,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;let l=n(4725),c=n(2585),f=n(2584),v=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(g,u,d,m,p,b){this._textarea=g,this._compositionView=u,this._bufferService=d,this._optionsService=m,this._coreService=p,this._renderService=b,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(g){this._compositionView.textContent=g.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(g){if(this._isComposing||this._isSendingComposition){if(g.keyCode===229||g.keyCode===16||g.keyCode===17||g.keyCode===18)return!1;this._finalizeComposition(!1)}return g.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(g){if(this._compositionView.classList.remove("active"),this._isComposing=!1,g){let u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let d;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,d=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),d.length>0&&this._coreService.triggerDataEvent(d,!0)}}),0)}else{this._isSendingComposition=!1;let u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){let g=this._textarea.value;setTimeout((()=>{if(!this._isComposing){let u=this._textarea.value,d=u.replace(g,"");this._dataAlreadySent=d,u.length>g.length?this._coreService.triggerDataEvent(d,!0):u.length<g.length?this._coreService.triggerDataEvent(`${f.C0.DEL}`,!0):u.length===g.length&&u!==g&&this._coreService.triggerDataEvent(u,!0)}}),0)}updateCompositionElements(g){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),d=this._renderService.dimensions.css.cell.height,m=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,p=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=p+"px",this._compositionView.style.top=m+"px",this._compositionView.style.height=d+"px",this._compositionView.style.lineHeight=d+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let b=this._compositionView.getBoundingClientRect();this._textarea.style.left=p+"px",this._textarea.style.top=m+"px",this._textarea.style.width=Math.max(b.width,1)+"px",this._textarea.style.height=Math.max(b.height,1)+"px",this._textarea.style.lineHeight=b.height+"px"}g||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=v=a([h(2,c.IBufferService),h(3,c.IOptionsService),h(4,c.ICoreService),h(5,l.IRenderService)],v)},9806:(o,i)=>{function n(a,h,l){let c=l.getBoundingClientRect(),f=a.getComputedStyle(l),v=parseInt(f.getPropertyValue("padding-left")),g=parseInt(f.getPropertyValue("padding-top"));return[h.clientX-c.left-v,h.clientY-c.top-g]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=n,i.getCoords=function(a,h,l,c,f,v,g,u,d){if(!v)return;let m=n(a,h,l);return m?(m[0]=Math.ceil((m[0]+(d?g/2:0))/g),m[1]=Math.ceil(m[1]/u),m[0]=Math.min(Math.max(m[0],1),c+(d?1:0)),m[1]=Math.min(Math.max(m[1],1),f),m):void 0}},9504:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;let a=n(2584);function h(u,d,m,p){let b=u-l(u,m),x=d-l(d,m),y=Math.abs(b-x)-(function(S,_,w){let C=0,P=S-l(S,w),T=_-l(_,w);for(let A=0;A<Math.abs(P-T);A++){let F=c(S,_)==="A"?-1:1;w.buffer.lines.get(P+F*A)?.isWrapped&&C++}return C})(u,d,m);return g(y,v(c(u,d),p))}function l(u,d){let m=0,p=d.buffer.lines.get(u),b=p?.isWrapped;for(;b&&u>=0&&u<d.rows;)m++,p=d.buffer.lines.get(--u),b=p?.isWrapped;return m}function c(u,d){return u>d?"A":"B"}function f(u,d,m,p,b,x){let y=u,S=d,_="";for(;y!==m||S!==p;)y+=b?1:-1,b&&y>x.cols-1?(_+=x.buffer.translateBufferLineToString(S,!1,u,y),y=0,u=0,S++):!b&&y<0&&(_+=x.buffer.translateBufferLineToString(S,!1,0,u+1),y=x.cols-1,u=y,S--);return _+x.buffer.translateBufferLineToString(S,!1,u,y)}function v(u,d){let m=d?"O":"[";return a.C0.ESC+m+u}function g(u,d){u=Math.floor(u);let m="";for(let p=0;p<u;p++)m+=d;return m}i.moveToCellSequence=function(u,d,m,p){let b=m.buffer.x,x=m.buffer.y;if(!m.buffer.hasScrollback)return(function(_,w,C,P,T,A){return h(w,P,T,A).length===0?"":g(f(_,w,_,w-l(w,T),!1,T).length,v("D",A))})(b,x,0,d,m,p)+h(x,d,m,p)+(function(_,w,C,P,T,A){let F;F=h(w,P,T,A).length>0?P-l(P,T):w;let B=P,U=(function(N,H,E,R,L,k){let $;return $=h(E,R,L,k).length>0?R-l(R,L):H,N<E&&$<=R||N>=E&&$<R?"C":"D"})(_,w,C,P,T,A);return g(f(_,F,C,B,U==="C",T).length,v(U,A))})(b,x,u,d,m,p);let y;if(x===d)return y=b>u?"D":"C",g(Math.abs(b-u),v(y,p));y=x>d?"D":"C";let S=Math.abs(x-d);return g((function(_,w){return w.cols-_})(x>d?u:b,m)+(S-1)*m.cols+1+((x>d?b:u)-1),v(y,p))}},1296:function(o,i,n){var a=this&&this.__decorate||function(A,F,B,U){var N,H=arguments.length,E=H<3?F:U===null?U=Object.getOwnPropertyDescriptor(F,B):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,F,B,U);else for(var R=A.length-1;R>=0;R--)(N=A[R])&&(E=(H<3?N(E):H>3?N(F,B,E):N(F,B))||E);return H>3&&E&&Object.defineProperty(F,B,E),E},h=this&&this.__param||function(A,F){return function(B,U){F(B,U,A)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;let l=n(3787),c=n(2550),f=n(2223),v=n(6171),g=n(6052),u=n(4725),d=n(8055),m=n(8460),p=n(844),b=n(2585),x="xterm-dom-renderer-owner-",y="xterm-rows",S="xterm-fg-",_="xterm-bg-",w="xterm-focus",C="xterm-selection",P=1,T=i.DomRenderer=class extends p.Disposable{constructor(A,F,B,U,N,H,E,R,L,k,$,X,O){super(),this._terminal=A,this._document=F,this._element=B,this._screenElement=U,this._viewportElement=N,this._helperContainer=H,this._linkifier2=E,this._charSizeService=L,this._optionsService=k,this._bufferService=$,this._coreBrowserService=X,this._themeService=O,this._terminalClass=P++,this._rowElements=[],this._selectionRenderModel=(0,g.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new m.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(C),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,v.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((se=>this._injectCss(se)))),this._injectCss(this._themeService.colors),this._rowFactory=R.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((se=>this._handleLinkHover(se)))),this.register(this._linkifier2.onHideLinkUnderline((se=>this._handleLinkLeave(se)))),this.register((0,p.toDisposable)((()=>{this._element.classList.remove(x+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new c.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let B of this._rowElements)B.style.width=`${this.dimensions.css.canvas.width}px`,B.style.height=`${this.dimensions.css.cell.height}px`,B.style.lineHeight=`${this.dimensions.css.cell.height}px`,B.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let F=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(A){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${y} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${y} .xterm-dim { color: ${d.color.multiplyOpacity(A.foreground,.5).css};}`,F+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let B=`blink_underline_${this._terminalClass}`,U=`blink_bar_${this._terminalClass}`,N=`blink_block_${this._terminalClass}`;F+=`@keyframes ${B} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${U} { 50% { box-shadow: none; }}`,F+=`@keyframes ${N} { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,F+=`${this._terminalSelector} .${y}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${y}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${y}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${N} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${A.cursor.css} !important; color: ${A.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${C} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${C} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${C} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(let[H,E]of A.ansi.entries())F+=`${this._terminalSelector} .${S}${H} { color: ${E.css}; }${this._terminalSelector} .${S}${H}.xterm-dim { color: ${d.color.multiplyOpacity(E,.5).css}; }${this._terminalSelector} .${_}${H} { background-color: ${E.css}; }`;F+=`${this._terminalSelector} .${S}${f.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(A.background).css}; }${this._terminalSelector} .${S}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${_}${f.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){let A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,F){for(let B=this._rowElements.length;B<=F;B++){let U=this._document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,F){this._refreshRowElements(A,F),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(w),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(w),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,F,B){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,F,B),this.renderRows(0,this._bufferService.rows-1),!A||!F)return;this._selectionRenderModel.update(this._terminal,A,F,B);let U=this._selectionRenderModel.viewportStartRow,N=this._selectionRenderModel.viewportEndRow,H=this._selectionRenderModel.viewportCappedStartRow,E=this._selectionRenderModel.viewportCappedEndRow;if(H>=this._bufferService.rows||E<0)return;let R=this._document.createDocumentFragment();if(B){let L=A[0]>F[0];R.appendChild(this._createSelectionElement(H,L?F[0]:A[0],L?A[0]:F[0],E-H+1))}else{let L=U===H?A[0]:0,k=H===N?F[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(H,L,k));let $=E-H-1;if(R.appendChild(this._createSelectionElement(H+1,0,this._bufferService.cols,$)),H!==E){let X=N===E?F[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(E,0,X))}}this._selectionContainer.appendChild(R)}_createSelectionElement(A,F,B,U=1){let N=this._document.createElement("div"),H=F*this.dimensions.css.cell.width,E=this.dimensions.css.cell.width*(B-F);return H+E>this.dimensions.css.canvas.width&&(E=this.dimensions.css.canvas.width-H),N.style.height=U*this.dimensions.css.cell.height+"px",N.style.top=A*this.dimensions.css.cell.height+"px",N.style.left=`${H}px`,N.style.width=`${E}px`,N}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let A of this._rowElements)A.replaceChildren()}renderRows(A,F){let B=this._bufferService.buffer,U=B.ybase+B.y,N=Math.min(B.x,this._bufferService.cols-1),H=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,R=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=A;L<=F;L++){let k=L+B.ydisp,$=this._rowElements[L],X=B.lines.get(k);if(!$||!X)break;$.replaceChildren(...this._rowFactory.createRow(X,k,k===U,E,R,N,H,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,F,B,U,N,H){B<0&&(A=0),U<0&&(F=0);let E=this._bufferService.rows-1;B=Math.max(Math.min(B,E),0),U=Math.max(Math.min(U,E),0),N=Math.min(N,this._bufferService.cols);let R=this._bufferService.buffer,L=R.ybase+R.y,k=Math.min(R.x,N-1),$=this._optionsService.rawOptions.cursorBlink,X=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let se=B;se<=U;++se){let z=se+R.ydisp,I=this._rowElements[se],J=R.lines.get(z);if(!I||!J)break;I.replaceChildren(...this._rowFactory.createRow(J,z,z===L,X,O,k,$,this.dimensions.css.cell.width,this._widthCache,H?se===B?A:0:-1,H?(se===U?F:N)-1:-1))}}};i.DomRenderer=T=a([h(7,b.IInstantiationService),h(8,u.ICharSizeService),h(9,b.IOptionsService),h(10,b.IBufferService),h(11,u.ICoreBrowserService),h(12,u.IThemeService)],T)},3787:function(o,i,n){var a=this&&this.__decorate||function(y,S,_,w){var C,P=arguments.length,T=P<3?S:w===null?w=Object.getOwnPropertyDescriptor(S,_):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(y,S,_,w);else for(var A=y.length-1;A>=0;A--)(C=y[A])&&(T=(P<3?C(T):P>3?C(S,_,T):C(S,_))||T);return P>3&&T&&Object.defineProperty(S,_,T),T},h=this&&this.__param||function(y,S){return function(_,w){S(_,w,y)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;let l=n(2223),c=n(643),f=n(511),v=n(2585),g=n(8055),u=n(4725),d=n(4269),m=n(6171),p=n(3734),b=i.DomRendererRowFactory=class{constructor(y,S,_,w,C,P,T){this._document=y,this._characterJoinerService=S,this._optionsService=_,this._coreBrowserService=w,this._coreService=C,this._decorationService=P,this._themeService=T,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,S,_){this._selectionStart=y,this._selectionEnd=S,this._columnSelectMode=_}createRow(y,S,_,w,C,P,T,A,F,B,U){let N=[],H=this._characterJoinerService.getJoinedCharacters(S),E=this._themeService.colors,R,L=y.getNoBgTrimmedLength();_&&L<P+1&&(L=P+1);let k=0,$="",X=0,O=0,se=0,z=!1,I=0,J=!1,Y=0,V=[],Q=B!==-1&&U!==-1;for(let W=0;W<L;W++){y.loadCell(W,this._workCell);let ae=this._workCell.getWidth();if(ae===0)continue;let me=!1,Re=W,re=this._workCell;if(H.length>0&&W===H[0][0]){me=!0;let pe=H.shift();re=new d.JoinedCellData(this._workCell,y.translateToString(!0,pe[0],pe[1]),pe[1]-pe[0]),Re=pe[1]-1,ae=re.getWidth()}let Pe=this._isCellInSelection(W,S),gt=_&&W===P,hs=Q&&W>=B&&W<=U,Bt=!1;this._decorationService.forEachDecorationAtCell(W,S,void 0,(pe=>{Bt=!0}));let Ds=re.getChars()||c.WHITESPACE_CELL_CHAR;if(Ds===" "&&(re.isUnderline()||re.isOverline())&&(Ds="\xA0"),Y=ae*A-F.get(Ds,re.isBold(),re.isItalic()),R){if(k&&(Pe&&J||!Pe&&!J&&re.bg===X)&&(Pe&&J&&E.selectionForeground||re.fg===O)&&re.extended.ext===se&&hs===z&&Y===I&&!gt&&!me&&!Bt){re.isInvisible()?$+=c.WHITESPACE_CELL_CHAR:$+=Ds,k++;continue}k&&(R.textContent=$),R=this._document.createElement("span"),k=0,$=""}else R=this._document.createElement("span");if(X=re.bg,O=re.fg,se=re.extended.ext,z=hs,I=Y,J=Pe,me&&P>=W&&P<=Re&&(P=W),!this._coreService.isCursorHidden&>&&this._coreService.isCursorInitialized){if(V.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&V.push("xterm-cursor-blink"),V.push(w==="bar"?"xterm-cursor-bar":w==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(C)switch(C){case"outline":V.push("xterm-cursor-outline");break;case"block":V.push("xterm-cursor-block");break;case"bar":V.push("xterm-cursor-bar");break;case"underline":V.push("xterm-cursor-underline")}}if(re.isBold()&&V.push("xterm-bold"),re.isItalic()&&V.push("xterm-italic"),re.isDim()&&V.push("xterm-dim"),$=re.isInvisible()?c.WHITESPACE_CELL_CHAR:re.getChars()||c.WHITESPACE_CELL_CHAR,re.isUnderline()&&(V.push(`xterm-underline-${re.extended.underlineStyle}`),$===" "&&($="\xA0"),!re.isUnderlineColorDefault()))if(re.isUnderlineColorRGB())R.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(re.getUnderlineColor()).join(",")})`;else{let pe=re.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&re.isBold()&&pe<8&&(pe+=8),R.style.textDecorationColor=E.ansi[pe].css}re.isOverline()&&(V.push("xterm-overline"),$===" "&&($="\xA0")),re.isStrikethrough()&&V.push("xterm-strikethrough"),hs&&(R.style.textDecoration="underline");let ht=re.getFgColor(),Rs=re.getFgColorMode(),Et=re.getBgColor(),As=re.getBgColorMode(),Lr=!!re.isInverse();if(Lr){let pe=ht;ht=Et,Et=pe;let vt=Rs;Rs=As,As=vt}let q,ee,de,ve=!1;switch(this._decorationService.forEachDecorationAtCell(W,S,void 0,(pe=>{pe.options.layer!=="top"&&ve||(pe.backgroundColorRGB&&(As=50331648,Et=pe.backgroundColorRGB.rgba>>8&16777215,q=pe.backgroundColorRGB),pe.foregroundColorRGB&&(Rs=50331648,ht=pe.foregroundColorRGB.rgba>>8&16777215,ee=pe.foregroundColorRGB),ve=pe.options.layer==="top")})),!ve&&Pe&&(q=this._coreBrowserService.isFocused?E.selectionBackgroundOpaque:E.selectionInactiveBackgroundOpaque,Et=q.rgba>>8&16777215,As=50331648,ve=!0,E.selectionForeground&&(Rs=50331648,ht=E.selectionForeground.rgba>>8&16777215,ee=E.selectionForeground)),ve&&V.push("xterm-decoration-top"),As){case 16777216:case 33554432:de=E.ansi[Et],V.push(`xterm-bg-${Et}`);break;case 50331648:de=g.channels.toColor(Et>>16,Et>>8&255,255&Et),this._addStyle(R,`background-color:#${x((Et>>>0).toString(16),"0",6)}`);break;default:Lr?(de=E.foreground,V.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):de=E.background}switch(q||re.isDim()&&(q=g.color.multiplyOpacity(de,.5)),Rs){case 16777216:case 33554432:re.isBold()&&ht<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ht+=8),this._applyMinimumContrast(R,de,E.ansi[ht],re,q,void 0)||V.push(`xterm-fg-${ht}`);break;case 50331648:let pe=g.channels.toColor(ht>>16&255,ht>>8&255,255&ht);this._applyMinimumContrast(R,de,pe,re,q,ee)||this._addStyle(R,`color:#${x(ht.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(R,de,E.foreground,re,q,ee)||Lr&&V.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}V.length&&(R.className=V.join(" "),V.length=0),gt||me||Bt?R.textContent=$:k++,Y!==this.defaultSpacing&&(R.style.letterSpacing=`${Y}px`),N.push(R),W=Re}return R&&k&&(R.textContent=$),N}_applyMinimumContrast(y,S,_,w,C,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,m.treatGlyphAsBackgroundColor)(w.getCode()))return!1;let T=this._getContrastCache(w),A;if(C||P||(A=T.getColor(S.rgba,_.rgba)),A===void 0){let F=this._optionsService.rawOptions.minimumContrastRatio/(w.isDim()?2:1);A=g.color.ensureContrastRatio(C||S,P||_,F),T.setColor((C||S).rgba,(P||_).rgba,A??null)}return!!A&&(this._addStyle(y,`color:${A.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,S){y.setAttribute("style",`${y.getAttribute("style")||""}${S};`)}_isCellInSelection(y,S){let _=this._selectionStart,w=this._selectionEnd;return!(!_||!w)&&(this._columnSelectMode?_[0]<=w[0]?y>=_[0]&&S>=_[1]&&y<w[0]&&S<=w[1]:y<_[0]&&S>=_[1]&&y>=w[0]&&S<=w[1]:S>_[1]&&S<w[1]||_[1]===w[1]&&S===_[1]&&y>=_[0]&&y<w[0]||_[1]<w[1]&&S===w[1]&&y<w[0]||_[1]<w[1]&&S===_[1]&&y>=_[0])}};function x(y,S,_){for(;y.length<_;)y=S+y;return y}i.DomRendererRowFactory=b=a([h(1,u.ICharacterJoinerService),h(2,v.IOptionsService),h(3,u.ICoreBrowserService),h(4,v.ICoreService),h(5,v.IDecorationService),h(6,u.IThemeService)],b)},2550:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(n,a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=n.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let h=n.createElement("span");h.classList.add("xterm-char-measure-element");let l=n.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";let c=n.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontStyle="italic";let f=n.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold",f.style.fontStyle="italic",this._measureElements=[h,l,c,f],this._container.appendChild(h),this._container.appendChild(l),this._container.appendChild(c),this._container.appendChild(f),a.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(n,a,h,l){n===this._font&&a===this._fontSize&&h===this._weight&&l===this._weightBold||(this._font=n,this._fontSize=a,this._weight=h,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${h}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${h}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(n,a,h){let l=0;if(!a&&!h&&n.length===1&&(l=n.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];let v=this._measure(n,0);return v>0&&(this._flat[l]=v),v}let c=n;a&&(c+="B"),h&&(c+="I");let f=this._holey.get(c);if(f===void 0){let v=0;a&&(v|=1),h&&(v|=2),f=this._measure(n,v),f>0&&this._holey.set(c,f)}return f}_measure(n,a){let h=this._measureElements[a];return h.textContent=n.repeat(32),h.offsetWidth/32}}},2223:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;let a=n(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=a.isFirefox||a.isLegacyEdge?"bottom":"ideographic"},6171:(o,i)=>{function n(h){return 57508<=h&&h<=57558}function a(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},i.isPowerlineGlyph=n,i.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},i.isEmoji=a,i.allowRescaling=function(h,l,c,f){return l===1&&c>Math.ceil(1.5*f)&&h!==void 0&&h>255&&!a(h)&&!n(h)&&!(function(v){return 57344<=v&&v<=63743})(h)},i.treatGlyphAsBackgroundColor=function(h){return n(h)||(function(l){return 9472<=l&&l<=9631})(h)},i.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},i.computeNextVariantOffset=function(h,l,c=0){return(h-(2*Math.round(l)-c))%(2*Math.round(l))}},6052:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class n{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(h,l,c,f=!1){if(this.selectionStart=l,this.selectionEnd=c,!l||!c||l[0]===c[0]&&l[1]===c[1])return void this.clear();let v=h.buffers.active.ydisp,g=l[1]-v,u=c[1]-v,d=Math.max(g,0),m=Math.min(u,h.rows-1);d>=h.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=g,this.viewportEndRow=u,this.viewportCappedStartRow=d,this.viewportCappedEndRow=m,this.startCol=l[0],this.endCol=c[0])}isCellSelected(h,l,c){return!!this.hasSelection&&(c-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&c>=this.viewportCappedStartRow&&l<this.endCol&&c<=this.viewportCappedEndRow:l<this.startCol&&c>=this.viewportCappedStartRow&&l>=this.endCol&&c<=this.viewportCappedEndRow:c>this.viewportStartRow&&c<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&c===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&c===this.viewportStartRow&&l>=this.startCol)}}i.createSelectionRenderModel=function(){return new n}},456:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(n){this._bufferService=n,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let n=this.selectionStart[0]+this.selectionStartLength;return n>this._bufferService.cols?n%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)-1]:[n%this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)]:[n,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let n=this.selectionStart[0]+this.selectionStartLength;return n>this._bufferService.cols?[n%this._bufferService.cols,this.selectionStart[1]+Math.floor(n/this._bufferService.cols)]:[Math.max(n,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let n=this.selectionStart,a=this.selectionEnd;return!(!n||!a)&&(n[1]>a[1]||n[1]===a[1]&&n[0]>a[0])}handleTrim(n){return this.selectionStart&&(this.selectionStart[1]-=n),this.selectionEnd&&(this.selectionEnd[1]-=n),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(o,i,n){var a=this&&this.__decorate||function(m,p,b,x){var y,S=arguments.length,_=S<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(m,p,b,x);else for(var w=m.length-1;w>=0;w--)(y=m[w])&&(_=(S<3?y(_):S>3?y(p,b,_):y(p,b))||_);return S>3&&_&&Object.defineProperty(p,b,_),_},h=this&&this.__param||function(m,p){return function(b,x){p(b,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;let l=n(2585),c=n(8460),f=n(844),v=i.CharSizeService=class extends f.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,p,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new c.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new d(this._optionsService))}catch{this._measureStrategy=this.register(new u(m,p,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){let m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};i.CharSizeService=v=a([h(2,l.IOptionsService)],v);class g extends f.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(p,b){p!==void 0&&p>0&&b!==void 0&&b>0&&(this._result.width=p,this._result.height=b)}}class u extends g{constructor(p,b,x){super(),this._document=p,this._parentElement=b,this._optionsService=x,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class d extends g{constructor(p){super(),this._optionsService=p,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let b=this._ctx.measureText("W");if(!("width"in b&&"fontBoundingBoxAscent"in b&&"fontBoundingBoxDescent"in b))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let p=this._ctx.measureText("W");return this._validateAndSet(p.width,p.fontBoundingBoxAscent+p.fontBoundingBoxDescent),this._result}}},4269:function(o,i,n){var a=this&&this.__decorate||function(d,m,p,b){var x,y=arguments.length,S=y<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,p):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,m,p,b);else for(var _=d.length-1;_>=0;_--)(x=d[_])&&(S=(y<3?x(S):y>3?x(m,p,S):x(m,p))||S);return y>3&&S&&Object.defineProperty(m,p,S),S},h=this&&this.__param||function(d,m){return function(p,b){m(p,b,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;let l=n(3734),c=n(643),f=n(511),v=n(2585);class g extends l.AttributeData{constructor(m,p,b){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=p,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=g;let u=i.CharacterJoinerService=class Ep{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(m){let p={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(p),p.id}deregister(m){for(let p=0;p<this._characterJoiners.length;p++)if(this._characterJoiners[p].id===m)return this._characterJoiners.splice(p,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];let p=this._bufferService.buffer.lines.get(m);if(!p||p.length===0)return[];let b=[],x=p.translateToString(!0),y=0,S=0,_=0,w=p.getFg(0),C=p.getBg(0);for(let P=0;P<p.getTrimmedLength();P++)if(p.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==w||this._workCell.bg!==C){if(P-y>1){let T=this._getJoinedRanges(x,_,S,p,y);for(let A=0;A<T.length;A++)b.push(T[A])}y=P,_=S,w=this._workCell.fg,C=this._workCell.bg}S+=this._workCell.getChars().length||c.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){let P=this._getJoinedRanges(x,_,S,p,y);for(let T=0;T<P.length;T++)b.push(P[T])}return b}_getJoinedRanges(m,p,b,x,y){let S=m.substring(p,b),_=[];try{_=this._characterJoiners[0].handler(S)}catch(w){console.error(w)}for(let w=1;w<this._characterJoiners.length;w++)try{let C=this._characterJoiners[w].handler(S);for(let P=0;P<C.length;P++)Ep._mergeRanges(_,C[P])}catch(C){console.error(C)}return this._stringRangesToCellRanges(_,x,y),_}_stringRangesToCellRanges(m,p,b){let x=0,y=!1,S=0,_=m[x];if(_){for(let w=b;w<this._bufferService.cols;w++){let C=p.getWidth(w),P=p.getString(w).length||c.WHITESPACE_CELL_CHAR.length;if(C!==0){if(!y&&_[0]<=S&&(_[0]=w,y=!0),_[1]<=S){if(_[1]=w,_=m[++x],!_)break;_[0]<=S?(_[0]=w,y=!0):y=!1}S+=P}}_&&(_[1]=this._bufferService.cols)}}static _mergeRanges(m,p){let b=!1;for(let x=0;x<m.length;x++){let y=m[x];if(b){if(p[1]<=y[0])return m[x-1][1]=p[1],m;if(p[1]<=y[1])return m[x-1][1]=Math.max(p[1],y[1]),m.splice(x,1),m;m.splice(x,1),x--}else{if(p[1]<=y[0])return m.splice(x,0,p),m;if(p[1]<=y[1])return y[0]=Math.min(p[0],y[0]),m;p[0]<y[1]&&(y[0]=Math.min(p[0],y[0]),b=!0)}}return b?m[m.length-1][1]=p[1]:m.push(p),m}};i.CharacterJoinerService=u=a([h(0,v.IBufferService)],u)},5114:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;let a=n(844),h=n(8460),l=n(3656);class c extends a.Disposable{constructor(g,u,d){super(),this._textarea=g,this._window=u,this.mainDocument=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new f(this._window),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new h.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((m=>this._screenDprMonitor.setWindow(m)))),this.register((0,h.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(g){this._window!==g&&(this._window=g,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}i.CoreBrowserService=c;class f extends a.Disposable{constructor(g){super(),this._parentWindow=g,this._windowResizeListener=this.register(new a.MutableDisposable),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,a.toDisposable)((()=>this.clearListener())))}setWindow(g){this._parentWindow=g,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;let a=n(844);class h extends a.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,a.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(c){return this.linkProviders.push(c),{dispose:()=>{let f=this.linkProviders.indexOf(c);f!==-1&&this.linkProviders.splice(f,1)}}}}i.LinkProviderService=h},8934:function(o,i,n){var a=this&&this.__decorate||function(v,g,u,d){var m,p=arguments.length,b=p<3?g:d===null?d=Object.getOwnPropertyDescriptor(g,u):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,g,u,d);else for(var x=v.length-1;x>=0;x--)(m=v[x])&&(b=(p<3?m(b):p>3?m(g,u,b):m(g,u))||b);return p>3&&b&&Object.defineProperty(g,u,b),b},h=this&&this.__param||function(v,g){return function(u,d){g(u,d,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;let l=n(4725),c=n(9806),f=i.MouseService=class{constructor(v,g){this._renderService=v,this._charSizeService=g}getCoords(v,g,u,d,m){return(0,c.getCoords)(window,v,g,u,d,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,m)}getMouseReportCoords(v,g){let u=(0,c.getCoordsRelativeToElement)(window,v,g);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};i.MouseService=f=a([h(0,l.IRenderService),h(1,l.ICharSizeService)],f)},3230:function(o,i,n){var a=this&&this.__decorate||function(m,p,b,x){var y,S=arguments.length,_=S<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(m,p,b,x);else for(var w=m.length-1;w>=0;w--)(y=m[w])&&(_=(S<3?y(_):S>3?y(p,b,_):y(p,b))||_);return S>3&&_&&Object.defineProperty(p,b,_),_},h=this&&this.__param||function(m,p){return function(b,x){p(b,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;let l=n(6193),c=n(4725),f=n(8460),v=n(844),g=n(7226),u=n(2585),d=i.RenderService=class extends v.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,p,b,x,y,S,_,w){super(),this._rowCount=m,this._charSizeService=x,this._renderer=this.register(new v.MutableDisposable),this._pausedResizeTask=new g.DebouncedIdleTask,this._observerDisposable=this.register(new v.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((C,P)=>this._renderRows(C,P)),_),this.register(this._renderDebouncer),this.register(_.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(S.onResize((()=>this._fullRefresh()))),this.register(S.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(b.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(y.onDecorationRegistered((()=>this._fullRefresh()))),this.register(y.onDecorationRemoved((()=>this._fullRefresh()))),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(S.cols,S.rows),this._fullRefresh()}))),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(S.buffer.y,S.buffer.y,!0)))),this.register(w.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(_.window,p),this.register(_.onWindowChange((C=>this._registerIntersectionObserver(C,p))))}_registerIntersectionObserver(m,p){if("IntersectionObserver"in m){let b=new m.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});b.observe(p),this._observerDisposable.value=(0,v.toDisposable)((()=>b.disconnect()))}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(m,p,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,p,this._rowCount))}_renderRows(m,p){this._renderer.value&&(m=Math.min(m,this._rowCount-1),p=Math.min(p,this._rowCount-1),this._renderer.value.renderRows(m,p),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:m,end:p}),this._onRender.fire({start:m,end:p}),this._isNextRenderRedrawOnly=!0)}resize(m,p){this._rowCount=p,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(m){this._renderer.value=m,this._renderer.value&&(this._renderer.value.onRequestRedraw((p=>this.refreshRows(p.start,p.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,p){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(m,p))):this._renderer.value.handleResize(m,p),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(m,p,b){this._selectionState.start=m,this._selectionState.end=p,this._selectionState.columnSelectMode=b,this._renderer.value?.handleSelectionChanged(m,p,b)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};i.RenderService=d=a([h(2,u.IOptionsService),h(3,c.ICharSizeService),h(4,u.IDecorationService),h(5,u.IBufferService),h(6,c.ICoreBrowserService),h(7,c.IThemeService)],d)},9312:function(o,i,n){var a=this&&this.__decorate||function(_,w,C,P){var T,A=arguments.length,F=A<3?w:P===null?P=Object.getOwnPropertyDescriptor(w,C):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(_,w,C,P);else for(var B=_.length-1;B>=0;B--)(T=_[B])&&(F=(A<3?T(F):A>3?T(w,C,F):T(w,C))||F);return A>3&&F&&Object.defineProperty(w,C,F),F},h=this&&this.__param||function(_,w){return function(C,P){w(C,P,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;let l=n(9806),c=n(9504),f=n(456),v=n(4725),g=n(8460),u=n(844),d=n(6114),m=n(4841),p=n(511),b=n(2585),x="\xA0",y=new RegExp(x,"g"),S=i.SelectionService=class extends u.Disposable{constructor(_,w,C,P,T,A,F,B,U){super(),this._element=_,this._screenElement=w,this._linkifier=C,this._bufferService=P,this._coreService=T,this._mouseService=A,this._optionsService=F,this._renderService=B,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new g.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new g.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=N=>this._handleMouseMove(N),this._mouseUpListener=N=>this._handleMouseUp(N),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((N=>this._handleTrim(N))),this.register(this._bufferService.buffers.onBufferActivate((N=>this._handleBufferActivate(N)))),this.enable(),this._model=new f.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let _=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!(!_||!w||_[0]===w[0]&&_[1]===w[1])}get selectionText(){let _=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;if(!_||!w)return"";let C=this._bufferService.buffer,P=[];if(this._activeSelectionMode===3){if(_[0]===w[0])return"";let T=_[0]<w[0]?_[0]:w[0],A=_[0]<w[0]?w[0]:_[0];for(let F=_[1];F<=w[1];F++){let B=C.translateBufferLineToString(F,!0,T,A);P.push(B)}}else{let T=_[1]===w[1]?w[0]:void 0;P.push(C.translateBufferLineToString(_[1],!0,_[0],T));for(let A=_[1]+1;A<=w[1]-1;A++){let F=C.lines.get(A),B=C.translateBufferLineToString(A,!0);F?.isWrapped?P[P.length-1]+=B:P.push(B)}if(_[1]!==w[1]){let A=C.lines.get(w[1]),F=C.translateBufferLineToString(w[1],!0,0,w[0]);A&&A.isWrapped?P[P.length-1]+=F:P.push(F)}}return P.map((T=>T.replace(y," "))).join(d.isWindows?`\r
|
|
8
8
|
`:`
|
|
9
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(_){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),d.isLinux&&_&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(_){let S=this._getMouseBufferCoords(_),T=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!!(T&&D&&S)&&this._areCoordsInSelection(S,T,D)}isCellInSelection(_,S){let T=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!T||!D)&&this._areCoordsInSelection([_,S],T,D)}_areCoordsInSelection(_,S,T){return _[1]>S[1]&&_[1]<T[1]||S[1]===T[1]&&_[1]===S[1]&&_[0]>=S[0]&&_[0]<T[0]||S[1]<T[1]&&_[1]===T[1]&&_[0]<T[0]||S[1]<T[1]&&_[1]===S[1]&&_[0]>=S[0]}_selectWordAtCursor(_,S){let T=this._linkifier.currentLink?.link?.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,m.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let D=this._getMouseBufferCoords(_);return!!D&&(this._selectWordAt(D,S),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(_,S){this._model.clearSelection(),_=Math.max(_,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,_],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()}_handleTrim(_){this._model.handleTrim(_)&&this.refresh()}_getMouseBufferCoords(_){let S=this._mouseService.getCoords(_,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S}_getMouseEventScrollAmount(_){let S=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,_,this._screenElement)[1],T=this._renderService.dimensions.css.canvas.height;return S>=0&&S<=T?0:(S>T&&(S-=T),S=Math.min(Math.max(S,-50),50),S/=50,S/Math.abs(S)+Math.round(14*S))}shouldForceSelection(_){return d.isMac?_.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:_.shiftKey}handleMouseDown(_){if(this._mouseDownTimeStamp=_.timeStamp,(_.button!==2||!this.hasSelection)&&_.button===0){if(!this._enabled){if(!this.shouldForceSelection(_))return;_.stopPropagation()}_.preventDefault(),this._dragScrollAmount=0,this._enabled&&_.shiftKey?this._handleIncrementalClick(_):_.detail===1?this._handleSingleClick(_):_.detail===2?this._handleDoubleClick(_):_.detail===3&&this._handleTripleClick(_),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(_){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(_))}_handleSingleClick(_){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(_)?3:0,this._model.selectionStart=this._getMouseBufferCoords(_),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(_){this._selectWordAtCursor(_,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(_){let S=this._getMouseBufferCoords(_);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))}shouldColumnSelect(_){return _.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(_){if(_.stopImmediatePropagation(),!this._model.selectionStart)return;let S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(_),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(_),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){let D=T.lines.get(this._model.selectionEnd[1]);D&&D.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}S&&S[0]===this._model.selectionEnd[0]&&S[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let _=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(_.ydisp+this._bufferService.rows,_.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=_.ydisp),this.refresh()}}_handleMouseUp(_){let S=_.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&_.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let T=this._mouseService.getCoords(_,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){let D=(0,c.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(D,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let _=this._model.finalSelectionStart,S=this._model.finalSelectionEnd,T=!(!_||!S||_[0]===S[0]&&_[1]===S[1]);T?_&&S&&(this._oldSelectionStart&&this._oldSelectionEnd&&_[0]===this._oldSelectionStart[0]&&_[1]===this._oldSelectionStart[1]&&S[0]===this._oldSelectionEnd[0]&&S[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(_,S,T)):this._oldHasSelection&&this._fireOnSelectionChange(_,S,T)}_fireOnSelectionChange(_,S,T){this._oldSelectionStart=_,this._oldSelectionEnd=S,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(_){this.clearSelection(),this._trimListener.dispose(),this._trimListener=_.activeBuffer.lines.onTrim((S=>this._handleTrim(S)))}_convertViewportColToCharacterIndex(_,S){let T=S;for(let D=0;S>=D;D++){let P=_.loadCell(D,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:P>1&&S!==D&&(T+=P-1)}return T}setSelection(_,S,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[_,S],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(_){this._isClickInSelection(_)||(this._selectWordAtCursor(_,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(_,S,T=!0,D=!0){if(_[0]>=this._bufferService.cols)return;let P=this._bufferService.buffer,A=P.lines.get(_[1]);if(!A)return;let F=P.translateBufferLineToString(_[1],!1),B=this._convertViewportColToCharacterIndex(A,_[0]),$=B,z=_[0]-B,H=0,C=0,R=0,L=0;if(F.charAt(B)===" "){for(;B>0&&F.charAt(B-1)===" ";)B--;for(;$<F.length&&F.charAt($+1)===" ";)$++}else{let X=_[0],O=_[0];A.getWidth(X)===0&&(H++,X--),A.getWidth(O)===2&&(C++,O++);let te=A.getString(O).length;for(te>1&&(L+=te-1,$+=te-1);X>0&&B>0&&!this._isCharWordSeparator(A.loadCell(X-1,this._workCell));){A.loadCell(X-1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===0?(H++,X--):N>1&&(R+=N-1,B-=N-1),B--,X--}for(;O<A.length&&$+1<F.length&&!this._isCharWordSeparator(A.loadCell(O+1,this._workCell));){A.loadCell(O+1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===2?(C++,O++):N>1&&(L+=N-1,$+=N-1),$++,O++}}$++;let k=B+z-H+R,U=Math.min(this._bufferService.cols,$-B+H+C-R-L);if(S||F.slice(B,$).trim()!==""){if(T&&k===0&&A.getCodePoint(0)!==32){let X=P.lines.get(_[1]-1);if(X&&A.isWrapped&&X.getCodePoint(this._bufferService.cols-1)!==32){let O=this._getWordAt([this._bufferService.cols-1,_[1]-1],!1,!0,!1);if(O){let te=this._bufferService.cols-O.start;k-=te,U+=te}}}if(D&&k+U===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){let X=P.lines.get(_[1]+1);if(X?.isWrapped&&X.getCodePoint(0)!==32){let O=this._getWordAt([0,_[1]+1],!1,!1,!0);O&&(U+=O.length)}}return{start:k,length:U}}}_selectWordAt(_,S){let T=this._getWordAt(_,S);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,_[1]--;this._model.selectionStart=[T.start,_[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(_){let S=this._getWordAt(_,!0);if(S){let T=_[1];for(;S.start<0;)S.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,T]}}_isCharWordSeparator(_){return _.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(_.getChars())>=0}_selectLineAt(_){let S=this._bufferService.buffer.getWrappedRangeForLine(_),T={start:{x:0,y:S.first},end:{x:this._bufferService.cols-1,y:S.last}};this._model.selectionStart=[0,S.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,m.getRangeLength)(T,this._bufferService.cols)}};i.SelectionService=w=a([h(3,b.IBufferService),h(4,b.ICoreService),h(5,v.IMouseService),h(6,b.IOptionsService),h(7,v.IRenderService),h(8,v.ICoreBrowserService)],w)},4725:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;let a=n(8343);i.ICharSizeService=(0,a.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,a.createDecorator)("CoreBrowserService"),i.IMouseService=(0,a.createDecorator)("MouseService"),i.IRenderService=(0,a.createDecorator)("RenderService"),i.ISelectionService=(0,a.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,a.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,a.createDecorator)("ThemeService"),i.ILinkProviderService=(0,a.createDecorator)("LinkProviderService")},6731:function(o,i,n){var a=this&&this.__decorate||function(w,_,S,T){var D,P=arguments.length,A=P<3?_:T===null?T=Object.getOwnPropertyDescriptor(_,S):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(w,_,S,T);else for(var F=w.length-1;F>=0;F--)(D=w[F])&&(A=(P<3?D(A):P>3?D(_,S,A):D(_,S))||A);return P>3&&A&&Object.defineProperty(_,S,A),A},h=this&&this.__param||function(w,_){return function(S,T){_(S,T,w)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;let l=n(7239),c=n(8055),f=n(8460),v=n(844),g=n(2585),u=c.css.toColor("#ffffff"),d=c.css.toColor("#000000"),m=c.css.toColor("#ffffff"),p=c.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{let w=[c.css.toColor("#2e3436"),c.css.toColor("#cc0000"),c.css.toColor("#4e9a06"),c.css.toColor("#c4a000"),c.css.toColor("#3465a4"),c.css.toColor("#75507b"),c.css.toColor("#06989a"),c.css.toColor("#d3d7cf"),c.css.toColor("#555753"),c.css.toColor("#ef2929"),c.css.toColor("#8ae234"),c.css.toColor("#fce94f"),c.css.toColor("#729fcf"),c.css.toColor("#ad7fa8"),c.css.toColor("#34e2e2"),c.css.toColor("#eeeeec")],_=[0,95,135,175,215,255];for(let S=0;S<216;S++){let T=_[S/36%6|0],D=_[S/6%6|0],P=_[S%6];w.push({css:c.channels.toCss(T,D,P),rgba:c.channels.toRgba(T,D,P)})}for(let S=0;S<24;S++){let T=8+10*S;w.push({css:c.channels.toCss(T,T,T),rgba:c.channels.toRgba(T,T,T)})}return w})());let x=i.ThemeService=class extends v.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new f.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:d,cursor:m,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:c.color.blend(d,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:c.color.blend(d,b),ansi:i.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(w={}){let _=this._colors;if(_.foreground=y(w.foreground,u),_.background=y(w.background,d),_.cursor=y(w.cursor,m),_.cursorAccent=y(w.cursorAccent,p),_.selectionBackgroundTransparent=y(w.selectionBackground,b),_.selectionBackgroundOpaque=c.color.blend(_.background,_.selectionBackgroundTransparent),_.selectionInactiveBackgroundTransparent=y(w.selectionInactiveBackground,_.selectionBackgroundTransparent),_.selectionInactiveBackgroundOpaque=c.color.blend(_.background,_.selectionInactiveBackgroundTransparent),_.selectionForeground=w.selectionForeground?y(w.selectionForeground,c.NULL_COLOR):void 0,_.selectionForeground===c.NULL_COLOR&&(_.selectionForeground=void 0),c.color.isOpaque(_.selectionBackgroundTransparent)&&(_.selectionBackgroundTransparent=c.color.opacity(_.selectionBackgroundTransparent,.3)),c.color.isOpaque(_.selectionInactiveBackgroundTransparent)&&(_.selectionInactiveBackgroundTransparent=c.color.opacity(_.selectionInactiveBackgroundTransparent,.3)),_.ansi=i.DEFAULT_ANSI_COLORS.slice(),_.ansi[0]=y(w.black,i.DEFAULT_ANSI_COLORS[0]),_.ansi[1]=y(w.red,i.DEFAULT_ANSI_COLORS[1]),_.ansi[2]=y(w.green,i.DEFAULT_ANSI_COLORS[2]),_.ansi[3]=y(w.yellow,i.DEFAULT_ANSI_COLORS[3]),_.ansi[4]=y(w.blue,i.DEFAULT_ANSI_COLORS[4]),_.ansi[5]=y(w.magenta,i.DEFAULT_ANSI_COLORS[5]),_.ansi[6]=y(w.cyan,i.DEFAULT_ANSI_COLORS[6]),_.ansi[7]=y(w.white,i.DEFAULT_ANSI_COLORS[7]),_.ansi[8]=y(w.brightBlack,i.DEFAULT_ANSI_COLORS[8]),_.ansi[9]=y(w.brightRed,i.DEFAULT_ANSI_COLORS[9]),_.ansi[10]=y(w.brightGreen,i.DEFAULT_ANSI_COLORS[10]),_.ansi[11]=y(w.brightYellow,i.DEFAULT_ANSI_COLORS[11]),_.ansi[12]=y(w.brightBlue,i.DEFAULT_ANSI_COLORS[12]),_.ansi[13]=y(w.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),_.ansi[14]=y(w.brightCyan,i.DEFAULT_ANSI_COLORS[14]),_.ansi[15]=y(w.brightWhite,i.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){let S=Math.min(_.ansi.length-16,w.extendedAnsi.length);for(let T=0;T<S;T++)_.ansi[T+16]=y(w.extendedAnsi[T],i.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[w]=this._restoreColors.ansi[w]}else for(let _=0;_<this._restoreColors.ansi.length;++_)this._colors.ansi[_]=this._restoreColors.ansi[_]}modifyColors(w){w(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function y(w,_){if(w!==void 0)try{return c.css.toColor(w)}catch{}return _}i.ThemeService=x=a([h(0,g.IOptionsService)],x)},6349:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;let a=n(8460),h=n(844);class l extends h.Disposable{constructor(f){super(),this._maxLength=f,this.onDeleteEmitter=this.register(new a.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new a.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new a.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(f){if(this._maxLength===f)return;let v=new Array(f);for(let g=0;g<Math.min(f,this.length);g++)v[g]=this._array[this._getCyclicIndex(g)];this._array=v,this._maxLength=f,this._startIndex=0}get length(){return this._length}set length(f){if(f>this._length)for(let v=this._length;v<f;v++)this._array[v]=void 0;this._length=f}get(f){return this._array[this._getCyclicIndex(f)]}set(f,v){this._array[this._getCyclicIndex(f)]=v}push(f){this._array[this._getCyclicIndex(this._length)]=f,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(f,v,...g){if(v){for(let u=f;u<this._length-v;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+v)];this._length-=v,this.onDeleteEmitter.fire({index:f,amount:v})}for(let u=this._length-1;u>=f;u--)this._array[this._getCyclicIndex(u+g.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<g.length;u++)this._array[this._getCyclicIndex(f+u)]=g[u];if(g.length&&this.onInsertEmitter.fire({index:f,amount:g.length}),this._length+g.length>this._maxLength){let u=this._length+g.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=g.length}trimStart(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)}shiftElements(f,v,g){if(!(v<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(let d=v-1;d>=0;d--)this.set(f+d+g,this.get(f+d));let u=f+v+g-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<v;u++)this.set(f+u+g,this.get(f+u))}}_getCyclicIndex(f){return(this._startIndex+f)%this._maxLength}}i.CircularList=l},1439:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function n(a,h=5){if(typeof a!="object")return a;let l=Array.isArray(a)?[]:{};for(let c in a)l[c]=h<=1?a[c]:a[c]&&n(a[c],h-1);return l}},8055:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let n=0,a=0,h=0,l=0;var c,f,v,g,u;function d(p){let b=p.toString(16);return b.length<2?"0"+b:b}function m(p,b){return p<b?(b+.05)/(p+.05):(p+.05)/(b+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(p){p.toCss=function(b,x,y,w){return w!==void 0?`#${d(b)}${d(x)}${d(y)}${d(w)}`:`#${d(b)}${d(x)}${d(y)}`},p.toRgba=function(b,x,y,w=255){return(b<<24|x<<16|y<<8|w)>>>0},p.toColor=function(b,x,y,w){return{css:p.toCss(b,x,y,w),rgba:p.toRgba(b,x,y,w)}}})(c||(i.channels=c={})),(function(p){function b(x,y){return l=Math.round(255*y),[n,a,h]=u.toChannels(x.rgba),{css:c.toCss(n,a,h,l),rgba:c.toRgba(n,a,h,l)}}p.blend=function(x,y){if(l=(255&y.rgba)/255,l===1)return{css:y.css,rgba:y.rgba};let w=y.rgba>>24&255,_=y.rgba>>16&255,S=y.rgba>>8&255,T=x.rgba>>24&255,D=x.rgba>>16&255,P=x.rgba>>8&255;return n=T+Math.round((w-T)*l),a=D+Math.round((_-D)*l),h=P+Math.round((S-P)*l),{css:c.toCss(n,a,h),rgba:c.toRgba(n,a,h)}},p.isOpaque=function(x){return(255&x.rgba)==255},p.ensureContrastRatio=function(x,y,w){let _=u.ensureContrastRatio(x.rgba,y.rgba,w);if(_)return c.toColor(_>>24&255,_>>16&255,_>>8&255)},p.opaque=function(x){let y=(255|x.rgba)>>>0;return[n,a,h]=u.toChannels(y),{css:c.toCss(n,a,h),rgba:y}},p.opacity=b,p.multiplyOpacity=function(x,y){return l=255&x.rgba,b(x,l*y/255)},p.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(f||(i.color=f={})),(function(p){let b,x;try{let y=document.createElement("canvas");y.width=1,y.height=1;let w=y.getContext("2d",{willReadFrequently:!0});w&&(b=w,b.globalCompositeOperation="copy",x=b.createLinearGradient(0,0,1,1))}catch{}p.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return n=parseInt(y.slice(1,2).repeat(2),16),a=parseInt(y.slice(2,3).repeat(2),16),h=parseInt(y.slice(3,4).repeat(2),16),c.toColor(n,a,h);case 5:return n=parseInt(y.slice(1,2).repeat(2),16),a=parseInt(y.slice(2,3).repeat(2),16),h=parseInt(y.slice(3,4).repeat(2),16),l=parseInt(y.slice(4,5).repeat(2),16),c.toColor(n,a,h,l);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}let w=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return n=parseInt(w[1]),a=parseInt(w[2]),h=parseInt(w[3]),l=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),c.toColor(n,a,h,l);if(!b||!x)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=x,b.fillStyle=y,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[n,a,h,l]=b.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:c.toRgba(n,a,h,l),css:y}}})(v||(i.css=v={})),(function(p){function b(x,y,w){let _=x/255,S=y/255,T=w/255;return .2126*(_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4))+.7152*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}p.relativeLuminance=function(x){return b(x>>16&255,x>>8&255,255&x)},p.relativeLuminance2=b})(g||(i.rgb=g={})),(function(p){function b(y,w,_){let S=y>>24&255,T=y>>16&255,D=y>>8&255,P=w>>24&255,A=w>>16&255,F=w>>8&255,B=m(g.relativeLuminance2(P,A,F),g.relativeLuminance2(S,T,D));for(;B<_&&(P>0||A>0||F>0);)P-=Math.max(0,Math.ceil(.1*P)),A-=Math.max(0,Math.ceil(.1*A)),F-=Math.max(0,Math.ceil(.1*F)),B=m(g.relativeLuminance2(P,A,F),g.relativeLuminance2(S,T,D));return(P<<24|A<<16|F<<8|255)>>>0}function x(y,w,_){let S=y>>24&255,T=y>>16&255,D=y>>8&255,P=w>>24&255,A=w>>16&255,F=w>>8&255,B=m(g.relativeLuminance2(P,A,F),g.relativeLuminance2(S,T,D));for(;B<_&&(P<255||A<255||F<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),A=Math.min(255,A+Math.ceil(.1*(255-A))),F=Math.min(255,F+Math.ceil(.1*(255-F))),B=m(g.relativeLuminance2(P,A,F),g.relativeLuminance2(S,T,D));return(P<<24|A<<16|F<<8|255)>>>0}p.blend=function(y,w){if(l=(255&w)/255,l===1)return w;let _=w>>24&255,S=w>>16&255,T=w>>8&255,D=y>>24&255,P=y>>16&255,A=y>>8&255;return n=D+Math.round((_-D)*l),a=P+Math.round((S-P)*l),h=A+Math.round((T-A)*l),c.toRgba(n,a,h)},p.ensureContrastRatio=function(y,w,_){let S=g.relativeLuminance(y>>8),T=g.relativeLuminance(w>>8);if(m(S,T)<_){if(T<S){let A=b(y,w,_),F=m(S,g.relativeLuminance(A>>8));if(F<_){let B=x(y,w,_);return F>m(S,g.relativeLuminance(B>>8))?A:B}return A}let D=x(y,w,_),P=m(S,g.relativeLuminance(D>>8));if(P<_){let A=b(y,w,_);return P>m(S,g.relativeLuminance(A>>8))?D:A}return D}},p.reduceLuminance=b,p.increaseLuminance=x,p.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(u||(i.rgba=u={})),i.toPaddedHex=d,i.contrastRatio=m},8969:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;let a=n(844),h=n(2585),l=n(4348),c=n(7866),f=n(744),v=n(7302),g=n(6975),u=n(8460),d=n(1753),m=n(1480),p=n(7994),b=n(9282),x=n(5435),y=n(5981),w=n(2660),_=!1;class S extends a.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event((D=>{this._onScrollApi?.fire(D.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(D){for(let P in D)this.optionsService.options[P]=D[P]}constructor(D){super(),this._windowsWrappingHeuristics=this.register(new a.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new v.OptionsService(D)),this._instantiationService.setService(h.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(f.BufferService)),this._instantiationService.setService(h.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(c.LogService)),this._instantiationService.setService(h.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(g.CoreService)),this._instantiationService.setService(h.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(d.CoreMouseService)),this._instantiationService.setService(h.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(m.UnicodeService)),this._instantiationService.setService(h.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(p.CharsetService),this._instantiationService.setService(h.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(h.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new x.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new y.WriteBuffer(((P,A)=>this._inputHandler.parse(P,A)))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(D,P){this._writeBuffer.write(D,P)}writeSync(D,P){this._logService.logLevel<=h.LogLevelEnum.WARN&&!_&&(this._logService.warn("writeSync is unreliable and will be removed soon."),_=!0),this._writeBuffer.writeSync(D,P)}input(D,P=!0){this.coreService.triggerDataEvent(D,P)}resize(D,P){isNaN(D)||isNaN(P)||(D=Math.max(D,f.MINIMUM_COLS),P=Math.max(P,f.MINIMUM_ROWS),this._bufferService.resize(D,P))}scroll(D,P=!1){this._bufferService.scroll(D,P)}scrollLines(D,P,A){this._bufferService.scrollLines(D,P,A)}scrollPages(D){this.scrollLines(D*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(D){let P=D-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(D,P){return this._inputHandler.registerEscHandler(D,P)}registerDcsHandler(D,P){return this._inputHandler.registerDcsHandler(D,P)}registerCsiHandler(D,P){return this._inputHandler.registerCsiHandler(D,P)}registerOscHandler(D,P){return this._inputHandler.registerOscHandler(D,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let D=!1,P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?D=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(D=!0),D?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let D=[];D.push(this.onLineFeed(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),D.push(this.registerCsiHandler({final:"H"},(()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,a.toDisposable)((()=>{for(let P of D)P.dispose()}))}}}i.CoreTerminal=S},8460:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=n=>(this._listeners.push(n),{dispose:()=>{if(!this._disposed){for(let a=0;a<this._listeners.length;a++)if(this._listeners[a]===n)return void this._listeners.splice(a,1)}}})),this._event}fire(n,a){let h=[];for(let l=0;l<this._listeners.length;l++)h.push(this._listeners[l]);for(let l=0;l<h.length;l++)h[l].call(void 0,n,a)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(n,a){return n((h=>a.fire(h)))},i.runAndSubscribe=function(n,a){return a(void 0),n((h=>a(h)))}},5435:function(o,i,n){var a=this&&this.__decorate||function(H,C,R,L){var k,U=arguments.length,X=U<3?C:L===null?L=Object.getOwnPropertyDescriptor(C,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(H,C,R,L);else for(var O=H.length-1;O>=0;O--)(k=H[O])&&(X=(U<3?k(X):U>3?k(C,R,X):k(C,R))||X);return U>3&&X&&Object.defineProperty(C,R,X),X},h=this&&this.__param||function(H,C){return function(R,L){C(R,L,H)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;let l=n(2584),c=n(7116),f=n(2015),v=n(844),g=n(482),u=n(8437),d=n(8460),m=n(643),p=n(511),b=n(3734),x=n(2585),y=n(1480),w=n(6242),_=n(6351),S=n(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},D=131072;function P(H,C){if(H>24)return C.setWinLines||!1;switch(H){case 1:return!!C.restoreWin;case 2:return!!C.minimizeWin;case 3:return!!C.setWinPosition;case 4:return!!C.setWinSizePixels;case 5:return!!C.raiseWin;case 6:return!!C.lowerWin;case 7:return!!C.refreshWin;case 8:return!!C.setWinSizeChars;case 9:return!!C.maximizeWin;case 10:return!!C.fullscreenWin;case 11:return!!C.getWinState;case 13:return!!C.getWinPosition;case 14:return!!C.getWinSizePixels;case 15:return!!C.getScreenSizePixels;case 16:return!!C.getCellSizePixels;case 18:return!!C.getWinSizeChars;case 19:return!!C.getScreenSizeChars;case 20:return!!C.getIconTitle;case 21:return!!C.getWinTitle;case 22:return!!C.pushTitle;case 23:return!!C.popTitle;case 24:return!!C.setWinLines}return!1}var A;(function(H){H[H.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",H[H.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(i.WindowsOptionsReportType=A={}));let F=0;class B extends v.Disposable{getAttrData(){return this._curAttrData}constructor(C,R,L,k,U,X,O,te,N=new f.EscapeSequenceParser){super(),this._bufferService=C,this._charsetService=R,this._coreService=L,this._logService=k,this._optionsService=U,this._oscLinkService=X,this._coreMouseService=O,this._unicodeService=te,this._parser=N,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new g.StringToUtf32,this._utf8Decoder=new g.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new d.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new d.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new d.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new d.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new d.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new d.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new d.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new d.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new d.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new d.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new d.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((I=>this._activeBuffer=I.activeBuffer))),this._parser.setCsiHandlerFallback(((I,J)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(I),params:J.toArray()})})),this._parser.setEscHandlerFallback((I=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(I)})})),this._parser.setExecuteHandlerFallback((I=>{this._logService.debug("Unknown EXECUTE code: ",{code:I})})),this._parser.setOscHandlerFallback(((I,J,Y)=>{this._logService.debug("Unknown OSC code: ",{identifier:I,action:J,data:Y})})),this._parser.setDcsHandlerFallback(((I,J,Y)=>{J==="HOOK"&&(Y=Y.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(I),action:J,payload:Y})})),this._parser.setPrintHandler(((I,J,Y)=>this.print(I,J,Y))),this._parser.registerCsiHandler({final:"@"},(I=>this.insertChars(I))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(I=>this.scrollLeft(I))),this._parser.registerCsiHandler({final:"A"},(I=>this.cursorUp(I))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(I=>this.scrollRight(I))),this._parser.registerCsiHandler({final:"B"},(I=>this.cursorDown(I))),this._parser.registerCsiHandler({final:"C"},(I=>this.cursorForward(I))),this._parser.registerCsiHandler({final:"D"},(I=>this.cursorBackward(I))),this._parser.registerCsiHandler({final:"E"},(I=>this.cursorNextLine(I))),this._parser.registerCsiHandler({final:"F"},(I=>this.cursorPrecedingLine(I))),this._parser.registerCsiHandler({final:"G"},(I=>this.cursorCharAbsolute(I))),this._parser.registerCsiHandler({final:"H"},(I=>this.cursorPosition(I))),this._parser.registerCsiHandler({final:"I"},(I=>this.cursorForwardTab(I))),this._parser.registerCsiHandler({final:"J"},(I=>this.eraseInDisplay(I,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(I=>this.eraseInDisplay(I,!0))),this._parser.registerCsiHandler({final:"K"},(I=>this.eraseInLine(I,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(I=>this.eraseInLine(I,!0))),this._parser.registerCsiHandler({final:"L"},(I=>this.insertLines(I))),this._parser.registerCsiHandler({final:"M"},(I=>this.deleteLines(I))),this._parser.registerCsiHandler({final:"P"},(I=>this.deleteChars(I))),this._parser.registerCsiHandler({final:"S"},(I=>this.scrollUp(I))),this._parser.registerCsiHandler({final:"T"},(I=>this.scrollDown(I))),this._parser.registerCsiHandler({final:"X"},(I=>this.eraseChars(I))),this._parser.registerCsiHandler({final:"Z"},(I=>this.cursorBackwardTab(I))),this._parser.registerCsiHandler({final:"`"},(I=>this.charPosAbsolute(I))),this._parser.registerCsiHandler({final:"a"},(I=>this.hPositionRelative(I))),this._parser.registerCsiHandler({final:"b"},(I=>this.repeatPrecedingCharacter(I))),this._parser.registerCsiHandler({final:"c"},(I=>this.sendDeviceAttributesPrimary(I))),this._parser.registerCsiHandler({prefix:">",final:"c"},(I=>this.sendDeviceAttributesSecondary(I))),this._parser.registerCsiHandler({final:"d"},(I=>this.linePosAbsolute(I))),this._parser.registerCsiHandler({final:"e"},(I=>this.vPositionRelative(I))),this._parser.registerCsiHandler({final:"f"},(I=>this.hVPosition(I))),this._parser.registerCsiHandler({final:"g"},(I=>this.tabClear(I))),this._parser.registerCsiHandler({final:"h"},(I=>this.setMode(I))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(I=>this.setModePrivate(I))),this._parser.registerCsiHandler({final:"l"},(I=>this.resetMode(I))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(I=>this.resetModePrivate(I))),this._parser.registerCsiHandler({final:"m"},(I=>this.charAttributes(I))),this._parser.registerCsiHandler({final:"n"},(I=>this.deviceStatus(I))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(I=>this.deviceStatusPrivate(I))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(I=>this.softReset(I))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(I=>this.setCursorStyle(I))),this._parser.registerCsiHandler({final:"r"},(I=>this.setScrollRegion(I))),this._parser.registerCsiHandler({final:"s"},(I=>this.saveCursor(I))),this._parser.registerCsiHandler({final:"t"},(I=>this.windowOptions(I))),this._parser.registerCsiHandler({final:"u"},(I=>this.restoreCursor(I))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(I=>this.insertColumns(I))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(I=>this.deleteColumns(I))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(I=>this.selectProtected(I))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(I=>this.requestMode(I,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(I=>this.requestMode(I,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new w.OscHandler((I=>(this.setTitle(I),this.setIconName(I),!0)))),this._parser.registerOscHandler(1,new w.OscHandler((I=>this.setIconName(I)))),this._parser.registerOscHandler(2,new w.OscHandler((I=>this.setTitle(I)))),this._parser.registerOscHandler(4,new w.OscHandler((I=>this.setOrReportIndexedColor(I)))),this._parser.registerOscHandler(8,new w.OscHandler((I=>this.setHyperlink(I)))),this._parser.registerOscHandler(10,new w.OscHandler((I=>this.setOrReportFgColor(I)))),this._parser.registerOscHandler(11,new w.OscHandler((I=>this.setOrReportBgColor(I)))),this._parser.registerOscHandler(12,new w.OscHandler((I=>this.setOrReportCursorColor(I)))),this._parser.registerOscHandler(104,new w.OscHandler((I=>this.restoreIndexedColor(I)))),this._parser.registerOscHandler(110,new w.OscHandler((I=>this.restoreFgColor(I)))),this._parser.registerOscHandler(111,new w.OscHandler((I=>this.restoreBgColor(I)))),this._parser.registerOscHandler(112,new w.OscHandler((I=>this.restoreCursorColor(I)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(let I in c.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:I},(()=>this.selectCharset("("+I))),this._parser.registerEscHandler({intermediates:")",final:I},(()=>this.selectCharset(")"+I))),this._parser.registerEscHandler({intermediates:"*",final:I},(()=>this.selectCharset("*"+I))),this._parser.registerEscHandler({intermediates:"+",final:I},(()=>this.selectCharset("+"+I))),this._parser.registerEscHandler({intermediates:"-",final:I},(()=>this.selectCharset("-"+I))),this._parser.registerEscHandler({intermediates:".",final:I},(()=>this.selectCharset("."+I))),this._parser.registerEscHandler({intermediates:"/",final:I},(()=>this.selectCharset("/"+I)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((I=>(this._logService.error("Parsing error: ",I),I))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new _.DcsHandler(((I,J)=>this.requestStatusString(I,J))))}_preserveStack(C,R,L,k){this._parseStack.paused=!0,this._parseStack.cursorStartX=C,this._parseStack.cursorStartY=R,this._parseStack.decodedLength=L,this._parseStack.position=k}_logSlowResolvingAsync(C){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([C,new Promise(((R,L)=>setTimeout((()=>L("#SLOW_TIMEOUT")),5e3)))]).catch((R=>{if(R!=="#SLOW_TIMEOUT")throw R;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(C,R){let L,k=this._activeBuffer.x,U=this._activeBuffer.y,X=0,O=this._parseStack.paused;if(O){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,R))return this._logSlowResolvingAsync(L),L;k=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,C.length>D&&(X=this._parseStack.position+D)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof C=="string"?` "${C}"`:` "${Array.prototype.map.call(C,(I=>String.fromCharCode(I))).join("")}"`),typeof C=="string"?C.split("").map((I=>I.charCodeAt(0))):C),this._parseBuffer.length<C.length&&this._parseBuffer.length<D&&(this._parseBuffer=new Uint32Array(Math.min(C.length,D))),O||this._dirtyRowTracker.clearRange(),C.length>D)for(let I=X;I<C.length;I+=D){let J=I+D<C.length?I+D:C.length,Y=typeof C=="string"?this._stringDecoder.decode(C.substring(I,J),this._parseBuffer):this._utf8Decoder.decode(C.subarray(I,J),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,Y))return this._preserveStack(k,U,Y,I),this._logSlowResolvingAsync(L),L}else if(!O){let I=typeof C=="string"?this._stringDecoder.decode(C,this._parseBuffer):this._utf8Decoder.decode(C,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,I))return this._preserveStack(k,U,I,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===k&&this._activeBuffer.y===U||this._onCursorMove.fire();let te=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),N=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);N<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(N,this._bufferService.rows-1),Math.min(te,this._bufferService.rows-1))}print(C,R,L){let k,U,X=this._charsetService.charset,O=this._optionsService.rawOptions.screenReaderMode,te=this._bufferService.cols,N=this._coreService.decPrivateModes.wraparound,I=this._coreService.modes.insertMode,J=this._curAttrData,Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-R>0&&Y.getWidth(this._activeBuffer.x-1)===2&&Y.setCellFromCodepoint(this._activeBuffer.x-1,0,1,J);let V=this._parser.precedingJoinState;for(let Q=R;Q<L;++Q){if(k=C[Q],k<127&&X){let De=X[String.fromCharCode(k)];De&&(k=De.charCodeAt(0))}let W=this._unicodeService.charProperties(k,V);U=y.UnicodeService.extractWidth(W);let ae=y.UnicodeService.extractShouldJoin(W),me=ae?y.UnicodeService.extractWidth(V):0;if(V=W,O&&this._onA11yChar.fire((0,g.stringFromCodePoint)(k)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+U-me>te){if(N){let De=Y,se=this._activeBuffer.x-me;for(this._activeBuffer.x=me,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),me>0&&Y instanceof u.BufferLine&&Y.copyCellsFrom(De,se,0,me,!1);se<te;)De.setCellFromCodepoint(se++,0,1,J)}else if(this._activeBuffer.x=te-1,U===2)continue}if(ae&&this._activeBuffer.x){let De=Y.getWidth(this._activeBuffer.x-1)?1:2;Y.addCodepointToCell(this._activeBuffer.x-De,k,U);for(let se=U-me;--se>=0;)Y.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}else if(I&&(Y.insertCells(this._activeBuffer.x,U-me,this._activeBuffer.getNullCell(J)),Y.getWidth(te-1)===2&&Y.setCellFromCodepoint(te-1,m.NULL_CELL_CODE,m.NULL_CELL_WIDTH,J)),Y.setCellFromCodepoint(this._activeBuffer.x++,k,U,J),U>0)for(;--U;)Y.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}this._parser.precedingJoinState=V,this._activeBuffer.x<te&&L-R>0&&Y.getWidth(this._activeBuffer.x)===0&&!Y.hasContent(this._activeBuffer.x)&&Y.setCellFromCodepoint(this._activeBuffer.x,0,1,J),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(C,R){return C.final!=="t"||C.prefix||C.intermediates?this._parser.registerCsiHandler(C,R):this._parser.registerCsiHandler(C,(L=>!P(L.params[0],this._optionsService.rawOptions.windowOptions)||R(L)))}registerDcsHandler(C,R){return this._parser.registerDcsHandler(C,new _.DcsHandler(R))}registerEscHandler(C,R){return this._parser.registerEscHandler(C,R)}registerOscHandler(C,R){return this._parser.registerOscHandler(C,new w.OscHandler(R))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let C=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);C.hasWidth(this._activeBuffer.x)&&!C.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let C=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-C),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(C=this._bufferService.cols-1){this._activeBuffer.x=Math.min(C,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(C,R){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=C,this._activeBuffer.y=this._activeBuffer.scrollTop+R):(this._activeBuffer.x=C,this._activeBuffer.y=R),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(C,R){this._restrictCursor(),this._setCursor(this._activeBuffer.x+C,this._activeBuffer.y+R)}cursorUp(C){let R=this._activeBuffer.y-this._activeBuffer.scrollTop;return R>=0?this._moveCursor(0,-Math.min(R,C.params[0]||1)):this._moveCursor(0,-(C.params[0]||1)),!0}cursorDown(C){let R=this._activeBuffer.scrollBottom-this._activeBuffer.y;return R>=0?this._moveCursor(0,Math.min(R,C.params[0]||1)):this._moveCursor(0,C.params[0]||1),!0}cursorForward(C){return this._moveCursor(C.params[0]||1,0),!0}cursorBackward(C){return this._moveCursor(-(C.params[0]||1),0),!0}cursorNextLine(C){return this.cursorDown(C),this._activeBuffer.x=0,!0}cursorPrecedingLine(C){return this.cursorUp(C),this._activeBuffer.x=0,!0}cursorCharAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(C){return this._setCursor(C.length>=2?(C.params[1]||1)-1:0,(C.params[0]||1)-1),!0}charPosAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(C){return this._moveCursor(C.params[0]||1,0),!0}linePosAbsolute(C){return this._setCursor(this._activeBuffer.x,(C.params[0]||1)-1),!0}vPositionRelative(C){return this._moveCursor(0,C.params[0]||1),!0}hVPosition(C){return this.cursorPosition(C),!0}tabClear(C){let R=C.params[0];return R===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:R===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=C.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=C.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(C){let R=C.params[0];return R===1&&(this._curAttrData.bg|=536870912),R!==2&&R!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(C,R,L,k=!1,U=!1){let X=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);X.replaceCells(R,L,this._activeBuffer.getNullCell(this._eraseAttrData()),U),k&&(X.isWrapped=!1)}_resetBufferLine(C,R=!1){let L=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),R),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+C),L.isWrapped=!1)}eraseInDisplay(C,R=!1){let L;switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);L<this._bufferService.rows;L++)this._resetBufferLine(L,R);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,R),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,R);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,R);this._dirtyRowTracker.markDirty(0);break;case 3:let k=this._activeBuffer.lines.length-this._bufferService.rows;k>0&&(this._activeBuffer.lines.trimStart(k),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-k,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-k,0),this._onScroll.fire(0))}return!0}eraseInLine(C,R=!1){switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,R);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,R)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(C){this._restrictCursor();let R=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let L=this._activeBuffer.ybase+this._activeBuffer.y,k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-k+1;for(;R--;)this._activeBuffer.lines.splice(U-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(C){this._restrictCursor();let R=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let L=this._activeBuffer.ybase+this._activeBuffer.y,k;for(k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,k=this._bufferService.rows-1+this._activeBuffer.ybase-k;R--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(k,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(C){this._restrictCursor();let R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.insertCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(C){this._restrictCursor();let R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.deleteCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(C){let R=C.params[0]||1;for(;R--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(C){let R=C.params[0]||1;for(;R--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let R=C.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.deleteCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let R=C.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.insertCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let R=C.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.insertCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let R=C.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.deleteCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(C){this._restrictCursor();let R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(C.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(C){let R=this._parser.precedingJoinState;if(!R)return!0;let L=C.params[0]||1,k=y.UnicodeService.extractWidth(R),U=this._activeBuffer.x-k,X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(U),O=new Uint32Array(X.length*L),te=0;for(let I=0;I<X.length;){let J=X.codePointAt(I)||0;O[te++]=J,I+=J>65535?2:1}let N=te;for(let I=1;I<L;++I)O.copyWithin(N,0,te),N+=te;return this.print(O,0,N),!0}sendDeviceAttributesPrimary(C){return C.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(C){return C.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(C.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(C){return(this._optionsService.rawOptions.termName+"").indexOf(C)===0}setMode(C){for(let R=0;R<C.length;R++)switch(C.params[R]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(C){for(let R=0;R<C.length;R++)switch(C.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),this._charsetService.setgCharset(1,c.DEFAULT_CHARSET),this._charsetService.setgCharset(2,c.DEFAULT_CHARSET),this._charsetService.setgCharset(3,c.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(C){for(let R=0;R<C.length;R++)switch(C.params[R]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(C){for(let R=0;R<C.length;R++)switch(C.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),C.params[R]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(C,R){let L=this._coreService.decPrivateModes,{activeProtocol:k,activeEncoding:U}=this._coreMouseService,X=this._coreService,{buffers:O,cols:te}=this._bufferService,{active:N,alt:I}=O,J=this._optionsService.rawOptions,Y=ae=>ae?1:2,V=C.params[0];return Q=V,W=R?V===2?4:V===4?Y(X.modes.insertMode):V===12?3:V===20?Y(J.convertEol):0:V===1?Y(L.applicationCursorKeys):V===3?J.windowOptions.setWinLines?te===80?2:te===132?1:0:0:V===6?Y(L.origin):V===7?Y(L.wraparound):V===8?3:V===9?Y(k==="X10"):V===12?Y(J.cursorBlink):V===25?Y(!X.isCursorHidden):V===45?Y(L.reverseWraparound):V===66?Y(L.applicationKeypad):V===67?4:V===1e3?Y(k==="VT200"):V===1002?Y(k==="DRAG"):V===1003?Y(k==="ANY"):V===1004?Y(L.sendFocus):V===1005?4:V===1006?Y(U==="SGR"):V===1015?4:V===1016?Y(U==="SGR_PIXELS"):V===1048?1:V===47||V===1047||V===1049?Y(N===I):V===2004?Y(L.bracketedPasteMode):0,X.triggerDataEvent(`${l.C0.ESC}[${R?"":"?"}${Q};${W}$y`),!0;var Q,W}_updateAttrColor(C,R,L,k,U){return R===2?(C|=50331648,C&=-16777216,C|=b.AttributeData.fromColorRGB([L,k,U])):R===5&&(C&=-50331904,C|=33554432|255&L),C}_extractColor(C,R,L){let k=[0,0,-1,0,0,0],U=0,X=0;do{if(k[X+U]=C.params[R+X],C.hasSubParams(R+X)){let O=C.getSubParams(R+X),te=0;do k[1]===5&&(U=1),k[X+te+1+U]=O[te];while(++te<O.length&&te+X+1+U<k.length);break}if(k[1]===5&&X+U>=2||k[1]===2&&X+U>=5)break;k[1]&&(U=1)}while(++X+R<C.length&&X+U<k.length);for(let O=2;O<k.length;++O)k[O]===-1&&(k[O]=0);switch(k[0]){case 38:L.fg=this._updateAttrColor(L.fg,k[1],k[3],k[4],k[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,k[1],k[3],k[4],k[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,k[1],k[3],k[4],k[5])}return X}_processUnderline(C,R){R.extended=R.extended.clone(),(!~C||C>5)&&(C=1),R.extended.underlineStyle=C,R.fg|=268435456,C===0&&(R.fg&=-268435457),R.updateExtended()}_processSGR0(C){C.fg=u.DEFAULT_ATTR_DATA.fg,C.bg=u.DEFAULT_ATTR_DATA.bg,C.extended=C.extended.clone(),C.extended.underlineStyle=0,C.extended.underlineColor&=-67108864,C.updateExtended()}charAttributes(C){if(C.length===1&&C.params[0]===0)return this._processSGR0(this._curAttrData),!0;let R=C.length,L,k=this._curAttrData;for(let U=0;U<R;U++)L=C.params[U],L>=30&&L<=37?(k.fg&=-50331904,k.fg|=16777216|L-30):L>=40&&L<=47?(k.bg&=-50331904,k.bg|=16777216|L-40):L>=90&&L<=97?(k.fg&=-50331904,k.fg|=16777224|L-90):L>=100&&L<=107?(k.bg&=-50331904,k.bg|=16777224|L-100):L===0?this._processSGR0(k):L===1?k.fg|=134217728:L===3?k.bg|=67108864:L===4?(k.fg|=268435456,this._processUnderline(C.hasSubParams(U)?C.getSubParams(U)[0]:1,k)):L===5?k.fg|=536870912:L===7?k.fg|=67108864:L===8?k.fg|=1073741824:L===9?k.fg|=2147483648:L===2?k.bg|=134217728:L===21?this._processUnderline(2,k):L===22?(k.fg&=-134217729,k.bg&=-134217729):L===23?k.bg&=-67108865:L===24?(k.fg&=-268435457,this._processUnderline(0,k)):L===25?k.fg&=-536870913:L===27?k.fg&=-67108865:L===28?k.fg&=-1073741825:L===29?k.fg&=2147483647:L===39?(k.fg&=-67108864,k.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):L===49?(k.bg&=-67108864,k.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?U+=this._extractColor(C,U,k):L===53?k.bg|=1073741824:L===55?k.bg&=-1073741825:L===59?(k.extended=k.extended.clone(),k.extended.underlineColor=-1,k.updateExtended()):L===100?(k.fg&=-67108864,k.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,k.bg&=-67108864,k.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(C){switch(C.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:let R=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${R};${L}R`)}return!0}deviceStatusPrivate(C){if(C.params[0]===6){let R=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${R};${L}R`)}return!0}softReset(C){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(C){let R=C.params[0]||1;switch(R){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}let L=R%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(C){let R=C.params[0]||1,L;return(C.length<2||(L=C.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>R&&(this._activeBuffer.scrollTop=R-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(C){if(!P(C.params[0],this._optionsService.rawOptions.windowOptions))return!0;let R=C.length>1?C.params[1]:0;switch(C.params[0]){case 14:R!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:R!==0&&R!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),R!==0&&R!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:R!==0&&R!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),R!==0&&R!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(C){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(C){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(C){return this._windowTitle=C,this._onTitleChange.fire(C),!0}setIconName(C){return this._iconName=C,!0}setOrReportIndexedColor(C){let R=[],L=C.split(";");for(;L.length>1;){let k=L.shift(),U=L.shift();if(/^\d+$/.exec(k)){let X=parseInt(k);if(z(X))if(U==="?")R.push({type:0,index:X});else{let O=(0,S.parseColor)(U);O&&R.push({type:1,index:X,color:O})}}}return R.length&&this._onColor.fire(R),!0}setHyperlink(C){let R=C.split(";");return!(R.length<2)&&(R[1]?this._createHyperlink(R[0],R[1]):!R[0]&&this._finishHyperlink())}_createHyperlink(C,R){this._getCurrentLinkId()&&this._finishHyperlink();let L=C.split(":"),k,U=L.findIndex((X=>X.startsWith("id=")));return U!==-1&&(k=L[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:k,uri:R}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(C,R){let L=C.split(";");for(let k=0;k<L.length&&!(R>=this._specialColors.length);++k,++R)if(L[k]==="?")this._onColor.fire([{type:0,index:this._specialColors[R]}]);else{let U=(0,S.parseColor)(L[k]);U&&this._onColor.fire([{type:1,index:this._specialColors[R],color:U}])}return!0}setOrReportFgColor(C){return this._setOrReportSpecialColor(C,0)}setOrReportBgColor(C){return this._setOrReportSpecialColor(C,1)}setOrReportCursorColor(C){return this._setOrReportSpecialColor(C,2)}restoreIndexedColor(C){if(!C)return this._onColor.fire([{type:2}]),!0;let R=[],L=C.split(";");for(let k=0;k<L.length;++k)if(/^\d+$/.exec(L[k])){let U=parseInt(L[k]);z(U)&&R.push({type:2,index:U})}return R.length&&this._onColor.fire(R),!0}restoreFgColor(C){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(C){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(C){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),!0}selectCharset(C){return C.length!==2?(this.selectDefaultCharset(),!0):(C[0]==="/"||this._charsetService.setgCharset(T[C[0]],c.CHARSETS[C[1]]||c.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let C=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,C,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(C){return this._charsetService.setgLevel(C),!0}screenAlignmentPattern(){let C=new p.CellData;C.content=4194373,C.fg=this._curAttrData.fg,C.bg=this._curAttrData.bg,this._setCursor(0,0);for(let R=0;R<this._bufferService.rows;++R){let L=this._activeBuffer.ybase+this._activeBuffer.y+R,k=this._activeBuffer.lines.get(L);k&&(k.fill(C),k.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(C,R){let L=this._bufferService.buffer,k=this._optionsService.rawOptions;return(U=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${U}${l.C0.ESC}\\`),!0))(C==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:C==='"p'?'P1$r61;1"p':C==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:C==="m"?"P1$r0m":C===" q"?`P1$r${{block:2,underline:4,bar:6}[k.cursorStyle]-(k.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(C,R){this._dirtyRowTracker.markRangeDirty(C,R)}}i.InputHandler=B;let $=class{constructor(H){this._bufferService=H,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(H){H<this.start?this.start=H:H>this.end&&(this.end=H)}markRangeDirty(H,C){H>C&&(F=H,H=C,C=F),H<this.start&&(this.start=H),C>this.end&&(this.end=C)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function z(H){return 0<=H&&H<256}$=a([h(0,x.IBufferService)],$)},844:(o,i)=>{function n(a){for(let h of a)h.dispose();a.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let a of this._disposables)a.dispose();this._disposables.length=0}register(a){return this._disposables.push(a),a}unregister(a){let h=this._disposables.indexOf(a);h!==-1&&this._disposables.splice(h,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(a){this._isDisposed||a===this._value||(this._value?.dispose(),this._value=a)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},i.toDisposable=function(a){return{dispose:a}},i.disposeArray=n,i.getDisposeArrayDisposable=function(a){return{dispose:()=>n(a)}}},1505:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(h,l,c){this._data[h]||(this._data[h]={}),this._data[h][l]=c}get(h,l){return this._data[h]?this._data[h][l]:void 0}clear(){this._data={}}}i.TwoKeyMap=n,i.FourKeyMap=class{constructor(){this._data=new n}set(a,h,l,c,f){this._data.get(a,h)||this._data.set(a,h,new n),this._data.get(a,h).set(l,c,f)}get(a,h,l,c){return this._data.get(a,h)?.get(l,c)}clear(){this._data.clear()}}},6114:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;let n=i.isNode?"node":navigator.userAgent,a=i.isNode?"node":navigator.platform;i.isFirefox=n.includes("Firefox"),i.isLegacyEdge=n.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(n),i.getSafariVersion=function(){if(!i.isSafari)return 0;let h=n.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(a),i.isIpad=a==="iPad",i.isIphone=a==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(a),i.isLinux=a.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(n)},6106:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let n=0;i.SortedList=class{constructor(a){this._getKey=a,this._array=[]}clear(){this._array.length=0}insert(a){this._array.length!==0?(n=this._search(this._getKey(a)),this._array.splice(n,0,a)):this._array.push(a)}delete(a){if(this._array.length===0)return!1;let h=this._getKey(a);if(h===void 0||(n=this._search(h),n===-1)||this._getKey(this._array[n])!==h)return!1;do if(this._array[n]===a)return this._array.splice(n,1),!0;while(++n<this._array.length&&this._getKey(this._array[n])===h);return!1}*getKeyIterator(a){if(this._array.length!==0&&(n=this._search(a),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===a))do yield this._array[n];while(++n<this._array.length&&this._getKey(this._array[n])===a)}forEachByKey(a,h){if(this._array.length!==0&&(n=this._search(a),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===a))do h(this._array[n]);while(++n<this._array.length&&this._getKey(this._array[n])===a)}values(){return[...this._array].values()}_search(a){let h=0,l=this._array.length-1;for(;l>=h;){let c=h+l>>1,f=this._getKey(this._array[c]);if(f>a)l=c-1;else{if(!(f<a)){for(;c>0&&this._getKey(this._array[c-1])===a;)c--;return c}h=c+1}}return h}}},7226:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;let a=n(6114);class h{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(f){this._idleCallback=void 0;let v=0,g=0,u=f.timeRemaining(),d=0;for(;this._i<this._tasks.length;){if(v=Date.now(),this._tasks[this._i]()||this._i++,v=Math.max(1,Date.now()-v),g=Math.max(v,g),d=f.timeRemaining(),1.5*g>d)return u-v<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-v))}ms`),void this._start();u=d}this.clear()}}class l extends h{_requestCallback(f){return setTimeout((()=>f(this._createDeadline(16))))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){let v=Date.now()+f;return{timeRemaining:()=>Math.max(0,v-Date.now())}}}i.PriorityTaskQueue=l,i.IdleTaskQueue=!a.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(c){return requestIdleCallback(c)}_cancelCallback(c){cancelIdleCallback(c)}}:l,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(c){this._queue.clear(),this._queue.enqueue(c)}flush(){this._queue.flush()}}},9282:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;let a=n(643);i.updateWindowsModeWrappedState=function(h){let l=h.buffer.lines.get(h.buffer.ybase+h.buffer.y-1),c=l?.get(h.cols-1),f=h.buffer.lines.get(h.buffer.ybase+h.buffer.y);f&&c&&(f.isWrapped=c[a.CHAR_DATA_CODE_INDEX]!==a.NULL_CELL_CODE&&c[a.CHAR_DATA_CODE_INDEX]!==a.WHITESPACE_CELL_CODE)}},3734:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new a}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){let l=new n;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}i.AttributeData=n;class a{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){let l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,c=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=c}clone(){return new a(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=a},9092:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;let a=n(6349),h=n(7226),l=n(3734),c=n(8437),f=n(4634),v=n(511),g=n(643),u=n(4863),d=n(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(m,p,b){this._hasScrollback=m,this._optionsService=p,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=c.DEFAULT_ATTR_DATA.clone(),this.savedCharset=d.DEFAULT_CHARSET,this.markers=[],this._nullCell=v.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]),this._whitespaceCell=v.CellData.fromCharData([0,g.WHITESPACE_CELL_CHAR,g.WHITESPACE_CELL_WIDTH,g.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new h.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new a.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(m){return m?(this._nullCell.fg=m.fg,this._nullCell.bg=m.bg,this._nullCell.extended=m.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(m){return m?(this._whitespaceCell.fg=m.fg,this._whitespaceCell.bg=m.bg,this._whitespaceCell.extended=m.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(m,p){return new c.BufferLine(this._bufferService.cols,this.getNullCell(m),p)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let m=this.ybase+this.y-this.ydisp;return m>=0&&m<this._rows}_getCorrectBufferLength(m){if(!this._hasScrollback)return m;let p=m+this._optionsService.rawOptions.scrollback;return p>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:p}fillViewportRows(m){if(this.lines.length===0){m===void 0&&(m=c.DEFAULT_ATTR_DATA);let p=this._rows;for(;p--;)this.lines.push(this.getBlankLine(m))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new a.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(m,p){let b=this.getNullCell(c.DEFAULT_ATTR_DATA),x=0,y=this._getCorrectBufferLength(p);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<m)for(let _=0;_<this.lines.length;_++)x+=+this.lines.get(_).resize(m,b);let w=0;if(this._rows<p)for(let _=this._rows;_<p;_++)this.lines.length<p+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new c.BufferLine(m,b)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new c.BufferLine(m,b)));else for(let _=this._rows;_>p;_--)this.lines.length>p+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){let _=this.lines.length-y;_>0&&(this.lines.trimStart(_),this.ybase=Math.max(this.ybase-_,0),this.ydisp=Math.max(this.ydisp-_,0),this.savedY=Math.max(this.savedY-_,0)),this.lines.maxLength=y}this.x=Math.min(this.x,m-1),this.y=Math.min(this.y,p-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,m-1),this.scrollTop=0}if(this.scrollBottom=p-1,this._isReflowEnabled&&(this._reflow(m,p),this._cols>m))for(let w=0;w<this.lines.length;w++)x+=+this.lines.get(w).resize(m,b);this._cols=m,this._rows=p,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let m=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,m=!1);let p=0;for(;this._memoryCleanupPosition<this.lines.length;)if(p+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),p>100)return!0;return m}get _isReflowEnabled(){let m=this._optionsService.rawOptions.windowsPty;return m&&m.buildNumber?this._hasScrollback&&m.backend==="conpty"&&m.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(m,p){this._cols!==m&&(m>this._cols?this._reflowLarger(m,p):this._reflowSmaller(m,p))}_reflowLarger(m,p){let b=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,m,this.ybase+this.y,this.getNullCell(c.DEFAULT_ATTR_DATA));if(b.length>0){let x=(0,f.reflowLargerCreateNewLayout)(this.lines,b);(0,f.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(m,p,x.countRemoved)}}_reflowLargerAdjustViewport(m,p,b){let x=this.getNullCell(c.DEFAULT_ATTR_DATA),y=b;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<p&&this.lines.push(new c.BufferLine(m,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(m,p){let b=this.getNullCell(c.DEFAULT_ATTR_DATA),x=[],y=0;for(let w=this.lines.length-1;w>=0;w--){let _=this.lines.get(w);if(!_||!_.isWrapped&&_.getTrimmedLength()<=m)continue;let S=[_];for(;_.isWrapped&&w>0;)_=this.lines.get(--w),S.unshift(_);let T=this.ybase+this.y;if(T>=w&&T<w+S.length)continue;let D=S[S.length-1].getTrimmedLength(),P=(0,f.reflowSmallerGetNewLineLengths)(S,this._cols,m),A=P.length-S.length,F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+A):Math.max(0,this.lines.length-this.lines.maxLength+A);let B=[];for(let L=0;L<A;L++){let k=this.getBlankLine(c.DEFAULT_ATTR_DATA,!0);B.push(k)}B.length>0&&(x.push({start:w+S.length+y,newLines:B}),y+=B.length),S.push(...B);let $=P.length-1,z=P[$];z===0&&($--,z=P[$]);let H=S.length-A-1,C=D;for(;H>=0;){let L=Math.min(C,z);if(S[$]===void 0)break;if(S[$].copyCellsFrom(S[H],C-L,z-L,L,!0),z-=L,z===0&&($--,z=P[$]),C-=L,C===0){H--;let k=Math.max(H,0);C=(0,f.getWrappedLineTrimmedLength)(S,k,this._cols)}}for(let L=0;L<S.length;L++)P[L]<m&&S[L].setCell(P[L],b);let R=A-F;for(;R-- >0;)this.ybase===0?this.y<p-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-p&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+A,this.ybase+p-1)}if(x.length>0){let w=[],_=[];for(let $=0;$<this.lines.length;$++)_.push(this.lines.get($));let S=this.lines.length,T=S-1,D=0,P=x[D];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let A=0;for(let $=Math.min(this.lines.maxLength-1,S+y-1);$>=0;$--)if(P&&P.start>T+A){for(let z=P.newLines.length-1;z>=0;z--)this.lines.set($--,P.newLines[z]);$++,w.push({index:T+1,amount:P.newLines.length}),A+=P.newLines.length,P=x[++D]}else this.lines.set($,_[T--]);let F=0;for(let $=w.length-1;$>=0;$--)w[$].index+=F,this.lines.onInsertEmitter.fire(w[$]),F+=w[$].amount;let B=Math.max(0,S+y-this.lines.maxLength);B>0&&this.lines.onTrimEmitter.fire(B)}}translateBufferLineToString(m,p,b=0,x){let y=this.lines.get(m);return y?y.translateToString(p,b,x):""}getWrappedRangeForLine(m){let p=m,b=m;for(;p>0&&this.lines.get(p).isWrapped;)p--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:p,last:b}}setupTabStops(m){for(m!=null?this.tabs[m]||(m=this.prevStop(m)):(this.tabs={},m=0);m<this._cols;m+=this._optionsService.rawOptions.tabStopWidth)this.tabs[m]=!0}prevStop(m){for(m==null&&(m=this.x);!this.tabs[--m]&&m>0;);return m>=this._cols?this._cols-1:m<0?0:m}nextStop(m){for(m==null&&(m=this.x);!this.tabs[++m]&&m<this._cols;);return m>=this._cols?this._cols-1:m<0?0:m}clearMarkers(m){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].line===m&&(this.markers[p].dispose(),this.markers.splice(p--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].dispose(),this.markers.splice(m--,1);this._isClearing=!1}addMarker(m){let p=new u.Marker(m);return this.markers.push(p),p.register(this.lines.onTrim((b=>{p.line-=b,p.line<0&&p.dispose()}))),p.register(this.lines.onInsert((b=>{p.line>=b.index&&(p.line+=b.amount)}))),p.register(this.lines.onDelete((b=>{p.line>=b.index&&p.line<b.index+b.amount&&p.dispose(),p.line>b.index&&(p.line-=b.amount)}))),p.register(p.onDispose((()=>this._removeMarker(p)))),p}_removeMarker(m){this._isClearing||this.markers.splice(this.markers.indexOf(m),1)}}},8437:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;let a=n(3734),h=n(511),l=n(643),c=n(482);i.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData);let f=0;class v{constructor(u,d,m=!1){this.isWrapped=m,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);let p=d||h.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let b=0;b<u;++b)this.setCell(b,p);this.length=u}get(u){let d=this._data[3*u+0],m=2097151&d;return[this._data[3*u+1],2097152&d?this._combined[u]:m?(0,c.stringFromCodePoint)(m):"",d>>22,2097152&d?this._combined[u].charCodeAt(this._combined[u].length-1):m]}set(u,d){this._data[3*u+1]=d[l.CHAR_DATA_ATTR_INDEX],d[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=d[1],this._data[3*u+0]=2097152|u|d[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=d[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|d[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){let d=this._data[3*u+0];return 2097152&d?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&d}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){let d=this._data[3*u+0];return 2097152&d?this._combined[u]:2097151&d?(0,c.stringFromCodePoint)(2097151&d):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,d){return f=3*u,d.content=this._data[f+0],d.fg=this._data[f+1],d.bg=this._data[f+2],2097152&d.content&&(d.combinedData=this._combined[u]),268435456&d.bg&&(d.extended=this._extendedAttrs[u]),d}setCell(u,d){2097152&d.content&&(this._combined[u]=d.combinedData),268435456&d.bg&&(this._extendedAttrs[u]=d.extended),this._data[3*u+0]=d.content,this._data[3*u+1]=d.fg,this._data[3*u+2]=d.bg}setCellFromCodepoint(u,d,m,p){268435456&p.bg&&(this._extendedAttrs[u]=p.extended),this._data[3*u+0]=d|m<<22,this._data[3*u+1]=p.fg,this._data[3*u+2]=p.bg}addCodepointToCell(u,d,m){let p=this._data[3*u+0];2097152&p?this._combined[u]+=(0,c.stringFromCodePoint)(d):2097151&p?(this._combined[u]=(0,c.stringFromCodePoint)(2097151&p)+(0,c.stringFromCodePoint)(d),p&=-2097152,p|=2097152):p=d|4194304,m&&(p&=-12582913,p|=m<<22),this._data[3*u+0]=p}insertCells(u,d,m){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,m),d<this.length-u){let p=new h.CellData;for(let b=this.length-u-d-1;b>=0;--b)this.setCell(u+d+b,this.loadCell(u+b,p));for(let b=0;b<d;++b)this.setCell(u+b,m)}else for(let p=u;p<this.length;++p)this.setCell(p,m);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,m)}deleteCells(u,d,m){if(u%=this.length,d<this.length-u){let p=new h.CellData;for(let b=0;b<this.length-u-d;++b)this.setCell(u+b,this.loadCell(u+d+b,p));for(let b=this.length-d;b<this.length;++b)this.setCell(b,m)}else for(let p=u;p<this.length;++p)this.setCell(p,m);u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,m),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodepoint(u,0,1,m)}replaceCells(u,d,m,p=!1){if(p)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodepoint(u-1,0,1,m),d<this.length&&this.getWidth(d-1)===2&&!this.isProtected(d)&&this.setCellFromCodepoint(d,0,1,m);u<d&&u<this.length;)this.isProtected(u)||this.setCell(u,m),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,m),d<this.length&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d,0,1,m);u<d&&u<this.length;)this.setCell(u++,m)}resize(u,d){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let m=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*m)this._data=new Uint32Array(this._data.buffer,0,m);else{let p=new Uint32Array(m);p.set(this._data),this._data=p}for(let p=this.length;p<u;++p)this.setCell(p,d)}else{this._data=this._data.subarray(0,m);let p=Object.keys(this._combined);for(let x=0;x<p.length;x++){let y=parseInt(p[x],10);y>=u&&delete this._combined[y]}let b=Object.keys(this._extendedAttrs);for(let x=0;x<b.length;x++){let y=parseInt(b[x],10);y>=u&&delete this._extendedAttrs[y]}}return this.length=u,4*m*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,d=!1){if(d)for(let m=0;m<this.length;++m)this.isProtected(m)||this.setCell(m,u);else{this._combined={},this._extendedAttrs={};for(let m=0;m<this.length;++m)this.setCell(m,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(let d in u._combined)this._combined[d]=u._combined[d];this._extendedAttrs={};for(let d in u._extendedAttrs)this._extendedAttrs[d]=u._extendedAttrs[d];this.isWrapped=u.isWrapped}clone(){let u=new v(0);u._data=new Uint32Array(this._data),u.length=this.length;for(let d in this._combined)u._combined[d]=this._combined[d];for(let d in this._extendedAttrs)u._extendedAttrs[d]=this._extendedAttrs[d];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,d,m,p,b){let x=u._data;if(b)for(let w=p-1;w>=0;w--){for(let _=0;_<3;_++)this._data[3*(m+w)+_]=x[3*(d+w)+_];268435456&x[3*(d+w)+2]&&(this._extendedAttrs[m+w]=u._extendedAttrs[d+w])}else for(let w=0;w<p;w++){for(let _=0;_<3;_++)this._data[3*(m+w)+_]=x[3*(d+w)+_];268435456&x[3*(d+w)+2]&&(this._extendedAttrs[m+w]=u._extendedAttrs[d+w])}let y=Object.keys(u._combined);for(let w=0;w<y.length;w++){let _=parseInt(y[w],10);_>=d&&(this._combined[_-d+m]=u._combined[_])}}translateToString(u,d,m,p){d=d??0,m=m??this.length,u&&(m=Math.min(m,this.getTrimmedLength())),p&&(p.length=0);let b="";for(;d<m;){let x=this._data[3*d+0],y=2097151&x,w=2097152&x?this._combined[d]:y?(0,c.stringFromCodePoint)(y):l.WHITESPACE_CELL_CHAR;if(b+=w,p)for(let _=0;_<w.length;++_)p.push(d);d+=x>>22||1}return p&&p.push(d),b}}i.BufferLine=v},4841:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(n,a){if(n.start.y>n.end.y)throw new Error(`Buffer range end (${n.end.x}, ${n.end.y}) cannot be before start (${n.start.x}, ${n.start.y})`);return a*(n.end.y-n.start.y)+(n.end.x-n.start.x+1)}},4634:(o,i)=>{function n(a,h,l){if(h===a.length-1)return a[h].getTrimmedLength();let c=!a[h].hasContent(l-1)&&a[h].getWidth(l-1)===1,f=a[h+1].getWidth(0)===2;return c&&f?l-1:l}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(a,h,l,c,f){let v=[];for(let g=0;g<a.length-1;g++){let u=g,d=a.get(++u);if(!d.isWrapped)continue;let m=[a.get(g)];for(;u<a.length&&d.isWrapped;)m.push(d),d=a.get(++u);if(c>=g&&c<u){g+=m.length-1;continue}let p=0,b=n(m,p,h),x=1,y=0;for(;x<m.length;){let _=n(m,x,h),S=_-y,T=l-b,D=Math.min(S,T);m[p].copyCellsFrom(m[x],y,b,D,!1),b+=D,b===l&&(p++,b=0),y+=D,y===_&&(x++,y=0),b===0&&p!==0&&m[p-1].getWidth(l-1)===2&&(m[p].copyCellsFrom(m[p-1],l-1,b++,1,!1),m[p-1].setCell(l-1,f))}m[p].replaceCells(b,l,f);let w=0;for(let _=m.length-1;_>0&&(_>p||m[_].getTrimmedLength()===0);_--)w++;w>0&&(v.push(g+m.length-w),v.push(w)),g+=m.length-1}return v},i.reflowLargerCreateNewLayout=function(a,h){let l=[],c=0,f=h[c],v=0;for(let g=0;g<a.length;g++)if(f===g){let u=h[++c];a.onDeleteEmitter.fire({index:g-v,amount:u}),g+=u-1,v+=u,f=h[++c]}else l.push(g);return{layout:l,countRemoved:v}},i.reflowLargerApplyNewLayout=function(a,h){let l=[];for(let c=0;c<h.length;c++)l.push(a.get(h[c]));for(let c=0;c<l.length;c++)a.set(c,l[c]);a.length=h.length},i.reflowSmallerGetNewLineLengths=function(a,h,l){let c=[],f=a.map(((d,m)=>n(a,m,h))).reduce(((d,m)=>d+m)),v=0,g=0,u=0;for(;u<f;){if(f-u<l){c.push(f-u);break}v+=l;let d=n(a,g,h);v>d&&(v-=d,g++);let m=a[g].getWidth(v-1)===2;m&&v--;let p=m?l-1:l;c.push(p),u+=p}return c},i.getWrappedLineTrimmedLength=n},5295:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;let a=n(8460),h=n(844),l=n(9092);class c extends h.Disposable{constructor(v,g){super(),this._optionsService=v,this._bufferService=g,this._onBufferActivate=this.register(new a.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(v){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(v),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(v,g){this._normal.resize(v,g),this._alt.resize(v,g),this.setupTabStops(v)}setupTabStops(v){this._normal.setupTabStops(v),this._alt.setupTabStops(v)}}i.BufferSet=c},511:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;let a=n(482),h=n(643),l=n(3734);class c extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(v){let g=new c;return g.setFromCharData(v),g}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,a.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(v){this.fg=v[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let g=!1;if(v[h.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(v[h.CHAR_DATA_CHAR_INDEX].length===2){let u=v[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){let d=v[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=d&&d<=57343?this.content=1024*(u-55296)+d-56320+65536|v[h.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=v[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[h.CHAR_DATA_WIDTH_INDEX]<<22;g&&(this.combinedData=v[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|v[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=c},643:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;let a=n(8460),h=n(844);class l{get id(){return this._id}constructor(f){this.line=f,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new a.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,h.disposeArray)(this._disposables),this._disposables.length=0)}register(f){return this._disposables.push(f),f}}i.Marker=l,l._nextId=1},7116:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},i.CHARSETS.A={"#":"\xA3"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},i.CHARSETS.C=i.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},i.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},i.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},i.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},i.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},i.CHARSETS.E=i.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},i.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},i.CHARSETS.H=i.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},i.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(o,i)=>{var n,a,h;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
|
|
10
|
-
`,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL="\x7F"})(n||(i.C0=n={})),(function(l){l.PAD="\x80",l.HOP="\x81",l.BPH="\x82",l.NBH="\x83",l.IND="\x84",l.NEL="\x85",l.SSA="\x86",l.ESA="\x87",l.HTS="\x88",l.HTJ="\x89",l.VTS="\x8A",l.PLD="\x8B",l.PLU="\x8C",l.RI="\x8D",l.SS2="\x8E",l.SS3="\x8F",l.DCS="\x90",l.PU1="\x91",l.PU2="\x92",l.STS="\x93",l.CCH="\x94",l.MW="\x95",l.SPA="\x96",l.EPA="\x97",l.SOS="\x98",l.SGCI="\x99",l.SCI="\x9A",l.CSI="\x9B",l.ST="\x9C",l.OSC="\x9D",l.PM="\x9E",l.APC="\x9F"})(a||(i.C1=a={})),(function(l){l.ST=`${n.ESC}\\`})(h||(i.C1_ESCAPED=h={}))},7399:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;let a=n(2584),h={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};i.evaluateKeyboardEvent=function(l,c,f,v){let g={type:0,cancel:!1,key:void 0},u=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?g.key=c?a.C0.ESC+"OA":a.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?g.key=c?a.C0.ESC+"OD":a.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?g.key=c?a.C0.ESC+"OC":a.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(g.key=c?a.C0.ESC+"OB":a.C0.ESC+"[B");break;case 8:g.key=l.ctrlKey?"\b":a.C0.DEL,l.altKey&&(g.key=a.C0.ESC+g.key);break;case 9:if(l.shiftKey){g.key=a.C0.ESC+"[Z";break}g.key=a.C0.HT,g.cancel=!0;break;case 13:g.key=l.altKey?a.C0.ESC+a.C0.CR:a.C0.CR,g.cancel=!0;break;case 27:g.key=a.C0.ESC,l.altKey&&(g.key=a.C0.ESC+a.C0.ESC),g.cancel=!0;break;case 37:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"D",g.key===a.C0.ESC+"[1;3D"&&(g.key=a.C0.ESC+(f?"b":"[1;5D"))):g.key=c?a.C0.ESC+"OD":a.C0.ESC+"[D";break;case 39:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"C",g.key===a.C0.ESC+"[1;3C"&&(g.key=a.C0.ESC+(f?"f":"[1;5C"))):g.key=c?a.C0.ESC+"OC":a.C0.ESC+"[C";break;case 38:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"A",f||g.key!==a.C0.ESC+"[1;3A"||(g.key=a.C0.ESC+"[1;5A")):g.key=c?a.C0.ESC+"OA":a.C0.ESC+"[A";break;case 40:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"B",f||g.key!==a.C0.ESC+"[1;3B"||(g.key=a.C0.ESC+"[1;5B")):g.key=c?a.C0.ESC+"OB":a.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(g.key=a.C0.ESC+"[2~");break;case 46:g.key=u?a.C0.ESC+"[3;"+(u+1)+"~":a.C0.ESC+"[3~";break;case 36:g.key=u?a.C0.ESC+"[1;"+(u+1)+"H":c?a.C0.ESC+"OH":a.C0.ESC+"[H";break;case 35:g.key=u?a.C0.ESC+"[1;"+(u+1)+"F":c?a.C0.ESC+"OF":a.C0.ESC+"[F";break;case 33:l.shiftKey?g.type=2:l.ctrlKey?g.key=a.C0.ESC+"[5;"+(u+1)+"~":g.key=a.C0.ESC+"[5~";break;case 34:l.shiftKey?g.type=3:l.ctrlKey?g.key=a.C0.ESC+"[6;"+(u+1)+"~":g.key=a.C0.ESC+"[6~";break;case 112:g.key=u?a.C0.ESC+"[1;"+(u+1)+"P":a.C0.ESC+"OP";break;case 113:g.key=u?a.C0.ESC+"[1;"+(u+1)+"Q":a.C0.ESC+"OQ";break;case 114:g.key=u?a.C0.ESC+"[1;"+(u+1)+"R":a.C0.ESC+"OR";break;case 115:g.key=u?a.C0.ESC+"[1;"+(u+1)+"S":a.C0.ESC+"OS";break;case 116:g.key=u?a.C0.ESC+"[15;"+(u+1)+"~":a.C0.ESC+"[15~";break;case 117:g.key=u?a.C0.ESC+"[17;"+(u+1)+"~":a.C0.ESC+"[17~";break;case 118:g.key=u?a.C0.ESC+"[18;"+(u+1)+"~":a.C0.ESC+"[18~";break;case 119:g.key=u?a.C0.ESC+"[19;"+(u+1)+"~":a.C0.ESC+"[19~";break;case 120:g.key=u?a.C0.ESC+"[20;"+(u+1)+"~":a.C0.ESC+"[20~";break;case 121:g.key=u?a.C0.ESC+"[21;"+(u+1)+"~":a.C0.ESC+"[21~";break;case 122:g.key=u?a.C0.ESC+"[23;"+(u+1)+"~":a.C0.ESC+"[23~";break;case 123:g.key=u?a.C0.ESC+"[24;"+(u+1)+"~":a.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(f&&!v||!l.altKey||l.metaKey)!f||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?g.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(g.key=a.C0.US),l.key==="@"&&(g.key=a.C0.NUL)):l.keyCode===65&&(g.type=1);else{let d=h[l.keyCode],m=d?.[l.shiftKey?1:0];if(m)g.key=a.C0.ESC+m;else if(l.keyCode>=65&&l.keyCode<=90){let p=l.ctrlKey?l.keyCode-64:l.keyCode+32,b=String.fromCharCode(p);l.shiftKey&&(b=b.toUpperCase()),g.key=a.C0.ESC+b}else if(l.keyCode===32)g.key=a.C0.ESC+(l.ctrlKey?a.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let p=l.code.slice(3,4);l.shiftKey||(p=p.toLowerCase()),g.key=a.C0.ESC+p,g.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?g.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?g.key=a.C0.NUL:l.keyCode>=51&&l.keyCode<=55?g.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?g.key=a.C0.DEL:l.keyCode===219?g.key=a.C0.ESC:l.keyCode===220?g.key=a.C0.FS:l.keyCode===221&&(g.key=a.C0.GS)}return g}},482:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(n){return n>65535?(n-=65536,String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):String.fromCharCode(n)},i.utf32ToString=function(n,a=0,h=n.length){let l="";for(let c=a;c<h;++c){let f=n[c];f>65535?(f-=65536,l+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):l+=String.fromCharCode(f)}return l},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(n,a){let h=n.length;if(!h)return 0;let l=0,c=0;if(this._interim){let f=n.charCodeAt(c++);56320<=f&&f<=57343?a[l++]=1024*(this._interim-55296)+f-56320+65536:(a[l++]=this._interim,a[l++]=f),this._interim=0}for(let f=c;f<h;++f){let v=n.charCodeAt(f);if(55296<=v&&v<=56319){if(++f>=h)return this._interim=v,l;let g=n.charCodeAt(f);56320<=g&&g<=57343?a[l++]=1024*(v-55296)+g-56320+65536:(a[l++]=v,a[l++]=g)}else v!==65279&&(a[l++]=v)}return l}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(n,a){let h=n.length;if(!h)return 0;let l,c,f,v,g=0,u=0,d=0;if(this.interim[0]){let b=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let y,w=0;for(;(y=63&this.interim[++w])&&w<4;)x<<=6,x|=y;let _=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,S=_-w;for(;d<S;){if(d>=h)return 0;if(y=n[d++],(192&y)!=128){d--,b=!0;break}this.interim[w++]=y,x<<=6,x|=63&y}b||(_===2?x<128?d--:a[g++]=x:_===3?x<2048||x>=55296&&x<=57343||x===65279||(a[g++]=x):x<65536||x>1114111||(a[g++]=x)),this.interim.fill(0)}let m=h-4,p=d;for(;p<h;){for(;!(!(p<m)||128&(l=n[p])||128&(c=n[p+1])||128&(f=n[p+2])||128&(v=n[p+3]));)a[g++]=l,a[g++]=c,a[g++]=f,a[g++]=v,p+=4;if(l=n[p++],l<128)a[g++]=l;else if((224&l)==192){if(p>=h)return this.interim[0]=l,g;if(c=n[p++],(192&c)!=128){p--;continue}if(u=(31&l)<<6|63&c,u<128){p--;continue}a[g++]=u}else if((240&l)==224){if(p>=h)return this.interim[0]=l,g;if(c=n[p++],(192&c)!=128){p--;continue}if(p>=h)return this.interim[0]=l,this.interim[1]=c,g;if(f=n[p++],(192&f)!=128){p--;continue}if(u=(15&l)<<12|(63&c)<<6|63&f,u<2048||u>=55296&&u<=57343||u===65279)continue;a[g++]=u}else if((248&l)==240){if(p>=h)return this.interim[0]=l,g;if(c=n[p++],(192&c)!=128){p--;continue}if(p>=h)return this.interim[0]=l,this.interim[1]=c,g;if(f=n[p++],(192&f)!=128){p--;continue}if(p>=h)return this.interim[0]=l,this.interim[1]=c,this.interim[2]=f,g;if(v=n[p++],(192&v)!=128){p--;continue}if(u=(7&l)<<18|(63&c)<<12|(63&f)<<6|63&v,u<65536||u>1114111)continue;a[g++]=u}}return g}}},225:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;let a=n(1480),h=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],l=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],c;i.UnicodeV6=class{constructor(){if(this.version="6",!c){c=new Uint8Array(65536),c.fill(1),c[0]=0,c.fill(0,1,32),c.fill(0,127,160),c.fill(2,4352,4448),c[9001]=2,c[9002]=2,c.fill(2,11904,42192),c[12351]=1,c.fill(2,44032,55204),c.fill(2,63744,64256),c.fill(2,65040,65050),c.fill(2,65072,65136),c.fill(2,65280,65377),c.fill(2,65504,65511);for(let f=0;f<h.length;++f)c.fill(0,h[f][0],h[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?c[f]:(function(v,g){let u,d=0,m=g.length-1;if(v<g[0][0]||v>g[m][1])return!1;for(;m>=d;)if(u=d+m>>1,v>g[u][1])d=u+1;else{if(!(v<g[u][0]))return!0;m=u-1}return!1})(f,l)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,v){let g=this.wcwidth(f),u=g===0&&v!==0;if(u){let d=a.UnicodeService.extractWidth(v);d===0?u=!1:d>g&&(g=d)}return a.UnicodeService.createPropertyValue(0,g,u)}}},5981:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;let a=n(8460),h=n(844);class l extends h.Disposable{constructor(f){super(),this._action=f,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(f,v){if(v!==void 0&&this._syncCalls>v)return void(this._syncCalls=0);if(this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let g;for(this._isSyncWriting=!0;g=this._writeBuffer.shift();){this._action(g);let u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(f,v){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(v),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(v)}_innerWrite(f=0,v=!0){let g=f||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let u=this._writeBuffer[this._bufferOffset],d=this._action(u,v);if(d){let p=b=>Date.now()-g>=12?setTimeout((()=>this._innerWrite(0,b))):this._innerWrite(g,b);return void d.catch((b=>(queueMicrotask((()=>{throw b})),Promise.resolve(!1)))).then(p)}let m=this._callbacks[this._bufferOffset];if(m&&m(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-g>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}i.WriteBuffer=l},5941:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;let n=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,a=/^[\da-f]+$/;function h(l,c){let f=l.toString(16),v=f.length<2?"0"+f:f;switch(c){case 4:return f[0];case 8:return v;case 12:return(v+v).slice(0,3);default:return v+v}}i.parseColor=function(l){if(!l)return;let c=l.toLowerCase();if(c.indexOf("rgb:")===0){c=c.slice(4);let f=n.exec(c);if(f){let v=f[1]?15:f[4]?255:f[7]?4095:65535;return[Math.round(parseInt(f[1]||f[4]||f[7]||f[10],16)/v*255),Math.round(parseInt(f[2]||f[5]||f[8]||f[11],16)/v*255),Math.round(parseInt(f[3]||f[6]||f[9]||f[12],16)/v*255)]}}else if(c.indexOf("#")===0&&(c=c.slice(1),a.exec(c)&&[3,6,9,12].includes(c.length))){let f=c.length/3,v=[0,0,0];for(let g=0;g<3;++g){let u=parseInt(c.slice(f*g,f*g+f),16);v[g]=f===1?u<<4:f===2?u:f===3?u>>4:u>>8}return v}},i.toRgbString=function(l,c=16){let[f,v,g]=l;return`rgb:${h(f,c)}/${h(v,c)}/${h(g,c)}`}},5770:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;let a=n(482),h=n(8742),l=n(5770),c=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=c,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=c}registerHandler(v,g){this._handlers[v]===void 0&&(this._handlers[v]=[]);let u=this._handlers[v];return u.push(g),{dispose:()=>{let d=u.indexOf(g);d!==-1&&u.splice(d,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}reset(){if(this._active.length)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].unhook(!1);this._stack.paused=!1,this._active=c,this._ident=0}hook(v,g){if(this.reset(),this._ident=v,this._active=this._handlers[v]||c,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(g);else this._handlerFb(this._ident,"HOOK",g)}put(v,g,u){if(this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].put(v,g,u);else this._handlerFb(this._ident,"PUT",(0,a.utf32ToString)(v,g,u))}unhook(v,g=!0){if(this._active.length){let u=!1,d=this._active.length-1,m=!1;if(this._stack.paused&&(d=this._stack.loopPosition-1,u=g,m=this._stack.fallThrough,this._stack.paused=!1),!m&&u===!1){for(;d>=0&&(u=this._active[d].unhook(v),u!==!0);d--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!1,u;d--}for(;d>=0;d--)if(u=this._active[d].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",v);this._active=c,this._ident=0}};let f=new h.Params;f.addParam(0),i.DcsHandler=class{constructor(v){this._handler=v,this._data="",this._params=f,this._hitLimit=!1}hook(v){this._params=v.length>1||v.params[0]?v.clone():f,this._data="",this._hitLimit=!1}put(v,g,u){this._hitLimit||(this._data+=(0,a.utf32ToString)(v,g,u),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(v){let g=!1;if(this._hitLimit)g=!1;else if(v&&(g=this._handler(this._data,this._params),g instanceof Promise))return g.then((u=>(this._params=f,this._data="",this._hitLimit=!1,u)));return this._params=f,this._data="",this._hitLimit=!1,g}}},2015:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;let a=n(844),h=n(8742),l=n(6242),c=n(6351);class f{constructor(d){this.table=new Uint8Array(d)}setDefault(d,m){this.table.fill(d<<4|m)}add(d,m,p,b){this.table[m<<8|d]=p<<4|b}addMany(d,m,p,b){for(let x=0;x<d.length;x++)this.table[m<<8|d[x]]=p<<4|b}}i.TransitionTable=f;let v=160;i.VT500_TRANSITION_TABLE=(function(){let u=new f(4095),d=Array.apply(null,Array(256)).map(((w,_)=>_)),m=(w,_)=>d.slice(w,_),p=m(32,127),b=m(0,24);b.push(25),b.push.apply(b,m(28,32));let x=m(0,14),y;for(y in u.setDefault(1,0),u.addMany(p,0,2,0),x)u.addMany([24,26,153,154],y,3,0),u.addMany(m(128,144),y,3,0),u.addMany(m(144,152),y,3,0),u.add(156,y,0,0),u.add(27,y,11,1),u.add(157,y,4,8),u.addMany([152,158,159],y,0,7),u.add(155,y,11,3),u.add(144,y,11,9);return u.addMany(b,0,3,0),u.addMany(b,1,3,1),u.add(127,1,0,1),u.addMany(b,8,0,8),u.addMany(b,3,3,3),u.add(127,3,0,3),u.addMany(b,4,3,4),u.add(127,4,0,4),u.addMany(b,6,3,6),u.addMany(b,5,3,5),u.add(127,5,0,5),u.addMany(b,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(p,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(m(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(p,7,0,7),u.addMany(b,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(m(64,127),3,7,0),u.addMany(m(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(m(48,60),4,8,4),u.addMany(m(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(m(32,64),6,0,6),u.add(127,6,0,6),u.addMany(m(64,127),6,0,0),u.addMany(m(32,48),3,9,5),u.addMany(m(32,48),5,9,5),u.addMany(m(48,64),5,0,6),u.addMany(m(64,127),5,7,0),u.addMany(m(32,48),4,9,5),u.addMany(m(32,48),1,9,2),u.addMany(m(32,48),2,9,2),u.addMany(m(48,127),2,10,0),u.addMany(m(48,80),1,10,0),u.addMany(m(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(m(96,127),1,10,0),u.add(80,1,11,9),u.addMany(b,9,0,9),u.add(127,9,0,9),u.addMany(m(28,32),9,0,9),u.addMany(m(32,48),9,9,12),u.addMany(m(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(b,11,0,11),u.addMany(m(32,128),11,0,11),u.addMany(m(28,32),11,0,11),u.addMany(b,10,0,10),u.add(127,10,0,10),u.addMany(m(28,32),10,0,10),u.addMany(m(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(m(32,48),10,9,12),u.addMany(b,12,0,12),u.add(127,12,0,12),u.addMany(m(28,32),12,0,12),u.addMany(m(32,48),12,9,12),u.addMany(m(48,64),12,0,11),u.addMany(m(64,127),12,12,13),u.addMany(m(64,127),10,12,13),u.addMany(m(64,127),9,12,13),u.addMany(b,13,13,13),u.addMany(p,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(v,0,2,0),u.add(v,8,5,8),u.add(v,6,0,6),u.add(v,11,0,11),u.add(v,13,13,13),u})();class g extends a.Disposable{constructor(d=i.VT500_TRANSITION_TABLE){super(),this._transitions=d,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new h.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(m,p,b)=>{},this._executeHandlerFb=m=>{},this._csiHandlerFb=(m,p)=>{},this._escHandlerFb=m=>{},this._errorHandlerFb=m=>m,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,a.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new c.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(d,m=[64,126]){let p=0;if(d.prefix){if(d.prefix.length>1)throw new Error("only one byte as prefix supported");if(p=d.prefix.charCodeAt(0),p&&60>p||p>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(d.intermediates){if(d.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<d.intermediates.length;++x){let y=d.intermediates.charCodeAt(x);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");p<<=8,p|=y}}if(d.final.length!==1)throw new Error("final must be a single byte");let b=d.final.charCodeAt(0);if(m[0]>b||b>m[1])throw new Error(`final must be in range ${m[0]} .. ${m[1]}`);return p<<=8,p|=b,p}identToString(d){let m=[];for(;d;)m.push(String.fromCharCode(255&d)),d>>=8;return m.reverse().join("")}setPrintHandler(d){this._printHandler=d}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(d,m){let p=this._identifier(d,[48,126]);this._escHandlers[p]===void 0&&(this._escHandlers[p]=[]);let b=this._escHandlers[p];return b.push(m),{dispose:()=>{let x=b.indexOf(m);x!==-1&&b.splice(x,1)}}}clearEscHandler(d){this._escHandlers[this._identifier(d,[48,126])]&&delete this._escHandlers[this._identifier(d,[48,126])]}setEscHandlerFallback(d){this._escHandlerFb=d}setExecuteHandler(d,m){this._executeHandlers[d.charCodeAt(0)]=m}clearExecuteHandler(d){this._executeHandlers[d.charCodeAt(0)]&&delete this._executeHandlers[d.charCodeAt(0)]}setExecuteHandlerFallback(d){this._executeHandlerFb=d}registerCsiHandler(d,m){let p=this._identifier(d);this._csiHandlers[p]===void 0&&(this._csiHandlers[p]=[]);let b=this._csiHandlers[p];return b.push(m),{dispose:()=>{let x=b.indexOf(m);x!==-1&&b.splice(x,1)}}}clearCsiHandler(d){this._csiHandlers[this._identifier(d)]&&delete this._csiHandlers[this._identifier(d)]}setCsiHandlerFallback(d){this._csiHandlerFb=d}registerDcsHandler(d,m){return this._dcsParser.registerHandler(this._identifier(d),m)}clearDcsHandler(d){this._dcsParser.clearHandler(this._identifier(d))}setDcsHandlerFallback(d){this._dcsParser.setHandlerFallback(d)}registerOscHandler(d,m){return this._oscParser.registerHandler(d,m)}clearOscHandler(d){this._oscParser.clearHandler(d)}setOscHandlerFallback(d){this._oscParser.setHandlerFallback(d)}setErrorHandler(d){this._errorHandler=d}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(d,m,p,b,x){this._parseStack.state=d,this._parseStack.handlers=m,this._parseStack.handlerPos=p,this._parseStack.transition=b,this._parseStack.chunkPos=x}parse(d,m,p){let b,x=0,y=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(p===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let _=this._parseStack.handlers,S=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(p===!1&&S>-1){for(;S>=0&&(b=_[S](this._params),b!==!0);S--)if(b instanceof Promise)return this._parseStack.handlerPos=S,b}this._parseStack.handlers=[];break;case 4:if(p===!1&&S>-1){for(;S>=0&&(b=_[S](),b!==!0);S--)if(b instanceof Promise)return this._parseStack.handlerPos=S,b}this._parseStack.handlers=[];break;case 6:if(x=d[this._parseStack.chunkPos],b=this._dcsParser.unhook(x!==24&&x!==26,p),b)return b;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=d[this._parseStack.chunkPos],b=this._oscParser.end(x!==24&&x!==26,p),b)return b;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let _=w;_<m;++_){switch(x=d[_],y=this._transitions.table[this.currentState<<8|(x<160?x:v)],y>>4){case 2:for(let A=_+1;;++A){if(A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,_,A),_=A-1;break}if(++A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,_,A),_=A-1;break}if(++A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,_,A),_=A-1;break}if(++A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,_,A),_=A-1;break}}break;case 3:this._executeHandlers[x]?this._executeHandlers[x]():this._executeHandlerFb(x),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:_,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let S=this._csiHandlers[this._collect<<8|x],T=S?S.length-1:-1;for(;T>=0&&(b=S[T](this._params),b!==!0);T--)if(b instanceof Promise)return this._preserveStack(3,S,T,y,_),b;T<0&&this._csiHandlerFb(this._collect<<8|x,this._params),this.precedingJoinState=0;break;case 8:do switch(x){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(x-48)}while(++_<m&&(x=d[_])>47&&x<60);_--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:let D=this._escHandlers[this._collect<<8|x],P=D?D.length-1:-1;for(;P>=0&&(b=D[P](),b!==!0);P--)if(b instanceof Promise)return this._preserveStack(4,D,P,y,_),b;P<0&&this._escHandlerFb(this._collect<<8|x),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|x,this._params);break;case 13:for(let A=_+1;;++A)if(A>=m||(x=d[A])===24||x===26||x===27||x>127&&x<v){this._dcsParser.put(d,_,A),_=A-1;break}break;case 14:if(b=this._dcsParser.unhook(x!==24&&x!==26),b)return this._preserveStack(6,[],0,y,_),b;x===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let A=_+1;;A++)if(A>=m||(x=d[A])<32||x>127&&x<v){this._oscParser.put(d,_,A),_=A-1;break}break;case 6:if(b=this._oscParser.end(x!==24&&x!==26),b)return this._preserveStack(5,[],0,y,_),b;x===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}i.EscapeSequenceParser=g},6242:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;let a=n(5770),h=n(482),l=[];i.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(c,f){this._handlers[c]===void 0&&(this._handlers[c]=[]);let v=this._handlers[c];return v.push(f),{dispose:()=>{let g=v.indexOf(f);g!==-1&&v.splice(g,1)}}}clearHandler(c){this._handlers[c]&&delete this._handlers[c]}setHandlerFallback(c){this._handlerFb=c}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let c=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;c>=0;--c)this._active[c].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].start();else this._handlerFb(this._id,"START")}_put(c,f,v){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(c,f,v);else this._handlerFb(this._id,"PUT",(0,h.utf32ToString)(c,f,v))}start(){this.reset(),this._state=1}put(c,f,v){if(this._state!==3){if(this._state===1)for(;f<v;){let g=c[f++];if(g===59){this._state=2,this._start();break}if(g<48||57<g)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+g-48}this._state===2&&v-f>0&&this._put(c,f,v)}}end(c,f=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let v=!1,g=this._active.length-1,u=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,v=f,u=this._stack.fallThrough,this._stack.paused=!1),!u&&v===!1){for(;g>=0&&(v=this._active[g].end(c),v!==!0);g--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,v;g--}for(;g>=0;g--)if(v=this._active[g].end(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,v}else this._handlerFb(this._id,"END",c);this._active=l,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(c){this._handler=c,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(c,f,v){this._hitLimit||(this._data+=(0,h.utf32ToString)(c,f,v),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(c){let f=!1;if(this._hitLimit)f=!1;else if(c&&(f=this._handler(this._data),f instanceof Promise))return f.then((v=>(this._data="",this._hitLimit=!1,v)));return this._data="",this._hitLimit=!1,f}}},8742:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;let n=2147483647;class a{static fromArray(l){let c=new a;if(!l.length)return c;for(let f=Array.isArray(l[0])?1:0;f<l.length;++f){let v=l[f];if(Array.isArray(v))for(let g=0;g<v.length;++g)c.addSubParam(v[g]);else c.addParam(v)}return c}constructor(l=32,c=32){if(this.maxLength=l,this.maxSubParamsLength=c,c>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(c),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){let l=new a(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){let l=[];for(let c=0;c<this.length;++c){l.push(this.params[c]);let f=this._subParamsIdx[c]>>8,v=255&this._subParamsIdx[c];v-f>0&&l.push(Array.prototype.slice.call(this._subParams,f,v))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>n?n:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>n?n:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){let c=this._subParamsIdx[l]>>8,f=255&this._subParamsIdx[l];return f-c>0?this._subParams.subarray(c,f):null}getSubParamsAll(){let l={};for(let c=0;c<this.length;++c){let f=this._subParamsIdx[c]>>8,v=255&this._subParamsIdx[c];v-f>0&&(l[c]=this._subParams.slice(f,v))}return l}addDigit(l){let c;if(this._rejectDigits||!(c=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let f=this._digitIsSub?this._subParams:this.params,v=f[c-1];f[c-1]=~v?Math.min(10*v+l,n):l}}i.Params=a},5741:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let n=this._addons.length-1;n>=0;n--)this._addons[n].instance.dispose()}loadAddon(n,a){let h={instance:a,dispose:a.dispose,isDisposed:!1};this._addons.push(h),a.dispose=()=>this._wrappedAddonDispose(h),a.activate(n)}_wrappedAddonDispose(n){if(n.isDisposed)return;let a=-1;for(let h=0;h<this._addons.length;h++)if(this._addons[h]===n){a=h;break}if(a===-1)throw new Error("Could not dispose an addon that has not been loaded");n.isDisposed=!0,n.dispose.apply(n.instance),this._addons.splice(a,1)}}},8771:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;let a=n(3785),h=n(511);i.BufferApiView=class{constructor(l,c){this._buffer=l,this.type=c}init(l){return this._buffer=l,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(l){let c=this._buffer.lines.get(l);if(c)return new a.BufferLineApiView(c)}getNullCell(){return new h.CellData}}},3785:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;let a=n(511);i.BufferLineApiView=class{constructor(h){this._line=h}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(h,l){if(!(h<0||h>=this._line.length))return l?(this._line.loadCell(h,l),l):this._line.loadCell(h,new a.CellData)}translateToString(h,l,c){return this._line.translateToString(h,l,c)}}},8285:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;let a=n(8771),h=n(8460),l=n(844);class c extends l.Disposable{constructor(v){super(),this._core=v,this._onBufferChange=this.register(new h.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new a.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new a.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}i.BufferNamespaceApi=c},7975:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(n){this._core=n}registerCsiHandler(n,a){return this._core.registerCsiHandler(n,(h=>a(h.toArray())))}addCsiHandler(n,a){return this.registerCsiHandler(n,a)}registerDcsHandler(n,a){return this._core.registerDcsHandler(n,((h,l)=>a(h,l.toArray())))}addDcsHandler(n,a){return this.registerDcsHandler(n,a)}registerEscHandler(n,a){return this._core.registerEscHandler(n,a)}addEscHandler(n,a){return this.registerEscHandler(n,a)}registerOscHandler(n,a){return this._core.registerOscHandler(n,a)}addOscHandler(n,a){return this.registerOscHandler(n,a)}}},7090:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(n){this._core=n}register(n){this._core.unicodeService.register(n)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(n){this._core.unicodeService.activeVersion=n}}},744:function(o,i,n){var a=this&&this.__decorate||function(u,d,m,p){var b,x=arguments.length,y=x<3?d:p===null?p=Object.getOwnPropertyDescriptor(d,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,d,m,p);else for(var w=u.length-1;w>=0;w--)(b=u[w])&&(y=(x<3?b(y):x>3?b(d,m,y):b(d,m))||y);return x>3&&y&&Object.defineProperty(d,m,y),y},h=this&&this.__param||function(u,d){return function(m,p){d(m,p,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;let l=n(8460),c=n(844),f=n(5295),v=n(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let g=i.BufferService=class extends c.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new f.BufferSet(u,this))}resize(u,d){this.cols=u,this.rows=d,this.buffers.resize(u,d),this._onResize.fire({cols:u,rows:d})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,d=!1){let m=this.buffer,p;p=this._cachedBlankLine,p&&p.length===this.cols&&p.getFg(0)===u.fg&&p.getBg(0)===u.bg||(p=m.getBlankLine(u,d),this._cachedBlankLine=p),p.isWrapped=d;let b=m.ybase+m.scrollTop,x=m.ybase+m.scrollBottom;if(m.scrollTop===0){let y=m.lines.isFull;x===m.lines.length-1?y?m.lines.recycle().copyFrom(p):m.lines.push(p.clone()):m.lines.splice(x+1,0,p.clone()),y?this.isUserScrolling&&(m.ydisp=Math.max(m.ydisp-1,0)):(m.ybase++,this.isUserScrolling||m.ydisp++)}else{let y=x-b+1;m.lines.shiftElements(b+1,y-1,-1),m.lines.set(x,p.clone())}this.isUserScrolling||(m.ydisp=m.ybase),this._onScroll.fire(m.ydisp)}scrollLines(u,d,m){let p=this.buffer;if(u<0){if(p.ydisp===0)return;this.isUserScrolling=!0}else u+p.ydisp>=p.ybase&&(this.isUserScrolling=!1);let b=p.ydisp;p.ydisp=Math.max(Math.min(p.ydisp+u,p.ybase),0),b!==p.ydisp&&(d||this._onScroll.fire(p.ydisp))}};i.BufferService=g=a([h(0,v.IOptionsService)],g)},7994:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(n){this.glevel=n,this.charset=this._charsets[n]}setgCharset(n,a){this._charsets[n]=a,this.glevel===n&&(this.charset=a)}}},1753:function(o,i,n){var a=this&&this.__decorate||function(p,b,x,y){var w,_=arguments.length,S=_<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(p,b,x,y);else for(var T=p.length-1;T>=0;T--)(w=p[T])&&(S=(_<3?w(S):_>3?w(b,x,S):w(b,x))||S);return _>3&&S&&Object.defineProperty(b,x,S),S},h=this&&this.__param||function(p,b){return function(x,y){b(x,y,p)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;let l=n(2585),c=n(8460),f=n(844),v={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:p=>p.button!==4&&p.action===1&&(p.ctrl=!1,p.alt=!1,p.shift=!1,!0)},VT200:{events:19,restrict:p=>p.action!==32},DRAG:{events:23,restrict:p=>p.action!==32||p.button!==3},ANY:{events:31,restrict:p=>!0}};function g(p,b){let x=(p.ctrl?16:0)|(p.shift?4:0)|(p.alt?8:0);return p.button===4?(x|=64,x|=p.action):(x|=3&p.button,4&p.button&&(x|=64),8&p.button&&(x|=128),p.action===32?x|=32:p.action!==0||b||(x|=3)),x}let u=String.fromCharCode,d={DEFAULT:p=>{let b=[g(p,!1)+32,p.col+32,p.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${u(b[0])}${u(b[1])}${u(b[2])}`},SGR:p=>{let b=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${g(p,!0)};${p.col};${p.row}${b}`},SGR_PIXELS:p=>{let b=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${g(p,!0)};${p.x};${p.y}${b}`}},m=i.CoreMouseService=class extends f.Disposable{constructor(p,b){super(),this._bufferService=p,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new c.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(let x of Object.keys(v))this.addProtocol(x,v[x]);for(let x of Object.keys(d))this.addEncoding(x,d[x]);this.reset()}addProtocol(p,b){this._protocols[p]=b}addEncoding(p,b){this._encodings[p]=b}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(p){if(!this._protocols[p])throw new Error(`unknown protocol "${p}"`);this._activeProtocol=p,this._onProtocolChange.fire(this._protocols[p].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(p){if(!this._encodings[p])throw new Error(`unknown encoding "${p}"`);this._activeEncoding=p}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(p){if(p.col<0||p.col>=this._bufferService.cols||p.row<0||p.row>=this._bufferService.rows||p.button===4&&p.action===32||p.button===3&&p.action!==32||p.button!==4&&(p.action===2||p.action===3)||(p.col++,p.row++,p.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,p,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(p))return!1;let b=this._encodings[this._activeEncoding](p);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=p,!0}explainEvents(p){return{down:!!(1&p),up:!!(2&p),drag:!!(4&p),move:!!(8&p),wheel:!!(16&p)}}_equalEvents(p,b,x){if(x){if(p.x!==b.x||p.y!==b.y)return!1}else if(p.col!==b.col||p.row!==b.row)return!1;return p.button===b.button&&p.action===b.action&&p.ctrl===b.ctrl&&p.alt===b.alt&&p.shift===b.shift}};i.CoreMouseService=m=a([h(0,l.IBufferService),h(1,l.ICoreService)],m)},6975:function(o,i,n){var a=this&&this.__decorate||function(m,p,b,x){var y,w=arguments.length,_=w<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(m,p,b,x);else for(var S=m.length-1;S>=0;S--)(y=m[S])&&(_=(w<3?y(_):w>3?y(p,b,_):y(p,b))||_);return w>3&&_&&Object.defineProperty(p,b,_),_},h=this&&this.__param||function(m,p){return function(b,x){p(b,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;let l=n(1439),c=n(8460),f=n(844),v=n(2585),g=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),d=i.CoreService=class extends f.Disposable{constructor(m,p,b){super(),this._bufferService=m,this._logService=p,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new c.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new c.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(g),this.decPrivateModes=(0,l.clone)(u)}reset(){this.modes=(0,l.clone)(g),this.decPrivateModes=(0,l.clone)(u)}triggerDataEvent(m,p=!1){if(this._optionsService.rawOptions.disableStdin)return;let b=this._bufferService.buffer;p&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),p&&this._onUserInput.fire(),this._logService.debug(`sending data "${m}"`,(()=>m.split("").map((x=>x.charCodeAt(0))))),this._onData.fire(m)}triggerBinaryEvent(m){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${m}"`,(()=>m.split("").map((p=>p.charCodeAt(0))))),this._onBinary.fire(m))}};i.CoreService=d=a([h(0,v.IBufferService),h(1,v.ILogService),h(2,v.IOptionsService)],d)},9074:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;let a=n(8055),h=n(8460),l=n(844),c=n(6106),f=0,v=0;class g extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new c.SortedList((m=>m?.marker.line)),this._onDecorationRegistered=this.register(new h.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new h.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(m){if(m.marker.isDisposed)return;let p=new u(m);if(p){let b=p.marker.onDispose((()=>p.dispose()));p.onDispose((()=>{p&&(this._decorations.delete(p)&&this._onDecorationRemoved.fire(p),b.dispose())})),this._decorations.insert(p),this._onDecorationRegistered.fire(p)}return p}reset(){for(let m of this._decorations.values())m.dispose();this._decorations.clear()}*getDecorationsAtCell(m,p,b){let x=0,y=0;for(let w of this._decorations.getKeyIterator(p))x=w.options.x??0,y=x+(w.options.width??1),m>=x&&m<y&&(!b||(w.options.layer??"bottom")===b)&&(yield w)}forEachDecorationAtCell(m,p,b,x){this._decorations.forEachByKey(p,(y=>{f=y.options.x??0,v=f+(y.options.width??1),m>=f&&m<v&&(!b||(y.options.layer??"bottom")===b)&&x(y)}))}}i.DecorationService=g;class u extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=a.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=a.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(m){super(),this.options=m,this.onRenderEmitter=this.register(new h.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=m.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;let a=n(2585),h=n(8343);class l{constructor(...f){this._entries=new Map;for(let[v,g]of f)this.set(v,g)}set(f,v){let g=this._entries.get(f);return this._entries.set(f,v),g}forEach(f){for(let[v,g]of this._entries.entries())f(v,g)}has(f){return this._entries.has(f)}get(f){return this._entries.get(f)}}i.ServiceCollection=l,i.InstantiationService=class{constructor(){this._services=new l,this._services.set(a.IInstantiationService,this)}setService(c,f){this._services.set(c,f)}getService(c){return this._services.get(c)}createInstance(c,...f){let v=(0,h.getServiceDependencies)(c).sort(((d,m)=>d.index-m.index)),g=[];for(let d of v){let m=this._services.get(d.id);if(!m)throw new Error(`[createInstance] ${c.name} depends on UNKNOWN service ${d.id}.`);g.push(m)}let u=v.length>0?v[0].index:f.length;if(f.length!==u)throw new Error(`[createInstance] First service dependency of ${c.name} at position ${u+1} conflicts with ${f.length} static arguments`);return new c(...f,...g)}}},7866:function(o,i,n){var a=this&&this.__decorate||function(u,d,m,p){var b,x=arguments.length,y=x<3?d:p===null?p=Object.getOwnPropertyDescriptor(d,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,d,m,p);else for(var w=u.length-1;w>=0;w--)(b=u[w])&&(y=(x<3?b(y):x>3?b(d,m,y):b(d,m))||y);return x>3&&y&&Object.defineProperty(d,m,y),y},h=this&&this.__param||function(u,d){return function(m,p){d(m,p,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;let l=n(844),c=n(2585),f={trace:c.LogLevelEnum.TRACE,debug:c.LogLevelEnum.DEBUG,info:c.LogLevelEnum.INFO,warn:c.LogLevelEnum.WARN,error:c.LogLevelEnum.ERROR,off:c.LogLevelEnum.OFF},v,g=i.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=c.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),v=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let d=0;d<u.length;d++)typeof u[d]=="function"&&(u[d]=u[d]())}_log(u,d,m){this._evalLazyOptionalParams(m),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+d,...m)}trace(u,...d){this._logLevel<=c.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,u,d)}debug(u,...d){this._logLevel<=c.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,u,d)}info(u,...d){this._logLevel<=c.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,u,d)}warn(u,...d){this._logLevel<=c.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,u,d)}error(u,...d){this._logLevel<=c.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,u,d)}};i.LogService=g=a([h(0,c.IOptionsService)],g),i.setTraceLogger=function(u){v=u},i.traceCall=function(u,d,m){if(typeof m.value!="function")throw new Error("not supported");let p=m.value;m.value=function(...b){if(v.logLevel!==c.LogLevelEnum.TRACE)return p.apply(this,b);v.trace(`GlyphRenderer#${p.name}(${b.map((y=>JSON.stringify(y))).join(", ")})`);let x=p.apply(this,b);return v.trace(`GlyphRenderer#${p.name} return`,x),x}}},7302:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;let a=n(8460),h=n(844),l=n(6114);i.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};let c=["normal","bold","100","200","300","400","500","600","700","800","900"];class f extends h.Disposable{constructor(g){super(),this._onOptionChange=this.register(new a.EventEmitter),this.onOptionChange=this._onOptionChange.event;let u={...i.DEFAULT_OPTIONS};for(let d in g)if(d in u)try{let m=g[d];u[d]=this._sanitizeAndValidateOption(d,m)}catch(m){console.error(m)}this.rawOptions=u,this.options={...u},this._setupOptions(),this.register((0,h.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(g,u){return this.onOptionChange((d=>{d===g&&u(this.rawOptions[g])}))}onMultipleOptionChange(g,u){return this.onOptionChange((d=>{g.indexOf(d)!==-1&&u()}))}_setupOptions(){let g=d=>{if(!(d in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${d}"`);return this.rawOptions[d]},u=(d,m)=>{if(!(d in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${d}"`);m=this._sanitizeAndValidateOption(d,m),this.rawOptions[d]!==m&&(this.rawOptions[d]=m,this._onOptionChange.fire(d))};for(let d in this.rawOptions){let m={get:g.bind(this,d),set:u.bind(this,d)};Object.defineProperty(this.options,d,m)}}_sanitizeAndValidateOption(g,u){switch(g){case"cursorStyle":if(u||(u=i.DEFAULT_OPTIONS[g]),!(function(d){return d==="block"||d==="underline"||d==="bar"})(u))throw new Error(`"${u}" is not a valid value for ${g}`);break;case"wordSeparator":u||(u=i.DEFAULT_OPTIONS[g]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=c.includes(u)?u:i.DEFAULT_OPTIONS[g];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${g} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${g} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${g} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${g} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}i.OptionsService=f},2660:function(o,i,n){var a=this&&this.__decorate||function(f,v,g,u){var d,m=arguments.length,p=m<3?v:u===null?u=Object.getOwnPropertyDescriptor(v,g):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(f,v,g,u);else for(var b=f.length-1;b>=0;b--)(d=f[b])&&(p=(m<3?d(p):m>3?d(v,g,p):d(v,g))||p);return m>3&&p&&Object.defineProperty(v,g,p),p},h=this&&this.__param||function(f,v){return function(g,u){v(g,u,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;let l=n(2585),c=i.OscLinkService=class{constructor(f){this._bufferService=f,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(f){let v=this._bufferService.buffer;if(f.id===void 0){let b=v.addMarker(v.ybase+v.y),x={data:f,id:this._nextId++,lines:[b]};return b.onDispose((()=>this._removeMarkerFromLink(x,b))),this._dataByLinkId.set(x.id,x),x.id}let g=f,u=this._getEntryIdKey(g),d=this._entriesWithId.get(u);if(d)return this.addLineToLink(d.id,v.ybase+v.y),d.id;let m=v.addMarker(v.ybase+v.y),p={id:this._nextId++,key:this._getEntryIdKey(g),data:g,lines:[m]};return m.onDispose((()=>this._removeMarkerFromLink(p,m))),this._entriesWithId.set(p.key,p),this._dataByLinkId.set(p.id,p),p.id}addLineToLink(f,v){let g=this._dataByLinkId.get(f);if(g&&g.lines.every((u=>u.line!==v))){let u=this._bufferService.buffer.addMarker(v);g.lines.push(u),u.onDispose((()=>this._removeMarkerFromLink(g,u)))}}getLinkData(f){return this._dataByLinkId.get(f)?.data}_getEntryIdKey(f){return`${f.id};;${f.uri}`}_removeMarkerFromLink(f,v){let g=f.lines.indexOf(v);g!==-1&&(f.lines.splice(g,1),f.lines.length===0&&(f.data.id!==void 0&&this._entriesWithId.delete(f.key),this._dataByLinkId.delete(f.id)))}};i.OscLinkService=c=a([h(0,l.IBufferService)],c)},8343:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;let n="di$target",a="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(h){return h[a]||[]},i.createDecorator=function(h){if(i.serviceRegistry.has(h))return i.serviceRegistry.get(h);let l=function(c,f,v){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,u,d){u[n]===u?u[a].push({id:g,index:d}):(u[a]=[{id:g,index:d}],u[n]=u)})(l,c,v)};return l.toString=()=>h,i.serviceRegistry.set(h,l),l}},2585:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;let a=n(8343);var h;i.IBufferService=(0,a.createDecorator)("BufferService"),i.ICoreMouseService=(0,a.createDecorator)("CoreMouseService"),i.ICoreService=(0,a.createDecorator)("CoreService"),i.ICharsetService=(0,a.createDecorator)("CharsetService"),i.IInstantiationService=(0,a.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(h||(i.LogLevelEnum=h={})),i.ILogService=(0,a.createDecorator)("LogService"),i.IOptionsService=(0,a.createDecorator)("OptionsService"),i.IOscLinkService=(0,a.createDecorator)("OscLinkService"),i.IUnicodeService=(0,a.createDecorator)("UnicodeService"),i.IDecorationService=(0,a.createDecorator)("DecorationService")},1480:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;let a=n(8460),h=n(225);class l{static extractShouldJoin(f){return(1&f)!=0}static extractWidth(f){return f>>1&3}static extractCharKind(f){return f>>3}static createPropertyValue(f,v,g=!1){return(16777215&f)<<3|(3&v)<<1|(g?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new a.EventEmitter,this.onChange=this._onChange.event;let f=new h.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let v=0,g=0,u=f.length;for(let d=0;d<u;++d){let m=f.charCodeAt(d);if(55296<=m&&m<=56319){if(++d>=u)return v+this.wcwidth(m);let x=f.charCodeAt(d);56320<=x&&x<=57343?m=1024*(m-55296)+x-56320+65536:v+=this.wcwidth(x)}let p=this.charProperties(m,g),b=l.extractWidth(p);l.extractShouldJoin(p)&&(b-=l.extractWidth(g)),v+=b,g=p}return v}charProperties(f,v){return this._activeProvider.charProperties(f,v)}}i.UnicodeService=l}},t={};function r(o){var i=t[o];if(i!==void 0)return i.exports;var n=t[o]={exports:{}};return e[o].call(n.exports,n,n.exports,r),n.exports}var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;let i=r(9042),n=r(3236),a=r(844),h=r(5741),l=r(8285),c=r(7975),f=r(7090),v=["cols","rows"];class g extends a.Disposable{constructor(d){super(),this._core=this.register(new n.Terminal(d)),this._addonManager=this.register(new h.AddonManager),this._publicOptions={...this._core.options};let m=b=>this._core.options[b],p=(b,x)=>{this._checkReadonlyOptions(b),this._core.options[b]=x};for(let b in this._core.options){let x={get:m.bind(this,b),set:p.bind(this,b)};Object.defineProperty(this._publicOptions,b,x)}}_checkReadonlyOptions(d){if(v.includes(d))throw new Error(`Option "${d}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new c.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new f.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let d=this._core.coreService.decPrivateModes,m="none";switch(this._core.coreMouseService.activeProtocol){case"X10":m="x10";break;case"VT200":m="vt200";break;case"DRAG":m="drag";break;case"ANY":m="any"}return{applicationCursorKeysMode:d.applicationCursorKeys,applicationKeypadMode:d.applicationKeypad,bracketedPasteMode:d.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:m,originMode:d.origin,reverseWraparoundMode:d.reverseWraparound,sendFocusMode:d.sendFocus,wraparoundMode:d.wraparound}}get options(){return this._publicOptions}set options(d){for(let m in d)this._publicOptions[m]=d[m]}blur(){this._core.blur()}focus(){this._core.focus()}input(d,m=!0){this._core.input(d,m)}resize(d,m){this._verifyIntegers(d,m),this._core.resize(d,m)}open(d){this._core.open(d)}attachCustomKeyEventHandler(d){this._core.attachCustomKeyEventHandler(d)}attachCustomWheelEventHandler(d){this._core.attachCustomWheelEventHandler(d)}registerLinkProvider(d){return this._core.registerLinkProvider(d)}registerCharacterJoiner(d){return this._checkProposedApi(),this._core.registerCharacterJoiner(d)}deregisterCharacterJoiner(d){this._checkProposedApi(),this._core.deregisterCharacterJoiner(d)}registerMarker(d=0){return this._verifyIntegers(d),this._core.registerMarker(d)}registerDecoration(d){return this._checkProposedApi(),this._verifyPositiveIntegers(d.x??0,d.width??0,d.height??0),this._core.registerDecoration(d)}hasSelection(){return this._core.hasSelection()}select(d,m,p){this._verifyIntegers(d,m,p),this._core.select(d,m,p)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(d,m){this._verifyIntegers(d,m),this._core.selectLines(d,m)}dispose(){super.dispose()}scrollLines(d){this._verifyIntegers(d),this._core.scrollLines(d)}scrollPages(d){this._verifyIntegers(d),this._core.scrollPages(d)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(d){this._verifyIntegers(d),this._core.scrollToLine(d)}clear(){this._core.clear()}write(d,m){this._core.write(d,m)}writeln(d,m){this._core.write(d),this._core.write(`\r
|
|
11
|
-
`,m)}paste(d){this._core.paste(d)}refresh(d,m){this._verifyIntegers(d,m),this._core.refresh(d,m)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(d){this._addonManager.loadAddon(this,d)}static get strings(){return i}_verifyIntegers(...d){for(let m of d)if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...d){for(let m of d)if(m&&(m===1/0||isNaN(m)||m%1!=0||m<0))throw new Error("This API only accepts positive integers")}}o.Terminal=g})(),s})()))});var oy={};Hn(oy,{apply:()=>Fx,inject:()=>Mx});module.exports=ff(oy);var ne=require("react");var Ke=require("react"),ir=require("@deepseek-ai/dsh-client-ui-primitives"),kp=Ms($n(),1);var Kt="/ssh-local/v1",lr=class extends Error{constructor(r,s,o){super(s);this.status=r;this.body=o;this.name="ApiError"}};async function oe(e,t={}){let r=t.method??"GET",s=await fetch(`${Kt}${e}`,{...t,headers:{Accept:"application/json",...r==="GET"?{}:{"Content-Type":"application/json","X-DSH-SSH-Request":"1"},...t.headers}});if(s.status===204)return;let o=await s.json().catch(()=>({}));if(!s.ok)throw new lr(s.status,typeof o.error=="string"?o.error:`HTTP ${s.status}`,o);return o}function Vn(){return oe("/profiles")}function Ol(){return oe("/ftp-profiles")}function Ml(){return oe("/file-transfer/endpoints")}function Fl(e,t,r){let s=new URLSearchParams({paneId:e,endpointId:t});return r!==void 0&&s.set("path",r),oe(`/file-transfer/directory?${s.toString()}`)}function Bl(e,t){return`${Kt}/file-transfer/download?${new URLSearchParams({endpointId:e,path:t}).toString()}`}function Fs(e){return oe("/file-transfer/delete",{method:"POST",body:JSON.stringify(e)})}function Nl(e){return oe("/file-transfer/move",{method:"POST",body:JSON.stringify(e)})}function zl(){return oe("/file-transfer/jobs")}function Bs(e){return oe("/file-transfer/jobs",{method:"POST",body:JSON.stringify(e)})}function Hl(e){return oe(`/file-transfer/jobs/${encodeURIComponent(e)}`,{method:"DELETE"})}function Ul(){return oe("/vault")}function $l(){return oe("/proxies")}function Vl(){return oe("/forwards")}function wi(e){return oe(`/injections?sessionId=${encodeURIComponent(e)}`)}function jl(e){return oe(`/profiles/${encodeURIComponent(e)}/projects`)}function Wl(e,t){return oe(`/profiles/${encodeURIComponent(e)}/projects`,{method:"POST",body:JSON.stringify({project:t})})}function ql(e,t,r){return oe(`/profiles/${encodeURIComponent(e)}/projects/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({project:r})})}function Kl(e,t){return oe(`/profiles/${encodeURIComponent(e)}/projects/${encodeURIComponent(t)}`,{method:"DELETE"})}function Si(e){return oe(`/injections/${encodeURIComponent(e.sessionId)}`,{method:"PUT",body:JSON.stringify(e)})}function Gl(e){return oe(`/activity?sessionId=${encodeURIComponent(e)}`)}function Xl(e){return`${Kt}/activity/events?sessionId=${encodeURIComponent(e)}`}function Jl(e,t,r){let s=new URLSearchParams({sessionId:e,profileId:t});return r!==void 0&&s.set("path",r),oe(`/activity/files?${s.toString()}`)}function Yl(e,t){let r=new URLSearchParams({sessionId:e});return t!==void 0&&r.set("path",t),oe(`/activity/local-directory?${r.toString()}`)}function Ql(e,t){let r=new URLSearchParams({sessionId:e,path:t});return oe(`/activity/local-file?${r.toString()}`)}function Zl(e,t,r){return oe("/activity/local-delete",{method:"POST",body:JSON.stringify({sessionId:e,directory:t,paths:r})})}function eh(e,t,r=!1){let s=new URLSearchParams({sessionId:e,path:t});return r&&s.set("inline","1"),`${Kt}/activity/local-download?${s.toString()}`}function th(e,t,r){let s=new URLSearchParams({sessionId:e,profileId:t,path:r});return oe(`/activity/file?${s.toString()}`)}function rh(e,t,r,s=!1){let o=new URLSearchParams({sessionId:e,profileId:t,path:r});return s&&o.set("inline","1"),`${Kt}/activity/download?${o.toString()}`}function sh(e,t="~"){let r=new URLSearchParams({path:t});return oe(`/profiles/${encodeURIComponent(e)}/sftp/directory?${r.toString()}`)}function ih(e,t){let r=new URLSearchParams({path:t});return oe(`/profiles/${encodeURIComponent(e)}/sftp/file?${r.toString()}`)}function nh(e,t,r=!1){let s=new URLSearchParams({path:t});return r&&s.set("inline","1"),`${Kt}/profiles/${encodeURIComponent(e)}/sftp/download?${s.toString()}`}async function jn(e,t,r,s=!1){let o=new URLSearchParams({directory:t,name:r.name});s&&o.set("overwrite","1");let i=await fetch(`${Kt}/profiles/${encodeURIComponent(e)}/sftp/upload?${o.toString()}`,{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/octet-stream","X-DSH-SSH-Request":"1"},body:r}),n=await i.json().catch(()=>({}));if(!i.ok)throw new lr(i.status,typeof n.error=="string"?n.error:`HTTP ${i.status}`,n);return n}function oh(e,t,r,s){return oe(`/activity/terminals/${encodeURIComponent(t)}/input`,{method:"POST",body:JSON.stringify({sessionId:e,text:r,sequence:s})})}function ah(e,t,r){let s=new URLSearchParams({sessionId:e,cursor:String(r)});return oe(`/activity/terminals/${encodeURIComponent(t)}/output?${s.toString()}`)}function lh(e,t,r=0){let s=new URLSearchParams({sessionId:e,cursor:String(r)});return`${Kt}/activity/terminals/${encodeURIComponent(t)}/stream?${s.toString()}`}function hh(e,t=0){let r=new URLSearchParams({cursor:String(t)});return`${Kt}/terminals/${encodeURIComponent(e)}/stream?${r.toString()}`}function ch(e,t,r,s){return oe(`/activity/terminals/${encodeURIComponent(t)}/resize`,{method:"POST",body:JSON.stringify({sessionId:e,cols:r,rows:s})})}function dh(e,t){let r=new URLSearchParams({sessionId:e});return oe(`/activity/terminals/${encodeURIComponent(t)}?${r.toString()}`,{method:"DELETE"})}function uh(e,t,r){return oe("/activity/directory",{method:"PUT",body:JSON.stringify({sessionId:e,profileId:t,cwd:r})})}function Gt(e){return`${e.username}@${e.host}:${e.port}`}var xe=require("react");function ph(e,t){let r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}var mf=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gf=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vf={};function ki(e,t){return((t||vf).jsx?gf:mf).test(e)}var bf=/[ \t\n\f\r]/g;function Wn(e){return typeof e=="object"?e.type==="text"?fh(e.value):!1:fh(e)}function fh(e){return e.replace(bf,"")===""}var Xt=class{constructor(t,r,s){this.normal=r,this.property=t,s&&(this.space=s)}};Xt.prototype.normal={};Xt.prototype.property={};Xt.prototype.space=void 0;function qn(e,t){let r={},s={};for(let o of e)Object.assign(r,o.property),Object.assign(s,o.normal);return new Xt(r,s,t)}function Ns(e){return e.toLowerCase()}var qe=class{constructor(t,r){this.attribute=r,this.property=t}};qe.prototype.attribute="";qe.prototype.booleanish=!1;qe.prototype.boolean=!1;qe.prototype.commaOrSpaceSeparated=!1;qe.prototype.commaSeparated=!1;qe.prototype.defined=!1;qe.prototype.mustUseProperty=!1;qe.prototype.number=!1;qe.prototype.overloadedBoolean=!1;qe.prototype.property="";qe.prototype.spaceSeparated=!1;qe.prototype.space=void 0;var zs={};Hn(zs,{boolean:()=>fe,booleanish:()=>Me,commaOrSpaceSeparated:()=>at,commaSeparated:()=>Jt,number:()=>Z,overloadedBoolean:()=>Ci,spaceSeparated:()=>Se});var _f=0,fe=Ir(),Me=Ir(),Ci=Ir(),Z=Ir(),Se=Ir(),Jt=Ir(),at=Ir();function Ir(){return 2**++_f}var Kn=Object.keys(zs),Lr=class extends qe{constructor(t,r,s,o){let i=-1;if(super(t,r),mh(this,"space",o),typeof s=="number")for(;++i<Kn.length;){let n=Kn[i];mh(this,Kn[i],(s&zs[n])===zs[n])}}};Lr.prototype.defined=!0;function mh(e,t,r){r&&(e[t]=r)}function Ct(e){let t={},r={};for(let[s,o]of Object.entries(e.properties)){let i=new Lr(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(i.mustUseProperty=!0),t[s]=i,r[Ns(s)]=s,r[Ns(i.attribute)]=s}return new Xt(t,r,e.space)}var Gn=Ct({properties:{ariaActiveDescendant:null,ariaAtomic:Me,ariaAutoComplete:null,ariaBusy:Me,ariaChecked:Me,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:Se,ariaCurrent:null,ariaDescribedBy:Se,ariaDetails:null,ariaDisabled:Me,ariaDropEffect:Se,ariaErrorMessage:null,ariaExpanded:Me,ariaFlowTo:Se,ariaGrabbed:Me,ariaHasPopup:null,ariaHidden:Me,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Se,ariaLevel:Z,ariaLive:null,ariaModal:Me,ariaMultiLine:Me,ariaMultiSelectable:Me,ariaOrientation:null,ariaOwns:Se,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:Me,ariaReadOnly:Me,ariaRelevant:null,ariaRequired:Me,ariaRoleDescription:Se,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:Me,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ei(e,t){return t in e?e[t]:t}function Ti(e,t){return Ei(e,t.toLowerCase())}var gh=Ct({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jt,acceptCharset:Se,accessKey:Se,action:null,allow:null,allowFullScreen:fe,allowPaymentRequest:fe,allowUserMedia:fe,alpha:fe,alt:null,as:null,async:fe,autoCapitalize:null,autoComplete:Se,autoFocus:fe,autoPlay:fe,blocking:Se,capture:null,charSet:null,checked:fe,cite:null,className:Se,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:Me,controls:fe,controlsList:Se,coords:Z|Jt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fe,defer:fe,dir:null,dirName:null,disabled:fe,download:Ci,draggable:Me,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fe,formTarget:null,headers:Se,height:Z,hidden:Ci,high:Z,href:null,hrefLang:null,htmlFor:Se,httpEquiv:Se,id:null,imageSizes:null,imageSrcSet:null,inert:fe,inputMode:null,integrity:null,is:null,isMap:fe,itemId:null,itemProp:Se,itemRef:Se,itemScope:fe,itemType:Se,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fe,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:fe,muted:fe,name:null,nonce:null,noModule:fe,noValidate:fe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:fe,optimum:Z,pattern:null,ping:Se,placeholder:null,playsInline:fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fe,referrerPolicy:null,rel:Se,required:fe,reversed:fe,rows:Z,rowSpan:Z,sandbox:Se,scope:null,scoped:fe,seamless:fe,selected:fe,shadowRootClonable:fe,shadowRootCustomElementRegistry:fe,shadowRootDelegatesFocus:fe,shadowRootMode:null,shadowRootSerializable:fe,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:Me,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:fe,useMap:null,value:Me,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Se,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fe,declare:fe,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:fe,noHref:fe,noShade:fe,noWrap:fe,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:Me,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:fe,disablePictureInPicture:fe,disableRemotePlayback:fe,exportParts:Jt,part:Se,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:Ti});var vh=Ct({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:at,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:Se,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jt,g2:Jt,glyphName:Jt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:at,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Se,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:at,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:at,rev:at,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:at,requiredFeatures:at,requiredFonts:at,requiredFormats:at,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:at,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:at,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:at,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ei});var Xn=Ct({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var Jn=Ct({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ti});var Yn=Ct({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var Qn={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var xf=/[A-Z]/g,bh=/-[a-z]/g,yf=/^data[-\w.:]+$/i;function Zn(e,t){let r=Ns(t),s=t,o=qe;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&yf.test(t)){if(t.charAt(4)==="-"){let i=t.slice(5).replace(bh,Sf);s="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{let i=t.slice(4);if(!bh.test(i)){let n=i.replace(xf,wf);n.charAt(0)!=="-"&&(n="-"+n),t="data"+n}}o=Lr}return new o(s,t)}function wf(e){return"-"+e.toLowerCase()}function Sf(e){return e.charAt(1).toUpperCase()}var _h=qn([Gn,gh,Xn,Jn,Yn],"html"),Pi=qn([Gn,vh,Xn,Jn,Yn],"svg");function xh(e){return e.join(" ").trim()}var Mh=Ms(Ah(),1);var Ri=Ih("end"),ls=Ih("start");function Ih(e){return t;function t(r){let s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function ro(e){let t=ls(e),r=Ri(e);if(t&&r)return{start:t,end:r}}function hr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Lh(e.position):"start"in e||"end"in e?Lh(e):"line"in e||"column"in e?so(e):""}function so(e){return Oh(e&&e.line)+":"+Oh(e&&e.column)}function Lh(e){return so(e&&e.start)+"-"+so(e&&e.end)}function Oh(e){return e&&typeof e=="number"?e:1}var ze=class extends Error{constructor(t,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let o="",i={},n=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof t=="string"?o=t:!i.cause&&t&&(n=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof s=="string"){let h=s.indexOf(":");h===-1?i.ruleId=s:(i.source=s.slice(0,h),i.ruleId=s.slice(h+1))}if(!i.place&&i.ancestors&&i.ancestors){let h=i.ancestors[i.ancestors.length-1];h&&(i.place=h.position)}let a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=hr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=n&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ze.prototype.file="";ze.prototype.name="";ze.prototype.reason="";ze.prototype.message="";ze.prototype.stack="";ze.prototype.column=void 0;ze.prototype.line=void 0;ze.prototype.ancestors=void 0;ze.prototype.cause=void 0;ze.prototype.fatal=void 0;ze.prototype.place=void 0;ze.prototype.ruleId=void 0;ze.prototype.source=void 0;var io={}.hasOwnProperty,Xf=new Map,Jf=/[A-Z]/g,Yf=new Set(["table","tbody","thead","tfoot","tr"]),Qf=new Set(["td","th"]),Fh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function no(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let r=t.filePath||void 0,s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=om(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=nm(r,t.jsx,t.jsxs)}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Pi:_h,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Bh(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Bh(e,t,r){if(t.type==="element")return Zf(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return em(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rm(e,t,r);if(t.type==="mdxjsEsm")return tm(e,t);if(t.type==="root")return sm(e,t,r);if(t.type==="text")return im(e,t)}function Zf(e,t,r){let s=e.schema,o=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(o=Pi,e.schema=o),e.ancestors.push(t);let i=zh(e,t.tagName,!1),n=am(e,t),a=ao(e,t);return Yf.has(t.tagName)&&(a=a.filter(function(h){return typeof h=="string"?!Wn(h):!0})),Nh(e,n,i,t),oo(n,a),e.ancestors.pop(),e.schema=s,e.create(t,i,n,r)}function em(e,t){if(t.data&&t.data.estree&&e.evaluater){let s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Us(e,t.position)}function tm(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Us(e,t.position)}function rm(e,t,r){let s=e.schema,o=s;t.name==="svg"&&s.space==="html"&&(o=Pi,e.schema=o),e.ancestors.push(t);let i=t.name===null?e.Fragment:zh(e,t.name,!0),n=lm(e,t),a=ao(e,t);return Nh(e,n,i,t),oo(n,a),e.ancestors.pop(),e.schema=s,e.create(t,i,n,r)}function sm(e,t,r){let s={};return oo(s,ao(e,t)),e.create(t,e.Fragment,s,r)}function im(e,t){return t.value}function Nh(e,t,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=s)}function oo(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function nm(e,t,r){return s;function s(o,i,n,a){let l=Array.isArray(n.children)?r:t;return a?l(i,n,a):l(i,n)}}function om(e,t){return r;function r(s,o,i,n){let a=Array.isArray(i.children),h=ls(s);return t(o,i,n,a,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function am(e,t){let r={},s,o;for(o in t.properties)if(o!=="children"&&io.call(t.properties,o)){let i=hm(e,o,t.properties[o]);if(i){let[n,a]=i;e.tableCellAlignToStyle&&n==="align"&&typeof a=="string"&&Qf.has(t.tagName)?s=a:r[n]=a}}if(s){let i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function lm(e,t){let r={};for(let s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){let i=s.data.estree.body[0];i.type;let n=i.expression;n.type;let a=n.properties[0];a.type,Object.assign(r,e.evaluater.evaluateExpression(a.argument))}else Us(e,t.position);else{let o=s.name,i;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){let a=s.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else Us(e,t.position);else i=s.value===null?!0:s.value;r[o]=i}return r}function ao(e,t){let r=[],s=-1,o=e.passKeys?new Map:Xf;for(;++s<t.children.length;){let i=t.children[s],n;if(e.passKeys){let h=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(h){let l=o.get(h)||0;n=h+"-"+l,o.set(h,l+1)}}let a=Bh(e,i,n);a!==void 0&&r.push(a)}return r}function hm(e,t,r){let s=Zn(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?ph(r):xh(r)),s.property==="style"){let o=typeof r=="object"?r:cm(e,String(r));return e.stylePropertyNameCase==="css"&&(o=dm(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&s.space?Qn[s.property]||s.property:s.attribute,r]}}function cm(e,t){try{return(0,Mh.default)(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let s=r,o=new ze("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Fh+"#cannot-parse-style-attribute",o}}function zh(e,t,r){let s;if(!r)s={type:"Literal",value:t};else if(t.includes(".")){let o=t.split("."),i=-1,n;for(;++i<o.length;){let a=ki(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};n=n?{type:"MemberExpression",object:n,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}s=n}else s=ki(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){let o=s.value;return io.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(s);Us(e)}function Us(e,t){let r=new ze("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Fh+"#cannot-handle-mdx-estrees-without-createevaluater",r}function dm(e){let t={},r;for(r in e)io.call(e,r)&&(t[um(r)]=e[r]);return t}function um(e){let t=e.replace(Jf,pm);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function pm(e){return"-"+e.toLowerCase()}var $s={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var us=require("react/jsx-runtime"),ud=require("react");var fm={};function Mr(e,t){let r=t||fm,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Uh(e,s,o)}function Uh(e,t,r){if(mm(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Hh(e.children,t,r)}return Array.isArray(e)?Hh(e,t,r):""}function Hh(e,t,r){let s=[],o=-1;for(;++o<e.length;)s[o]=Uh(e[o],t,r);return s.join("")}function mm(e){return!!(e&&typeof e=="object")}var $h=document.createElement("i");function hs(e){let t="&"+e+";";$h.innerHTML=t;let r=$h.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function He(e,t,r,s){let o=e.length,i=0,n;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,s.length<1e4)n=Array.from(s),n.unshift(t,r),e.splice(...n);else for(r&&e.splice(t,r);i<s.length;)n=s.slice(i,i+1e4),n.unshift(t,0),e.splice(...n),i+=1e4,t+=1e4}function rt(e,t){return e.length>0?(He(e,e.length,0,t),e):t}var Vh={}.hasOwnProperty;function Ai(e){let t={},r=-1;for(;++r<e.length;)gm(t,e[r]);return t}function gm(e,t){let r;for(r in t){let o=(Vh.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r],n;if(i)for(n in i){Vh.call(o,n)||(o[n]=[]);let a=i[n];vm(o[n],Array.isArray(a)?a:a?[a]:[])}}}function vm(e,t){let r=-1,s=[];for(;++r<t.length;)(t[r].add==="after"?e:s).push(t[r]);He(e,0,0,s)}function Ii(e,t){let r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function Ye(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var je=cr(/[A-Za-z]/),Fe=cr(/[\dA-Za-z]/),jh=cr(/[#-'*+\--9=?A-Z^-~]/);function Fr(e){return e!==null&&(e<32||e===127)}var Vs=cr(/\d/),Wh=cr(/[\dA-Fa-f]/),qh=cr(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function _e(e){return e!==null&&(e<0||e===32)}function ue(e){return e===-2||e===-1||e===32}var Br=cr(/\p{P}|\p{S}/u),Mt=cr(/\s/);function cr(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Et(e){let t=[],r=-1,s=0,o=0;for(;++r<e.length;){let i=e.charCodeAt(r),n="";if(i===37&&Fe(e.charCodeAt(r+1))&&Fe(e.charCodeAt(r+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(n=String.fromCharCode(i));else if(i>55295&&i<57344){let a=e.charCodeAt(r+1);i<56320&&a>56319&&a<57344?(n=String.fromCharCode(i,a),o=1):n="\uFFFD"}else n=String.fromCharCode(i);n&&(t.push(e.slice(s,r),encodeURIComponent(n)),s=r+o+1,n=""),o&&(r+=o,o=0)}return t.join("")+e.slice(s)}function le(e,t,r,s){let o=s?s-1:Number.POSITIVE_INFINITY,i=0;return n;function n(h){return ue(h)?(e.enter(r),a(h)):t(h)}function a(h){return ue(h)&&i++<o?(e.consume(h),a):(e.exit(r),t(h))}}var Kh={tokenize:bm};function bm(e){let t=e.attempt(this.parser.constructs.contentInitial,s,o),r;return t;function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),le(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){let h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,n(a)}function n(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ie(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),n)}}var Xh={tokenize:_m},Gh={tokenize:xm};function _m(e){let t=this,r=[],s=0,o,i,n;return a;function a(x){if(s<r.length){let y=r[s];return t.containerState=y[1],e.attempt(y[0].continuation,h,l)(x)}return l(x)}function h(x){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();let y=t.events.length,w=y,_;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){_=t.events[w][1].end;break}p(s);let S=y;for(;S<t.events.length;)t.events[S][1].end={..._},S++;return He(t.events,w+1,0,t.events.slice(y)),t.events.length=S,l(x)}return a(x)}function l(x){if(s===r.length){if(!o)return v(x);if(o.currentConstruct&&o.currentConstruct.concrete)return u(x);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Gh,c,f)(x)}function c(x){return o&&b(),p(s),v(x)}function f(x){return t.parser.lazy[t.now().line]=s!==r.length,n=t.now().offset,u(x)}function v(x){return t.containerState={},e.attempt(Gh,g,u)(x)}function g(x){return s++,r.push([t.currentConstruct,t.containerState]),v(x)}function u(x){if(x===null){o&&b(),p(0),e.consume(x);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),d(x)}function d(x){if(x===null){m(e.exit("chunkFlow"),!0),p(0),e.consume(x);return}return ie(x)?(e.consume(x),m(e.exit("chunkFlow")),s=0,t.interrupt=void 0,a):(e.consume(x),d)}function m(x,y){let w=t.sliceStream(x);if(y&&w.push(null),x.previous=i,i&&(i.next=x),i=x,o.defineSkip(x.start),o.write(w),t.parser.lazy[x.start.line]){let _=o.events.length;for(;_--;)if(o.events[_][1].start.offset<n&&(!o.events[_][1].end||o.events[_][1].end.offset>n))return;let S=t.events.length,T=S,D,P;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(D){P=t.events[T][1].end;break}D=!0}for(p(s),_=S;_<t.events.length;)t.events[_][1].end={...P},_++;He(t.events,T+1,0,t.events.slice(S)),t.events.length=_}}function p(x){let y=r.length;for(;y-- >x;){let w=r[y];t.containerState=w[1],w[0].exit.call(t,e)}r.length=x}function b(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function xm(e,t,r){return le(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yt(e){if(e===null||_e(e)||Mt(e))return 1;if(Br(e))return 2}function dr(e,t,r){let s=[],o=-1;for(;++o<e.length;){let i=e[o].resolveAll;i&&!s.includes(i)&&(t=i(t,r),s.push(i))}return t}var js={name:"attention",resolveAll:ym,tokenize:wm};function ym(e,t){let r=-1,s,o,i,n,a,h,l,c;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(s=r;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[s][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[s][1].end.offset-e[s][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let f={...e[s][1].end},v={...e[r][1].start};Jh(f,-h),Jh(v,h),n={type:h>1?"strongSequence":"emphasisSequence",start:f,end:{...e[s][1].end}},a={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:v},i={type:h>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[r][1].start}},o={type:h>1?"strong":"emphasis",start:{...n.start},end:{...a.end}},e[s][1].end={...n.start},e[r][1].start={...a.end},l=[],e[s][1].end.offset-e[s][1].start.offset&&(l=rt(l,[["enter",e[s][1],t],["exit",e[s][1],t]])),l=rt(l,[["enter",o,t],["enter",n,t],["exit",n,t],["enter",i,t]]),l=rt(l,dr(t.parser.constructs.insideSpan.null,e.slice(s+1,r),t)),l=rt(l,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(c=2,l=rt(l,[["enter",e[r][1],t],["exit",e[r][1],t]])):c=0,He(e,s-1,r-s+3,l),r=s+l.length-c-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function wm(e,t){let r=this.parser.constructs.attentionMarkers.null,s=this.previous,o=Yt(s),i;return n;function n(h){return i=h,e.enter("attentionSequence"),a(h)}function a(h){if(h===i)return e.consume(h),a;let l=e.exit("attentionSequence"),c=Yt(h),f=!c||c===2&&o||r.includes(h),v=!o||o===2&&c||r.includes(s);return l._open=!!(i===42?f:f&&(o||!v)),l._close=!!(i===42?v:v&&(c||!f)),t(h)}}function Jh(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var lo={name:"autolink",tokenize:Sm};function Sm(e,t,r){let s=0;return o;function o(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(g){return je(g)?(e.consume(g),n):g===64?r(g):l(g)}function n(g){return g===43||g===45||g===46||Fe(g)?(s=1,a(g)):l(g)}function a(g){return g===58?(e.consume(g),s=0,h):(g===43||g===45||g===46||Fe(g))&&s++<32?(e.consume(g),a):(s=0,l(g))}function h(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Fr(g)?r(g):(e.consume(g),h)}function l(g){return g===64?(e.consume(g),c):jh(g)?(e.consume(g),l):r(g)}function c(g){return Fe(g)?f(g):r(g)}function f(g){return g===46?(e.consume(g),s=0,c):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):v(g)}function v(g){if((g===45||Fe(g))&&s++<63){let u=g===45?v:f;return e.consume(g),u}return r(g)}}var Ft={partial:!0,tokenize:km};function km(e,t,r){return s;function s(i){return ue(i)?le(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||ie(i)?t(i):r(i)}}var Li={continuation:{tokenize:Em},exit:Tm,name:"blockQuote",tokenize:Cm};function Cm(e,t,r){let s=this;return o;function o(n){if(n===62){let a=s.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(n),e.exit("blockQuoteMarker"),i}return r(n)}function i(n){return ue(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}function Em(e,t,r){let s=this;return o;function o(n){return ue(n)?le(e,i,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(n):i(n)}function i(n){return e.attempt(Li,t,r)(n)}}function Tm(e){e.exit("blockQuote")}var Oi={name:"characterEscape",tokenize:Pm};function Pm(e,t,r){return s;function s(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return qh(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}var Mi={name:"characterReference",tokenize:Dm};function Dm(e,t,r){let s=this,o=0,i,n;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),h}function h(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,n=Fe,c(f))}function l(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,n=Wh,c):(e.enter("characterReferenceValue"),i=7,n=Vs,c(f))}function c(f){if(f===59&&o){let v=e.exit("characterReferenceValue");return n===Fe&&!hs(s.sliceSerialize(v))?r(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return n(f)&&o++<i?(e.consume(f),c):r(f)}}var Yh={partial:!0,tokenize:Am},Fi={concrete:!0,name:"codeFenced",tokenize:Rm};function Rm(e,t,r){let s=this,o={partial:!0,tokenize:w},i=0,n=0,a;return h;function h(_){return l(_)}function l(_){let S=s.events[s.events.length-1];return i=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,a=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(_)}function c(_){return _===a?(n++,e.consume(_),c):n<3?r(_):(e.exit("codeFencedFenceSequence"),ue(_)?le(e,f,"whitespace")(_):f(_))}function f(_){return _===null||ie(_)?(e.exit("codeFencedFence"),s.interrupt?t(_):e.check(Yh,d,y)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===null||ie(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(_)):ue(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),le(e,g,"whitespace")(_)):_===96&&_===a?r(_):(e.consume(_),v)}function g(_){return _===null||ie(_)?f(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),u(_))}function u(_){return _===null||ie(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(_)):_===96&&_===a?r(_):(e.consume(_),u)}function d(_){return e.attempt(o,y,m)(_)}function m(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),p}function p(_){return i>0&&ue(_)?le(e,b,"linePrefix",i+1)(_):b(_)}function b(_){return _===null||ie(_)?e.check(Yh,d,y)(_):(e.enter("codeFlowValue"),x(_))}function x(_){return _===null||ie(_)?(e.exit("codeFlowValue"),b(_)):(e.consume(_),x)}function y(_){return e.exit("codeFenced"),t(_)}function w(_,S,T){let D=0;return P;function P(z){return _.enter("lineEnding"),_.consume(z),_.exit("lineEnding"),A}function A(z){return _.enter("codeFencedFence"),ue(z)?le(_,F,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):F(z)}function F(z){return z===a?(_.enter("codeFencedFenceSequence"),B(z)):T(z)}function B(z){return z===a?(D++,_.consume(z),B):D>=n?(_.exit("codeFencedFenceSequence"),ue(z)?le(_,$,"whitespace")(z):$(z)):T(z)}function $(z){return z===null||ie(z)?(_.exit("codeFencedFence"),S(z)):T(z)}}}function Am(e,t,r){let s=this;return o;function o(n){return n===null?r(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i)}function i(n){return s.parser.lazy[s.now().line]?r(n):t(n)}}var Ws={name:"codeIndented",tokenize:Lm},Im={partial:!0,tokenize:Om};function Lm(e,t,r){let s=this;return o;function o(l){return e.enter("codeIndented"),le(e,i,"linePrefix",5)(l)}function i(l){let c=s.events[s.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?n(l):r(l)}function n(l){return l===null?h(l):ie(l)?e.attempt(Im,n,h)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||ie(l)?(e.exit("codeFlowValue"),n(l)):(e.consume(l),a)}function h(l){return e.exit("codeIndented"),t(l)}}function Om(e,t,r){let s=this;return o;function o(n){return s.parser.lazy[s.now().line]?r(n):ie(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),o):le(e,i,"linePrefix",5)(n)}function i(n){let a=s.events[s.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(n):ie(n)?o(n):r(n)}}var ho={name:"codeText",previous:Fm,resolve:Mm,tokenize:Bm};function Mm(e){let t=e.length-4,r=3,s,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=r;++s<t;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(s=r-1,t++;++s<=t;)o===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(o=s):(s===t||e[s][1].type==="lineEnding")&&(e[o][1].type="codeTextData",s!==o+2&&(e[o][1].end=e[s-1][1].end,e.splice(o+2,s-o-2),t-=s-o-2,s=o+2),o=void 0);return e}function Fm(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Bm(e,t,r){let s=this,o=0,i,n;return a;function a(v){return e.enter("codeText"),e.enter("codeTextSequence"),h(v)}function h(v){return v===96?(e.consume(v),o++,h):(e.exit("codeTextSequence"),l(v))}function l(v){return v===null?r(v):v===32?(e.enter("space"),e.consume(v),e.exit("space"),l):v===96?(n=e.enter("codeTextSequence"),i=0,f(v)):ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(v))}function c(v){return v===null||v===32||v===96||ie(v)?(e.exit("codeTextData"),l(v)):(e.consume(v),c)}function f(v){return v===96?(e.consume(v),i++,f):i===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(v)):(n.type="codeTextData",c(v))}}var Bi=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){let s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,r,s){let o=r||0;this.setCursor(Math.trunc(t));let i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return s&&qs(this.left,s),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),qs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qs(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let r=this.left.splice(t,Number.POSITIVE_INFINITY);qs(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qs(this.left,r.reverse())}}};function qs(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function Ni(e){let t={},r=-1,s,o,i,n,a,h,l,c=new Bi(e);for(;++r<c.length;){for(;r in t;)r=t[r];if(s=c.get(r),r&&s[1].type==="chunkFlow"&&c.get(r-1)[1].type==="listItemPrefix"&&(h=s[1]._tokenizer.events,i=0,i<h.length&&h[i][1].type==="lineEndingBlank"&&(i+=2),i<h.length&&h[i][1].type==="content"))for(;++i<h.length&&h[i][1].type!=="content";)h[i][1].type==="chunkText"&&(h[i][1]._isInFirstContentOfListItem=!0,i++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,Nm(c,r)),r=t[r],l=!0);else if(s[1]._container){for(i=r,o=void 0;i--;)if(n=c.get(i),n[1].type==="lineEnding"||n[1].type==="lineEndingBlank")n[0]==="enter"&&(o&&(c.get(o)[1].type="lineEndingBlank"),n[1].type="lineEnding",o=i);else if(!(n[1].type==="linePrefix"||n[1].type==="listItemIndent"))break;o&&(s[1].end={...c.get(o)[1].start},a=c.slice(o,r),a.unshift(s),c.splice(o,r-o+1,a))}}return He(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Nm(e,t){let r=e.get(t)[1],s=e.get(t)[2],o=t-1,i=[],n=r._tokenizer;n||(n=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(n._contentTypeTextTrailing=!0));let a=n.events,h=[],l={},c,f,v=-1,g=r,u=0,d=0,m=[d];for(;g;){for(;e.get(++o)[1]!==g;);i.push(o),g._tokenizer||(c=s.sliceStream(g),g.next||c.push(null),f&&n.defineSkip(g.start),g._isInFirstContentOfListItem&&(n._gfmTasklistFirstContentOfListItem=!0),n.write(c),g._isInFirstContentOfListItem&&(n._gfmTasklistFirstContentOfListItem=void 0)),f=g,g=g.next}for(g=r;++v<a.length;)a[v][0]==="exit"&&a[v-1][0]==="enter"&&a[v][1].type===a[v-1][1].type&&a[v][1].start.line!==a[v][1].end.line&&(d=v+1,m.push(d),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(n.events=[],g?(g._tokenizer=void 0,g.previous=void 0):m.pop(),v=m.length;v--;){let p=a.slice(m[v],m[v+1]),b=i.pop();h.push([b,b+p.length-1]),e.splice(b,2,p)}for(h.reverse(),v=-1;++v<h.length;)l[u+h[v][0]]=u+h[v][1],u+=h[v][1]-h[v][0]-1;return l}var co={resolve:Hm,tokenize:Um},zm={partial:!0,tokenize:$m};function Hm(e){return Ni(e),e}function Um(e,t){let r;return s;function s(a){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):ie(a)?e.check(zm,n,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function n(a){return e.consume(a),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function $m(e,t,r){let s=this;return o;function o(n){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),le(e,i,"linePrefix")}function i(n){if(n===null||ie(n))return r(n);let a=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(n):e.interrupt(s.parser.constructs.flow,r,t)(n)}}function zi(e,t,r,s,o,i,n,a,h){let l=h||Number.POSITIVE_INFINITY,c=0;return f;function f(p){return p===60?(e.enter(s),e.enter(o),e.enter(i),e.consume(p),e.exit(i),v):p===null||p===32||p===41||Fr(p)?r(p):(e.enter(s),e.enter(n),e.enter(a),e.enter("chunkString",{contentType:"string"}),d(p))}function v(p){return p===62?(e.enter(i),e.consume(p),e.exit(i),e.exit(o),e.exit(s),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),g(p))}function g(p){return p===62?(e.exit("chunkString"),e.exit(a),v(p)):p===null||p===60||ie(p)?r(p):(e.consume(p),p===92?u:g)}function u(p){return p===60||p===62||p===92?(e.consume(p),g):g(p)}function d(p){return!c&&(p===null||p===41||_e(p))?(e.exit("chunkString"),e.exit(a),e.exit(n),e.exit(s),t(p)):c<l&&p===40?(e.consume(p),c++,d):p===41?(e.consume(p),c--,d):p===null||p===32||p===40||Fr(p)?r(p):(e.consume(p),p===92?m:d)}function m(p){return p===40||p===41||p===92?(e.consume(p),d):d(p)}}function Hi(e,t,r,s,o,i){let n=this,a=0,h;return l;function l(g){return e.enter(s),e.enter(o),e.consume(g),e.exit(o),e.enter(i),c}function c(g){return a>999||g===null||g===91||g===93&&!h||g===94&&!a&&"_hiddenFootnoteSupport"in n.parser.constructs?r(g):g===93?(e.exit(i),e.enter(o),e.consume(g),e.exit(o),e.exit(s),t):ie(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||ie(g)||a++>999?(e.exit("chunkString"),c(g)):(e.consume(g),h||(h=!ue(g)),g===92?v:f)}function v(g){return g===91||g===92||g===93?(e.consume(g),a++,f):f(g)}}function Ui(e,t,r,s,o,i){let n;return a;function a(v){return v===34||v===39||v===40?(e.enter(s),e.enter(o),e.consume(v),e.exit(o),n=v===40?41:v,h):r(v)}function h(v){return v===n?(e.enter(o),e.consume(v),e.exit(o),e.exit(s),t):(e.enter(i),l(v))}function l(v){return v===n?(e.exit(i),h(n)):v===null?r(v):ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),le(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(v))}function c(v){return v===n||v===null||ie(v)?(e.exit("chunkString"),l(v)):(e.consume(v),v===92?f:c)}function f(v){return v===n||v===92?(e.consume(v),c):c(v)}}function Nr(e,t){let r;return s;function s(o){return ie(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,s):ue(o)?le(e,s,r?"linePrefix":"lineSuffix")(o):t(o)}}var uo={name:"definition",tokenize:jm},Vm={partial:!0,tokenize:Wm};function jm(e,t,r){let s=this,o;return i;function i(g){return e.enter("definition"),n(g)}function n(g){return Hi.call(s,e,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function a(g){return o=Ye(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),h):r(g)}function h(g){return _e(g)?Nr(e,l)(g):l(g)}function l(g){return zi(e,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function c(g){return e.attempt(Vm,f,f)(g)}function f(g){return ue(g)?le(e,v,"whitespace")(g):v(g)}function v(g){return g===null||ie(g)?(e.exit("definition"),s.parser.defined.push(o),t(g)):r(g)}}function Wm(e,t,r){return s;function s(a){return _e(a)?Nr(e,o)(a):r(a)}function o(a){return Ui(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return ue(a)?le(e,n,"whitespace")(a):n(a)}function n(a){return a===null||ie(a)?t(a):r(a)}}var po={name:"hardBreakEscape",tokenize:qm};function qm(e,t,r){return s;function s(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return ie(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}var fo={name:"headingAtx",resolve:Km,tokenize:Gm};function Km(e,t){let r=e.length-2,s=3,o,i;return e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(o={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},i={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"},He(e,s,r-s+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function Gm(e,t,r){let s=0;return o;function o(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),n(c)}function n(c){return c===35&&s++<6?(e.consume(c),n):c===null||_e(c)?(e.exit("atxHeadingSequence"),a(c)):r(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),h(c)):c===null||ie(c)?(e.exit("atxHeading"),t(c)):ue(c)?le(e,a,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function h(c){return c===35?(e.consume(c),h):(e.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||_e(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),l)}}var Qh=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],mo=["pre","script","style","textarea"];var go={concrete:!0,name:"htmlFlow",resolveTo:Ym,tokenize:Qm},Xm={partial:!0,tokenize:eg},Jm={partial:!0,tokenize:Zm};function Ym(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Qm(e,t,r){let s=this,o,i,n,a,h;return l;function l(O){return c(O)}function c(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),f}function f(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),i=!0,d):O===63?(e.consume(O),o=3,s.interrupt?t:k):je(O)?(e.consume(O),n=String.fromCharCode(O),m):r(O)}function v(O){return O===45?(e.consume(O),o=2,g):O===91?(e.consume(O),o=5,a=0,u):je(O)?(e.consume(O),o=4,s.interrupt?t:k):r(O)}function g(O){return O===45?(e.consume(O),s.interrupt?t:k):r(O)}function u(O){let te="CDATA[";return O===te.charCodeAt(a++)?(e.consume(O),a===te.length?s.interrupt?t:F:u):r(O)}function d(O){return je(O)?(e.consume(O),n=String.fromCharCode(O),m):r(O)}function m(O){if(O===null||O===47||O===62||_e(O)){let te=O===47,N=n.toLowerCase();return!te&&!i&&mo.includes(N)?(o=1,s.interrupt?t(O):F(O)):Qh.includes(n.toLowerCase())?(o=6,te?(e.consume(O),p):s.interrupt?t(O):F(O)):(o=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(O):i?b(O):x(O))}return O===45||Fe(O)?(e.consume(O),n+=String.fromCharCode(O),m):r(O)}function p(O){return O===62?(e.consume(O),s.interrupt?t:F):r(O)}function b(O){return ue(O)?(e.consume(O),b):P(O)}function x(O){return O===47?(e.consume(O),P):O===58||O===95||je(O)?(e.consume(O),y):ue(O)?(e.consume(O),x):P(O)}function y(O){return O===45||O===46||O===58||O===95||Fe(O)?(e.consume(O),y):w(O)}function w(O){return O===61?(e.consume(O),_):ue(O)?(e.consume(O),w):x(O)}function _(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),h=O,S):ue(O)?(e.consume(O),_):T(O)}function S(O){return O===h?(e.consume(O),h=null,D):O===null||ie(O)?r(O):(e.consume(O),S)}function T(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||_e(O)?w(O):(e.consume(O),T)}function D(O){return O===47||O===62||ue(O)?x(O):r(O)}function P(O){return O===62?(e.consume(O),A):r(O)}function A(O){return O===null||ie(O)?F(O):ue(O)?(e.consume(O),A):r(O)}function F(O){return O===45&&o===2?(e.consume(O),H):O===60&&o===1?(e.consume(O),C):O===62&&o===4?(e.consume(O),U):O===63&&o===3?(e.consume(O),k):O===93&&o===5?(e.consume(O),L):ie(O)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Xm,X,B)(O)):O===null||ie(O)?(e.exit("htmlFlowData"),B(O)):(e.consume(O),F)}function B(O){return e.check(Jm,$,X)(O)}function $(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),z}function z(O){return O===null||ie(O)?B(O):(e.enter("htmlFlowData"),F(O))}function H(O){return O===45?(e.consume(O),k):F(O)}function C(O){return O===47?(e.consume(O),n="",R):F(O)}function R(O){if(O===62){let te=n.toLowerCase();return mo.includes(te)?(e.consume(O),U):F(O)}return je(O)&&n.length<8?(e.consume(O),n+=String.fromCharCode(O),R):F(O)}function L(O){return O===93?(e.consume(O),k):F(O)}function k(O){return O===62?(e.consume(O),U):O===45&&o===2?(e.consume(O),k):F(O)}function U(O){return O===null||ie(O)?(e.exit("htmlFlowData"),X(O)):(e.consume(O),U)}function X(O){return e.exit("htmlFlow"),t(O)}}function Zm(e,t,r){let s=this;return o;function o(n){return ie(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i):r(n)}function i(n){return s.parser.lazy[s.now().line]?r(n):t(n)}}function eg(e,t,r){return s;function s(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ft,t,r)}}var vo={name:"htmlText",tokenize:tg};function tg(e,t,r){let s=this,o,i,n;return a;function a(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),h}function h(k){return k===33?(e.consume(k),l):k===47?(e.consume(k),w):k===63?(e.consume(k),x):je(k)?(e.consume(k),T):r(k)}function l(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),i=0,u):je(k)?(e.consume(k),b):r(k)}function c(k){return k===45?(e.consume(k),g):r(k)}function f(k){return k===null?r(k):k===45?(e.consume(k),v):ie(k)?(n=f,C(k)):(e.consume(k),f)}function v(k){return k===45?(e.consume(k),g):f(k)}function g(k){return k===62?H(k):k===45?v(k):f(k)}function u(k){let U="CDATA[";return k===U.charCodeAt(i++)?(e.consume(k),i===U.length?d:u):r(k)}function d(k){return k===null?r(k):k===93?(e.consume(k),m):ie(k)?(n=d,C(k)):(e.consume(k),d)}function m(k){return k===93?(e.consume(k),p):d(k)}function p(k){return k===62?H(k):k===93?(e.consume(k),p):d(k)}function b(k){return k===null||k===62?H(k):ie(k)?(n=b,C(k)):(e.consume(k),b)}function x(k){return k===null?r(k):k===63?(e.consume(k),y):ie(k)?(n=x,C(k)):(e.consume(k),x)}function y(k){return k===62?H(k):x(k)}function w(k){return je(k)?(e.consume(k),_):r(k)}function _(k){return k===45||Fe(k)?(e.consume(k),_):S(k)}function S(k){return ie(k)?(n=S,C(k)):ue(k)?(e.consume(k),S):H(k)}function T(k){return k===45||Fe(k)?(e.consume(k),T):k===47||k===62||_e(k)?D(k):r(k)}function D(k){return k===47?(e.consume(k),H):k===58||k===95||je(k)?(e.consume(k),P):ie(k)?(n=D,C(k)):ue(k)?(e.consume(k),D):H(k)}function P(k){return k===45||k===46||k===58||k===95||Fe(k)?(e.consume(k),P):A(k)}function A(k){return k===61?(e.consume(k),F):ie(k)?(n=A,C(k)):ue(k)?(e.consume(k),A):D(k)}function F(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(e.consume(k),o=k,B):ie(k)?(n=F,C(k)):ue(k)?(e.consume(k),F):(e.consume(k),$)}function B(k){return k===o?(e.consume(k),o=void 0,z):k===null?r(k):ie(k)?(n=B,C(k)):(e.consume(k),B)}function $(k){return k===null||k===34||k===39||k===60||k===61||k===96?r(k):k===47||k===62||_e(k)?D(k):(e.consume(k),$)}function z(k){return k===47||k===62||_e(k)?D(k):r(k)}function H(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):r(k)}function C(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),R}function R(k){return ue(k)?le(e,L,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):L(k)}function L(k){return e.enter("htmlTextData"),n(k)}}var zr={name:"labelEnd",resolveAll:ng,resolveTo:og,tokenize:ag},rg={tokenize:lg},sg={tokenize:hg},ig={tokenize:cg};function ng(e){let t=-1,r=[];for(;++t<e.length;){let s=e[t][1];if(r.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){let o=s.type==="labelImage"?4:2;s.type="data",t+=o}}return e.length!==r.length&&He(e,0,e.length,r),e}function og(e,t){let r=e.length,s=0,o,i,n,a;for(;r--;)if(o=e[r][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(n){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=r,o.type!=="labelLink")){s=2;break}}else o.type==="labelEnd"&&(n=r);let h={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[i][1].start},end:{...e[n][1].end}},c={type:"labelText",start:{...e[i+s+2][1].end},end:{...e[n-2][1].start}};return a=[["enter",h,t],["enter",l,t]],a=rt(a,e.slice(i+1,i+s+3)),a=rt(a,[["enter",c,t]]),a=rt(a,dr(t.parser.constructs.insideSpan.null,e.slice(i+s+4,n-3),t)),a=rt(a,[["exit",c,t],e[n-2],e[n-1],["exit",l,t]]),a=rt(a,e.slice(n+1)),a=rt(a,[["exit",h,t]]),He(e,i,e.length,a),e}function ag(e,t,r){let s=this,o=s.events.length,i,n;for(;o--;)if((s.events[o][1].type==="labelImage"||s.events[o][1].type==="labelLink")&&!s.events[o][1]._balanced){i=s.events[o][1];break}return a;function a(v){return i?i._inactive?f(v):(n=s.parser.defined.includes(Ye(s.sliceSerialize({start:i.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):r(v)}function h(v){return v===40?e.attempt(rg,c,n?c:f)(v):v===91?e.attempt(sg,c,n?l:f)(v):n?c(v):f(v)}function l(v){return e.attempt(ig,c,f)(v)}function c(v){return t(v)}function f(v){return i._balanced=!0,r(v)}}function lg(e,t,r){return s;function s(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return _e(f)?Nr(e,i)(f):i(f)}function i(f){return f===41?c(f):zi(e,n,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function n(f){return _e(f)?Nr(e,h)(f):c(f)}function a(f){return r(f)}function h(f){return f===34||f===39||f===40?Ui(e,l,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return _e(f)?Nr(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):r(f)}}function hg(e,t,r){let s=this;return o;function o(a){return Hi.call(s,e,i,n,"reference","referenceMarker","referenceString")(a)}function i(a){return s.parser.defined.includes(Ye(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(a):r(a)}function n(a){return r(a)}}function cg(e,t,r){return s;function s(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}var bo={name:"labelStartImage",resolveAll:zr.resolveAll,tokenize:dg};function dg(e,t,r){let s=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),n):r(a)}function n(a){return a===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(a):t(a)}}var _o={name:"labelStartLink",resolveAll:zr.resolveAll,tokenize:ug};function ug(e,t,r){let s=this;return o;function o(n){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(n),e.exit("labelMarker"),e.exit("labelLink"),i}function i(n){return n===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(n):t(n)}}var Ks={name:"lineEnding",tokenize:pg};function pg(e,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),le(e,t,"linePrefix")}}var Hr={name:"thematicBreak",tokenize:fg};function fg(e,t,r){let s=0,o;return i;function i(l){return e.enter("thematicBreak"),n(l)}function n(l){return o=l,a(l)}function a(l){return l===o?(e.enter("thematicBreakSequence"),h(l)):s>=3&&(l===null||ie(l))?(e.exit("thematicBreak"),t(l)):r(l)}function h(l){return l===o?(e.consume(l),s++,h):(e.exit("thematicBreakSequence"),ue(l)?le(e,a,"whitespace")(l):a(l))}}var Qe={continuation:{tokenize:bg},exit:xg,name:"list",tokenize:vg},mg={partial:!0,tokenize:yg},gg={partial:!0,tokenize:_g};function vg(e,t,r){let s=this,o=s.events[s.events.length-1],i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,n=0;return a;function a(g){let u=s.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(u==="listUnordered"?!s.containerState.marker||g===s.containerState.marker:Vs(g)){if(s.containerState.type||(s.containerState.type=u,e.enter(u,{_container:!0})),u==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Hr,r,l)(g):l(g);if(!s.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(g)}return r(g)}function h(g){return Vs(g)&&++n<10?(e.consume(g),h):(!s.interrupt||n<2)&&(s.containerState.marker?g===s.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),l(g)):r(g)}function l(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||g,e.check(Ft,s.interrupt?r:c,e.attempt(mg,v,f))}function c(g){return s.containerState.initialBlankLine=!0,i++,v(g)}function f(g){return ue(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):r(g)}function v(g){return s.containerState.size=i+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function bg(e,t,r){let s=this;return s.containerState._closeFlow=void 0,e.check(Ft,o,i);function o(a){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,le(e,t,"listItemIndent",s.containerState.size+1)(a)}function i(a){return s.containerState.furtherBlankLines||!ue(a)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,n(a)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(gg,t,n)(a))}function n(a){return s.containerState._closeFlow=!0,s.interrupt=void 0,le(e,e.attempt(Qe,t,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function _g(e,t,r){let s=this;return le(e,o,"listItemIndent",s.containerState.size+1);function o(i){let n=s.events[s.events.length-1];return n&&n[1].type==="listItemIndent"&&n[2].sliceSerialize(n[1],!0).length===s.containerState.size?t(i):r(i)}}function xg(e){e.exit(this.containerState.type)}function yg(e,t,r){let s=this;return le(e,o,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){let n=s.events[s.events.length-1];return!ue(i)&&n&&n[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}var $i={name:"setextUnderline",resolveTo:wg,tokenize:Sg};function wg(e,t){let r=e.length,s,o,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){s=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!i&&e[r][1].type==="definition"&&(i=r);let n={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",n,t]),e.splice(i+1,0,["exit",e[s][1],t]),e[s][1].end={...e[i][1].end}):e[s][1]=n,e.push(["exit",n,t]),e}function Sg(e,t,r){let s=this,o;return i;function i(l){let c=s.events.length,f;for(;c--;)if(s.events[c][1].type!=="lineEnding"&&s.events[c][1].type!=="linePrefix"&&s.events[c][1].type!=="content"){f=s.events[c][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||f)?(e.enter("setextHeadingLine"),o=l,n(l)):r(l)}function n(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===o?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),ue(l)?le(e,h,"lineSuffix")(l):h(l))}function h(l){return l===null||ie(l)?(e.exit("setextHeadingLine"),t(l)):r(l)}}var Zh={tokenize:kg};function kg(e){let t=this,r=e.attempt(Ft,s,e.attempt(this.parser.constructs.flowInitial,o,le(e,e.attempt(this.parser.constructs.flow,o,e.attempt(co,o)),"linePrefix")));return r;function s(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var ec={resolveAll:ic()},tc=sc("string"),rc=sc("text");function sc(e){return{resolveAll:ic(e==="text"?Cg:void 0),tokenize:t};function t(r){let s=this,o=this.parser.constructs[e],i=r.attempt(o,n,a);return n;function n(c){return l(c)?i(c):a(c)}function a(c){if(c===null){r.consume(c);return}return r.enter("data"),r.consume(c),h}function h(c){return l(c)?(r.exit("data"),i(c)):(r.consume(c),h)}function l(c){if(c===null)return!0;let f=o[c],v=-1;if(f)for(;++v<f.length;){let g=f[v];if(!g.previous||g.previous.call(s,s.previous))return!0}return!1}}}function ic(e){return t;function t(r,s){let o=-1,i;for(;++o<=r.length;)i===void 0?r[o]&&r[o][1].type==="data"&&(i=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==i+2&&(r[i][1].end=r[o-1][1].end,r.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(r,s):r}}function Cg(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){let s=e[r-1][1],o=t.sliceStream(s),i=o.length,n=-1,a=0,h;for(;i--;){let l=o[i];if(typeof l=="string"){for(n=l.length;l.charCodeAt(n-1)===32;)a++,n--;if(n)break;n=-1}else if(l===-2)h=!0,a++;else if(l!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(a=0),a){let l={type:r===e.length||h||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?n:s.start._bufferIndex+n,_index:s.start._index+i,line:s.end.line,column:s.end.column-a,offset:s.end.offset-a},end:{...s.end}};s.end={...l.start},s.start.offset===s.end.offset?Object.assign(s,l):(e.splice(r,0,["enter",l,t],["exit",l,t]),r+=2)}r++}return e}var xo={};Hn(xo,{attentionMarkers:()=>Lg,contentInitial:()=>Tg,disable:()=>Og,document:()=>Eg,flow:()=>Dg,flowInitial:()=>Pg,insideSpan:()=>Ig,string:()=>Rg,text:()=>Ag});var Eg={42:Qe,43:Qe,45:Qe,48:Qe,49:Qe,50:Qe,51:Qe,52:Qe,53:Qe,54:Qe,55:Qe,56:Qe,57:Qe,62:Li},Tg={91:uo},Pg={[-2]:Ws,[-1]:Ws,32:Ws},Dg={35:fo,42:Hr,45:[$i,Hr],60:go,61:$i,95:Hr,96:Fi,126:Fi},Rg={38:Mi,92:Oi},Ag={[-5]:Ks,[-4]:Ks,[-3]:Ks,33:bo,38:Mi,42:js,60:[lo,vo],91:_o,92:[po,Oi],93:zr,95:js,96:ho},Ig={null:[js,ec]},Lg={null:[42,95]},Og={null:[]};function nc(e,t,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},o={},i=[],n=[],a=[],h=!0,l={attempt:D(S),check:D(T),consume:y,enter:w,exit:_,interrupt:D(T,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:u,sliceStream:d,write:g},f=t.tokenize.call(c,l),v;return t.resolveAll&&i.push(t),c;function g(B){return n=rt(n,B),b(),n[n.length-1]!==null?[]:(P(t,0),c.events=dr(i,c.events,c),c.events)}function u(B,$){return Fg(d(B),$)}function d(B){return Mg(n,B)}function m(){let{_bufferIndex:B,_index:$,line:z,column:H,offset:C}=s;return{_bufferIndex:B,_index:$,line:z,column:H,offset:C}}function p(B){o[B.line]=B.column,F()}function b(){let B;for(;s._index<n.length;){let $=n[s._index];if(typeof $=="string")for(B=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===B&&s._bufferIndex<$.length;)x($.charCodeAt(s._bufferIndex));else x($)}}function x(B){h=void 0,v=B,f=f(B)}function y(B){ie(B)?(s.line++,s.column=1,s.offset+=B===-3?2:1,F()):B!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===n[s._index].length&&(s._bufferIndex=-1,s._index++)),c.previous=B,h=!0}function w(B,$){let z=$||{};return z.type=B,z.start=m(),c.events.push(["enter",z,c]),a.push(z),z}function _(B){let $=a.pop();return $.end=m(),c.events.push(["exit",$,c]),$}function S(B,$){P(B,$.from)}function T(B,$){$.restore()}function D(B,$){return z;function z(H,C,R){let L,k,U,X;return Array.isArray(H)?te(H):"tokenize"in H?te([H]):O(H);function O(Y){return V;function V(Q){let W=Q!==null&&Y[Q],ae=Q!==null&&Y.null,me=[...Array.isArray(W)?W:W?[W]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return te(me)(Q)}}function te(Y){return L=Y,k=0,Y.length===0?R:N(Y[k])}function N(Y){return V;function V(Q){return X=A(),U=Y,Y.partial||(c.currentConstruct=Y),Y.name&&c.parser.constructs.disable.null.includes(Y.name)?J(Q):Y.tokenize.call($?Object.assign(Object.create(c),$):c,l,I,J)(Q)}}function I(Y){return h=!0,B(U,X),C}function J(Y){return h=!0,X.restore(),++k<L.length?N(L[k]):R}}}function P(B,$){B.resolveAll&&!i.includes(B)&&i.push(B),B.resolve&&He(c.events,$,c.events.length-$,B.resolve(c.events.slice($),c)),B.resolveTo&&(c.events=B.resolveTo(c.events,c))}function A(){let B=m(),$=c.previous,z=c.currentConstruct,H=c.events.length,C=Array.from(a);return{from:H,restore:R};function R(){s=B,c.previous=$,c.currentConstruct=z,c.events.length=H,a=C,F()}}function F(){s.line in o&&s.column<2&&(s.column=o[s.line],s.offset+=o[s.line]-1)}}function Mg(e,t){let r=t.start._index,s=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex,n;if(r===o)n=[e[r].slice(s,i)];else{if(n=e.slice(r,o),s>-1){let a=n[0];typeof a=="string"?n[0]=a.slice(s):n.shift()}i>0&&n.push(e[o].slice(0,i))}return n}function Fg(e,t){let r=-1,s=[],o;for(;++r<e.length;){let i=e[r],n;if(typeof i=="string")n=i;else switch(i){case-5:{n="\r";break}case-4:{n=`
|
|
9
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(_){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),d.isLinux&&_&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(_){let w=this._getMouseBufferCoords(_),C=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!!(C&&P&&w)&&this._areCoordsInSelection(w,C,P)}isCellInSelection(_,w){let C=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!C||!P)&&this._areCoordsInSelection([_,w],C,P)}_areCoordsInSelection(_,w,C){return _[1]>w[1]&&_[1]<C[1]||w[1]===C[1]&&_[1]===w[1]&&_[0]>=w[0]&&_[0]<C[0]||w[1]<C[1]&&_[1]===C[1]&&_[0]<C[0]||w[1]<C[1]&&_[1]===w[1]&&_[0]>=w[0]}_selectWordAtCursor(_,w){let C=this._linkifier.currentLink?.link?.range;if(C)return this._model.selectionStart=[C.start.x-1,C.start.y-1],this._model.selectionStartLength=(0,m.getRangeLength)(C,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let P=this._getMouseBufferCoords(_);return!!P&&(this._selectWordAt(P,w),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(_,w){this._model.clearSelection(),_=Math.max(_,0),w=Math.min(w,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,_],this._model.selectionEnd=[this._bufferService.cols,w],this.refresh(),this._onSelectionChange.fire()}_handleTrim(_){this._model.handleTrim(_)&&this.refresh()}_getMouseBufferCoords(_){let w=this._mouseService.getCoords(_,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(w)return w[0]--,w[1]--,w[1]+=this._bufferService.buffer.ydisp,w}_getMouseEventScrollAmount(_){let w=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,_,this._screenElement)[1],C=this._renderService.dimensions.css.canvas.height;return w>=0&&w<=C?0:(w>C&&(w-=C),w=Math.min(Math.max(w,-50),50),w/=50,w/Math.abs(w)+Math.round(14*w))}shouldForceSelection(_){return d.isMac?_.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:_.shiftKey}handleMouseDown(_){if(this._mouseDownTimeStamp=_.timeStamp,(_.button!==2||!this.hasSelection)&&_.button===0){if(!this._enabled){if(!this.shouldForceSelection(_))return;_.stopPropagation()}_.preventDefault(),this._dragScrollAmount=0,this._enabled&&_.shiftKey?this._handleIncrementalClick(_):_.detail===1?this._handleSingleClick(_):_.detail===2?this._handleDoubleClick(_):_.detail===3&&this._handleTripleClick(_),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(_){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(_))}_handleSingleClick(_){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(_)?3:0,this._model.selectionStart=this._getMouseBufferCoords(_),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let w=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);w&&w.length!==this._model.selectionStart[0]&&w.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(_){this._selectWordAtCursor(_,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(_){let w=this._getMouseBufferCoords(_);w&&(this._activeSelectionMode=2,this._selectLineAt(w[1]))}shouldColumnSelect(_){return _.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(_){if(_.stopImmediatePropagation(),!this._model.selectionStart)return;let w=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(_),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(_),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let C=this._bufferService.buffer;if(this._model.selectionEnd[1]<C.lines.length){let P=C.lines.get(this._model.selectionEnd[1]);P&&P.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}w&&w[0]===this._model.selectionEnd[0]&&w[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let _=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(_.ydisp+this._bufferService.rows,_.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=_.ydisp),this.refresh()}}_handleMouseUp(_){let w=_.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&w<500&&_.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let C=this._mouseService.getCoords(_,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){let P=(0,c.moveToCellSequence)(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let _=this._model.finalSelectionStart,w=this._model.finalSelectionEnd,C=!(!_||!w||_[0]===w[0]&&_[1]===w[1]);C?_&&w&&(this._oldSelectionStart&&this._oldSelectionEnd&&_[0]===this._oldSelectionStart[0]&&_[1]===this._oldSelectionStart[1]&&w[0]===this._oldSelectionEnd[0]&&w[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(_,w,C)):this._oldHasSelection&&this._fireOnSelectionChange(_,w,C)}_fireOnSelectionChange(_,w,C){this._oldSelectionStart=_,this._oldSelectionEnd=w,this._oldHasSelection=C,this._onSelectionChange.fire()}_handleBufferActivate(_){this.clearSelection(),this._trimListener.dispose(),this._trimListener=_.activeBuffer.lines.onTrim((w=>this._handleTrim(w)))}_convertViewportColToCharacterIndex(_,w){let C=w;for(let P=0;w>=P;P++){let T=_.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:T>1&&w!==P&&(C+=T-1)}return C}setSelection(_,w,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[_,w],this._model.selectionStartLength=C,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(_){this._isClickInSelection(_)||(this._selectWordAtCursor(_,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(_,w,C=!0,P=!0){if(_[0]>=this._bufferService.cols)return;let T=this._bufferService.buffer,A=T.lines.get(_[1]);if(!A)return;let F=T.translateBufferLineToString(_[1],!1),B=this._convertViewportColToCharacterIndex(A,_[0]),U=B,N=_[0]-B,H=0,E=0,R=0,L=0;if(F.charAt(B)===" "){for(;B>0&&F.charAt(B-1)===" ";)B--;for(;U<F.length&&F.charAt(U+1)===" ";)U++}else{let X=_[0],O=_[0];A.getWidth(X)===0&&(H++,X--),A.getWidth(O)===2&&(E++,O++);let se=A.getString(O).length;for(se>1&&(L+=se-1,U+=se-1);X>0&&B>0&&!this._isCharWordSeparator(A.loadCell(X-1,this._workCell));){A.loadCell(X-1,this._workCell);let z=this._workCell.getChars().length;this._workCell.getWidth()===0?(H++,X--):z>1&&(R+=z-1,B-=z-1),B--,X--}for(;O<A.length&&U+1<F.length&&!this._isCharWordSeparator(A.loadCell(O+1,this._workCell));){A.loadCell(O+1,this._workCell);let z=this._workCell.getChars().length;this._workCell.getWidth()===2?(E++,O++):z>1&&(L+=z-1,U+=z-1),U++,O++}}U++;let k=B+N-H+R,$=Math.min(this._bufferService.cols,U-B+H+E-R-L);if(w||F.slice(B,U).trim()!==""){if(C&&k===0&&A.getCodePoint(0)!==32){let X=T.lines.get(_[1]-1);if(X&&A.isWrapped&&X.getCodePoint(this._bufferService.cols-1)!==32){let O=this._getWordAt([this._bufferService.cols-1,_[1]-1],!1,!0,!1);if(O){let se=this._bufferService.cols-O.start;k-=se,$+=se}}}if(P&&k+$===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){let X=T.lines.get(_[1]+1);if(X?.isWrapped&&X.getCodePoint(0)!==32){let O=this._getWordAt([0,_[1]+1],!1,!1,!0);O&&($+=O.length)}}return{start:k,length:$}}}_selectWordAt(_,w){let C=this._getWordAt(_,w);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,_[1]--;this._model.selectionStart=[C.start,_[1]],this._model.selectionStartLength=C.length}}_selectToWordAt(_){let w=this._getWordAt(_,!0);if(w){let C=_[1];for(;w.start<0;)w.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;w.start+w.length>this._bufferService.cols;)w.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?w.start:w.start+w.length,C]}}_isCharWordSeparator(_){return _.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(_.getChars())>=0}_selectLineAt(_){let w=this._bufferService.buffer.getWrappedRangeForLine(_),C={start:{x:0,y:w.first},end:{x:this._bufferService.cols-1,y:w.last}};this._model.selectionStart=[0,w.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,m.getRangeLength)(C,this._bufferService.cols)}};i.SelectionService=S=a([h(3,b.IBufferService),h(4,b.ICoreService),h(5,v.IMouseService),h(6,b.IOptionsService),h(7,v.IRenderService),h(8,v.ICoreBrowserService)],S)},4725:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;let a=n(8343);i.ICharSizeService=(0,a.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,a.createDecorator)("CoreBrowserService"),i.IMouseService=(0,a.createDecorator)("MouseService"),i.IRenderService=(0,a.createDecorator)("RenderService"),i.ISelectionService=(0,a.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,a.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,a.createDecorator)("ThemeService"),i.ILinkProviderService=(0,a.createDecorator)("LinkProviderService")},6731:function(o,i,n){var a=this&&this.__decorate||function(S,_,w,C){var P,T=arguments.length,A=T<3?_:C===null?C=Object.getOwnPropertyDescriptor(_,w):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,_,w,C);else for(var F=S.length-1;F>=0;F--)(P=S[F])&&(A=(T<3?P(A):T>3?P(_,w,A):P(_,w))||A);return T>3&&A&&Object.defineProperty(_,w,A),A},h=this&&this.__param||function(S,_){return function(w,C){_(w,C,S)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;let l=n(7239),c=n(8055),f=n(8460),v=n(844),g=n(2585),u=c.css.toColor("#ffffff"),d=c.css.toColor("#000000"),m=c.css.toColor("#ffffff"),p=c.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{let S=[c.css.toColor("#2e3436"),c.css.toColor("#cc0000"),c.css.toColor("#4e9a06"),c.css.toColor("#c4a000"),c.css.toColor("#3465a4"),c.css.toColor("#75507b"),c.css.toColor("#06989a"),c.css.toColor("#d3d7cf"),c.css.toColor("#555753"),c.css.toColor("#ef2929"),c.css.toColor("#8ae234"),c.css.toColor("#fce94f"),c.css.toColor("#729fcf"),c.css.toColor("#ad7fa8"),c.css.toColor("#34e2e2"),c.css.toColor("#eeeeec")],_=[0,95,135,175,215,255];for(let w=0;w<216;w++){let C=_[w/36%6|0],P=_[w/6%6|0],T=_[w%6];S.push({css:c.channels.toCss(C,P,T),rgba:c.channels.toRgba(C,P,T)})}for(let w=0;w<24;w++){let C=8+10*w;S.push({css:c.channels.toCss(C,C,C),rgba:c.channels.toRgba(C,C,C)})}return S})());let x=i.ThemeService=class extends v.Disposable{get colors(){return this._colors}constructor(S){super(),this._optionsService=S,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new f.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:d,cursor:m,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:c.color.blend(d,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:c.color.blend(d,b),ansi:i.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(S={}){let _=this._colors;if(_.foreground=y(S.foreground,u),_.background=y(S.background,d),_.cursor=y(S.cursor,m),_.cursorAccent=y(S.cursorAccent,p),_.selectionBackgroundTransparent=y(S.selectionBackground,b),_.selectionBackgroundOpaque=c.color.blend(_.background,_.selectionBackgroundTransparent),_.selectionInactiveBackgroundTransparent=y(S.selectionInactiveBackground,_.selectionBackgroundTransparent),_.selectionInactiveBackgroundOpaque=c.color.blend(_.background,_.selectionInactiveBackgroundTransparent),_.selectionForeground=S.selectionForeground?y(S.selectionForeground,c.NULL_COLOR):void 0,_.selectionForeground===c.NULL_COLOR&&(_.selectionForeground=void 0),c.color.isOpaque(_.selectionBackgroundTransparent)&&(_.selectionBackgroundTransparent=c.color.opacity(_.selectionBackgroundTransparent,.3)),c.color.isOpaque(_.selectionInactiveBackgroundTransparent)&&(_.selectionInactiveBackgroundTransparent=c.color.opacity(_.selectionInactiveBackgroundTransparent,.3)),_.ansi=i.DEFAULT_ANSI_COLORS.slice(),_.ansi[0]=y(S.black,i.DEFAULT_ANSI_COLORS[0]),_.ansi[1]=y(S.red,i.DEFAULT_ANSI_COLORS[1]),_.ansi[2]=y(S.green,i.DEFAULT_ANSI_COLORS[2]),_.ansi[3]=y(S.yellow,i.DEFAULT_ANSI_COLORS[3]),_.ansi[4]=y(S.blue,i.DEFAULT_ANSI_COLORS[4]),_.ansi[5]=y(S.magenta,i.DEFAULT_ANSI_COLORS[5]),_.ansi[6]=y(S.cyan,i.DEFAULT_ANSI_COLORS[6]),_.ansi[7]=y(S.white,i.DEFAULT_ANSI_COLORS[7]),_.ansi[8]=y(S.brightBlack,i.DEFAULT_ANSI_COLORS[8]),_.ansi[9]=y(S.brightRed,i.DEFAULT_ANSI_COLORS[9]),_.ansi[10]=y(S.brightGreen,i.DEFAULT_ANSI_COLORS[10]),_.ansi[11]=y(S.brightYellow,i.DEFAULT_ANSI_COLORS[11]),_.ansi[12]=y(S.brightBlue,i.DEFAULT_ANSI_COLORS[12]),_.ansi[13]=y(S.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),_.ansi[14]=y(S.brightCyan,i.DEFAULT_ANSI_COLORS[14]),_.ansi[15]=y(S.brightWhite,i.DEFAULT_ANSI_COLORS[15]),S.extendedAnsi){let w=Math.min(_.ansi.length-16,S.extendedAnsi.length);for(let C=0;C<w;C++)_.ansi[C+16]=y(S.extendedAnsi[C],i.DEFAULT_ANSI_COLORS[C+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(S){this._restoreColor(S),this._onChangeColors.fire(this.colors)}_restoreColor(S){if(S!==void 0)switch(S){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[S]=this._restoreColors.ansi[S]}else for(let _=0;_<this._restoreColors.ansi.length;++_)this._colors.ansi[_]=this._restoreColors.ansi[_]}modifyColors(S){S(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function y(S,_){if(S!==void 0)try{return c.css.toColor(S)}catch{}return _}i.ThemeService=x=a([h(0,g.IOptionsService)],x)},6349:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;let a=n(8460),h=n(844);class l extends h.Disposable{constructor(f){super(),this._maxLength=f,this.onDeleteEmitter=this.register(new a.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new a.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new a.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(f){if(this._maxLength===f)return;let v=new Array(f);for(let g=0;g<Math.min(f,this.length);g++)v[g]=this._array[this._getCyclicIndex(g)];this._array=v,this._maxLength=f,this._startIndex=0}get length(){return this._length}set length(f){if(f>this._length)for(let v=this._length;v<f;v++)this._array[v]=void 0;this._length=f}get(f){return this._array[this._getCyclicIndex(f)]}set(f,v){this._array[this._getCyclicIndex(f)]=v}push(f){this._array[this._getCyclicIndex(this._length)]=f,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(f,v,...g){if(v){for(let u=f;u<this._length-v;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+v)];this._length-=v,this.onDeleteEmitter.fire({index:f,amount:v})}for(let u=this._length-1;u>=f;u--)this._array[this._getCyclicIndex(u+g.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<g.length;u++)this._array[this._getCyclicIndex(f+u)]=g[u];if(g.length&&this.onInsertEmitter.fire({index:f,amount:g.length}),this._length+g.length>this._maxLength){let u=this._length+g.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=g.length}trimStart(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)}shiftElements(f,v,g){if(!(v<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(let d=v-1;d>=0;d--)this.set(f+d+g,this.get(f+d));let u=f+v+g-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<v;u++)this.set(f+u+g,this.get(f+u))}}_getCyclicIndex(f){return(this._startIndex+f)%this._maxLength}}i.CircularList=l},1439:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function n(a,h=5){if(typeof a!="object")return a;let l=Array.isArray(a)?[]:{};for(let c in a)l[c]=h<=1?a[c]:a[c]&&n(a[c],h-1);return l}},8055:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let n=0,a=0,h=0,l=0;var c,f,v,g,u;function d(p){let b=p.toString(16);return b.length<2?"0"+b:b}function m(p,b){return p<b?(b+.05)/(p+.05):(p+.05)/(b+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(p){p.toCss=function(b,x,y,S){return S!==void 0?`#${d(b)}${d(x)}${d(y)}${d(S)}`:`#${d(b)}${d(x)}${d(y)}`},p.toRgba=function(b,x,y,S=255){return(b<<24|x<<16|y<<8|S)>>>0},p.toColor=function(b,x,y,S){return{css:p.toCss(b,x,y,S),rgba:p.toRgba(b,x,y,S)}}})(c||(i.channels=c={})),(function(p){function b(x,y){return l=Math.round(255*y),[n,a,h]=u.toChannels(x.rgba),{css:c.toCss(n,a,h,l),rgba:c.toRgba(n,a,h,l)}}p.blend=function(x,y){if(l=(255&y.rgba)/255,l===1)return{css:y.css,rgba:y.rgba};let S=y.rgba>>24&255,_=y.rgba>>16&255,w=y.rgba>>8&255,C=x.rgba>>24&255,P=x.rgba>>16&255,T=x.rgba>>8&255;return n=C+Math.round((S-C)*l),a=P+Math.round((_-P)*l),h=T+Math.round((w-T)*l),{css:c.toCss(n,a,h),rgba:c.toRgba(n,a,h)}},p.isOpaque=function(x){return(255&x.rgba)==255},p.ensureContrastRatio=function(x,y,S){let _=u.ensureContrastRatio(x.rgba,y.rgba,S);if(_)return c.toColor(_>>24&255,_>>16&255,_>>8&255)},p.opaque=function(x){let y=(255|x.rgba)>>>0;return[n,a,h]=u.toChannels(y),{css:c.toCss(n,a,h),rgba:y}},p.opacity=b,p.multiplyOpacity=function(x,y){return l=255&x.rgba,b(x,l*y/255)},p.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(f||(i.color=f={})),(function(p){let b,x;try{let y=document.createElement("canvas");y.width=1,y.height=1;let S=y.getContext("2d",{willReadFrequently:!0});S&&(b=S,b.globalCompositeOperation="copy",x=b.createLinearGradient(0,0,1,1))}catch{}p.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return n=parseInt(y.slice(1,2).repeat(2),16),a=parseInt(y.slice(2,3).repeat(2),16),h=parseInt(y.slice(3,4).repeat(2),16),c.toColor(n,a,h);case 5:return n=parseInt(y.slice(1,2).repeat(2),16),a=parseInt(y.slice(2,3).repeat(2),16),h=parseInt(y.slice(3,4).repeat(2),16),l=parseInt(y.slice(4,5).repeat(2),16),c.toColor(n,a,h,l);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}let S=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(S)return n=parseInt(S[1]),a=parseInt(S[2]),h=parseInt(S[3]),l=Math.round(255*(S[5]===void 0?1:parseFloat(S[5]))),c.toColor(n,a,h,l);if(!b||!x)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=x,b.fillStyle=y,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[n,a,h,l]=b.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:c.toRgba(n,a,h,l),css:y}}})(v||(i.css=v={})),(function(p){function b(x,y,S){let _=x/255,w=y/255,C=S/255;return .2126*(_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4))+.7152*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}p.relativeLuminance=function(x){return b(x>>16&255,x>>8&255,255&x)},p.relativeLuminance2=b})(g||(i.rgb=g={})),(function(p){function b(y,S,_){let w=y>>24&255,C=y>>16&255,P=y>>8&255,T=S>>24&255,A=S>>16&255,F=S>>8&255,B=m(g.relativeLuminance2(T,A,F),g.relativeLuminance2(w,C,P));for(;B<_&&(T>0||A>0||F>0);)T-=Math.max(0,Math.ceil(.1*T)),A-=Math.max(0,Math.ceil(.1*A)),F-=Math.max(0,Math.ceil(.1*F)),B=m(g.relativeLuminance2(T,A,F),g.relativeLuminance2(w,C,P));return(T<<24|A<<16|F<<8|255)>>>0}function x(y,S,_){let w=y>>24&255,C=y>>16&255,P=y>>8&255,T=S>>24&255,A=S>>16&255,F=S>>8&255,B=m(g.relativeLuminance2(T,A,F),g.relativeLuminance2(w,C,P));for(;B<_&&(T<255||A<255||F<255);)T=Math.min(255,T+Math.ceil(.1*(255-T))),A=Math.min(255,A+Math.ceil(.1*(255-A))),F=Math.min(255,F+Math.ceil(.1*(255-F))),B=m(g.relativeLuminance2(T,A,F),g.relativeLuminance2(w,C,P));return(T<<24|A<<16|F<<8|255)>>>0}p.blend=function(y,S){if(l=(255&S)/255,l===1)return S;let _=S>>24&255,w=S>>16&255,C=S>>8&255,P=y>>24&255,T=y>>16&255,A=y>>8&255;return n=P+Math.round((_-P)*l),a=T+Math.round((w-T)*l),h=A+Math.round((C-A)*l),c.toRgba(n,a,h)},p.ensureContrastRatio=function(y,S,_){let w=g.relativeLuminance(y>>8),C=g.relativeLuminance(S>>8);if(m(w,C)<_){if(C<w){let A=b(y,S,_),F=m(w,g.relativeLuminance(A>>8));if(F<_){let B=x(y,S,_);return F>m(w,g.relativeLuminance(B>>8))?A:B}return A}let P=x(y,S,_),T=m(w,g.relativeLuminance(P>>8));if(T<_){let A=b(y,S,_);return T>m(w,g.relativeLuminance(A>>8))?P:A}return P}},p.reduceLuminance=b,p.increaseLuminance=x,p.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}})(u||(i.rgba=u={})),i.toPaddedHex=d,i.contrastRatio=m},8969:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;let a=n(844),h=n(2585),l=n(4348),c=n(7866),f=n(744),v=n(7302),g=n(6975),u=n(8460),d=n(1753),m=n(1480),p=n(7994),b=n(9282),x=n(5435),y=n(5981),S=n(2660),_=!1;class w extends a.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event((P=>{this._onScrollApi?.fire(P.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(P){for(let T in P)this.optionsService.options[T]=P[T]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new a.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new v.OptionsService(P)),this._instantiationService.setService(h.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(f.BufferService)),this._instantiationService.setService(h.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(c.LogService)),this._instantiationService.setService(h.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(g.CoreService)),this._instantiationService.setService(h.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(d.CoreMouseService)),this._instantiationService.setService(h.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(m.UnicodeService)),this._instantiationService.setService(h.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(p.CharsetService),this._instantiationService.setService(h.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(S.OscLinkService),this._instantiationService.setService(h.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new x.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((T=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((T=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new y.WriteBuffer(((T,A)=>this._inputHandler.parse(T,A)))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,T){this._writeBuffer.write(P,T)}writeSync(P,T){this._logService.logLevel<=h.LogLevelEnum.WARN&&!_&&(this._logService.warn("writeSync is unreliable and will be removed soon."),_=!0),this._writeBuffer.writeSync(P,T)}input(P,T=!0){this.coreService.triggerDataEvent(P,T)}resize(P,T){isNaN(P)||isNaN(T)||(P=Math.max(P,f.MINIMUM_COLS),T=Math.max(T,f.MINIMUM_ROWS),this._bufferService.resize(P,T))}scroll(P,T=!1){this._bufferService.scroll(P,T)}scrollLines(P,T,A){this._bufferService.scrollLines(P,T,A)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){let T=P-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(P,T){return this._inputHandler.registerEscHandler(P,T)}registerDcsHandler(P,T){return this._inputHandler.registerDcsHandler(P,T)}registerCsiHandler(P,T){return this._inputHandler.registerCsiHandler(P,T)}registerOscHandler(P,T){return this._inputHandler.registerOscHandler(P,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1,T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?P=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let P=[];P.push(this.onLineFeed(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},(()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,a.toDisposable)((()=>{for(let T of P)T.dispose()}))}}}i.CoreTerminal=w},8460:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=n=>(this._listeners.push(n),{dispose:()=>{if(!this._disposed){for(let a=0;a<this._listeners.length;a++)if(this._listeners[a]===n)return void this._listeners.splice(a,1)}}})),this._event}fire(n,a){let h=[];for(let l=0;l<this._listeners.length;l++)h.push(this._listeners[l]);for(let l=0;l<h.length;l++)h[l].call(void 0,n,a)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(n,a){return n((h=>a.fire(h)))},i.runAndSubscribe=function(n,a){return a(void 0),n((h=>a(h)))}},5435:function(o,i,n){var a=this&&this.__decorate||function(H,E,R,L){var k,$=arguments.length,X=$<3?E:L===null?L=Object.getOwnPropertyDescriptor(E,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(H,E,R,L);else for(var O=H.length-1;O>=0;O--)(k=H[O])&&(X=($<3?k(X):$>3?k(E,R,X):k(E,R))||X);return $>3&&X&&Object.defineProperty(E,R,X),X},h=this&&this.__param||function(H,E){return function(R,L){E(R,L,H)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;let l=n(2584),c=n(7116),f=n(2015),v=n(844),g=n(482),u=n(8437),d=n(8460),m=n(643),p=n(511),b=n(3734),x=n(2585),y=n(1480),S=n(6242),_=n(6351),w=n(5941),C={"(":0,")":1,"*":2,"+":3,"-":1,".":2},P=131072;function T(H,E){if(H>24)return E.setWinLines||!1;switch(H){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var A;(function(H){H[H.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",H[H.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(i.WindowsOptionsReportType=A={}));let F=0;class B extends v.Disposable{getAttrData(){return this._curAttrData}constructor(E,R,L,k,$,X,O,se,z=new f.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=R,this._coreService=L,this._logService=k,this._optionsService=$,this._oscLinkService=X,this._coreMouseService=O,this._unicodeService=se,this._parser=z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new g.StringToUtf32,this._utf8Decoder=new g.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new d.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new d.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new d.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new d.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new d.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new d.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new d.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new d.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new d.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new d.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new d.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new U(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((I=>this._activeBuffer=I.activeBuffer))),this._parser.setCsiHandlerFallback(((I,J)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(I),params:J.toArray()})})),this._parser.setEscHandlerFallback((I=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(I)})})),this._parser.setExecuteHandlerFallback((I=>{this._logService.debug("Unknown EXECUTE code: ",{code:I})})),this._parser.setOscHandlerFallback(((I,J,Y)=>{this._logService.debug("Unknown OSC code: ",{identifier:I,action:J,data:Y})})),this._parser.setDcsHandlerFallback(((I,J,Y)=>{J==="HOOK"&&(Y=Y.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(I),action:J,payload:Y})})),this._parser.setPrintHandler(((I,J,Y)=>this.print(I,J,Y))),this._parser.registerCsiHandler({final:"@"},(I=>this.insertChars(I))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(I=>this.scrollLeft(I))),this._parser.registerCsiHandler({final:"A"},(I=>this.cursorUp(I))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(I=>this.scrollRight(I))),this._parser.registerCsiHandler({final:"B"},(I=>this.cursorDown(I))),this._parser.registerCsiHandler({final:"C"},(I=>this.cursorForward(I))),this._parser.registerCsiHandler({final:"D"},(I=>this.cursorBackward(I))),this._parser.registerCsiHandler({final:"E"},(I=>this.cursorNextLine(I))),this._parser.registerCsiHandler({final:"F"},(I=>this.cursorPrecedingLine(I))),this._parser.registerCsiHandler({final:"G"},(I=>this.cursorCharAbsolute(I))),this._parser.registerCsiHandler({final:"H"},(I=>this.cursorPosition(I))),this._parser.registerCsiHandler({final:"I"},(I=>this.cursorForwardTab(I))),this._parser.registerCsiHandler({final:"J"},(I=>this.eraseInDisplay(I,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(I=>this.eraseInDisplay(I,!0))),this._parser.registerCsiHandler({final:"K"},(I=>this.eraseInLine(I,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(I=>this.eraseInLine(I,!0))),this._parser.registerCsiHandler({final:"L"},(I=>this.insertLines(I))),this._parser.registerCsiHandler({final:"M"},(I=>this.deleteLines(I))),this._parser.registerCsiHandler({final:"P"},(I=>this.deleteChars(I))),this._parser.registerCsiHandler({final:"S"},(I=>this.scrollUp(I))),this._parser.registerCsiHandler({final:"T"},(I=>this.scrollDown(I))),this._parser.registerCsiHandler({final:"X"},(I=>this.eraseChars(I))),this._parser.registerCsiHandler({final:"Z"},(I=>this.cursorBackwardTab(I))),this._parser.registerCsiHandler({final:"`"},(I=>this.charPosAbsolute(I))),this._parser.registerCsiHandler({final:"a"},(I=>this.hPositionRelative(I))),this._parser.registerCsiHandler({final:"b"},(I=>this.repeatPrecedingCharacter(I))),this._parser.registerCsiHandler({final:"c"},(I=>this.sendDeviceAttributesPrimary(I))),this._parser.registerCsiHandler({prefix:">",final:"c"},(I=>this.sendDeviceAttributesSecondary(I))),this._parser.registerCsiHandler({final:"d"},(I=>this.linePosAbsolute(I))),this._parser.registerCsiHandler({final:"e"},(I=>this.vPositionRelative(I))),this._parser.registerCsiHandler({final:"f"},(I=>this.hVPosition(I))),this._parser.registerCsiHandler({final:"g"},(I=>this.tabClear(I))),this._parser.registerCsiHandler({final:"h"},(I=>this.setMode(I))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(I=>this.setModePrivate(I))),this._parser.registerCsiHandler({final:"l"},(I=>this.resetMode(I))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(I=>this.resetModePrivate(I))),this._parser.registerCsiHandler({final:"m"},(I=>this.charAttributes(I))),this._parser.registerCsiHandler({final:"n"},(I=>this.deviceStatus(I))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(I=>this.deviceStatusPrivate(I))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(I=>this.softReset(I))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(I=>this.setCursorStyle(I))),this._parser.registerCsiHandler({final:"r"},(I=>this.setScrollRegion(I))),this._parser.registerCsiHandler({final:"s"},(I=>this.saveCursor(I))),this._parser.registerCsiHandler({final:"t"},(I=>this.windowOptions(I))),this._parser.registerCsiHandler({final:"u"},(I=>this.restoreCursor(I))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(I=>this.insertColumns(I))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(I=>this.deleteColumns(I))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(I=>this.selectProtected(I))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(I=>this.requestMode(I,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(I=>this.requestMode(I,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new S.OscHandler((I=>(this.setTitle(I),this.setIconName(I),!0)))),this._parser.registerOscHandler(1,new S.OscHandler((I=>this.setIconName(I)))),this._parser.registerOscHandler(2,new S.OscHandler((I=>this.setTitle(I)))),this._parser.registerOscHandler(4,new S.OscHandler((I=>this.setOrReportIndexedColor(I)))),this._parser.registerOscHandler(8,new S.OscHandler((I=>this.setHyperlink(I)))),this._parser.registerOscHandler(10,new S.OscHandler((I=>this.setOrReportFgColor(I)))),this._parser.registerOscHandler(11,new S.OscHandler((I=>this.setOrReportBgColor(I)))),this._parser.registerOscHandler(12,new S.OscHandler((I=>this.setOrReportCursorColor(I)))),this._parser.registerOscHandler(104,new S.OscHandler((I=>this.restoreIndexedColor(I)))),this._parser.registerOscHandler(110,new S.OscHandler((I=>this.restoreFgColor(I)))),this._parser.registerOscHandler(111,new S.OscHandler((I=>this.restoreBgColor(I)))),this._parser.registerOscHandler(112,new S.OscHandler((I=>this.restoreCursorColor(I)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(let I in c.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:I},(()=>this.selectCharset("("+I))),this._parser.registerEscHandler({intermediates:")",final:I},(()=>this.selectCharset(")"+I))),this._parser.registerEscHandler({intermediates:"*",final:I},(()=>this.selectCharset("*"+I))),this._parser.registerEscHandler({intermediates:"+",final:I},(()=>this.selectCharset("+"+I))),this._parser.registerEscHandler({intermediates:"-",final:I},(()=>this.selectCharset("-"+I))),this._parser.registerEscHandler({intermediates:".",final:I},(()=>this.selectCharset("."+I))),this._parser.registerEscHandler({intermediates:"/",final:I},(()=>this.selectCharset("/"+I)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((I=>(this._logService.error("Parsing error: ",I),I))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new _.DcsHandler(((I,J)=>this.requestStatusString(I,J))))}_preserveStack(E,R,L,k){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=R,this._parseStack.decodedLength=L,this._parseStack.position=k}_logSlowResolvingAsync(E){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([E,new Promise(((R,L)=>setTimeout((()=>L("#SLOW_TIMEOUT")),5e3)))]).catch((R=>{if(R!=="#SLOW_TIMEOUT")throw R;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(E,R){let L,k=this._activeBuffer.x,$=this._activeBuffer.y,X=0,O=this._parseStack.paused;if(O){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,R))return this._logSlowResolvingAsync(L),L;k=this._parseStack.cursorStartX,$=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>P&&(X=this._parseStack.position+P)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,(I=>String.fromCharCode(I))).join("")}"`),typeof E=="string"?E.split("").map((I=>I.charCodeAt(0))):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<P&&(this._parseBuffer=new Uint32Array(Math.min(E.length,P))),O||this._dirtyRowTracker.clearRange(),E.length>P)for(let I=X;I<E.length;I+=P){let J=I+P<E.length?I+P:E.length,Y=typeof E=="string"?this._stringDecoder.decode(E.substring(I,J),this._parseBuffer):this._utf8Decoder.decode(E.subarray(I,J),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,Y))return this._preserveStack(k,$,Y,I),this._logSlowResolvingAsync(L),L}else if(!O){let I=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,I))return this._preserveStack(k,$,I,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===k&&this._activeBuffer.y===$||this._onCursorMove.fire();let se=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),z=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);z<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(z,this._bufferService.rows-1),Math.min(se,this._bufferService.rows-1))}print(E,R,L){let k,$,X=this._charsetService.charset,O=this._optionsService.rawOptions.screenReaderMode,se=this._bufferService.cols,z=this._coreService.decPrivateModes.wraparound,I=this._coreService.modes.insertMode,J=this._curAttrData,Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-R>0&&Y.getWidth(this._activeBuffer.x-1)===2&&Y.setCellFromCodepoint(this._activeBuffer.x-1,0,1,J);let V=this._parser.precedingJoinState;for(let Q=R;Q<L;++Q){if(k=E[Q],k<127&&X){let Re=X[String.fromCharCode(k)];Re&&(k=Re.charCodeAt(0))}let W=this._unicodeService.charProperties(k,V);$=y.UnicodeService.extractWidth(W);let ae=y.UnicodeService.extractShouldJoin(W),me=ae?y.UnicodeService.extractWidth(V):0;if(V=W,O&&this._onA11yChar.fire((0,g.stringFromCodePoint)(k)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+$-me>se){if(z){let Re=Y,re=this._activeBuffer.x-me;for(this._activeBuffer.x=me,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),me>0&&Y instanceof u.BufferLine&&Y.copyCellsFrom(Re,re,0,me,!1);re<se;)Re.setCellFromCodepoint(re++,0,1,J)}else if(this._activeBuffer.x=se-1,$===2)continue}if(ae&&this._activeBuffer.x){let Re=Y.getWidth(this._activeBuffer.x-1)?1:2;Y.addCodepointToCell(this._activeBuffer.x-Re,k,$);for(let re=$-me;--re>=0;)Y.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}else if(I&&(Y.insertCells(this._activeBuffer.x,$-me,this._activeBuffer.getNullCell(J)),Y.getWidth(se-1)===2&&Y.setCellFromCodepoint(se-1,m.NULL_CELL_CODE,m.NULL_CELL_WIDTH,J)),Y.setCellFromCodepoint(this._activeBuffer.x++,k,$,J),$>0)for(;--$;)Y.setCellFromCodepoint(this._activeBuffer.x++,0,0,J)}this._parser.precedingJoinState=V,this._activeBuffer.x<se&&L-R>0&&Y.getWidth(this._activeBuffer.x)===0&&!Y.hasContent(this._activeBuffer.x)&&Y.setCellFromCodepoint(this._activeBuffer.x,0,1,J),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,R){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,R):this._parser.registerCsiHandler(E,(L=>!T(L.params[0],this._optionsService.rawOptions.windowOptions)||R(L)))}registerDcsHandler(E,R){return this._parser.registerDcsHandler(E,new _.DcsHandler(R))}registerEscHandler(E,R){return this._parser.registerEscHandler(E,R)}registerOscHandler(E,R){return this._parser.registerOscHandler(E,new S.OscHandler(R))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);E.hasWidth(this._activeBuffer.x)&&!E.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let E=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-E),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(E=this._bufferService.cols-1){this._activeBuffer.x=Math.min(E,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(E,R){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+R):(this._activeBuffer.x=E,this._activeBuffer.y=R),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,R){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+R)}cursorUp(E){let R=this._activeBuffer.y-this._activeBuffer.scrollTop;return R>=0?this._moveCursor(0,-Math.min(R,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){let R=this._activeBuffer.scrollBottom-this._activeBuffer.y;return R>=0?this._moveCursor(0,Math.min(R,E.params[0]||1)):this._moveCursor(0,E.params[0]||1),!0}cursorForward(E){return this._moveCursor(E.params[0]||1,0),!0}cursorBackward(E){return this._moveCursor(-(E.params[0]||1),0),!0}cursorNextLine(E){return this.cursorDown(E),this._activeBuffer.x=0,!0}cursorPrecedingLine(E){return this.cursorUp(E),this._activeBuffer.x=0,!0}cursorCharAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(E){return this._setCursor(E.length>=2?(E.params[1]||1)-1:0,(E.params[0]||1)-1),!0}charPosAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(E){return this._moveCursor(E.params[0]||1,0),!0}linePosAbsolute(E){return this._setCursor(this._activeBuffer.x,(E.params[0]||1)-1),!0}vPositionRelative(E){return this._moveCursor(0,E.params[0]||1),!0}hVPosition(E){return this.cursorPosition(E),!0}tabClear(E){let R=E.params[0];return R===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:R===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=E.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let R=E.params[0]||1;for(;R--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){let R=E.params[0];return R===1&&(this._curAttrData.bg|=536870912),R!==2&&R!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,R,L,k=!1,$=!1){let X=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);X.replaceCells(R,L,this._activeBuffer.getNullCell(this._eraseAttrData()),$),k&&(X.isWrapped=!1)}_resetBufferLine(E,R=!1){let L=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),R),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),L.isWrapped=!1)}eraseInDisplay(E,R=!1){let L;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);L<this._bufferService.rows;L++)this._resetBufferLine(L,R);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,R),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,R);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,R);this._dirtyRowTracker.markDirty(0);break;case 3:let k=this._activeBuffer.lines.length-this._bufferService.rows;k>0&&(this._activeBuffer.lines.trimStart(k),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-k,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-k,0),this._onScroll.fire(0))}return!0}eraseInLine(E,R=!1){switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,R);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,R);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,R)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(E){this._restrictCursor();let R=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let L=this._activeBuffer.ybase+this._activeBuffer.y,k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-k+1;for(;R--;)this._activeBuffer.lines.splice($-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(E){this._restrictCursor();let R=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let L=this._activeBuffer.ybase+this._activeBuffer.y,k;for(k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,k=this._bufferService.rows-1+this._activeBuffer.ybase-k;R--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(k,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(E){this._restrictCursor();let R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();let R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let R=E.params[0]||1;for(;R--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(E){let R=E.params[0]||1;for(;R--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let R=E.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.deleteCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let R=E.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.insertCells(0,R,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let R=E.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.insertCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let R=E.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){let k=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);k.deleteCells(this._activeBuffer.x,R,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();let R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return R&&(R.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(E.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(E){let R=this._parser.precedingJoinState;if(!R)return!0;let L=E.params[0]||1,k=y.UnicodeService.extractWidth(R),$=this._activeBuffer.x-k,X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString($),O=new Uint32Array(X.length*L),se=0;for(let I=0;I<X.length;){let J=X.codePointAt(I)||0;O[se++]=J,I+=J>65535?2:1}let z=se;for(let I=1;I<L;++I)O.copyWithin(z,0,se),z+=se;return this.print(O,0,z),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let R=0;R<E.length;R++)switch(E.params[R]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let R=0;R<E.length;R++)switch(E.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),this._charsetService.setgCharset(1,c.DEFAULT_CHARSET),this._charsetService.setgCharset(2,c.DEFAULT_CHARSET),this._charsetService.setgCharset(3,c.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(E){for(let R=0;R<E.length;R++)switch(E.params[R]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let R=0;R<E.length;R++)switch(E.params[R]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),E.params[R]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(E,R){let L=this._coreService.decPrivateModes,{activeProtocol:k,activeEncoding:$}=this._coreMouseService,X=this._coreService,{buffers:O,cols:se}=this._bufferService,{active:z,alt:I}=O,J=this._optionsService.rawOptions,Y=ae=>ae?1:2,V=E.params[0];return Q=V,W=R?V===2?4:V===4?Y(X.modes.insertMode):V===12?3:V===20?Y(J.convertEol):0:V===1?Y(L.applicationCursorKeys):V===3?J.windowOptions.setWinLines?se===80?2:se===132?1:0:0:V===6?Y(L.origin):V===7?Y(L.wraparound):V===8?3:V===9?Y(k==="X10"):V===12?Y(J.cursorBlink):V===25?Y(!X.isCursorHidden):V===45?Y(L.reverseWraparound):V===66?Y(L.applicationKeypad):V===67?4:V===1e3?Y(k==="VT200"):V===1002?Y(k==="DRAG"):V===1003?Y(k==="ANY"):V===1004?Y(L.sendFocus):V===1005?4:V===1006?Y($==="SGR"):V===1015?4:V===1016?Y($==="SGR_PIXELS"):V===1048?1:V===47||V===1047||V===1049?Y(z===I):V===2004?Y(L.bracketedPasteMode):0,X.triggerDataEvent(`${l.C0.ESC}[${R?"":"?"}${Q};${W}$y`),!0;var Q,W}_updateAttrColor(E,R,L,k,$){return R===2?(E|=50331648,E&=-16777216,E|=b.AttributeData.fromColorRGB([L,k,$])):R===5&&(E&=-50331904,E|=33554432|255&L),E}_extractColor(E,R,L){let k=[0,0,-1,0,0,0],$=0,X=0;do{if(k[X+$]=E.params[R+X],E.hasSubParams(R+X)){let O=E.getSubParams(R+X),se=0;do k[1]===5&&($=1),k[X+se+1+$]=O[se];while(++se<O.length&&se+X+1+$<k.length);break}if(k[1]===5&&X+$>=2||k[1]===2&&X+$>=5)break;k[1]&&($=1)}while(++X+R<E.length&&X+$<k.length);for(let O=2;O<k.length;++O)k[O]===-1&&(k[O]=0);switch(k[0]){case 38:L.fg=this._updateAttrColor(L.fg,k[1],k[3],k[4],k[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,k[1],k[3],k[4],k[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,k[1],k[3],k[4],k[5])}return X}_processUnderline(E,R){R.extended=R.extended.clone(),(!~E||E>5)&&(E=1),R.extended.underlineStyle=E,R.fg|=268435456,E===0&&(R.fg&=-268435457),R.updateExtended()}_processSGR0(E){E.fg=u.DEFAULT_ATTR_DATA.fg,E.bg=u.DEFAULT_ATTR_DATA.bg,E.extended=E.extended.clone(),E.extended.underlineStyle=0,E.extended.underlineColor&=-67108864,E.updateExtended()}charAttributes(E){if(E.length===1&&E.params[0]===0)return this._processSGR0(this._curAttrData),!0;let R=E.length,L,k=this._curAttrData;for(let $=0;$<R;$++)L=E.params[$],L>=30&&L<=37?(k.fg&=-50331904,k.fg|=16777216|L-30):L>=40&&L<=47?(k.bg&=-50331904,k.bg|=16777216|L-40):L>=90&&L<=97?(k.fg&=-50331904,k.fg|=16777224|L-90):L>=100&&L<=107?(k.bg&=-50331904,k.bg|=16777224|L-100):L===0?this._processSGR0(k):L===1?k.fg|=134217728:L===3?k.bg|=67108864:L===4?(k.fg|=268435456,this._processUnderline(E.hasSubParams($)?E.getSubParams($)[0]:1,k)):L===5?k.fg|=536870912:L===7?k.fg|=67108864:L===8?k.fg|=1073741824:L===9?k.fg|=2147483648:L===2?k.bg|=134217728:L===21?this._processUnderline(2,k):L===22?(k.fg&=-134217729,k.bg&=-134217729):L===23?k.bg&=-67108865:L===24?(k.fg&=-268435457,this._processUnderline(0,k)):L===25?k.fg&=-536870913:L===27?k.fg&=-67108865:L===28?k.fg&=-1073741825:L===29?k.fg&=2147483647:L===39?(k.fg&=-67108864,k.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):L===49?(k.bg&=-67108864,k.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?$+=this._extractColor(E,$,k):L===53?k.bg|=1073741824:L===55?k.bg&=-1073741825:L===59?(k.extended=k.extended.clone(),k.extended.underlineColor=-1,k.updateExtended()):L===100?(k.fg&=-67108864,k.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,k.bg&=-67108864,k.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:let R=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${R};${L}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){let R=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${R};${L}R`)}return!0}softReset(E){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(E){let R=E.params[0]||1;switch(R){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}let L=R%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(E){let R=E.params[0]||1,L;return(E.length<2||(L=E.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>R&&(this._activeBuffer.scrollTop=R-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(E){if(!T(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;let R=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:R!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:R!==0&&R!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),R!==0&&R!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:R!==0&&R!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),R!==0&&R!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(E){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(E){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(E){return this._windowTitle=E,this._onTitleChange.fire(E),!0}setIconName(E){return this._iconName=E,!0}setOrReportIndexedColor(E){let R=[],L=E.split(";");for(;L.length>1;){let k=L.shift(),$=L.shift();if(/^\d+$/.exec(k)){let X=parseInt(k);if(N(X))if($==="?")R.push({type:0,index:X});else{let O=(0,w.parseColor)($);O&&R.push({type:1,index:X,color:O})}}}return R.length&&this._onColor.fire(R),!0}setHyperlink(E){let R=E.split(";");return!(R.length<2)&&(R[1]?this._createHyperlink(R[0],R[1]):!R[0]&&this._finishHyperlink())}_createHyperlink(E,R){this._getCurrentLinkId()&&this._finishHyperlink();let L=E.split(":"),k,$=L.findIndex((X=>X.startsWith("id=")));return $!==-1&&(k=L[$].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:k,uri:R}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(E,R){let L=E.split(";");for(let k=0;k<L.length&&!(R>=this._specialColors.length);++k,++R)if(L[k]==="?")this._onColor.fire([{type:0,index:this._specialColors[R]}]);else{let $=(0,w.parseColor)(L[k]);$&&this._onColor.fire([{type:1,index:this._specialColors[R],color:$}])}return!0}setOrReportFgColor(E){return this._setOrReportSpecialColor(E,0)}setOrReportBgColor(E){return this._setOrReportSpecialColor(E,1)}setOrReportCursorColor(E){return this._setOrReportSpecialColor(E,2)}restoreIndexedColor(E){if(!E)return this._onColor.fire([{type:2}]),!0;let R=[],L=E.split(";");for(let k=0;k<L.length;++k)if(/^\d+$/.exec(L[k])){let $=parseInt(L[k]);N($)&&R.push({type:2,index:$})}return R.length&&this._onColor.fire(R),!0}restoreFgColor(E){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(E){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(E){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(C[E[0]],c.CHARSETS[E[1]]||c.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let E=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,E,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){let E=new p.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let R=0;R<this._bufferService.rows;++R){let L=this._activeBuffer.ybase+this._activeBuffer.y+R,k=this._activeBuffer.lines.get(L);k&&(k.fill(E),k.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,R){let L=this._bufferService.buffer,k=this._optionsService.rawOptions;return($=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${$}${l.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[k.cursorStyle]-(k.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,R){this._dirtyRowTracker.markRangeDirty(E,R)}}i.InputHandler=B;let U=class{constructor(H){this._bufferService=H,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(H){H<this.start?this.start=H:H>this.end&&(this.end=H)}markRangeDirty(H,E){H>E&&(F=H,H=E,E=F),H<this.start&&(this.start=H),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function N(H){return 0<=H&&H<256}U=a([h(0,x.IBufferService)],U)},844:(o,i)=>{function n(a){for(let h of a)h.dispose();a.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let a of this._disposables)a.dispose();this._disposables.length=0}register(a){return this._disposables.push(a),a}unregister(a){let h=this._disposables.indexOf(a);h!==-1&&this._disposables.splice(h,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(a){this._isDisposed||a===this._value||(this._value?.dispose(),this._value=a)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},i.toDisposable=function(a){return{dispose:a}},i.disposeArray=n,i.getDisposeArrayDisposable=function(a){return{dispose:()=>n(a)}}},1505:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(h,l,c){this._data[h]||(this._data[h]={}),this._data[h][l]=c}get(h,l){return this._data[h]?this._data[h][l]:void 0}clear(){this._data={}}}i.TwoKeyMap=n,i.FourKeyMap=class{constructor(){this._data=new n}set(a,h,l,c,f){this._data.get(a,h)||this._data.set(a,h,new n),this._data.get(a,h).set(l,c,f)}get(a,h,l,c){return this._data.get(a,h)?.get(l,c)}clear(){this._data.clear()}}},6114:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;let n=i.isNode?"node":navigator.userAgent,a=i.isNode?"node":navigator.platform;i.isFirefox=n.includes("Firefox"),i.isLegacyEdge=n.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(n),i.getSafariVersion=function(){if(!i.isSafari)return 0;let h=n.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(a),i.isIpad=a==="iPad",i.isIphone=a==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(a),i.isLinux=a.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(n)},6106:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let n=0;i.SortedList=class{constructor(a){this._getKey=a,this._array=[]}clear(){this._array.length=0}insert(a){this._array.length!==0?(n=this._search(this._getKey(a)),this._array.splice(n,0,a)):this._array.push(a)}delete(a){if(this._array.length===0)return!1;let h=this._getKey(a);if(h===void 0||(n=this._search(h),n===-1)||this._getKey(this._array[n])!==h)return!1;do if(this._array[n]===a)return this._array.splice(n,1),!0;while(++n<this._array.length&&this._getKey(this._array[n])===h);return!1}*getKeyIterator(a){if(this._array.length!==0&&(n=this._search(a),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===a))do yield this._array[n];while(++n<this._array.length&&this._getKey(this._array[n])===a)}forEachByKey(a,h){if(this._array.length!==0&&(n=this._search(a),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===a))do h(this._array[n]);while(++n<this._array.length&&this._getKey(this._array[n])===a)}values(){return[...this._array].values()}_search(a){let h=0,l=this._array.length-1;for(;l>=h;){let c=h+l>>1,f=this._getKey(this._array[c]);if(f>a)l=c-1;else{if(!(f<a)){for(;c>0&&this._getKey(this._array[c-1])===a;)c--;return c}h=c+1}}return h}}},7226:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;let a=n(6114);class h{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(f){this._idleCallback=void 0;let v=0,g=0,u=f.timeRemaining(),d=0;for(;this._i<this._tasks.length;){if(v=Date.now(),this._tasks[this._i]()||this._i++,v=Math.max(1,Date.now()-v),g=Math.max(v,g),d=f.timeRemaining(),1.5*g>d)return u-v<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-v))}ms`),void this._start();u=d}this.clear()}}class l extends h{_requestCallback(f){return setTimeout((()=>f(this._createDeadline(16))))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){let v=Date.now()+f;return{timeRemaining:()=>Math.max(0,v-Date.now())}}}i.PriorityTaskQueue=l,i.IdleTaskQueue=!a.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(c){return requestIdleCallback(c)}_cancelCallback(c){cancelIdleCallback(c)}}:l,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(c){this._queue.clear(),this._queue.enqueue(c)}flush(){this._queue.flush()}}},9282:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;let a=n(643);i.updateWindowsModeWrappedState=function(h){let l=h.buffer.lines.get(h.buffer.ybase+h.buffer.y-1),c=l?.get(h.cols-1),f=h.buffer.lines.get(h.buffer.ybase+h.buffer.y);f&&c&&(f.isWrapped=c[a.CHAR_DATA_CODE_INDEX]!==a.NULL_CELL_CODE&&c[a.CHAR_DATA_CODE_INDEX]!==a.WHITESPACE_CELL_CODE)}},3734:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new a}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){let l=new n;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}i.AttributeData=n;class a{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){let l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,c=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=c}clone(){return new a(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=a},9092:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;let a=n(6349),h=n(7226),l=n(3734),c=n(8437),f=n(4634),v=n(511),g=n(643),u=n(4863),d=n(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(m,p,b){this._hasScrollback=m,this._optionsService=p,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=c.DEFAULT_ATTR_DATA.clone(),this.savedCharset=d.DEFAULT_CHARSET,this.markers=[],this._nullCell=v.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]),this._whitespaceCell=v.CellData.fromCharData([0,g.WHITESPACE_CELL_CHAR,g.WHITESPACE_CELL_WIDTH,g.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new h.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new a.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(m){return m?(this._nullCell.fg=m.fg,this._nullCell.bg=m.bg,this._nullCell.extended=m.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(m){return m?(this._whitespaceCell.fg=m.fg,this._whitespaceCell.bg=m.bg,this._whitespaceCell.extended=m.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(m,p){return new c.BufferLine(this._bufferService.cols,this.getNullCell(m),p)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let m=this.ybase+this.y-this.ydisp;return m>=0&&m<this._rows}_getCorrectBufferLength(m){if(!this._hasScrollback)return m;let p=m+this._optionsService.rawOptions.scrollback;return p>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:p}fillViewportRows(m){if(this.lines.length===0){m===void 0&&(m=c.DEFAULT_ATTR_DATA);let p=this._rows;for(;p--;)this.lines.push(this.getBlankLine(m))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new a.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(m,p){let b=this.getNullCell(c.DEFAULT_ATTR_DATA),x=0,y=this._getCorrectBufferLength(p);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<m)for(let _=0;_<this.lines.length;_++)x+=+this.lines.get(_).resize(m,b);let S=0;if(this._rows<p)for(let _=this._rows;_<p;_++)this.lines.length<p+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new c.BufferLine(m,b)):this.ybase>0&&this.lines.length<=this.ybase+this.y+S+1?(this.ybase--,S++,this.ydisp>0&&this.ydisp--):this.lines.push(new c.BufferLine(m,b)));else for(let _=this._rows;_>p;_--)this.lines.length>p+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){let _=this.lines.length-y;_>0&&(this.lines.trimStart(_),this.ybase=Math.max(this.ybase-_,0),this.ydisp=Math.max(this.ydisp-_,0),this.savedY=Math.max(this.savedY-_,0)),this.lines.maxLength=y}this.x=Math.min(this.x,m-1),this.y=Math.min(this.y,p-1),S&&(this.y+=S),this.savedX=Math.min(this.savedX,m-1),this.scrollTop=0}if(this.scrollBottom=p-1,this._isReflowEnabled&&(this._reflow(m,p),this._cols>m))for(let S=0;S<this.lines.length;S++)x+=+this.lines.get(S).resize(m,b);this._cols=m,this._rows=p,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let m=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,m=!1);let p=0;for(;this._memoryCleanupPosition<this.lines.length;)if(p+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),p>100)return!0;return m}get _isReflowEnabled(){let m=this._optionsService.rawOptions.windowsPty;return m&&m.buildNumber?this._hasScrollback&&m.backend==="conpty"&&m.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(m,p){this._cols!==m&&(m>this._cols?this._reflowLarger(m,p):this._reflowSmaller(m,p))}_reflowLarger(m,p){let b=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,m,this.ybase+this.y,this.getNullCell(c.DEFAULT_ATTR_DATA));if(b.length>0){let x=(0,f.reflowLargerCreateNewLayout)(this.lines,b);(0,f.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(m,p,x.countRemoved)}}_reflowLargerAdjustViewport(m,p,b){let x=this.getNullCell(c.DEFAULT_ATTR_DATA),y=b;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<p&&this.lines.push(new c.BufferLine(m,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(m,p){let b=this.getNullCell(c.DEFAULT_ATTR_DATA),x=[],y=0;for(let S=this.lines.length-1;S>=0;S--){let _=this.lines.get(S);if(!_||!_.isWrapped&&_.getTrimmedLength()<=m)continue;let w=[_];for(;_.isWrapped&&S>0;)_=this.lines.get(--S),w.unshift(_);let C=this.ybase+this.y;if(C>=S&&C<S+w.length)continue;let P=w[w.length-1].getTrimmedLength(),T=(0,f.reflowSmallerGetNewLineLengths)(w,this._cols,m),A=T.length-w.length,F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+A):Math.max(0,this.lines.length-this.lines.maxLength+A);let B=[];for(let L=0;L<A;L++){let k=this.getBlankLine(c.DEFAULT_ATTR_DATA,!0);B.push(k)}B.length>0&&(x.push({start:S+w.length+y,newLines:B}),y+=B.length),w.push(...B);let U=T.length-1,N=T[U];N===0&&(U--,N=T[U]);let H=w.length-A-1,E=P;for(;H>=0;){let L=Math.min(E,N);if(w[U]===void 0)break;if(w[U].copyCellsFrom(w[H],E-L,N-L,L,!0),N-=L,N===0&&(U--,N=T[U]),E-=L,E===0){H--;let k=Math.max(H,0);E=(0,f.getWrappedLineTrimmedLength)(w,k,this._cols)}}for(let L=0;L<w.length;L++)T[L]<m&&w[L].setCell(T[L],b);let R=A-F;for(;R-- >0;)this.ybase===0?this.y<p-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-p&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+A,this.ybase+p-1)}if(x.length>0){let S=[],_=[];for(let U=0;U<this.lines.length;U++)_.push(this.lines.get(U));let w=this.lines.length,C=w-1,P=0,T=x[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let A=0;for(let U=Math.min(this.lines.maxLength-1,w+y-1);U>=0;U--)if(T&&T.start>C+A){for(let N=T.newLines.length-1;N>=0;N--)this.lines.set(U--,T.newLines[N]);U++,S.push({index:C+1,amount:T.newLines.length}),A+=T.newLines.length,T=x[++P]}else this.lines.set(U,_[C--]);let F=0;for(let U=S.length-1;U>=0;U--)S[U].index+=F,this.lines.onInsertEmitter.fire(S[U]),F+=S[U].amount;let B=Math.max(0,w+y-this.lines.maxLength);B>0&&this.lines.onTrimEmitter.fire(B)}}translateBufferLineToString(m,p,b=0,x){let y=this.lines.get(m);return y?y.translateToString(p,b,x):""}getWrappedRangeForLine(m){let p=m,b=m;for(;p>0&&this.lines.get(p).isWrapped;)p--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:p,last:b}}setupTabStops(m){for(m!=null?this.tabs[m]||(m=this.prevStop(m)):(this.tabs={},m=0);m<this._cols;m+=this._optionsService.rawOptions.tabStopWidth)this.tabs[m]=!0}prevStop(m){for(m==null&&(m=this.x);!this.tabs[--m]&&m>0;);return m>=this._cols?this._cols-1:m<0?0:m}nextStop(m){for(m==null&&(m=this.x);!this.tabs[++m]&&m<this._cols;);return m>=this._cols?this._cols-1:m<0?0:m}clearMarkers(m){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].line===m&&(this.markers[p].dispose(),this.markers.splice(p--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].dispose(),this.markers.splice(m--,1);this._isClearing=!1}addMarker(m){let p=new u.Marker(m);return this.markers.push(p),p.register(this.lines.onTrim((b=>{p.line-=b,p.line<0&&p.dispose()}))),p.register(this.lines.onInsert((b=>{p.line>=b.index&&(p.line+=b.amount)}))),p.register(this.lines.onDelete((b=>{p.line>=b.index&&p.line<b.index+b.amount&&p.dispose(),p.line>b.index&&(p.line-=b.amount)}))),p.register(p.onDispose((()=>this._removeMarker(p)))),p}_removeMarker(m){this._isClearing||this.markers.splice(this.markers.indexOf(m),1)}}},8437:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;let a=n(3734),h=n(511),l=n(643),c=n(482);i.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData);let f=0;class v{constructor(u,d,m=!1){this.isWrapped=m,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);let p=d||h.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let b=0;b<u;++b)this.setCell(b,p);this.length=u}get(u){let d=this._data[3*u+0],m=2097151&d;return[this._data[3*u+1],2097152&d?this._combined[u]:m?(0,c.stringFromCodePoint)(m):"",d>>22,2097152&d?this._combined[u].charCodeAt(this._combined[u].length-1):m]}set(u,d){this._data[3*u+1]=d[l.CHAR_DATA_ATTR_INDEX],d[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=d[1],this._data[3*u+0]=2097152|u|d[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=d[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|d[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){let d=this._data[3*u+0];return 2097152&d?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&d}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){let d=this._data[3*u+0];return 2097152&d?this._combined[u]:2097151&d?(0,c.stringFromCodePoint)(2097151&d):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,d){return f=3*u,d.content=this._data[f+0],d.fg=this._data[f+1],d.bg=this._data[f+2],2097152&d.content&&(d.combinedData=this._combined[u]),268435456&d.bg&&(d.extended=this._extendedAttrs[u]),d}setCell(u,d){2097152&d.content&&(this._combined[u]=d.combinedData),268435456&d.bg&&(this._extendedAttrs[u]=d.extended),this._data[3*u+0]=d.content,this._data[3*u+1]=d.fg,this._data[3*u+2]=d.bg}setCellFromCodepoint(u,d,m,p){268435456&p.bg&&(this._extendedAttrs[u]=p.extended),this._data[3*u+0]=d|m<<22,this._data[3*u+1]=p.fg,this._data[3*u+2]=p.bg}addCodepointToCell(u,d,m){let p=this._data[3*u+0];2097152&p?this._combined[u]+=(0,c.stringFromCodePoint)(d):2097151&p?(this._combined[u]=(0,c.stringFromCodePoint)(2097151&p)+(0,c.stringFromCodePoint)(d),p&=-2097152,p|=2097152):p=d|4194304,m&&(p&=-12582913,p|=m<<22),this._data[3*u+0]=p}insertCells(u,d,m){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,m),d<this.length-u){let p=new h.CellData;for(let b=this.length-u-d-1;b>=0;--b)this.setCell(u+d+b,this.loadCell(u+b,p));for(let b=0;b<d;++b)this.setCell(u+b,m)}else for(let p=u;p<this.length;++p)this.setCell(p,m);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,m)}deleteCells(u,d,m){if(u%=this.length,d<this.length-u){let p=new h.CellData;for(let b=0;b<this.length-u-d;++b)this.setCell(u+b,this.loadCell(u+d+b,p));for(let b=this.length-d;b<this.length;++b)this.setCell(b,m)}else for(let p=u;p<this.length;++p)this.setCell(p,m);u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,m),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodepoint(u,0,1,m)}replaceCells(u,d,m,p=!1){if(p)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodepoint(u-1,0,1,m),d<this.length&&this.getWidth(d-1)===2&&!this.isProtected(d)&&this.setCellFromCodepoint(d,0,1,m);u<d&&u<this.length;)this.isProtected(u)||this.setCell(u,m),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,m),d<this.length&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d,0,1,m);u<d&&u<this.length;)this.setCell(u++,m)}resize(u,d){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let m=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*m)this._data=new Uint32Array(this._data.buffer,0,m);else{let p=new Uint32Array(m);p.set(this._data),this._data=p}for(let p=this.length;p<u;++p)this.setCell(p,d)}else{this._data=this._data.subarray(0,m);let p=Object.keys(this._combined);for(let x=0;x<p.length;x++){let y=parseInt(p[x],10);y>=u&&delete this._combined[y]}let b=Object.keys(this._extendedAttrs);for(let x=0;x<b.length;x++){let y=parseInt(b[x],10);y>=u&&delete this._extendedAttrs[y]}}return this.length=u,4*m*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,d=!1){if(d)for(let m=0;m<this.length;++m)this.isProtected(m)||this.setCell(m,u);else{this._combined={},this._extendedAttrs={};for(let m=0;m<this.length;++m)this.setCell(m,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(let d in u._combined)this._combined[d]=u._combined[d];this._extendedAttrs={};for(let d in u._extendedAttrs)this._extendedAttrs[d]=u._extendedAttrs[d];this.isWrapped=u.isWrapped}clone(){let u=new v(0);u._data=new Uint32Array(this._data),u.length=this.length;for(let d in this._combined)u._combined[d]=this._combined[d];for(let d in this._extendedAttrs)u._extendedAttrs[d]=this._extendedAttrs[d];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,d,m,p,b){let x=u._data;if(b)for(let S=p-1;S>=0;S--){for(let _=0;_<3;_++)this._data[3*(m+S)+_]=x[3*(d+S)+_];268435456&x[3*(d+S)+2]&&(this._extendedAttrs[m+S]=u._extendedAttrs[d+S])}else for(let S=0;S<p;S++){for(let _=0;_<3;_++)this._data[3*(m+S)+_]=x[3*(d+S)+_];268435456&x[3*(d+S)+2]&&(this._extendedAttrs[m+S]=u._extendedAttrs[d+S])}let y=Object.keys(u._combined);for(let S=0;S<y.length;S++){let _=parseInt(y[S],10);_>=d&&(this._combined[_-d+m]=u._combined[_])}}translateToString(u,d,m,p){d=d??0,m=m??this.length,u&&(m=Math.min(m,this.getTrimmedLength())),p&&(p.length=0);let b="";for(;d<m;){let x=this._data[3*d+0],y=2097151&x,S=2097152&x?this._combined[d]:y?(0,c.stringFromCodePoint)(y):l.WHITESPACE_CELL_CHAR;if(b+=S,p)for(let _=0;_<S.length;++_)p.push(d);d+=x>>22||1}return p&&p.push(d),b}}i.BufferLine=v},4841:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(n,a){if(n.start.y>n.end.y)throw new Error(`Buffer range end (${n.end.x}, ${n.end.y}) cannot be before start (${n.start.x}, ${n.start.y})`);return a*(n.end.y-n.start.y)+(n.end.x-n.start.x+1)}},4634:(o,i)=>{function n(a,h,l){if(h===a.length-1)return a[h].getTrimmedLength();let c=!a[h].hasContent(l-1)&&a[h].getWidth(l-1)===1,f=a[h+1].getWidth(0)===2;return c&&f?l-1:l}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(a,h,l,c,f){let v=[];for(let g=0;g<a.length-1;g++){let u=g,d=a.get(++u);if(!d.isWrapped)continue;let m=[a.get(g)];for(;u<a.length&&d.isWrapped;)m.push(d),d=a.get(++u);if(c>=g&&c<u){g+=m.length-1;continue}let p=0,b=n(m,p,h),x=1,y=0;for(;x<m.length;){let _=n(m,x,h),w=_-y,C=l-b,P=Math.min(w,C);m[p].copyCellsFrom(m[x],y,b,P,!1),b+=P,b===l&&(p++,b=0),y+=P,y===_&&(x++,y=0),b===0&&p!==0&&m[p-1].getWidth(l-1)===2&&(m[p].copyCellsFrom(m[p-1],l-1,b++,1,!1),m[p-1].setCell(l-1,f))}m[p].replaceCells(b,l,f);let S=0;for(let _=m.length-1;_>0&&(_>p||m[_].getTrimmedLength()===0);_--)S++;S>0&&(v.push(g+m.length-S),v.push(S)),g+=m.length-1}return v},i.reflowLargerCreateNewLayout=function(a,h){let l=[],c=0,f=h[c],v=0;for(let g=0;g<a.length;g++)if(f===g){let u=h[++c];a.onDeleteEmitter.fire({index:g-v,amount:u}),g+=u-1,v+=u,f=h[++c]}else l.push(g);return{layout:l,countRemoved:v}},i.reflowLargerApplyNewLayout=function(a,h){let l=[];for(let c=0;c<h.length;c++)l.push(a.get(h[c]));for(let c=0;c<l.length;c++)a.set(c,l[c]);a.length=h.length},i.reflowSmallerGetNewLineLengths=function(a,h,l){let c=[],f=a.map(((d,m)=>n(a,m,h))).reduce(((d,m)=>d+m)),v=0,g=0,u=0;for(;u<f;){if(f-u<l){c.push(f-u);break}v+=l;let d=n(a,g,h);v>d&&(v-=d,g++);let m=a[g].getWidth(v-1)===2;m&&v--;let p=m?l-1:l;c.push(p),u+=p}return c},i.getWrappedLineTrimmedLength=n},5295:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;let a=n(8460),h=n(844),l=n(9092);class c extends h.Disposable{constructor(v,g){super(),this._optionsService=v,this._bufferService=g,this._onBufferActivate=this.register(new a.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(v){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(v),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(v,g){this._normal.resize(v,g),this._alt.resize(v,g),this.setupTabStops(v)}setupTabStops(v){this._normal.setupTabStops(v),this._alt.setupTabStops(v)}}i.BufferSet=c},511:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;let a=n(482),h=n(643),l=n(3734);class c extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(v){let g=new c;return g.setFromCharData(v),g}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,a.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(v){this.fg=v[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let g=!1;if(v[h.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(v[h.CHAR_DATA_CHAR_INDEX].length===2){let u=v[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){let d=v[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=d&&d<=57343?this.content=1024*(u-55296)+d-56320+65536|v[h.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=v[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[h.CHAR_DATA_WIDTH_INDEX]<<22;g&&(this.combinedData=v[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|v[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=c},643:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;let a=n(8460),h=n(844);class l{get id(){return this._id}constructor(f){this.line=f,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new a.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,h.disposeArray)(this._disposables),this._disposables.length=0)}register(f){return this._disposables.push(f),f}}i.Marker=l,l._nextId=1},7116:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},i.CHARSETS.A={"#":"\xA3"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},i.CHARSETS.C=i.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},i.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},i.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},i.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},i.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},i.CHARSETS.E=i.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},i.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},i.CHARSETS.H=i.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},i.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(o,i)=>{var n,a,h;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
|
|
10
|
+
`,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL="\x7F"})(n||(i.C0=n={})),(function(l){l.PAD="\x80",l.HOP="\x81",l.BPH="\x82",l.NBH="\x83",l.IND="\x84",l.NEL="\x85",l.SSA="\x86",l.ESA="\x87",l.HTS="\x88",l.HTJ="\x89",l.VTS="\x8A",l.PLD="\x8B",l.PLU="\x8C",l.RI="\x8D",l.SS2="\x8E",l.SS3="\x8F",l.DCS="\x90",l.PU1="\x91",l.PU2="\x92",l.STS="\x93",l.CCH="\x94",l.MW="\x95",l.SPA="\x96",l.EPA="\x97",l.SOS="\x98",l.SGCI="\x99",l.SCI="\x9A",l.CSI="\x9B",l.ST="\x9C",l.OSC="\x9D",l.PM="\x9E",l.APC="\x9F"})(a||(i.C1=a={})),(function(l){l.ST=`${n.ESC}\\`})(h||(i.C1_ESCAPED=h={}))},7399:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;let a=n(2584),h={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};i.evaluateKeyboardEvent=function(l,c,f,v){let g={type:0,cancel:!1,key:void 0},u=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?g.key=c?a.C0.ESC+"OA":a.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?g.key=c?a.C0.ESC+"OD":a.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?g.key=c?a.C0.ESC+"OC":a.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(g.key=c?a.C0.ESC+"OB":a.C0.ESC+"[B");break;case 8:g.key=l.ctrlKey?"\b":a.C0.DEL,l.altKey&&(g.key=a.C0.ESC+g.key);break;case 9:if(l.shiftKey){g.key=a.C0.ESC+"[Z";break}g.key=a.C0.HT,g.cancel=!0;break;case 13:g.key=l.altKey?a.C0.ESC+a.C0.CR:a.C0.CR,g.cancel=!0;break;case 27:g.key=a.C0.ESC,l.altKey&&(g.key=a.C0.ESC+a.C0.ESC),g.cancel=!0;break;case 37:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"D",g.key===a.C0.ESC+"[1;3D"&&(g.key=a.C0.ESC+(f?"b":"[1;5D"))):g.key=c?a.C0.ESC+"OD":a.C0.ESC+"[D";break;case 39:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"C",g.key===a.C0.ESC+"[1;3C"&&(g.key=a.C0.ESC+(f?"f":"[1;5C"))):g.key=c?a.C0.ESC+"OC":a.C0.ESC+"[C";break;case 38:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"A",f||g.key!==a.C0.ESC+"[1;3A"||(g.key=a.C0.ESC+"[1;5A")):g.key=c?a.C0.ESC+"OA":a.C0.ESC+"[A";break;case 40:if(l.metaKey)break;u?(g.key=a.C0.ESC+"[1;"+(u+1)+"B",f||g.key!==a.C0.ESC+"[1;3B"||(g.key=a.C0.ESC+"[1;5B")):g.key=c?a.C0.ESC+"OB":a.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(g.key=a.C0.ESC+"[2~");break;case 46:g.key=u?a.C0.ESC+"[3;"+(u+1)+"~":a.C0.ESC+"[3~";break;case 36:g.key=u?a.C0.ESC+"[1;"+(u+1)+"H":c?a.C0.ESC+"OH":a.C0.ESC+"[H";break;case 35:g.key=u?a.C0.ESC+"[1;"+(u+1)+"F":c?a.C0.ESC+"OF":a.C0.ESC+"[F";break;case 33:l.shiftKey?g.type=2:l.ctrlKey?g.key=a.C0.ESC+"[5;"+(u+1)+"~":g.key=a.C0.ESC+"[5~";break;case 34:l.shiftKey?g.type=3:l.ctrlKey?g.key=a.C0.ESC+"[6;"+(u+1)+"~":g.key=a.C0.ESC+"[6~";break;case 112:g.key=u?a.C0.ESC+"[1;"+(u+1)+"P":a.C0.ESC+"OP";break;case 113:g.key=u?a.C0.ESC+"[1;"+(u+1)+"Q":a.C0.ESC+"OQ";break;case 114:g.key=u?a.C0.ESC+"[1;"+(u+1)+"R":a.C0.ESC+"OR";break;case 115:g.key=u?a.C0.ESC+"[1;"+(u+1)+"S":a.C0.ESC+"OS";break;case 116:g.key=u?a.C0.ESC+"[15;"+(u+1)+"~":a.C0.ESC+"[15~";break;case 117:g.key=u?a.C0.ESC+"[17;"+(u+1)+"~":a.C0.ESC+"[17~";break;case 118:g.key=u?a.C0.ESC+"[18;"+(u+1)+"~":a.C0.ESC+"[18~";break;case 119:g.key=u?a.C0.ESC+"[19;"+(u+1)+"~":a.C0.ESC+"[19~";break;case 120:g.key=u?a.C0.ESC+"[20;"+(u+1)+"~":a.C0.ESC+"[20~";break;case 121:g.key=u?a.C0.ESC+"[21;"+(u+1)+"~":a.C0.ESC+"[21~";break;case 122:g.key=u?a.C0.ESC+"[23;"+(u+1)+"~":a.C0.ESC+"[23~";break;case 123:g.key=u?a.C0.ESC+"[24;"+(u+1)+"~":a.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(f&&!v||!l.altKey||l.metaKey)!f||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?g.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(g.key=a.C0.US),l.key==="@"&&(g.key=a.C0.NUL)):l.keyCode===65&&(g.type=1);else{let d=h[l.keyCode],m=d?.[l.shiftKey?1:0];if(m)g.key=a.C0.ESC+m;else if(l.keyCode>=65&&l.keyCode<=90){let p=l.ctrlKey?l.keyCode-64:l.keyCode+32,b=String.fromCharCode(p);l.shiftKey&&(b=b.toUpperCase()),g.key=a.C0.ESC+b}else if(l.keyCode===32)g.key=a.C0.ESC+(l.ctrlKey?a.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let p=l.code.slice(3,4);l.shiftKey||(p=p.toLowerCase()),g.key=a.C0.ESC+p,g.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?g.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?g.key=a.C0.NUL:l.keyCode>=51&&l.keyCode<=55?g.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?g.key=a.C0.DEL:l.keyCode===219?g.key=a.C0.ESC:l.keyCode===220?g.key=a.C0.FS:l.keyCode===221&&(g.key=a.C0.GS)}return g}},482:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(n){return n>65535?(n-=65536,String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):String.fromCharCode(n)},i.utf32ToString=function(n,a=0,h=n.length){let l="";for(let c=a;c<h;++c){let f=n[c];f>65535?(f-=65536,l+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):l+=String.fromCharCode(f)}return l},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(n,a){let h=n.length;if(!h)return 0;let l=0,c=0;if(this._interim){let f=n.charCodeAt(c++);56320<=f&&f<=57343?a[l++]=1024*(this._interim-55296)+f-56320+65536:(a[l++]=this._interim,a[l++]=f),this._interim=0}for(let f=c;f<h;++f){let v=n.charCodeAt(f);if(55296<=v&&v<=56319){if(++f>=h)return this._interim=v,l;let g=n.charCodeAt(f);56320<=g&&g<=57343?a[l++]=1024*(v-55296)+g-56320+65536:(a[l++]=v,a[l++]=g)}else v!==65279&&(a[l++]=v)}return l}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(n,a){let h=n.length;if(!h)return 0;let l,c,f,v,g=0,u=0,d=0;if(this.interim[0]){let b=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let y,S=0;for(;(y=63&this.interim[++S])&&S<4;)x<<=6,x|=y;let _=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,w=_-S;for(;d<w;){if(d>=h)return 0;if(y=n[d++],(192&y)!=128){d--,b=!0;break}this.interim[S++]=y,x<<=6,x|=63&y}b||(_===2?x<128?d--:a[g++]=x:_===3?x<2048||x>=55296&&x<=57343||x===65279||(a[g++]=x):x<65536||x>1114111||(a[g++]=x)),this.interim.fill(0)}let m=h-4,p=d;for(;p<h;){for(;!(!(p<m)||128&(l=n[p])||128&(c=n[p+1])||128&(f=n[p+2])||128&(v=n[p+3]));)a[g++]=l,a[g++]=c,a[g++]=f,a[g++]=v,p+=4;if(l=n[p++],l<128)a[g++]=l;else if((224&l)==192){if(p>=h)return this.interim[0]=l,g;if(c=n[p++],(192&c)!=128){p--;continue}if(u=(31&l)<<6|63&c,u<128){p--;continue}a[g++]=u}else if((240&l)==224){if(p>=h)return this.interim[0]=l,g;if(c=n[p++],(192&c)!=128){p--;continue}if(p>=h)return this.interim[0]=l,this.interim[1]=c,g;if(f=n[p++],(192&f)!=128){p--;continue}if(u=(15&l)<<12|(63&c)<<6|63&f,u<2048||u>=55296&&u<=57343||u===65279)continue;a[g++]=u}else if((248&l)==240){if(p>=h)return this.interim[0]=l,g;if(c=n[p++],(192&c)!=128){p--;continue}if(p>=h)return this.interim[0]=l,this.interim[1]=c,g;if(f=n[p++],(192&f)!=128){p--;continue}if(p>=h)return this.interim[0]=l,this.interim[1]=c,this.interim[2]=f,g;if(v=n[p++],(192&v)!=128){p--;continue}if(u=(7&l)<<18|(63&c)<<12|(63&f)<<6|63&v,u<65536||u>1114111)continue;a[g++]=u}}return g}}},225:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;let a=n(1480),h=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],l=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],c;i.UnicodeV6=class{constructor(){if(this.version="6",!c){c=new Uint8Array(65536),c.fill(1),c[0]=0,c.fill(0,1,32),c.fill(0,127,160),c.fill(2,4352,4448),c[9001]=2,c[9002]=2,c.fill(2,11904,42192),c[12351]=1,c.fill(2,44032,55204),c.fill(2,63744,64256),c.fill(2,65040,65050),c.fill(2,65072,65136),c.fill(2,65280,65377),c.fill(2,65504,65511);for(let f=0;f<h.length;++f)c.fill(0,h[f][0],h[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?c[f]:(function(v,g){let u,d=0,m=g.length-1;if(v<g[0][0]||v>g[m][1])return!1;for(;m>=d;)if(u=d+m>>1,v>g[u][1])d=u+1;else{if(!(v<g[u][0]))return!0;m=u-1}return!1})(f,l)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,v){let g=this.wcwidth(f),u=g===0&&v!==0;if(u){let d=a.UnicodeService.extractWidth(v);d===0?u=!1:d>g&&(g=d)}return a.UnicodeService.createPropertyValue(0,g,u)}}},5981:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;let a=n(8460),h=n(844);class l extends h.Disposable{constructor(f){super(),this._action=f,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(f,v){if(v!==void 0&&this._syncCalls>v)return void(this._syncCalls=0);if(this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let g;for(this._isSyncWriting=!0;g=this._writeBuffer.shift();){this._action(g);let u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(f,v){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(v),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(v)}_innerWrite(f=0,v=!0){let g=f||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let u=this._writeBuffer[this._bufferOffset],d=this._action(u,v);if(d){let p=b=>Date.now()-g>=12?setTimeout((()=>this._innerWrite(0,b))):this._innerWrite(g,b);return void d.catch((b=>(queueMicrotask((()=>{throw b})),Promise.resolve(!1)))).then(p)}let m=this._callbacks[this._bufferOffset];if(m&&m(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-g>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}i.WriteBuffer=l},5941:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;let n=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,a=/^[\da-f]+$/;function h(l,c){let f=l.toString(16),v=f.length<2?"0"+f:f;switch(c){case 4:return f[0];case 8:return v;case 12:return(v+v).slice(0,3);default:return v+v}}i.parseColor=function(l){if(!l)return;let c=l.toLowerCase();if(c.indexOf("rgb:")===0){c=c.slice(4);let f=n.exec(c);if(f){let v=f[1]?15:f[4]?255:f[7]?4095:65535;return[Math.round(parseInt(f[1]||f[4]||f[7]||f[10],16)/v*255),Math.round(parseInt(f[2]||f[5]||f[8]||f[11],16)/v*255),Math.round(parseInt(f[3]||f[6]||f[9]||f[12],16)/v*255)]}}else if(c.indexOf("#")===0&&(c=c.slice(1),a.exec(c)&&[3,6,9,12].includes(c.length))){let f=c.length/3,v=[0,0,0];for(let g=0;g<3;++g){let u=parseInt(c.slice(f*g,f*g+f),16);v[g]=f===1?u<<4:f===2?u:f===3?u>>4:u>>8}return v}},i.toRgbString=function(l,c=16){let[f,v,g]=l;return`rgb:${h(f,c)}/${h(v,c)}/${h(g,c)}`}},5770:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;let a=n(482),h=n(8742),l=n(5770),c=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=c,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=c}registerHandler(v,g){this._handlers[v]===void 0&&(this._handlers[v]=[]);let u=this._handlers[v];return u.push(g),{dispose:()=>{let d=u.indexOf(g);d!==-1&&u.splice(d,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}reset(){if(this._active.length)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].unhook(!1);this._stack.paused=!1,this._active=c,this._ident=0}hook(v,g){if(this.reset(),this._ident=v,this._active=this._handlers[v]||c,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(g);else this._handlerFb(this._ident,"HOOK",g)}put(v,g,u){if(this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].put(v,g,u);else this._handlerFb(this._ident,"PUT",(0,a.utf32ToString)(v,g,u))}unhook(v,g=!0){if(this._active.length){let u=!1,d=this._active.length-1,m=!1;if(this._stack.paused&&(d=this._stack.loopPosition-1,u=g,m=this._stack.fallThrough,this._stack.paused=!1),!m&&u===!1){for(;d>=0&&(u=this._active[d].unhook(v),u!==!0);d--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!1,u;d--}for(;d>=0;d--)if(u=this._active[d].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=d,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",v);this._active=c,this._ident=0}};let f=new h.Params;f.addParam(0),i.DcsHandler=class{constructor(v){this._handler=v,this._data="",this._params=f,this._hitLimit=!1}hook(v){this._params=v.length>1||v.params[0]?v.clone():f,this._data="",this._hitLimit=!1}put(v,g,u){this._hitLimit||(this._data+=(0,a.utf32ToString)(v,g,u),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(v){let g=!1;if(this._hitLimit)g=!1;else if(v&&(g=this._handler(this._data,this._params),g instanceof Promise))return g.then((u=>(this._params=f,this._data="",this._hitLimit=!1,u)));return this._params=f,this._data="",this._hitLimit=!1,g}}},2015:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;let a=n(844),h=n(8742),l=n(6242),c=n(6351);class f{constructor(d){this.table=new Uint8Array(d)}setDefault(d,m){this.table.fill(d<<4|m)}add(d,m,p,b){this.table[m<<8|d]=p<<4|b}addMany(d,m,p,b){for(let x=0;x<d.length;x++)this.table[m<<8|d[x]]=p<<4|b}}i.TransitionTable=f;let v=160;i.VT500_TRANSITION_TABLE=(function(){let u=new f(4095),d=Array.apply(null,Array(256)).map(((S,_)=>_)),m=(S,_)=>d.slice(S,_),p=m(32,127),b=m(0,24);b.push(25),b.push.apply(b,m(28,32));let x=m(0,14),y;for(y in u.setDefault(1,0),u.addMany(p,0,2,0),x)u.addMany([24,26,153,154],y,3,0),u.addMany(m(128,144),y,3,0),u.addMany(m(144,152),y,3,0),u.add(156,y,0,0),u.add(27,y,11,1),u.add(157,y,4,8),u.addMany([152,158,159],y,0,7),u.add(155,y,11,3),u.add(144,y,11,9);return u.addMany(b,0,3,0),u.addMany(b,1,3,1),u.add(127,1,0,1),u.addMany(b,8,0,8),u.addMany(b,3,3,3),u.add(127,3,0,3),u.addMany(b,4,3,4),u.add(127,4,0,4),u.addMany(b,6,3,6),u.addMany(b,5,3,5),u.add(127,5,0,5),u.addMany(b,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(p,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(m(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(p,7,0,7),u.addMany(b,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(m(64,127),3,7,0),u.addMany(m(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(m(48,60),4,8,4),u.addMany(m(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(m(32,64),6,0,6),u.add(127,6,0,6),u.addMany(m(64,127),6,0,0),u.addMany(m(32,48),3,9,5),u.addMany(m(32,48),5,9,5),u.addMany(m(48,64),5,0,6),u.addMany(m(64,127),5,7,0),u.addMany(m(32,48),4,9,5),u.addMany(m(32,48),1,9,2),u.addMany(m(32,48),2,9,2),u.addMany(m(48,127),2,10,0),u.addMany(m(48,80),1,10,0),u.addMany(m(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(m(96,127),1,10,0),u.add(80,1,11,9),u.addMany(b,9,0,9),u.add(127,9,0,9),u.addMany(m(28,32),9,0,9),u.addMany(m(32,48),9,9,12),u.addMany(m(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(b,11,0,11),u.addMany(m(32,128),11,0,11),u.addMany(m(28,32),11,0,11),u.addMany(b,10,0,10),u.add(127,10,0,10),u.addMany(m(28,32),10,0,10),u.addMany(m(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(m(32,48),10,9,12),u.addMany(b,12,0,12),u.add(127,12,0,12),u.addMany(m(28,32),12,0,12),u.addMany(m(32,48),12,9,12),u.addMany(m(48,64),12,0,11),u.addMany(m(64,127),12,12,13),u.addMany(m(64,127),10,12,13),u.addMany(m(64,127),9,12,13),u.addMany(b,13,13,13),u.addMany(p,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(v,0,2,0),u.add(v,8,5,8),u.add(v,6,0,6),u.add(v,11,0,11),u.add(v,13,13,13),u})();class g extends a.Disposable{constructor(d=i.VT500_TRANSITION_TABLE){super(),this._transitions=d,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new h.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(m,p,b)=>{},this._executeHandlerFb=m=>{},this._csiHandlerFb=(m,p)=>{},this._escHandlerFb=m=>{},this._errorHandlerFb=m=>m,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,a.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new c.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(d,m=[64,126]){let p=0;if(d.prefix){if(d.prefix.length>1)throw new Error("only one byte as prefix supported");if(p=d.prefix.charCodeAt(0),p&&60>p||p>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(d.intermediates){if(d.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<d.intermediates.length;++x){let y=d.intermediates.charCodeAt(x);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");p<<=8,p|=y}}if(d.final.length!==1)throw new Error("final must be a single byte");let b=d.final.charCodeAt(0);if(m[0]>b||b>m[1])throw new Error(`final must be in range ${m[0]} .. ${m[1]}`);return p<<=8,p|=b,p}identToString(d){let m=[];for(;d;)m.push(String.fromCharCode(255&d)),d>>=8;return m.reverse().join("")}setPrintHandler(d){this._printHandler=d}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(d,m){let p=this._identifier(d,[48,126]);this._escHandlers[p]===void 0&&(this._escHandlers[p]=[]);let b=this._escHandlers[p];return b.push(m),{dispose:()=>{let x=b.indexOf(m);x!==-1&&b.splice(x,1)}}}clearEscHandler(d){this._escHandlers[this._identifier(d,[48,126])]&&delete this._escHandlers[this._identifier(d,[48,126])]}setEscHandlerFallback(d){this._escHandlerFb=d}setExecuteHandler(d,m){this._executeHandlers[d.charCodeAt(0)]=m}clearExecuteHandler(d){this._executeHandlers[d.charCodeAt(0)]&&delete this._executeHandlers[d.charCodeAt(0)]}setExecuteHandlerFallback(d){this._executeHandlerFb=d}registerCsiHandler(d,m){let p=this._identifier(d);this._csiHandlers[p]===void 0&&(this._csiHandlers[p]=[]);let b=this._csiHandlers[p];return b.push(m),{dispose:()=>{let x=b.indexOf(m);x!==-1&&b.splice(x,1)}}}clearCsiHandler(d){this._csiHandlers[this._identifier(d)]&&delete this._csiHandlers[this._identifier(d)]}setCsiHandlerFallback(d){this._csiHandlerFb=d}registerDcsHandler(d,m){return this._dcsParser.registerHandler(this._identifier(d),m)}clearDcsHandler(d){this._dcsParser.clearHandler(this._identifier(d))}setDcsHandlerFallback(d){this._dcsParser.setHandlerFallback(d)}registerOscHandler(d,m){return this._oscParser.registerHandler(d,m)}clearOscHandler(d){this._oscParser.clearHandler(d)}setOscHandlerFallback(d){this._oscParser.setHandlerFallback(d)}setErrorHandler(d){this._errorHandler=d}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(d,m,p,b,x){this._parseStack.state=d,this._parseStack.handlers=m,this._parseStack.handlerPos=p,this._parseStack.transition=b,this._parseStack.chunkPos=x}parse(d,m,p){let b,x=0,y=0,S=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,S=this._parseStack.chunkPos+1;else{if(p===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let _=this._parseStack.handlers,w=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(p===!1&&w>-1){for(;w>=0&&(b=_[w](this._params),b!==!0);w--)if(b instanceof Promise)return this._parseStack.handlerPos=w,b}this._parseStack.handlers=[];break;case 4:if(p===!1&&w>-1){for(;w>=0&&(b=_[w](),b!==!0);w--)if(b instanceof Promise)return this._parseStack.handlerPos=w,b}this._parseStack.handlers=[];break;case 6:if(x=d[this._parseStack.chunkPos],b=this._dcsParser.unhook(x!==24&&x!==26,p),b)return b;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=d[this._parseStack.chunkPos],b=this._oscParser.end(x!==24&&x!==26,p),b)return b;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,S=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let _=S;_<m;++_){switch(x=d[_],y=this._transitions.table[this.currentState<<8|(x<160?x:v)],y>>4){case 2:for(let A=_+1;;++A){if(A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,_,A),_=A-1;break}if(++A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,_,A),_=A-1;break}if(++A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,_,A),_=A-1;break}if(++A>=m||(x=d[A])<32||x>126&&x<v){this._printHandler(d,_,A),_=A-1;break}}break;case 3:this._executeHandlers[x]?this._executeHandlers[x]():this._executeHandlerFb(x),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:_,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let w=this._csiHandlers[this._collect<<8|x],C=w?w.length-1:-1;for(;C>=0&&(b=w[C](this._params),b!==!0);C--)if(b instanceof Promise)return this._preserveStack(3,w,C,y,_),b;C<0&&this._csiHandlerFb(this._collect<<8|x,this._params),this.precedingJoinState=0;break;case 8:do switch(x){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(x-48)}while(++_<m&&(x=d[_])>47&&x<60);_--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:let P=this._escHandlers[this._collect<<8|x],T=P?P.length-1:-1;for(;T>=0&&(b=P[T](),b!==!0);T--)if(b instanceof Promise)return this._preserveStack(4,P,T,y,_),b;T<0&&this._escHandlerFb(this._collect<<8|x),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|x,this._params);break;case 13:for(let A=_+1;;++A)if(A>=m||(x=d[A])===24||x===26||x===27||x>127&&x<v){this._dcsParser.put(d,_,A),_=A-1;break}break;case 14:if(b=this._dcsParser.unhook(x!==24&&x!==26),b)return this._preserveStack(6,[],0,y,_),b;x===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let A=_+1;;A++)if(A>=m||(x=d[A])<32||x>127&&x<v){this._oscParser.put(d,_,A),_=A-1;break}break;case 6:if(b=this._oscParser.end(x!==24&&x!==26),b)return this._preserveStack(5,[],0,y,_),b;x===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}i.EscapeSequenceParser=g},6242:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;let a=n(5770),h=n(482),l=[];i.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(c,f){this._handlers[c]===void 0&&(this._handlers[c]=[]);let v=this._handlers[c];return v.push(f),{dispose:()=>{let g=v.indexOf(f);g!==-1&&v.splice(g,1)}}}clearHandler(c){this._handlers[c]&&delete this._handlers[c]}setHandlerFallback(c){this._handlerFb=c}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let c=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;c>=0;--c)this._active[c].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].start();else this._handlerFb(this._id,"START")}_put(c,f,v){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(c,f,v);else this._handlerFb(this._id,"PUT",(0,h.utf32ToString)(c,f,v))}start(){this.reset(),this._state=1}put(c,f,v){if(this._state!==3){if(this._state===1)for(;f<v;){let g=c[f++];if(g===59){this._state=2,this._start();break}if(g<48||57<g)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+g-48}this._state===2&&v-f>0&&this._put(c,f,v)}}end(c,f=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let v=!1,g=this._active.length-1,u=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,v=f,u=this._stack.fallThrough,this._stack.paused=!1),!u&&v===!1){for(;g>=0&&(v=this._active[g].end(c),v!==!0);g--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,v;g--}for(;g>=0;g--)if(v=this._active[g].end(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,v}else this._handlerFb(this._id,"END",c);this._active=l,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(c){this._handler=c,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(c,f,v){this._hitLimit||(this._data+=(0,h.utf32ToString)(c,f,v),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(c){let f=!1;if(this._hitLimit)f=!1;else if(c&&(f=this._handler(this._data),f instanceof Promise))return f.then((v=>(this._data="",this._hitLimit=!1,v)));return this._data="",this._hitLimit=!1,f}}},8742:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;let n=2147483647;class a{static fromArray(l){let c=new a;if(!l.length)return c;for(let f=Array.isArray(l[0])?1:0;f<l.length;++f){let v=l[f];if(Array.isArray(v))for(let g=0;g<v.length;++g)c.addSubParam(v[g]);else c.addParam(v)}return c}constructor(l=32,c=32){if(this.maxLength=l,this.maxSubParamsLength=c,c>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(c),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){let l=new a(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){let l=[];for(let c=0;c<this.length;++c){l.push(this.params[c]);let f=this._subParamsIdx[c]>>8,v=255&this._subParamsIdx[c];v-f>0&&l.push(Array.prototype.slice.call(this._subParams,f,v))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>n?n:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>n?n:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){let c=this._subParamsIdx[l]>>8,f=255&this._subParamsIdx[l];return f-c>0?this._subParams.subarray(c,f):null}getSubParamsAll(){let l={};for(let c=0;c<this.length;++c){let f=this._subParamsIdx[c]>>8,v=255&this._subParamsIdx[c];v-f>0&&(l[c]=this._subParams.slice(f,v))}return l}addDigit(l){let c;if(this._rejectDigits||!(c=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let f=this._digitIsSub?this._subParams:this.params,v=f[c-1];f[c-1]=~v?Math.min(10*v+l,n):l}}i.Params=a},5741:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let n=this._addons.length-1;n>=0;n--)this._addons[n].instance.dispose()}loadAddon(n,a){let h={instance:a,dispose:a.dispose,isDisposed:!1};this._addons.push(h),a.dispose=()=>this._wrappedAddonDispose(h),a.activate(n)}_wrappedAddonDispose(n){if(n.isDisposed)return;let a=-1;for(let h=0;h<this._addons.length;h++)if(this._addons[h]===n){a=h;break}if(a===-1)throw new Error("Could not dispose an addon that has not been loaded");n.isDisposed=!0,n.dispose.apply(n.instance),this._addons.splice(a,1)}}},8771:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;let a=n(3785),h=n(511);i.BufferApiView=class{constructor(l,c){this._buffer=l,this.type=c}init(l){return this._buffer=l,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(l){let c=this._buffer.lines.get(l);if(c)return new a.BufferLineApiView(c)}getNullCell(){return new h.CellData}}},3785:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;let a=n(511);i.BufferLineApiView=class{constructor(h){this._line=h}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(h,l){if(!(h<0||h>=this._line.length))return l?(this._line.loadCell(h,l),l):this._line.loadCell(h,new a.CellData)}translateToString(h,l,c){return this._line.translateToString(h,l,c)}}},8285:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;let a=n(8771),h=n(8460),l=n(844);class c extends l.Disposable{constructor(v){super(),this._core=v,this._onBufferChange=this.register(new h.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new a.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new a.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}i.BufferNamespaceApi=c},7975:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(n){this._core=n}registerCsiHandler(n,a){return this._core.registerCsiHandler(n,(h=>a(h.toArray())))}addCsiHandler(n,a){return this.registerCsiHandler(n,a)}registerDcsHandler(n,a){return this._core.registerDcsHandler(n,((h,l)=>a(h,l.toArray())))}addDcsHandler(n,a){return this.registerDcsHandler(n,a)}registerEscHandler(n,a){return this._core.registerEscHandler(n,a)}addEscHandler(n,a){return this.registerEscHandler(n,a)}registerOscHandler(n,a){return this._core.registerOscHandler(n,a)}addOscHandler(n,a){return this.registerOscHandler(n,a)}}},7090:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(n){this._core=n}register(n){this._core.unicodeService.register(n)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(n){this._core.unicodeService.activeVersion=n}}},744:function(o,i,n){var a=this&&this.__decorate||function(u,d,m,p){var b,x=arguments.length,y=x<3?d:p===null?p=Object.getOwnPropertyDescriptor(d,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,d,m,p);else for(var S=u.length-1;S>=0;S--)(b=u[S])&&(y=(x<3?b(y):x>3?b(d,m,y):b(d,m))||y);return x>3&&y&&Object.defineProperty(d,m,y),y},h=this&&this.__param||function(u,d){return function(m,p){d(m,p,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;let l=n(8460),c=n(844),f=n(5295),v=n(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let g=i.BufferService=class extends c.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new f.BufferSet(u,this))}resize(u,d){this.cols=u,this.rows=d,this.buffers.resize(u,d),this._onResize.fire({cols:u,rows:d})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,d=!1){let m=this.buffer,p;p=this._cachedBlankLine,p&&p.length===this.cols&&p.getFg(0)===u.fg&&p.getBg(0)===u.bg||(p=m.getBlankLine(u,d),this._cachedBlankLine=p),p.isWrapped=d;let b=m.ybase+m.scrollTop,x=m.ybase+m.scrollBottom;if(m.scrollTop===0){let y=m.lines.isFull;x===m.lines.length-1?y?m.lines.recycle().copyFrom(p):m.lines.push(p.clone()):m.lines.splice(x+1,0,p.clone()),y?this.isUserScrolling&&(m.ydisp=Math.max(m.ydisp-1,0)):(m.ybase++,this.isUserScrolling||m.ydisp++)}else{let y=x-b+1;m.lines.shiftElements(b+1,y-1,-1),m.lines.set(x,p.clone())}this.isUserScrolling||(m.ydisp=m.ybase),this._onScroll.fire(m.ydisp)}scrollLines(u,d,m){let p=this.buffer;if(u<0){if(p.ydisp===0)return;this.isUserScrolling=!0}else u+p.ydisp>=p.ybase&&(this.isUserScrolling=!1);let b=p.ydisp;p.ydisp=Math.max(Math.min(p.ydisp+u,p.ybase),0),b!==p.ydisp&&(d||this._onScroll.fire(p.ydisp))}};i.BufferService=g=a([h(0,v.IOptionsService)],g)},7994:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(n){this.glevel=n,this.charset=this._charsets[n]}setgCharset(n,a){this._charsets[n]=a,this.glevel===n&&(this.charset=a)}}},1753:function(o,i,n){var a=this&&this.__decorate||function(p,b,x,y){var S,_=arguments.length,w=_<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(p,b,x,y);else for(var C=p.length-1;C>=0;C--)(S=p[C])&&(w=(_<3?S(w):_>3?S(b,x,w):S(b,x))||w);return _>3&&w&&Object.defineProperty(b,x,w),w},h=this&&this.__param||function(p,b){return function(x,y){b(x,y,p)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;let l=n(2585),c=n(8460),f=n(844),v={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:p=>p.button!==4&&p.action===1&&(p.ctrl=!1,p.alt=!1,p.shift=!1,!0)},VT200:{events:19,restrict:p=>p.action!==32},DRAG:{events:23,restrict:p=>p.action!==32||p.button!==3},ANY:{events:31,restrict:p=>!0}};function g(p,b){let x=(p.ctrl?16:0)|(p.shift?4:0)|(p.alt?8:0);return p.button===4?(x|=64,x|=p.action):(x|=3&p.button,4&p.button&&(x|=64),8&p.button&&(x|=128),p.action===32?x|=32:p.action!==0||b||(x|=3)),x}let u=String.fromCharCode,d={DEFAULT:p=>{let b=[g(p,!1)+32,p.col+32,p.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${u(b[0])}${u(b[1])}${u(b[2])}`},SGR:p=>{let b=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${g(p,!0)};${p.col};${p.row}${b}`},SGR_PIXELS:p=>{let b=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${g(p,!0)};${p.x};${p.y}${b}`}},m=i.CoreMouseService=class extends f.Disposable{constructor(p,b){super(),this._bufferService=p,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new c.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(let x of Object.keys(v))this.addProtocol(x,v[x]);for(let x of Object.keys(d))this.addEncoding(x,d[x]);this.reset()}addProtocol(p,b){this._protocols[p]=b}addEncoding(p,b){this._encodings[p]=b}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(p){if(!this._protocols[p])throw new Error(`unknown protocol "${p}"`);this._activeProtocol=p,this._onProtocolChange.fire(this._protocols[p].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(p){if(!this._encodings[p])throw new Error(`unknown encoding "${p}"`);this._activeEncoding=p}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(p){if(p.col<0||p.col>=this._bufferService.cols||p.row<0||p.row>=this._bufferService.rows||p.button===4&&p.action===32||p.button===3&&p.action!==32||p.button!==4&&(p.action===2||p.action===3)||(p.col++,p.row++,p.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,p,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(p))return!1;let b=this._encodings[this._activeEncoding](p);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=p,!0}explainEvents(p){return{down:!!(1&p),up:!!(2&p),drag:!!(4&p),move:!!(8&p),wheel:!!(16&p)}}_equalEvents(p,b,x){if(x){if(p.x!==b.x||p.y!==b.y)return!1}else if(p.col!==b.col||p.row!==b.row)return!1;return p.button===b.button&&p.action===b.action&&p.ctrl===b.ctrl&&p.alt===b.alt&&p.shift===b.shift}};i.CoreMouseService=m=a([h(0,l.IBufferService),h(1,l.ICoreService)],m)},6975:function(o,i,n){var a=this&&this.__decorate||function(m,p,b,x){var y,S=arguments.length,_=S<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(m,p,b,x);else for(var w=m.length-1;w>=0;w--)(y=m[w])&&(_=(S<3?y(_):S>3?y(p,b,_):y(p,b))||_);return S>3&&_&&Object.defineProperty(p,b,_),_},h=this&&this.__param||function(m,p){return function(b,x){p(b,x,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;let l=n(1439),c=n(8460),f=n(844),v=n(2585),g=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),d=i.CoreService=class extends f.Disposable{constructor(m,p,b){super(),this._bufferService=m,this._logService=p,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new c.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new c.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(g),this.decPrivateModes=(0,l.clone)(u)}reset(){this.modes=(0,l.clone)(g),this.decPrivateModes=(0,l.clone)(u)}triggerDataEvent(m,p=!1){if(this._optionsService.rawOptions.disableStdin)return;let b=this._bufferService.buffer;p&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),p&&this._onUserInput.fire(),this._logService.debug(`sending data "${m}"`,(()=>m.split("").map((x=>x.charCodeAt(0))))),this._onData.fire(m)}triggerBinaryEvent(m){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${m}"`,(()=>m.split("").map((p=>p.charCodeAt(0))))),this._onBinary.fire(m))}};i.CoreService=d=a([h(0,v.IBufferService),h(1,v.ILogService),h(2,v.IOptionsService)],d)},9074:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;let a=n(8055),h=n(8460),l=n(844),c=n(6106),f=0,v=0;class g extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new c.SortedList((m=>m?.marker.line)),this._onDecorationRegistered=this.register(new h.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new h.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(m){if(m.marker.isDisposed)return;let p=new u(m);if(p){let b=p.marker.onDispose((()=>p.dispose()));p.onDispose((()=>{p&&(this._decorations.delete(p)&&this._onDecorationRemoved.fire(p),b.dispose())})),this._decorations.insert(p),this._onDecorationRegistered.fire(p)}return p}reset(){for(let m of this._decorations.values())m.dispose();this._decorations.clear()}*getDecorationsAtCell(m,p,b){let x=0,y=0;for(let S of this._decorations.getKeyIterator(p))x=S.options.x??0,y=x+(S.options.width??1),m>=x&&m<y&&(!b||(S.options.layer??"bottom")===b)&&(yield S)}forEachDecorationAtCell(m,p,b,x){this._decorations.forEachByKey(p,(y=>{f=y.options.x??0,v=f+(y.options.width??1),m>=f&&m<v&&(!b||(y.options.layer??"bottom")===b)&&x(y)}))}}i.DecorationService=g;class u extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=a.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=a.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(m){super(),this.options=m,this.onRenderEmitter=this.register(new h.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=m.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;let a=n(2585),h=n(8343);class l{constructor(...f){this._entries=new Map;for(let[v,g]of f)this.set(v,g)}set(f,v){let g=this._entries.get(f);return this._entries.set(f,v),g}forEach(f){for(let[v,g]of this._entries.entries())f(v,g)}has(f){return this._entries.has(f)}get(f){return this._entries.get(f)}}i.ServiceCollection=l,i.InstantiationService=class{constructor(){this._services=new l,this._services.set(a.IInstantiationService,this)}setService(c,f){this._services.set(c,f)}getService(c){return this._services.get(c)}createInstance(c,...f){let v=(0,h.getServiceDependencies)(c).sort(((d,m)=>d.index-m.index)),g=[];for(let d of v){let m=this._services.get(d.id);if(!m)throw new Error(`[createInstance] ${c.name} depends on UNKNOWN service ${d.id}.`);g.push(m)}let u=v.length>0?v[0].index:f.length;if(f.length!==u)throw new Error(`[createInstance] First service dependency of ${c.name} at position ${u+1} conflicts with ${f.length} static arguments`);return new c(...f,...g)}}},7866:function(o,i,n){var a=this&&this.__decorate||function(u,d,m,p){var b,x=arguments.length,y=x<3?d:p===null?p=Object.getOwnPropertyDescriptor(d,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,d,m,p);else for(var S=u.length-1;S>=0;S--)(b=u[S])&&(y=(x<3?b(y):x>3?b(d,m,y):b(d,m))||y);return x>3&&y&&Object.defineProperty(d,m,y),y},h=this&&this.__param||function(u,d){return function(m,p){d(m,p,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;let l=n(844),c=n(2585),f={trace:c.LogLevelEnum.TRACE,debug:c.LogLevelEnum.DEBUG,info:c.LogLevelEnum.INFO,warn:c.LogLevelEnum.WARN,error:c.LogLevelEnum.ERROR,off:c.LogLevelEnum.OFF},v,g=i.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=c.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),v=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let d=0;d<u.length;d++)typeof u[d]=="function"&&(u[d]=u[d]())}_log(u,d,m){this._evalLazyOptionalParams(m),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+d,...m)}trace(u,...d){this._logLevel<=c.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,u,d)}debug(u,...d){this._logLevel<=c.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,u,d)}info(u,...d){this._logLevel<=c.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,u,d)}warn(u,...d){this._logLevel<=c.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,u,d)}error(u,...d){this._logLevel<=c.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,u,d)}};i.LogService=g=a([h(0,c.IOptionsService)],g),i.setTraceLogger=function(u){v=u},i.traceCall=function(u,d,m){if(typeof m.value!="function")throw new Error("not supported");let p=m.value;m.value=function(...b){if(v.logLevel!==c.LogLevelEnum.TRACE)return p.apply(this,b);v.trace(`GlyphRenderer#${p.name}(${b.map((y=>JSON.stringify(y))).join(", ")})`);let x=p.apply(this,b);return v.trace(`GlyphRenderer#${p.name} return`,x),x}}},7302:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;let a=n(8460),h=n(844),l=n(6114);i.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};let c=["normal","bold","100","200","300","400","500","600","700","800","900"];class f extends h.Disposable{constructor(g){super(),this._onOptionChange=this.register(new a.EventEmitter),this.onOptionChange=this._onOptionChange.event;let u={...i.DEFAULT_OPTIONS};for(let d in g)if(d in u)try{let m=g[d];u[d]=this._sanitizeAndValidateOption(d,m)}catch(m){console.error(m)}this.rawOptions=u,this.options={...u},this._setupOptions(),this.register((0,h.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(g,u){return this.onOptionChange((d=>{d===g&&u(this.rawOptions[g])}))}onMultipleOptionChange(g,u){return this.onOptionChange((d=>{g.indexOf(d)!==-1&&u()}))}_setupOptions(){let g=d=>{if(!(d in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${d}"`);return this.rawOptions[d]},u=(d,m)=>{if(!(d in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${d}"`);m=this._sanitizeAndValidateOption(d,m),this.rawOptions[d]!==m&&(this.rawOptions[d]=m,this._onOptionChange.fire(d))};for(let d in this.rawOptions){let m={get:g.bind(this,d),set:u.bind(this,d)};Object.defineProperty(this.options,d,m)}}_sanitizeAndValidateOption(g,u){switch(g){case"cursorStyle":if(u||(u=i.DEFAULT_OPTIONS[g]),!(function(d){return d==="block"||d==="underline"||d==="bar"})(u))throw new Error(`"${u}" is not a valid value for ${g}`);break;case"wordSeparator":u||(u=i.DEFAULT_OPTIONS[g]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=c.includes(u)?u:i.DEFAULT_OPTIONS[g];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${g} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${g} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${g} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${g} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}i.OptionsService=f},2660:function(o,i,n){var a=this&&this.__decorate||function(f,v,g,u){var d,m=arguments.length,p=m<3?v:u===null?u=Object.getOwnPropertyDescriptor(v,g):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(f,v,g,u);else for(var b=f.length-1;b>=0;b--)(d=f[b])&&(p=(m<3?d(p):m>3?d(v,g,p):d(v,g))||p);return m>3&&p&&Object.defineProperty(v,g,p),p},h=this&&this.__param||function(f,v){return function(g,u){v(g,u,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;let l=n(2585),c=i.OscLinkService=class{constructor(f){this._bufferService=f,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(f){let v=this._bufferService.buffer;if(f.id===void 0){let b=v.addMarker(v.ybase+v.y),x={data:f,id:this._nextId++,lines:[b]};return b.onDispose((()=>this._removeMarkerFromLink(x,b))),this._dataByLinkId.set(x.id,x),x.id}let g=f,u=this._getEntryIdKey(g),d=this._entriesWithId.get(u);if(d)return this.addLineToLink(d.id,v.ybase+v.y),d.id;let m=v.addMarker(v.ybase+v.y),p={id:this._nextId++,key:this._getEntryIdKey(g),data:g,lines:[m]};return m.onDispose((()=>this._removeMarkerFromLink(p,m))),this._entriesWithId.set(p.key,p),this._dataByLinkId.set(p.id,p),p.id}addLineToLink(f,v){let g=this._dataByLinkId.get(f);if(g&&g.lines.every((u=>u.line!==v))){let u=this._bufferService.buffer.addMarker(v);g.lines.push(u),u.onDispose((()=>this._removeMarkerFromLink(g,u)))}}getLinkData(f){return this._dataByLinkId.get(f)?.data}_getEntryIdKey(f){return`${f.id};;${f.uri}`}_removeMarkerFromLink(f,v){let g=f.lines.indexOf(v);g!==-1&&(f.lines.splice(g,1),f.lines.length===0&&(f.data.id!==void 0&&this._entriesWithId.delete(f.key),this._dataByLinkId.delete(f.id)))}};i.OscLinkService=c=a([h(0,l.IBufferService)],c)},8343:(o,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;let n="di$target",a="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(h){return h[a]||[]},i.createDecorator=function(h){if(i.serviceRegistry.has(h))return i.serviceRegistry.get(h);let l=function(c,f,v){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,u,d){u[n]===u?u[a].push({id:g,index:d}):(u[a]=[{id:g,index:d}],u[n]=u)})(l,c,v)};return l.toString=()=>h,i.serviceRegistry.set(h,l),l}},2585:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;let a=n(8343);var h;i.IBufferService=(0,a.createDecorator)("BufferService"),i.ICoreMouseService=(0,a.createDecorator)("CoreMouseService"),i.ICoreService=(0,a.createDecorator)("CoreService"),i.ICharsetService=(0,a.createDecorator)("CharsetService"),i.IInstantiationService=(0,a.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(h||(i.LogLevelEnum=h={})),i.ILogService=(0,a.createDecorator)("LogService"),i.IOptionsService=(0,a.createDecorator)("OptionsService"),i.IOscLinkService=(0,a.createDecorator)("OscLinkService"),i.IUnicodeService=(0,a.createDecorator)("UnicodeService"),i.IDecorationService=(0,a.createDecorator)("DecorationService")},1480:(o,i,n)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;let a=n(8460),h=n(225);class l{static extractShouldJoin(f){return(1&f)!=0}static extractWidth(f){return f>>1&3}static extractCharKind(f){return f>>3}static createPropertyValue(f,v,g=!1){return(16777215&f)<<3|(3&v)<<1|(g?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new a.EventEmitter,this.onChange=this._onChange.event;let f=new h.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let v=0,g=0,u=f.length;for(let d=0;d<u;++d){let m=f.charCodeAt(d);if(55296<=m&&m<=56319){if(++d>=u)return v+this.wcwidth(m);let x=f.charCodeAt(d);56320<=x&&x<=57343?m=1024*(m-55296)+x-56320+65536:v+=this.wcwidth(x)}let p=this.charProperties(m,g),b=l.extractWidth(p);l.extractShouldJoin(p)&&(b-=l.extractWidth(g)),v+=b,g=p}return v}charProperties(f,v){return this._activeProvider.charProperties(f,v)}}i.UnicodeService=l}},t={};function s(o){var i=t[o];if(i!==void 0)return i.exports;var n=t[o]={exports:{}};return e[o].call(n.exports,n,n.exports,s),n.exports}var r={};return(()=>{var o=r;Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;let i=s(9042),n=s(3236),a=s(844),h=s(5741),l=s(8285),c=s(7975),f=s(7090),v=["cols","rows"];class g extends a.Disposable{constructor(d){super(),this._core=this.register(new n.Terminal(d)),this._addonManager=this.register(new h.AddonManager),this._publicOptions={...this._core.options};let m=b=>this._core.options[b],p=(b,x)=>{this._checkReadonlyOptions(b),this._core.options[b]=x};for(let b in this._core.options){let x={get:m.bind(this,b),set:p.bind(this,b)};Object.defineProperty(this._publicOptions,b,x)}}_checkReadonlyOptions(d){if(v.includes(d))throw new Error(`Option "${d}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new c.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new f.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let d=this._core.coreService.decPrivateModes,m="none";switch(this._core.coreMouseService.activeProtocol){case"X10":m="x10";break;case"VT200":m="vt200";break;case"DRAG":m="drag";break;case"ANY":m="any"}return{applicationCursorKeysMode:d.applicationCursorKeys,applicationKeypadMode:d.applicationKeypad,bracketedPasteMode:d.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:m,originMode:d.origin,reverseWraparoundMode:d.reverseWraparound,sendFocusMode:d.sendFocus,wraparoundMode:d.wraparound}}get options(){return this._publicOptions}set options(d){for(let m in d)this._publicOptions[m]=d[m]}blur(){this._core.blur()}focus(){this._core.focus()}input(d,m=!0){this._core.input(d,m)}resize(d,m){this._verifyIntegers(d,m),this._core.resize(d,m)}open(d){this._core.open(d)}attachCustomKeyEventHandler(d){this._core.attachCustomKeyEventHandler(d)}attachCustomWheelEventHandler(d){this._core.attachCustomWheelEventHandler(d)}registerLinkProvider(d){return this._core.registerLinkProvider(d)}registerCharacterJoiner(d){return this._checkProposedApi(),this._core.registerCharacterJoiner(d)}deregisterCharacterJoiner(d){this._checkProposedApi(),this._core.deregisterCharacterJoiner(d)}registerMarker(d=0){return this._verifyIntegers(d),this._core.registerMarker(d)}registerDecoration(d){return this._checkProposedApi(),this._verifyPositiveIntegers(d.x??0,d.width??0,d.height??0),this._core.registerDecoration(d)}hasSelection(){return this._core.hasSelection()}select(d,m,p){this._verifyIntegers(d,m,p),this._core.select(d,m,p)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(d,m){this._verifyIntegers(d,m),this._core.selectLines(d,m)}dispose(){super.dispose()}scrollLines(d){this._verifyIntegers(d),this._core.scrollLines(d)}scrollPages(d){this._verifyIntegers(d),this._core.scrollPages(d)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(d){this._verifyIntegers(d),this._core.scrollToLine(d)}clear(){this._core.clear()}write(d,m){this._core.write(d,m)}writeln(d,m){this._core.write(d),this._core.write(`\r
|
|
11
|
+
`,m)}paste(d){this._core.paste(d)}refresh(d,m){this._verifyIntegers(d,m),this._core.refresh(d,m)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(d){this._addonManager.loadAddon(this,d)}static get strings(){return i}_verifyIntegers(...d){for(let m of d)if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...d){for(let m of d)if(m&&(m===1/0||isNaN(m)||m%1!=0||m<0))throw new Error("This API only accepts positive integers")}}o.Terminal=g})(),r})()))});var dy={};$n(dy,{apply:()=>$x,inject:()=>Hx});module.exports=_f(dy);var ne=require("react");var Ge=require("react"),as=require("@deepseek-ai/dsh-client-ui-primitives"),Dp=Fr(Vn(),1);var Jt="/ssh-local/v1",cs=class extends Error{constructor(s,r,o){super(r);this.status=s;this.body=o;this.name="ApiError"}};async function oe(e,t={}){let s=t.method??"GET",r=await fetch(`${Jt}${e}`,{...t,headers:{Accept:"application/json",...s==="GET"?{}:{"Content-Type":"application/json","X-DSH-SSH-Request":"1"},...t.headers}});if(r.status===204)return;let o=await r.json().catch(()=>({}));if(!r.ok)throw new cs(r.status,typeof o.error=="string"?o.error:`HTTP ${r.status}`,o);return o}function jn(){return oe("/profiles")}function Nl(){return oe("/ftp-profiles")}function zl(){return oe("/file-transfer/endpoints")}function Hl(e,t,s){let r=new URLSearchParams({paneId:e,endpointId:t});return s!==void 0&&r.set("path",s),oe(`/file-transfer/directory?${r.toString()}`)}function $l(e,t){return`${Jt}/file-transfer/download?${new URLSearchParams({endpointId:e,path:t}).toString()}`}function Br(e){return oe("/file-transfer/delete",{method:"POST",body:JSON.stringify(e)})}function Ul(e){return oe("/file-transfer/move",{method:"POST",body:JSON.stringify(e)})}function Vl(){return oe("/file-transfer/jobs")}function Nr(e){return oe("/file-transfer/jobs",{method:"POST",body:JSON.stringify(e)})}function jl(e){return oe(`/file-transfer/jobs/${encodeURIComponent(e)}`,{method:"DELETE"})}function Wl(){return oe("/vault")}function ql(){return oe("/proxies")}function Kl(){return oe("/forwards")}function Si(e){return oe(`/injections?sessionId=${encodeURIComponent(e)}`)}function Gl(e){return oe(`/profiles/${encodeURIComponent(e)}/projects`)}function Xl(e,t){return oe(`/profiles/${encodeURIComponent(e)}/projects`,{method:"POST",body:JSON.stringify({project:t})})}function Jl(e,t,s){return oe(`/profiles/${encodeURIComponent(e)}/projects/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({project:s})})}function Yl(e,t){return oe(`/profiles/${encodeURIComponent(e)}/projects/${encodeURIComponent(t)}`,{method:"DELETE"})}function ki(e){return oe(`/injections/${encodeURIComponent(e.sessionId)}`,{method:"PUT",body:JSON.stringify(e)})}function Ql(e){return oe(`/activity?sessionId=${encodeURIComponent(e)}`)}function Zl(e){return`${Jt}/activity/events?sessionId=${encodeURIComponent(e)}`}function eh(e,t,s){let r=new URLSearchParams({sessionId:e,profileId:t});return s!==void 0&&r.set("path",s),oe(`/activity/files?${r.toString()}`)}function th(e,t){let s=new URLSearchParams({sessionId:e});return t!==void 0&&s.set("path",t),oe(`/activity/local-directory?${s.toString()}`)}function sh(e,t){let s=new URLSearchParams({sessionId:e,path:t});return oe(`/activity/local-file?${s.toString()}`)}function rh(e,t,s){return oe("/activity/local-delete",{method:"POST",body:JSON.stringify({sessionId:e,directory:t,paths:s})})}function ih(e,t,s=!1){let r=new URLSearchParams({sessionId:e,path:t});return s&&r.set("inline","1"),`${Jt}/activity/local-download?${r.toString()}`}function nh(e,t,s){let r=new URLSearchParams({sessionId:e,profileId:t,path:s});return oe(`/activity/file?${r.toString()}`)}function oh(e,t,s,r=!1){let o=new URLSearchParams({sessionId:e,profileId:t,path:s});return r&&o.set("inline","1"),`${Jt}/activity/download?${o.toString()}`}function ah(e,t="~"){let s=new URLSearchParams({path:t});return oe(`/profiles/${encodeURIComponent(e)}/sftp/directory?${s.toString()}`)}function lh(e,t){let s=new URLSearchParams({path:t});return oe(`/profiles/${encodeURIComponent(e)}/sftp/file?${s.toString()}`)}function hh(e,t,s=!1){let r=new URLSearchParams({path:t});return s&&r.set("inline","1"),`${Jt}/profiles/${encodeURIComponent(e)}/sftp/download?${r.toString()}`}async function Wn(e,t,s,r=!1){let o=new URLSearchParams({directory:t,name:s.name});r&&o.set("overwrite","1");let i=await fetch(`${Jt}/profiles/${encodeURIComponent(e)}/sftp/upload?${o.toString()}`,{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/octet-stream","X-DSH-SSH-Request":"1"},body:s}),n=await i.json().catch(()=>({}));if(!i.ok)throw new cs(i.status,typeof n.error=="string"?n.error:`HTTP ${i.status}`,n);return n}function ch(e,t,s,r){return oe(`/activity/terminals/${encodeURIComponent(t)}/input`,{method:"POST",body:JSON.stringify({sessionId:e,text:s,sequence:r})})}function dh(e,t,s){let r=new URLSearchParams({sessionId:e,cursor:String(s)});return oe(`/activity/terminals/${encodeURIComponent(t)}/output?${r.toString()}`)}function uh(e,t,s=0){let r=new URLSearchParams({sessionId:e,cursor:String(s)});return`${Jt}/activity/terminals/${encodeURIComponent(t)}/stream?${r.toString()}`}function ph(e,t=0){let s=new URLSearchParams({cursor:String(t)});return`${Jt}/terminals/${encodeURIComponent(e)}/stream?${s.toString()}`}function fh(e,t,s,r){return oe(`/activity/terminals/${encodeURIComponent(t)}/resize`,{method:"POST",body:JSON.stringify({sessionId:e,cols:s,rows:r})})}function mh(e,t){let s=new URLSearchParams({sessionId:e});return oe(`/activity/terminals/${encodeURIComponent(t)}?${s.toString()}`,{method:"DELETE"})}function gh(e,t,s){return oe("/activity/directory",{method:"PUT",body:JSON.stringify({sessionId:e,profileId:t,cwd:s})})}function Yt(e){return`${e.username}@${e.host}:${e.port}`}var xe=require("react");function vh(e,t){let s=t||{};return(e[e.length-1]===""?[...e,""]:e).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}var xf=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yf=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wf={};function Ci(e,t){return((t||wf).jsx?yf:xf).test(e)}var Sf=/[ \t\n\f\r]/g;function qn(e){return typeof e=="object"?e.type==="text"?bh(e.value):!1:bh(e)}function bh(e){return e.replace(Sf,"")===""}var Qt=class{constructor(t,s,r){this.normal=s,this.property=t,r&&(this.space=r)}};Qt.prototype.normal={};Qt.prototype.property={};Qt.prototype.space=void 0;function Kn(e,t){let s={},r={};for(let o of e)Object.assign(s,o.property),Object.assign(r,o.normal);return new Qt(s,r,t)}function zr(e){return e.toLowerCase()}var Ke=class{constructor(t,s){this.attribute=s,this.property=t}};Ke.prototype.attribute="";Ke.prototype.booleanish=!1;Ke.prototype.boolean=!1;Ke.prototype.commaOrSpaceSeparated=!1;Ke.prototype.commaSeparated=!1;Ke.prototype.defined=!1;Ke.prototype.mustUseProperty=!1;Ke.prototype.number=!1;Ke.prototype.overloadedBoolean=!1;Ke.prototype.property="";Ke.prototype.spaceSeparated=!1;Ke.prototype.space=void 0;var Hr={};$n(Hr,{boolean:()=>fe,booleanish:()=>Fe,commaOrSpaceSeparated:()=>ct,commaSeparated:()=>Zt,number:()=>Z,overloadedBoolean:()=>Ei,spaceSeparated:()=>ke});var kf=0,fe=Os(),Fe=Os(),Ei=Os(),Z=Os(),ke=Os(),Zt=Os(),ct=Os();function Os(){return 2**++kf}var Gn=Object.keys(Hr),Ms=class extends Ke{constructor(t,s,r,o){let i=-1;if(super(t,s),_h(this,"space",o),typeof r=="number")for(;++i<Gn.length;){let n=Gn[i];_h(this,Gn[i],(r&Hr[n])===Hr[n])}}};Ms.prototype.defined=!0;function _h(e,t,s){s&&(e[t]=s)}function Tt(e){let t={},s={};for(let[r,o]of Object.entries(e.properties)){let i=new Ms(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,s[zr(r)]=r,s[zr(i.attribute)]=r}return new Qt(t,s,e.space)}var Xn=Tt({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:ke,ariaCurrent:null,ariaDescribedBy:ke,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:ke,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:ke,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ke,ariaLevel:Z,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:ke,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:ke,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:Fe,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ti(e,t){return t in e?e[t]:t}function Pi(e,t){return Ti(e,t.toLowerCase())}var xh=Tt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zt,acceptCharset:ke,accessKey:ke,action:null,allow:null,allowFullScreen:fe,allowPaymentRequest:fe,allowUserMedia:fe,alpha:fe,alt:null,as:null,async:fe,autoCapitalize:null,autoComplete:ke,autoFocus:fe,autoPlay:fe,blocking:ke,capture:null,charSet:null,checked:fe,cite:null,className:ke,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:Fe,controls:fe,controlsList:ke,coords:Z|Zt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fe,defer:fe,dir:null,dirName:null,disabled:fe,download:Ei,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fe,formTarget:null,headers:ke,height:Z,hidden:Ei,high:Z,href:null,hrefLang:null,htmlFor:ke,httpEquiv:ke,id:null,imageSizes:null,imageSrcSet:null,inert:fe,inputMode:null,integrity:null,is:null,isMap:fe,itemId:null,itemProp:ke,itemRef:ke,itemScope:fe,itemType:ke,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fe,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:fe,muted:fe,name:null,nonce:null,noModule:fe,noValidate:fe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:fe,optimum:Z,pattern:null,ping:ke,placeholder:null,playsInline:fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fe,referrerPolicy:null,rel:ke,required:fe,reversed:fe,rows:Z,rowSpan:Z,sandbox:ke,scope:null,scoped:fe,seamless:fe,selected:fe,shadowRootClonable:fe,shadowRootCustomElementRegistry:fe,shadowRootDelegatesFocus:fe,shadowRootMode:null,shadowRootSerializable:fe,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:Fe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:fe,useMap:null,value:Fe,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ke,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fe,declare:fe,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:fe,noHref:fe,noShade:fe,noWrap:fe,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:Fe,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:fe,disablePictureInPicture:fe,disableRemotePlayback:fe,exportParts:Zt,part:ke,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:Pi});var yh=Tt({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ct,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:ke,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Zt,g2:Zt,glyphName:Zt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:ct,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ke,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ct,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ct,rev:ct,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ct,requiredFeatures:ct,requiredFonts:ct,requiredFormats:ct,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:ct,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ct,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ct,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ti});var Jn=Tt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var Yn=Tt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Pi});var Qn=Tt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var Zn={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var Cf=/[A-Z]/g,wh=/-[a-z]/g,Ef=/^data[-\w.:]+$/i;function eo(e,t){let s=zr(t),r=t,o=Ke;if(s in e.normal)return e.property[e.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&Ef.test(t)){if(t.charAt(4)==="-"){let i=t.slice(5).replace(wh,Pf);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{let i=t.slice(4);if(!wh.test(i)){let n=i.replace(Cf,Tf);n.charAt(0)!=="-"&&(n="-"+n),t="data"+n}}o=Ms}return new o(r,t)}function Tf(e){return"-"+e.toLowerCase()}function Pf(e){return e.charAt(1).toUpperCase()}var Sh=Kn([Xn,xh,Jn,Yn,Qn],"html"),Di=Kn([Xn,yh,Jn,Yn,Qn],"svg");function kh(e){return e.join(" ").trim()}var zh=Fr(Mh(),1);var Ai=Fh("end"),hr=Fh("start");function Fh(e){return t;function t(s){let r=s&&s.position&&s.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ro(e){let t=hr(e),s=Ai(e);if(t&&s)return{start:t,end:s}}function ds(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Bh(e.position):"start"in e||"end"in e?Bh(e):"line"in e||"column"in e?io(e):""}function io(e){return Nh(e&&e.line)+":"+Nh(e&&e.column)}function Bh(e){return io(e&&e.start)+"-"+io(e&&e.end)}function Nh(e){return e&&typeof e=="number"?e:1}var He=class extends Error{constructor(t,s,r){super(),typeof s=="string"&&(r=s,s=void 0);let o="",i={},n=!1;if(s&&("line"in s&&"column"in s?i={place:s}:"start"in s&&"end"in s?i={place:s}:"type"in s?i={ancestors:[s],place:s.position}:i={...s}),typeof t=="string"?o=t:!i.cause&&t&&(n=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){let h=r.indexOf(":");h===-1?i.ruleId=r:(i.source=r.slice(0,h),i.ruleId=r.slice(h+1))}if(!i.place&&i.ancestors&&i.ancestors){let h=i.ancestors[i.ancestors.length-1];h&&(i.place=h.position)}let a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=ds(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=n&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};He.prototype.file="";He.prototype.name="";He.prototype.reason="";He.prototype.message="";He.prototype.stack="";He.prototype.column=void 0;He.prototype.line=void 0;He.prototype.ancestors=void 0;He.prototype.cause=void 0;He.prototype.fatal=void 0;He.prototype.place=void 0;He.prototype.ruleId=void 0;He.prototype.source=void 0;var no={}.hasOwnProperty,em=new Map,tm=/[A-Z]/g,sm=new Set(["table","tbody","thead","tfoot","tr"]),rm=new Set(["td","th"]),Hh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function oo(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let s=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=dm(s,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=cm(s,t.jsx,t.jsxs)}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Di:Sh,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=$h(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function $h(e,t,s){if(t.type==="element")return im(e,t,s);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return nm(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return am(e,t,s);if(t.type==="mdxjsEsm")return om(e,t);if(t.type==="root")return lm(e,t,s);if(t.type==="text")return hm(e,t)}function im(e,t,s){let r=e.schema,o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Di,e.schema=o),e.ancestors.push(t);let i=Vh(e,t.tagName,!1),n=um(e,t),a=lo(e,t);return sm.has(t.tagName)&&(a=a.filter(function(h){return typeof h=="string"?!qn(h):!0})),Uh(e,n,i,t),ao(n,a),e.ancestors.pop(),e.schema=r,e.create(t,i,n,s)}function nm(e,t){if(t.data&&t.data.estree&&e.evaluater){let r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ur(e,t.position)}function om(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ur(e,t.position)}function am(e,t,s){let r=e.schema,o=r;t.name==="svg"&&r.space==="html"&&(o=Di,e.schema=o),e.ancestors.push(t);let i=t.name===null?e.Fragment:Vh(e,t.name,!0),n=pm(e,t),a=lo(e,t);return Uh(e,n,i,t),ao(n,a),e.ancestors.pop(),e.schema=r,e.create(t,i,n,s)}function lm(e,t,s){let r={};return ao(r,lo(e,t)),e.create(t,e.Fragment,r,s)}function hm(e,t){return t.value}function Uh(e,t,s,r){typeof s!="string"&&s!==e.Fragment&&e.passNode&&(t.node=r)}function ao(e,t){if(t.length>0){let s=t.length>1?t:t[0];s&&(e.children=s)}}function cm(e,t,s){return r;function r(o,i,n,a){let l=Array.isArray(n.children)?s:t;return a?l(i,n,a):l(i,n)}}function dm(e,t){return s;function s(r,o,i,n){let a=Array.isArray(i.children),h=hr(r);return t(o,i,n,a,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function um(e,t){let s={},r,o;for(o in t.properties)if(o!=="children"&&no.call(t.properties,o)){let i=fm(e,o,t.properties[o]);if(i){let[n,a]=i;e.tableCellAlignToStyle&&n==="align"&&typeof a=="string"&&rm.has(t.tagName)?r=a:s[n]=a}}if(r){let i=s.style||(s.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return s}function pm(e,t){let s={};for(let r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){let i=r.data.estree.body[0];i.type;let n=i.expression;n.type;let a=n.properties[0];a.type,Object.assign(s,e.evaluater.evaluateExpression(a.argument))}else Ur(e,t.position);else{let o=r.name,i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){let a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else Ur(e,t.position);else i=r.value===null?!0:r.value;s[o]=i}return s}function lo(e,t){let s=[],r=-1,o=e.passKeys?new Map:em;for(;++r<t.children.length;){let i=t.children[r],n;if(e.passKeys){let h=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(h){let l=o.get(h)||0;n=h+"-"+l,o.set(h,l+1)}}let a=$h(e,i,n);a!==void 0&&s.push(a)}return s}function fm(e,t,s){let r=eo(e.schema,t);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=r.commaSeparated?vh(s):kh(s)),r.property==="style"){let o=typeof s=="object"?s:mm(e,String(s));return e.stylePropertyNameCase==="css"&&(o=gm(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?Zn[r.property]||r.property:r.attribute,s]}}function mm(e,t){try{return(0,zh.default)(t,{reactCompat:!0})}catch(s){if(e.ignoreInvalidStyle)return{};let r=s,o=new He("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Hh+"#cannot-parse-style-attribute",o}}function Vh(e,t,s){let r;if(!s)r={type:"Literal",value:t};else if(t.includes(".")){let o=t.split("."),i=-1,n;for(;++i<o.length;){let a=Ci(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};n=n?{type:"MemberExpression",object:n,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=n}else r=Ci(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){let o=r.value;return no.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ur(e)}function Ur(e,t){let s=new He("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Hh+"#cannot-handle-mdx-estrees-without-createevaluater",s}function gm(e){let t={},s;for(s in e)no.call(e,s)&&(t[vm(s)]=e[s]);return t}function vm(e){let t=e.replace(tm,bm);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function bm(e){return"-"+e.toLowerCase()}var Vr={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var pr=require("react/jsx-runtime"),gd=require("react");var _m={};function Bs(e,t){let s=t||_m,r=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,o=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return Wh(e,r,o)}function Wh(e,t,s){if(xm(e)){if("value"in e)return e.type==="html"&&!s?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return jh(e.children,t,s)}return Array.isArray(e)?jh(e,t,s):""}function jh(e,t,s){let r=[],o=-1;for(;++o<e.length;)r[o]=Wh(e[o],t,s);return r.join("")}function xm(e){return!!(e&&typeof e=="object")}var qh=document.createElement("i");function cr(e){let t="&"+e+";";qh.innerHTML=t;let s=qh.textContent;return s.charCodeAt(s.length-1)===59&&e!=="semi"||s===t?!1:s}function $e(e,t,s,r){let o=e.length,i=0,n;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,s=s>0?s:0,r.length<1e4)n=Array.from(r),n.unshift(t,s),e.splice(...n);else for(s&&e.splice(t,s);i<r.length;)n=r.slice(i,i+1e4),n.unshift(t,0),e.splice(...n),i+=1e4,t+=1e4}function it(e,t){return e.length>0?($e(e,e.length,0,t),e):t}var Kh={}.hasOwnProperty;function Ii(e){let t={},s=-1;for(;++s<e.length;)ym(t,e[s]);return t}function ym(e,t){let s;for(s in t){let o=(Kh.call(e,s)?e[s]:void 0)||(e[s]={}),i=t[s],n;if(i)for(n in i){Kh.call(o,n)||(o[n]=[]);let a=i[n];wm(o[n],Array.isArray(a)?a:a?[a]:[])}}}function wm(e,t){let s=-1,r=[];for(;++s<t.length;)(t[s].add==="after"?e:r).push(t[s]);$e(e,0,0,r)}function Li(e,t){let s=Number.parseInt(e,t);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"\uFFFD":String.fromCodePoint(s)}function Ze(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var We=us(/[A-Za-z]/),Be=us(/[\dA-Za-z]/),Gh=us(/[#-'*+\--9=?A-Z^-~]/);function Ns(e){return e!==null&&(e<32||e===127)}var jr=us(/\d/),Xh=us(/[\dA-Fa-f]/),Jh=us(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function _e(e){return e!==null&&(e<0||e===32)}function ue(e){return e===-2||e===-1||e===32}var zs=us(/\p{P}|\p{S}/u),Nt=us(/\s/);function us(e){return t;function t(s){return s!==null&&s>-1&&e.test(String.fromCharCode(s))}}function Pt(e){let t=[],s=-1,r=0,o=0;for(;++s<e.length;){let i=e.charCodeAt(s),n="";if(i===37&&Be(e.charCodeAt(s+1))&&Be(e.charCodeAt(s+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(n=String.fromCharCode(i));else if(i>55295&&i<57344){let a=e.charCodeAt(s+1);i<56320&&a>56319&&a<57344?(n=String.fromCharCode(i,a),o=1):n="\uFFFD"}else n=String.fromCharCode(i);n&&(t.push(e.slice(r,s),encodeURIComponent(n)),r=s+o+1,n=""),o&&(s+=o,o=0)}return t.join("")+e.slice(r)}function he(e,t,s,r){let o=r?r-1:Number.POSITIVE_INFINITY,i=0;return n;function n(h){return ue(h)?(e.enter(s),a(h)):t(h)}function a(h){return ue(h)&&i++<o?(e.consume(h),a):(e.exit(s),t(h))}}var Yh={tokenize:Sm};function Sm(e){let t=e.attempt(this.parser.constructs.contentInitial,r,o),s;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),he(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){let h=e.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=h),s=h,n(a)}function n(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ie(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),n)}}var Zh={tokenize:km},Qh={tokenize:Cm};function km(e){let t=this,s=[],r=0,o,i,n;return a;function a(x){if(r<s.length){let y=s[r];return t.containerState=y[1],e.attempt(y[0].continuation,h,l)(x)}return l(x)}function h(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();let y=t.events.length,S=y,_;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){_=t.events[S][1].end;break}p(r);let w=y;for(;w<t.events.length;)t.events[w][1].end={..._},w++;return $e(t.events,S+1,0,t.events.slice(y)),t.events.length=w,l(x)}return a(x)}function l(x){if(r===s.length){if(!o)return v(x);if(o.currentConstruct&&o.currentConstruct.concrete)return u(x);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Qh,c,f)(x)}function c(x){return o&&b(),p(r),v(x)}function f(x){return t.parser.lazy[t.now().line]=r!==s.length,n=t.now().offset,u(x)}function v(x){return t.containerState={},e.attempt(Qh,g,u)(x)}function g(x){return r++,s.push([t.currentConstruct,t.containerState]),v(x)}function u(x){if(x===null){o&&b(),p(0),e.consume(x);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),d(x)}function d(x){if(x===null){m(e.exit("chunkFlow"),!0),p(0),e.consume(x);return}return ie(x)?(e.consume(x),m(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(x),d)}function m(x,y){let S=t.sliceStream(x);if(y&&S.push(null),x.previous=i,i&&(i.next=x),i=x,o.defineSkip(x.start),o.write(S),t.parser.lazy[x.start.line]){let _=o.events.length;for(;_--;)if(o.events[_][1].start.offset<n&&(!o.events[_][1].end||o.events[_][1].end.offset>n))return;let w=t.events.length,C=w,P,T;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){if(P){T=t.events[C][1].end;break}P=!0}for(p(r),_=w;_<t.events.length;)t.events[_][1].end={...T},_++;$e(t.events,C+1,0,t.events.slice(w)),t.events.length=_}}function p(x){let y=s.length;for(;y-- >x;){let S=s[y];t.containerState=S[1],S[0].exit.call(t,e)}s.length=x}function b(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Cm(e,t,s){return he(e,e.attempt(this.parser.constructs.document,t,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function es(e){if(e===null||_e(e)||Nt(e))return 1;if(zs(e))return 2}function ps(e,t,s){let r=[],o=-1;for(;++o<e.length;){let i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,s),r.push(i))}return t}var Wr={name:"attention",resolveAll:Em,tokenize:Tm};function Em(e,t){let s=-1,r,o,i,n,a,h,l,c;for(;++s<e.length;)if(e[s][0]==="enter"&&e[s][1].type==="attentionSequence"&&e[s][1]._close){for(r=s;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[s][1]).charCodeAt(0)){if((e[r][1]._close||e[s][1]._open)&&(e[s][1].end.offset-e[s][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[s][1].end.offset-e[s][1].start.offset)%3))continue;h=e[r][1].end.offset-e[r][1].start.offset>1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;let f={...e[r][1].end},v={...e[s][1].start};ec(f,-h),ec(v,h),n={type:h>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:h>1?"strongSequence":"emphasisSequence",start:{...e[s][1].start},end:v},i={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[s][1].start}},o={type:h>1?"strong":"emphasis",start:{...n.start},end:{...a.end}},e[r][1].end={...n.start},e[s][1].start={...a.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=it(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=it(l,[["enter",o,t],["enter",n,t],["exit",n,t],["enter",i,t]]),l=it(l,ps(t.parser.constructs.insideSpan.null,e.slice(r+1,s),t)),l=it(l,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[s][1].end.offset-e[s][1].start.offset?(c=2,l=it(l,[["enter",e[s][1],t],["exit",e[s][1],t]])):c=0,$e(e,r-1,s-r+3,l),s=r+l.length-c-2;break}}for(s=-1;++s<e.length;)e[s][1].type==="attentionSequence"&&(e[s][1].type="data");return e}function Tm(e,t){let s=this.parser.constructs.attentionMarkers.null,r=this.previous,o=es(r),i;return n;function n(h){return i=h,e.enter("attentionSequence"),a(h)}function a(h){if(h===i)return e.consume(h),a;let l=e.exit("attentionSequence"),c=es(h),f=!c||c===2&&o||s.includes(h),v=!o||o===2&&c||s.includes(r);return l._open=!!(i===42?f:f&&(o||!v)),l._close=!!(i===42?v:v&&(c||!f)),t(h)}}function ec(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ho={name:"autolink",tokenize:Pm};function Pm(e,t,s){let r=0;return o;function o(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(g){return We(g)?(e.consume(g),n):g===64?s(g):l(g)}function n(g){return g===43||g===45||g===46||Be(g)?(r=1,a(g)):l(g)}function a(g){return g===58?(e.consume(g),r=0,h):(g===43||g===45||g===46||Be(g))&&r++<32?(e.consume(g),a):(r=0,l(g))}function h(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Ns(g)?s(g):(e.consume(g),h)}function l(g){return g===64?(e.consume(g),c):Gh(g)?(e.consume(g),l):s(g)}function c(g){return Be(g)?f(g):s(g)}function f(g){return g===46?(e.consume(g),r=0,c):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):v(g)}function v(g){if((g===45||Be(g))&&r++<63){let u=g===45?v:f;return e.consume(g),u}return s(g)}}var zt={partial:!0,tokenize:Dm};function Dm(e,t,s){return r;function r(i){return ue(i)?he(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||ie(i)?t(i):s(i)}}var Oi={continuation:{tokenize:Am},exit:Im,name:"blockQuote",tokenize:Rm};function Rm(e,t,s){let r=this;return o;function o(n){if(n===62){let a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(n),e.exit("blockQuoteMarker"),i}return s(n)}function i(n){return ue(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}function Am(e,t,s){let r=this;return o;function o(n){return ue(n)?he(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(n):i(n)}function i(n){return e.attempt(Oi,t,s)(n)}}function Im(e){e.exit("blockQuote")}var Mi={name:"characterEscape",tokenize:Lm};function Lm(e,t,s){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return Jh(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):s(i)}}var Fi={name:"characterReference",tokenize:Om};function Om(e,t,s){let r=this,o=0,i,n;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),h}function h(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,n=Be,c(f))}function l(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,n=Xh,c):(e.enter("characterReferenceValue"),i=7,n=jr,c(f))}function c(f){if(f===59&&o){let v=e.exit("characterReferenceValue");return n===Be&&!cr(r.sliceSerialize(v))?s(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return n(f)&&o++<i?(e.consume(f),c):s(f)}}var tc={partial:!0,tokenize:Fm},Bi={concrete:!0,name:"codeFenced",tokenize:Mm};function Mm(e,t,s){let r=this,o={partial:!0,tokenize:S},i=0,n=0,a;return h;function h(_){return l(_)}function l(_){let w=r.events[r.events.length-1];return i=w&&w[1].type==="linePrefix"?w[2].sliceSerialize(w[1],!0).length:0,a=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(_)}function c(_){return _===a?(n++,e.consume(_),c):n<3?s(_):(e.exit("codeFencedFenceSequence"),ue(_)?he(e,f,"whitespace")(_):f(_))}function f(_){return _===null||ie(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(tc,d,y)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===null||ie(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(_)):ue(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),he(e,g,"whitespace")(_)):_===96&&_===a?s(_):(e.consume(_),v)}function g(_){return _===null||ie(_)?f(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),u(_))}function u(_){return _===null||ie(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(_)):_===96&&_===a?s(_):(e.consume(_),u)}function d(_){return e.attempt(o,y,m)(_)}function m(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),p}function p(_){return i>0&&ue(_)?he(e,b,"linePrefix",i+1)(_):b(_)}function b(_){return _===null||ie(_)?e.check(tc,d,y)(_):(e.enter("codeFlowValue"),x(_))}function x(_){return _===null||ie(_)?(e.exit("codeFlowValue"),b(_)):(e.consume(_),x)}function y(_){return e.exit("codeFenced"),t(_)}function S(_,w,C){let P=0;return T;function T(N){return _.enter("lineEnding"),_.consume(N),_.exit("lineEnding"),A}function A(N){return _.enter("codeFencedFence"),ue(N)?he(_,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):F(N)}function F(N){return N===a?(_.enter("codeFencedFenceSequence"),B(N)):C(N)}function B(N){return N===a?(P++,_.consume(N),B):P>=n?(_.exit("codeFencedFenceSequence"),ue(N)?he(_,U,"whitespace")(N):U(N)):C(N)}function U(N){return N===null||ie(N)?(_.exit("codeFencedFence"),w(N)):C(N)}}}function Fm(e,t,s){let r=this;return o;function o(n){return n===null?s(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i)}function i(n){return r.parser.lazy[r.now().line]?s(n):t(n)}}var qr={name:"codeIndented",tokenize:Nm},Bm={partial:!0,tokenize:zm};function Nm(e,t,s){let r=this;return o;function o(l){return e.enter("codeIndented"),he(e,i,"linePrefix",5)(l)}function i(l){let c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?n(l):s(l)}function n(l){return l===null?h(l):ie(l)?e.attempt(Bm,n,h)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||ie(l)?(e.exit("codeFlowValue"),n(l)):(e.consume(l),a)}function h(l){return e.exit("codeIndented"),t(l)}}function zm(e,t,s){let r=this;return o;function o(n){return r.parser.lazy[r.now().line]?s(n):ie(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),o):he(e,i,"linePrefix",5)(n)}function i(n){let a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(n):ie(n)?o(n):s(n)}}var co={name:"codeText",previous:$m,resolve:Hm,tokenize:Um};function Hm(e){let t=e.length-4,s=3,r,o;if((e[s][1].type==="lineEnding"||e[s][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=s;++r<t;)if(e[r][1].type==="codeTextData"){e[s][1].type="codeTextPadding",e[t][1].type="codeTextPadding",s+=2,t-=2;break}}for(r=s-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function $m(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Um(e,t,s){let r=this,o=0,i,n;return a;function a(v){return e.enter("codeText"),e.enter("codeTextSequence"),h(v)}function h(v){return v===96?(e.consume(v),o++,h):(e.exit("codeTextSequence"),l(v))}function l(v){return v===null?s(v):v===32?(e.enter("space"),e.consume(v),e.exit("space"),l):v===96?(n=e.enter("codeTextSequence"),i=0,f(v)):ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(v))}function c(v){return v===null||v===32||v===96||ie(v)?(e.exit("codeTextData"),l(v)):(e.consume(v),c)}function f(v){return v===96?(e.consume(v),i++,f):i===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(v)):(n.type="codeTextData",c(v))}}var Ni=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,s){let r=s??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,s,r){let o=s||0;this.setCursor(Math.trunc(t));let i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Kr(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Kr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Kr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let s=this.left.splice(t,Number.POSITIVE_INFINITY);Kr(this.right,s.reverse())}else{let s=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Kr(this.left,s.reverse())}}};function Kr(e,t){let s=0;if(t.length<1e4)e.push(...t);else for(;s<t.length;)e.push(...t.slice(s,s+1e4)),s+=1e4}function zi(e){let t={},s=-1,r,o,i,n,a,h,l,c=new Ni(e);for(;++s<c.length;){for(;s in t;)s=t[s];if(r=c.get(s),s&&r[1].type==="chunkFlow"&&c.get(s-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,i=0,i<h.length&&h[i][1].type==="lineEndingBlank"&&(i+=2),i<h.length&&h[i][1].type==="content"))for(;++i<h.length&&h[i][1].type!=="content";)h[i][1].type==="chunkText"&&(h[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Vm(c,s)),s=t[s],l=!0);else if(r[1]._container){for(i=s,o=void 0;i--;)if(n=c.get(i),n[1].type==="lineEnding"||n[1].type==="lineEndingBlank")n[0]==="enter"&&(o&&(c.get(o)[1].type="lineEndingBlank"),n[1].type="lineEnding",o=i);else if(!(n[1].type==="linePrefix"||n[1].type==="listItemIndent"))break;o&&(r[1].end={...c.get(o)[1].start},a=c.slice(o,s),a.unshift(r),c.splice(o,s-o+1,a))}}return $e(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Vm(e,t){let s=e.get(t)[1],r=e.get(t)[2],o=t-1,i=[],n=s._tokenizer;n||(n=r.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(n._contentTypeTextTrailing=!0));let a=n.events,h=[],l={},c,f,v=-1,g=s,u=0,d=0,m=[d];for(;g;){for(;e.get(++o)[1]!==g;);i.push(o),g._tokenizer||(c=r.sliceStream(g),g.next||c.push(null),f&&n.defineSkip(g.start),g._isInFirstContentOfListItem&&(n._gfmTasklistFirstContentOfListItem=!0),n.write(c),g._isInFirstContentOfListItem&&(n._gfmTasklistFirstContentOfListItem=void 0)),f=g,g=g.next}for(g=s;++v<a.length;)a[v][0]==="exit"&&a[v-1][0]==="enter"&&a[v][1].type===a[v-1][1].type&&a[v][1].start.line!==a[v][1].end.line&&(d=v+1,m.push(d),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(n.events=[],g?(g._tokenizer=void 0,g.previous=void 0):m.pop(),v=m.length;v--;){let p=a.slice(m[v],m[v+1]),b=i.pop();h.push([b,b+p.length-1]),e.splice(b,2,p)}for(h.reverse(),v=-1;++v<h.length;)l[u+h[v][0]]=u+h[v][1],u+=h[v][1]-h[v][0]-1;return l}var uo={resolve:Wm,tokenize:qm},jm={partial:!0,tokenize:Km};function Wm(e){return zi(e),e}function qm(e,t){let s;return r;function r(a){return e.enter("content"),s=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):ie(a)?e.check(jm,n,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function n(a){return e.consume(a),e.exit("chunkContent"),s.next=e.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,o}}function Km(e,t,s){let r=this;return o;function o(n){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),he(e,i,"linePrefix")}function i(n){if(n===null||ie(n))return s(n);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(n):e.interrupt(r.parser.constructs.flow,s,t)(n)}}function Hi(e,t,s,r,o,i,n,a,h){let l=h||Number.POSITIVE_INFINITY,c=0;return f;function f(p){return p===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(p),e.exit(i),v):p===null||p===32||p===41||Ns(p)?s(p):(e.enter(r),e.enter(n),e.enter(a),e.enter("chunkString",{contentType:"string"}),d(p))}function v(p){return p===62?(e.enter(i),e.consume(p),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),g(p))}function g(p){return p===62?(e.exit("chunkString"),e.exit(a),v(p)):p===null||p===60||ie(p)?s(p):(e.consume(p),p===92?u:g)}function u(p){return p===60||p===62||p===92?(e.consume(p),g):g(p)}function d(p){return!c&&(p===null||p===41||_e(p))?(e.exit("chunkString"),e.exit(a),e.exit(n),e.exit(r),t(p)):c<l&&p===40?(e.consume(p),c++,d):p===41?(e.consume(p),c--,d):p===null||p===32||p===40||Ns(p)?s(p):(e.consume(p),p===92?m:d)}function m(p){return p===40||p===41||p===92?(e.consume(p),d):d(p)}}function $i(e,t,s,r,o,i){let n=this,a=0,h;return l;function l(g){return e.enter(r),e.enter(o),e.consume(g),e.exit(o),e.enter(i),c}function c(g){return a>999||g===null||g===91||g===93&&!h||g===94&&!a&&"_hiddenFootnoteSupport"in n.parser.constructs?s(g):g===93?(e.exit(i),e.enter(o),e.consume(g),e.exit(o),e.exit(r),t):ie(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||ie(g)||a++>999?(e.exit("chunkString"),c(g)):(e.consume(g),h||(h=!ue(g)),g===92?v:f)}function v(g){return g===91||g===92||g===93?(e.consume(g),a++,f):f(g)}}function Ui(e,t,s,r,o,i){let n;return a;function a(v){return v===34||v===39||v===40?(e.enter(r),e.enter(o),e.consume(v),e.exit(o),n=v===40?41:v,h):s(v)}function h(v){return v===n?(e.enter(o),e.consume(v),e.exit(o),e.exit(r),t):(e.enter(i),l(v))}function l(v){return v===n?(e.exit(i),h(n)):v===null?s(v):ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),he(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(v))}function c(v){return v===n||v===null||ie(v)?(e.exit("chunkString"),l(v)):(e.consume(v),v===92?f:c)}function f(v){return v===n||v===92?(e.consume(v),c):c(v)}}function Hs(e,t){let s;return r;function r(o){return ie(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s=!0,r):ue(o)?he(e,r,s?"linePrefix":"lineSuffix")(o):t(o)}}var po={name:"definition",tokenize:Xm},Gm={partial:!0,tokenize:Jm};function Xm(e,t,s){let r=this,o;return i;function i(g){return e.enter("definition"),n(g)}function n(g){return $i.call(r,e,a,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function a(g){return o=Ze(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),h):s(g)}function h(g){return _e(g)?Hs(e,l)(g):l(g)}function l(g){return Hi(e,c,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function c(g){return e.attempt(Gm,f,f)(g)}function f(g){return ue(g)?he(e,v,"whitespace")(g):v(g)}function v(g){return g===null||ie(g)?(e.exit("definition"),r.parser.defined.push(o),t(g)):s(g)}}function Jm(e,t,s){return r;function r(a){return _e(a)?Hs(e,o)(a):s(a)}function o(a){return Ui(e,i,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return ue(a)?he(e,n,"whitespace")(a):n(a)}function n(a){return a===null||ie(a)?t(a):s(a)}}var fo={name:"hardBreakEscape",tokenize:Ym};function Ym(e,t,s){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return ie(i)?(e.exit("hardBreakEscape"),t(i)):s(i)}}var mo={name:"headingAtx",resolve:Qm,tokenize:Zm};function Qm(e,t){let s=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),s-2>r&&e[s][1].type==="whitespace"&&(s-=2),e[s][1].type==="atxHeadingSequence"&&(r===s-1||s-4>r&&e[s-2][1].type==="whitespace")&&(s-=r+1===s?2:4),s>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[s][1].end},i={type:"chunkText",start:e[r][1].start,end:e[s][1].end,contentType:"text"},$e(e,r,s-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function Zm(e,t,s){let r=0;return o;function o(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),n(c)}function n(c){return c===35&&r++<6?(e.consume(c),n):c===null||_e(c)?(e.exit("atxHeadingSequence"),a(c)):s(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),h(c)):c===null||ie(c)?(e.exit("atxHeading"),t(c)):ue(c)?he(e,a,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function h(c){return c===35?(e.consume(c),h):(e.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||_e(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),l)}}var sc=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],go=["pre","script","style","textarea"];var vo={concrete:!0,name:"htmlFlow",resolveTo:sg,tokenize:rg},eg={partial:!0,tokenize:ng},tg={partial:!0,tokenize:ig};function sg(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function rg(e,t,s){let r=this,o,i,n,a,h;return l;function l(O){return c(O)}function c(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),f}function f(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),i=!0,d):O===63?(e.consume(O),o=3,r.interrupt?t:k):We(O)?(e.consume(O),n=String.fromCharCode(O),m):s(O)}function v(O){return O===45?(e.consume(O),o=2,g):O===91?(e.consume(O),o=5,a=0,u):We(O)?(e.consume(O),o=4,r.interrupt?t:k):s(O)}function g(O){return O===45?(e.consume(O),r.interrupt?t:k):s(O)}function u(O){let se="CDATA[";return O===se.charCodeAt(a++)?(e.consume(O),a===se.length?r.interrupt?t:F:u):s(O)}function d(O){return We(O)?(e.consume(O),n=String.fromCharCode(O),m):s(O)}function m(O){if(O===null||O===47||O===62||_e(O)){let se=O===47,z=n.toLowerCase();return!se&&!i&&go.includes(z)?(o=1,r.interrupt?t(O):F(O)):sc.includes(n.toLowerCase())?(o=6,se?(e.consume(O),p):r.interrupt?t(O):F(O)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?s(O):i?b(O):x(O))}return O===45||Be(O)?(e.consume(O),n+=String.fromCharCode(O),m):s(O)}function p(O){return O===62?(e.consume(O),r.interrupt?t:F):s(O)}function b(O){return ue(O)?(e.consume(O),b):T(O)}function x(O){return O===47?(e.consume(O),T):O===58||O===95||We(O)?(e.consume(O),y):ue(O)?(e.consume(O),x):T(O)}function y(O){return O===45||O===46||O===58||O===95||Be(O)?(e.consume(O),y):S(O)}function S(O){return O===61?(e.consume(O),_):ue(O)?(e.consume(O),S):x(O)}function _(O){return O===null||O===60||O===61||O===62||O===96?s(O):O===34||O===39?(e.consume(O),h=O,w):ue(O)?(e.consume(O),_):C(O)}function w(O){return O===h?(e.consume(O),h=null,P):O===null||ie(O)?s(O):(e.consume(O),w)}function C(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||_e(O)?S(O):(e.consume(O),C)}function P(O){return O===47||O===62||ue(O)?x(O):s(O)}function T(O){return O===62?(e.consume(O),A):s(O)}function A(O){return O===null||ie(O)?F(O):ue(O)?(e.consume(O),A):s(O)}function F(O){return O===45&&o===2?(e.consume(O),H):O===60&&o===1?(e.consume(O),E):O===62&&o===4?(e.consume(O),$):O===63&&o===3?(e.consume(O),k):O===93&&o===5?(e.consume(O),L):ie(O)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(eg,X,B)(O)):O===null||ie(O)?(e.exit("htmlFlowData"),B(O)):(e.consume(O),F)}function B(O){return e.check(tg,U,X)(O)}function U(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),N}function N(O){return O===null||ie(O)?B(O):(e.enter("htmlFlowData"),F(O))}function H(O){return O===45?(e.consume(O),k):F(O)}function E(O){return O===47?(e.consume(O),n="",R):F(O)}function R(O){if(O===62){let se=n.toLowerCase();return go.includes(se)?(e.consume(O),$):F(O)}return We(O)&&n.length<8?(e.consume(O),n+=String.fromCharCode(O),R):F(O)}function L(O){return O===93?(e.consume(O),k):F(O)}function k(O){return O===62?(e.consume(O),$):O===45&&o===2?(e.consume(O),k):F(O)}function $(O){return O===null||ie(O)?(e.exit("htmlFlowData"),X(O)):(e.consume(O),$)}function X(O){return e.exit("htmlFlow"),t(O)}}function ig(e,t,s){let r=this;return o;function o(n){return ie(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i):s(n)}function i(n){return r.parser.lazy[r.now().line]?s(n):t(n)}}function ng(e,t,s){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(zt,t,s)}}var bo={name:"htmlText",tokenize:og};function og(e,t,s){let r=this,o,i,n;return a;function a(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),h}function h(k){return k===33?(e.consume(k),l):k===47?(e.consume(k),S):k===63?(e.consume(k),x):We(k)?(e.consume(k),C):s(k)}function l(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),i=0,u):We(k)?(e.consume(k),b):s(k)}function c(k){return k===45?(e.consume(k),g):s(k)}function f(k){return k===null?s(k):k===45?(e.consume(k),v):ie(k)?(n=f,E(k)):(e.consume(k),f)}function v(k){return k===45?(e.consume(k),g):f(k)}function g(k){return k===62?H(k):k===45?v(k):f(k)}function u(k){let $="CDATA[";return k===$.charCodeAt(i++)?(e.consume(k),i===$.length?d:u):s(k)}function d(k){return k===null?s(k):k===93?(e.consume(k),m):ie(k)?(n=d,E(k)):(e.consume(k),d)}function m(k){return k===93?(e.consume(k),p):d(k)}function p(k){return k===62?H(k):k===93?(e.consume(k),p):d(k)}function b(k){return k===null||k===62?H(k):ie(k)?(n=b,E(k)):(e.consume(k),b)}function x(k){return k===null?s(k):k===63?(e.consume(k),y):ie(k)?(n=x,E(k)):(e.consume(k),x)}function y(k){return k===62?H(k):x(k)}function S(k){return We(k)?(e.consume(k),_):s(k)}function _(k){return k===45||Be(k)?(e.consume(k),_):w(k)}function w(k){return ie(k)?(n=w,E(k)):ue(k)?(e.consume(k),w):H(k)}function C(k){return k===45||Be(k)?(e.consume(k),C):k===47||k===62||_e(k)?P(k):s(k)}function P(k){return k===47?(e.consume(k),H):k===58||k===95||We(k)?(e.consume(k),T):ie(k)?(n=P,E(k)):ue(k)?(e.consume(k),P):H(k)}function T(k){return k===45||k===46||k===58||k===95||Be(k)?(e.consume(k),T):A(k)}function A(k){return k===61?(e.consume(k),F):ie(k)?(n=A,E(k)):ue(k)?(e.consume(k),A):P(k)}function F(k){return k===null||k===60||k===61||k===62||k===96?s(k):k===34||k===39?(e.consume(k),o=k,B):ie(k)?(n=F,E(k)):ue(k)?(e.consume(k),F):(e.consume(k),U)}function B(k){return k===o?(e.consume(k),o=void 0,N):k===null?s(k):ie(k)?(n=B,E(k)):(e.consume(k),B)}function U(k){return k===null||k===34||k===39||k===60||k===61||k===96?s(k):k===47||k===62||_e(k)?P(k):(e.consume(k),U)}function N(k){return k===47||k===62||_e(k)?P(k):s(k)}function H(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):s(k)}function E(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),R}function R(k){return ue(k)?he(e,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):L(k)}function L(k){return e.enter("htmlTextData"),n(k)}}var $s={name:"labelEnd",resolveAll:cg,resolveTo:dg,tokenize:ug},ag={tokenize:pg},lg={tokenize:fg},hg={tokenize:mg};function cg(e){let t=-1,s=[];for(;++t<e.length;){let r=e[t][1];if(s.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==s.length&&$e(e,0,e.length,s),e}function dg(e,t){let s=e.length,r=0,o,i,n,a;for(;s--;)if(o=e[s][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[s][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(n){if(e[s][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=s,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(n=s);let h={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[i][1].start},end:{...e[n][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[n-2][1].start}};return a=[["enter",h,t],["enter",l,t]],a=it(a,e.slice(i+1,i+r+3)),a=it(a,[["enter",c,t]]),a=it(a,ps(t.parser.constructs.insideSpan.null,e.slice(i+r+4,n-3),t)),a=it(a,[["exit",c,t],e[n-2],e[n-1],["exit",l,t]]),a=it(a,e.slice(n+1)),a=it(a,[["exit",h,t]]),$e(e,i,e.length,a),e}function ug(e,t,s){let r=this,o=r.events.length,i,n;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(v){return i?i._inactive?f(v):(n=r.parser.defined.includes(Ze(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):s(v)}function h(v){return v===40?e.attempt(ag,c,n?c:f)(v):v===91?e.attempt(lg,c,n?l:f)(v):n?c(v):f(v)}function l(v){return e.attempt(hg,c,f)(v)}function c(v){return t(v)}function f(v){return i._balanced=!0,s(v)}}function pg(e,t,s){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return _e(f)?Hs(e,i)(f):i(f)}function i(f){return f===41?c(f):Hi(e,n,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function n(f){return _e(f)?Hs(e,h)(f):c(f)}function a(f){return s(f)}function h(f){return f===34||f===39||f===40?Ui(e,l,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return _e(f)?Hs(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):s(f)}}function fg(e,t,s){let r=this;return o;function o(a){return $i.call(r,e,i,n,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Ze(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):s(a)}function n(a){return s(a)}}function mg(e,t,s){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):s(i)}}var _o={name:"labelStartImage",resolveAll:$s.resolveAll,tokenize:gg};function gg(e,t,s){let r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),n):s(a)}function n(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(a):t(a)}}var xo={name:"labelStartLink",resolveAll:$s.resolveAll,tokenize:vg};function vg(e,t,s){let r=this;return o;function o(n){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(n),e.exit("labelMarker"),e.exit("labelLink"),i}function i(n){return n===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(n):t(n)}}var Gr={name:"lineEnding",tokenize:bg};function bg(e,t){return s;function s(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),he(e,t,"linePrefix")}}var Us={name:"thematicBreak",tokenize:_g};function _g(e,t,s){let r=0,o;return i;function i(l){return e.enter("thematicBreak"),n(l)}function n(l){return o=l,a(l)}function a(l){return l===o?(e.enter("thematicBreakSequence"),h(l)):r>=3&&(l===null||ie(l))?(e.exit("thematicBreak"),t(l)):s(l)}function h(l){return l===o?(e.consume(l),r++,h):(e.exit("thematicBreakSequence"),ue(l)?he(e,a,"whitespace")(l):a(l))}}var et={continuation:{tokenize:Sg},exit:Cg,name:"list",tokenize:wg},xg={partial:!0,tokenize:Eg},yg={partial:!0,tokenize:kg};function wg(e,t,s){let r=this,o=r.events[r.events.length-1],i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,n=0;return a;function a(g){let u=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(u==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:jr(g)){if(r.containerState.type||(r.containerState.type=u,e.enter(u,{_container:!0})),u==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Us,s,l)(g):l(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(g)}return s(g)}function h(g){return jr(g)&&++n<10?(e.consume(g),h):(!r.interrupt||n<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),l(g)):s(g)}function l(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(zt,r.interrupt?s:c,e.attempt(xg,v,f))}function c(g){return r.containerState.initialBlankLine=!0,i++,v(g)}function f(g){return ue(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):s(g)}function v(g){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function Sg(e,t,s){let r=this;return r.containerState._closeFlow=void 0,e.check(zt,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,he(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!ue(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,n(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(yg,t,n)(a))}function n(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,he(e,e.attempt(et,t,s),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function kg(e,t,s){let r=this;return he(e,o,"listItemIndent",r.containerState.size+1);function o(i){let n=r.events[r.events.length-1];return n&&n[1].type==="listItemIndent"&&n[2].sliceSerialize(n[1],!0).length===r.containerState.size?t(i):s(i)}}function Cg(e){e.exit(this.containerState.type)}function Eg(e,t,s){let r=this;return he(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){let n=r.events[r.events.length-1];return!ue(i)&&n&&n[1].type==="listItemPrefixWhitespace"?t(i):s(i)}}var Vi={name:"setextUnderline",resolveTo:Tg,tokenize:Pg};function Tg(e,t){let s=e.length,r,o,i;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){r=s;break}e[s][1].type==="paragraph"&&(o=s)}else e[s][1].type==="content"&&e.splice(s,1),!i&&e[s][1].type==="definition"&&(i=s);let n={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",n,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=n,e.push(["exit",n,t]),e}function Pg(e,t,s){let r=this,o;return i;function i(l){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),o=l,n(l)):s(l)}function n(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===o?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),ue(l)?he(e,h,"lineSuffix")(l):h(l))}function h(l){return l===null||ie(l)?(e.exit("setextHeadingLine"),t(l)):s(l)}}var rc={tokenize:Dg};function Dg(e){let t=this,s=e.attempt(zt,r,e.attempt(this.parser.constructs.flowInitial,o,he(e,e.attempt(this.parser.constructs.flow,o,e.attempt(uo,o)),"linePrefix")));return s;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,s}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,s}}var ic={resolveAll:lc()},nc=ac("string"),oc=ac("text");function ac(e){return{resolveAll:lc(e==="text"?Rg:void 0),tokenize:t};function t(s){let r=this,o=this.parser.constructs[e],i=s.attempt(o,n,a);return n;function n(c){return l(c)?i(c):a(c)}function a(c){if(c===null){s.consume(c);return}return s.enter("data"),s.consume(c),h}function h(c){return l(c)?(s.exit("data"),i(c)):(s.consume(c),h)}function l(c){if(c===null)return!0;let f=o[c],v=-1;if(f)for(;++v<f.length;){let g=f[v];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function lc(e){return t;function t(s,r){let o=-1,i;for(;++o<=s.length;)i===void 0?s[o]&&s[o][1].type==="data"&&(i=o,o++):(!s[o]||s[o][1].type!=="data")&&(o!==i+2&&(s[i][1].end=s[o-1][1].end,s.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(s,r):s}}function Rg(e,t){let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){let r=e[s-1][1],o=t.sliceStream(r),i=o.length,n=-1,a=0,h;for(;i--;){let l=o[i];if(typeof l=="string"){for(n=l.length;l.charCodeAt(n-1)===32;)a++,n--;if(n)break;n=-1}else if(l===-2)h=!0,a++;else if(l!==-1){i++;break}}if(t._contentTypeTextTrailing&&s===e.length&&(a=0),a){let l={type:s===e.length||h||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?n:r.start._bufferIndex+n,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(s,0,["enter",l,t],["exit",l,t]),s+=2)}s++}return e}var yo={};$n(yo,{attentionMarkers:()=>Ng,contentInitial:()=>Ig,disable:()=>zg,document:()=>Ag,flow:()=>Og,flowInitial:()=>Lg,insideSpan:()=>Bg,string:()=>Mg,text:()=>Fg});var Ag={42:et,43:et,45:et,48:et,49:et,50:et,51:et,52:et,53:et,54:et,55:et,56:et,57:et,62:Oi},Ig={91:po},Lg={[-2]:qr,[-1]:qr,32:qr},Og={35:mo,42:Us,45:[Vi,Us],60:vo,61:Vi,95:Us,96:Bi,126:Bi},Mg={38:Fi,92:Mi},Fg={[-5]:Gr,[-4]:Gr,[-3]:Gr,33:_o,38:Fi,42:Wr,60:[ho,bo],91:xo,92:[fo,Mi],93:$s,95:Wr,96:co},Bg={null:[Wr,ic]},Ng={null:[42,95]},zg={null:[]};function hc(e,t,s){let r={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0},o={},i=[],n=[],a=[],h=!0,l={attempt:P(w),check:P(C),consume:y,enter:S,exit:_,interrupt:P(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:u,sliceStream:d,write:g},f=t.tokenize.call(c,l),v;return t.resolveAll&&i.push(t),c;function g(B){return n=it(n,B),b(),n[n.length-1]!==null?[]:(T(t,0),c.events=ps(i,c.events,c),c.events)}function u(B,U){return $g(d(B),U)}function d(B){return Hg(n,B)}function m(){let{_bufferIndex:B,_index:U,line:N,column:H,offset:E}=r;return{_bufferIndex:B,_index:U,line:N,column:H,offset:E}}function p(B){o[B.line]=B.column,F()}function b(){let B;for(;r._index<n.length;){let U=n[r._index];if(typeof U=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<U.length;)x(U.charCodeAt(r._bufferIndex));else x(U)}}function x(B){h=void 0,v=B,f=f(B)}function y(B){ie(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,F()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===n[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=B,h=!0}function S(B,U){let N=U||{};return N.type=B,N.start=m(),c.events.push(["enter",N,c]),a.push(N),N}function _(B){let U=a.pop();return U.end=m(),c.events.push(["exit",U,c]),U}function w(B,U){T(B,U.from)}function C(B,U){U.restore()}function P(B,U){return N;function N(H,E,R){let L,k,$,X;return Array.isArray(H)?se(H):"tokenize"in H?se([H]):O(H);function O(Y){return V;function V(Q){let W=Q!==null&&Y[Q],ae=Q!==null&&Y.null,me=[...Array.isArray(W)?W:W?[W]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return se(me)(Q)}}function se(Y){return L=Y,k=0,Y.length===0?R:z(Y[k])}function z(Y){return V;function V(Q){return X=A(),$=Y,Y.partial||(c.currentConstruct=Y),Y.name&&c.parser.constructs.disable.null.includes(Y.name)?J(Q):Y.tokenize.call(U?Object.assign(Object.create(c),U):c,l,I,J)(Q)}}function I(Y){return h=!0,B($,X),E}function J(Y){return h=!0,X.restore(),++k<L.length?z(L[k]):R}}}function T(B,U){B.resolveAll&&!i.includes(B)&&i.push(B),B.resolve&&$e(c.events,U,c.events.length-U,B.resolve(c.events.slice(U),c)),B.resolveTo&&(c.events=B.resolveTo(c.events,c))}function A(){let B=m(),U=c.previous,N=c.currentConstruct,H=c.events.length,E=Array.from(a);return{from:H,restore:R};function R(){r=B,c.previous=U,c.currentConstruct=N,c.events.length=H,a=E,F()}}function F(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function Hg(e,t){let s=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex,n;if(s===o)n=[e[s].slice(r,i)];else{if(n=e.slice(s,o),r>-1){let a=n[0];typeof a=="string"?n[0]=a.slice(r):n.shift()}i>0&&n.push(e[o].slice(0,i))}return n}function $g(e,t){let s=-1,r=[],o;for(;++s<e.length;){let i=e[s],n;if(typeof i=="string")n=i;else switch(i){case-5:{n="\r";break}case-4:{n=`
|
|
12
12
|
`;break}case-3:{n=`\r
|
|
13
|
-
`;break}case-2:{n=t?" ":" ";break}case-1:{if(!t&&o)continue;n=" ";break}default:n=String.fromCharCode(i)}o=i===-2,s.push(n)}return s.join("")}function yo(e){let s={constructs:Ai([xo,...(e||{}).extensions||[]]),content:o(Kh),defined:[],document:o(Xh),flow:o(Zh),lazy:{},string:o(tc),text:o(rc)};return s;function o(i){return n;function n(a){return nc(s,i,a)}}}function wo(e){for(;!Ni(e););return e}var oc=/[\0\t\n\r]/g;function So(){let e=1,t="",r=!0,s;return o;function o(i,n,a){let h=[],l,c,f,v,g;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(n||void 0).decode(i)),f=0,t="",r&&(i.charCodeAt(0)===65279&&f++,r=void 0);f<i.length;){if(oc.lastIndex=f,l=oc.exec(i),v=l&&l.index!==void 0?l.index:i.length,g=i.charCodeAt(v),!l){t=i.slice(f);break}if(g===10&&f===v&&s)h.push(-3),s=void 0;else switch(s&&(h.push(-5),s=void 0),f<v&&(h.push(i.slice(f,v)),e+=v-f),g){case 0:{h.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,h.push(-2);e++<c;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:s=!0,e=1}f=v+1}return a&&(s&&h.push(-5),t&&h.push(t),h.push(null)),h}}var Bg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ac(e){return e.replace(Bg,Ng)}function Ng(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){let o=r.charCodeAt(1),i=o===120||o===88;return Ii(r.slice(i?2:1),i?16:10)}return hs(r)||e}var hc={}.hasOwnProperty;function ko(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),zg(r)(wo(yo(r).document().write(So()(e,t,!0))))}function zg(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ot),autolinkProtocol:D,autolinkEmail:D,atxHeading:i(se),blockQuote:i(Q),characterEscape:D,characterReference:D,codeFenced:i(W),codeFencedFenceInfo:n,codeFencedFenceMeta:n,codeIndented:i(W,n),codeText:i(ae,n),codeTextData:D,data:D,codeFlowValue:D,definition:i(me),definitionDestinationString:n,definitionLabelString:n,definitionTitleString:n,emphasis:i(De),hardBreakEscape:i(Te),hardBreakTrailing:i(Te),htmlFlow:i(ft,n),htmlFlowData:D,htmlText:i(ft,n),htmlTextData:D,image:i(ar),label:n,link:i(Ot),listItem:i(ot),listItemValue:v,listOrdered:i(Tr,f),listUnordered:i(Tr),paragraph:i(Pr),reference:O,referenceString:n,resourceDestinationString:n,resourceTitleString:n,setextHeading:i(se),strong:i(kt),thematicBreak:i(Is)},exit:{atxHeading:h(),atxHeadingSequence:w,autolink:h(),autolinkEmail:V,autolinkProtocol:Y,blockQuote:h(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:N,characterReferenceMarkerNumeric:N,characterReferenceValue:I,characterReference:J,codeFenced:h(m),codeFencedFence:d,codeFencedFenceInfo:g,codeFencedFenceMeta:u,codeFlowValue:P,codeIndented:h(p),codeText:h(z),codeTextData:P,data:P,definition:h(),definitionDestinationString:y,definitionLabelString:b,definitionTitleString:x,emphasis:h(),hardBreakEscape:h(F),hardBreakTrailing:h(F),htmlFlow:h(B),htmlFlowData:P,htmlText:h($),htmlTextData:P,image:h(C),label:L,labelText:R,lineEnding:A,link:h(H),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:te,resourceDestinationString:k,resourceTitleString:U,resource:X,setextHeading:h(T),setextHeadingLineSequence:S,setextHeadingText:_,strong:h(),thematicBreak:h()}};cc(t,(e||{}).mdastExtensions||[]);let r={};return s;function s(q){let ee={type:"root",children:[]},de={stack:[ee],tokenStack:[],config:t,enter:a,exit:l,buffer:n,resume:c,data:r},ve=[],pe=-1;for(;++pe<q.length;)if(q[pe][1].type==="listOrdered"||q[pe][1].type==="listUnordered")if(q[pe][0]==="enter")ve.push(pe);else{let mt=ve.pop();pe=o(q,mt,pe)}for(pe=-1;++pe<q.length;){let mt=t[q[pe][0]];hc.call(mt,q[pe][1].type)&&mt[q[pe][1].type].call(Object.assign({sliceSerialize:q[pe][2].sliceSerialize},de),q[pe][1])}if(de.tokenStack.length>0){let mt=de.tokenStack[de.tokenStack.length-1];(mt[1]||lc).call(de,void 0,mt[0])}for(ee.position={start:ur(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:ur(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},pe=-1;++pe<t.transforms.length;)ee=t.transforms[pe](ee)||ee;return ee}function o(q,ee,de){let ve=ee-1,pe=-1,mt=!1,Rr,Wt,Ls,Os;for(;++ve<=de;){let gt=q[ve];switch(gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{gt[0]==="enter"?pe++:pe--,Os=void 0;break}case"lineEndingBlank":{gt[0]==="enter"&&(Rr&&!Os&&!pe&&!Ls&&(Ls=ve),Os=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Os=void 0}if(!pe&>[0]==="enter"&>[1].type==="listItemPrefix"||pe===-1&>[0]==="exit"&&(gt[1].type==="listUnordered"||gt[1].type==="listOrdered")){if(Rr){let as=ve;for(Wt=void 0;as--;){let qt=q[as];if(qt[1].type==="lineEnding"||qt[1].type==="lineEndingBlank"){if(qt[0]==="exit")continue;Wt&&(q[Wt][1].type="lineEndingBlank",mt=!0),qt[1].type="lineEnding",Wt=as}else if(!(qt[1].type==="linePrefix"||qt[1].type==="blockQuotePrefix"||qt[1].type==="blockQuotePrefixWhitespace"||qt[1].type==="blockQuoteMarker"||qt[1].type==="listItemIndent"))break}Ls&&(!Wt||Ls<Wt)&&(Rr._spread=!0),Rr.end=Object.assign({},Wt?q[Wt][1].start:gt[1].end),q.splice(Wt||ve,0,["exit",Rr,gt[2]]),ve++,de++}if(gt[1].type==="listItemPrefix"){let as={type:"listItem",_spread:!1,start:Object.assign({},gt[1].start),end:void 0};Rr=as,q.splice(ve,0,["enter",as,gt[2]]),ve++,de++,Ls=void 0,Os=!0}}}return q[ee][1]._spread=mt,de}function i(q,ee){return de;function de(ve){a.call(this,q(ve),ve),ee&&ee.call(this,ve)}}function n(){this.stack.push({type:"fragment",children:[]})}function a(q,ee,de){this.stack[this.stack.length-1].children.push(q),this.stack.push(q),this.tokenStack.push([ee,de||void 0]),q.position={start:ur(ee.start),end:void 0}}function h(q){return ee;function ee(de){q&&q.call(this,de),l.call(this,de)}}function l(q,ee){let de=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==q.type&&(ee?ee.call(this,q,ve[0]):(ve[1]||lc).call(this,q,ve[0]));else throw new Error("Cannot close `"+q.type+"` ("+hr({start:q.start,end:q.end})+"): it\u2019s not open");de.position.end=ur(q.end)}function c(){return Mr(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function v(q){if(this.data.expectingFirstListItemValue){let ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize(q),10),this.data.expectingFirstListItemValue=void 0}}function g(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=q}function u(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=q}function d(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function m(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.value=q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function p(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.value=q.replace(/(\r?\n|\r)$/g,"")}function b(q){let ee=this.resume(),de=this.stack[this.stack.length-1];de.label=ee,de.identifier=Ye(this.sliceSerialize(q)).toLowerCase()}function x(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.title=q}function y(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.url=q}function w(q){let ee=this.stack[this.stack.length-1];if(!ee.depth){let de=this.sliceSerialize(q).length;ee.depth=de}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function S(q){let ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize(q).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function D(q){let de=this.stack[this.stack.length-1].children,ve=de[de.length-1];(!ve||ve.type!=="text")&&(ve=Dr(),ve.position={start:ur(q.start),end:void 0},de.push(ve)),this.stack.push(ve)}function P(q){let ee=this.stack.pop();ee.value+=this.sliceSerialize(q),ee.position.end=ur(q.end)}function A(q){let ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){let de=ee.children[ee.children.length-1];de.position.end=ur(q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ee.type)&&(D.call(this,q),P.call(this,q))}function F(){this.data.atHardBreak=!0}function B(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.value=q}function $(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.value=q}function z(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.value=q}function H(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let ee=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=ee,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function C(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let ee=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=ee,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function R(q){let ee=this.sliceSerialize(q),de=this.stack[this.stack.length-2];de.label=ac(ee),de.identifier=Ye(ee).toLowerCase()}function L(){let q=this.stack[this.stack.length-1],ee=this.resume(),de=this.stack[this.stack.length-1];if(this.data.inReference=!0,de.type==="link"){let ve=q.children;de.children=ve}else de.alt=ee}function k(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.url=q}function U(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.title=q}function X(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function te(q){let ee=this.resume(),de=this.stack[this.stack.length-1];de.label=ee,de.identifier=Ye(this.sliceSerialize(q)).toLowerCase(),this.data.referenceType="full"}function N(q){this.data.characterReferenceType=q.type}function I(q){let ee=this.sliceSerialize(q),de=this.data.characterReferenceType,ve;de?(ve=Ii(ee,de==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=hs(ee);let pe=this.stack[this.stack.length-1];pe.value+=ve}function J(q){let ee=this.stack.pop();ee.position.end=ur(q.end)}function Y(q){P.call(this,q);let ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize(q)}function V(q){P.call(this,q);let ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize(q)}function Q(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function ae(){return{type:"inlineCode",value:""}}function me(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function De(){return{type:"emphasis",children:[]}}function se(){return{type:"heading",depth:0,children:[]}}function Te(){return{type:"break"}}function ft(){return{type:"html",value:""}}function ar(){return{type:"image",title:null,url:"",alt:null}}function Ot(){return{type:"link",title:null,url:"",children:[]}}function Tr(q){return{type:"list",ordered:q.type==="listOrdered",start:null,spread:q._spread,children:[]}}function ot(q){return{type:"listItem",spread:q._spread,checked:null,children:[]}}function Pr(){return{type:"paragraph",children:[]}}function kt(){return{type:"strong",children:[]}}function Dr(){return{type:"text",value:""}}function Is(){return{type:"thematicBreak"}}}function ur(e){return{line:e.line,column:e.column,offset:e.offset}}function cc(e,t){let r=-1;for(;++r<t.length;){let s=t[r];Array.isArray(s)?cc(e,s):Hg(e,s)}}function Hg(e,t){let r;for(r in t)if(hc.call(t,r))switch(r){case"canContainEols":{let s=t[r];s&&e[r].push(...s);break}case"transforms":{let s=t[r];s&&e[r].push(...s);break}case"enter":case"exit":{let s=t[r];s&&Object.assign(e[r],s);break}}}function lc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hr({start:t.start,end:t.end})+") is still open")}function Vi(e){let t=this;t.parser=r;function r(s){return ko(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function dc(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function uc(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
14
|
-
`}]}function
|
|
15
|
-
`:"",
|
|
16
|
-
`}),c.type==="element"&&c.tagName==="p"&&!o?n.push(...c.children):n.push(c)}let h=
|
|
17
|
-
`});let l={type:"element",tagName:"li",properties:i,children:n};return e.patch(t,l),e.applyData(t,l)}function
|
|
13
|
+
`;break}case-2:{n=t?" ":" ";break}case-1:{if(!t&&o)continue;n=" ";break}default:n=String.fromCharCode(i)}o=i===-2,r.push(n)}return r.join("")}function wo(e){let r={constructs:Ii([yo,...(e||{}).extensions||[]]),content:o(Yh),defined:[],document:o(Zh),flow:o(rc),lazy:{},string:o(nc),text:o(oc)};return r;function o(i){return n;function n(a){return hc(r,i,a)}}}function So(e){for(;!zi(e););return e}var cc=/[\0\t\n\r]/g;function ko(){let e=1,t="",s=!0,r;return o;function o(i,n,a){let h=[],l,c,f,v,g;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(n||void 0).decode(i)),f=0,t="",s&&(i.charCodeAt(0)===65279&&f++,s=void 0);f<i.length;){if(cc.lastIndex=f,l=cc.exec(i),v=l&&l.index!==void 0?l.index:i.length,g=i.charCodeAt(v),!l){t=i.slice(f);break}if(g===10&&f===v&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),f<v&&(h.push(i.slice(f,v)),e+=v-f),g){case 0:{h.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,h.push(-2);e++<c;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}f=v+1}return a&&(r&&h.push(-5),t&&h.push(t),h.push(null)),h}}var Ug=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function dc(e){return e.replace(Ug,Vg)}function Vg(e,t,s){if(t)return t;if(s.charCodeAt(0)===35){let o=s.charCodeAt(1),i=o===120||o===88;return Li(s.slice(i?2:1),i?16:10)}return cr(s)||e}var pc={}.hasOwnProperty;function Co(e,t,s){return t&&typeof t=="object"&&(s=t,t=void 0),jg(s)(So(wo(s).document().write(ko()(e,t,!0))))}function jg(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Bt),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(re),blockQuote:i(Q),characterEscape:P,characterReference:P,codeFenced:i(W),codeFencedFenceInfo:n,codeFencedFenceMeta:n,codeIndented:i(W,n),codeText:i(ae,n),codeTextData:P,data:P,codeFlowValue:P,definition:i(me),definitionDestinationString:n,definitionLabelString:n,definitionTitleString:n,emphasis:i(Re),hardBreakEscape:i(Pe),hardBreakTrailing:i(Pe),htmlFlow:i(gt,n),htmlFlowData:P,htmlText:i(gt,n),htmlTextData:P,image:i(hs),label:n,link:i(Bt),listItem:i(ht),listItemValue:v,listOrdered:i(Ds,f),listUnordered:i(Ds),paragraph:i(Rs),reference:O,referenceString:n,resourceDestinationString:n,resourceTitleString:n,setextHeading:i(re),strong:i(Et),thematicBreak:i(Lr)},exit:{atxHeading:h(),atxHeadingSequence:S,autolink:h(),autolinkEmail:V,autolinkProtocol:Y,blockQuote:h(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:I,characterReference:J,codeFenced:h(m),codeFencedFence:d,codeFencedFenceInfo:g,codeFencedFenceMeta:u,codeFlowValue:T,codeIndented:h(p),codeText:h(N),codeTextData:T,data:T,definition:h(),definitionDestinationString:y,definitionLabelString:b,definitionTitleString:x,emphasis:h(),hardBreakEscape:h(F),hardBreakTrailing:h(F),htmlFlow:h(B),htmlFlowData:T,htmlText:h(U),htmlTextData:T,image:h(E),label:L,labelText:R,lineEnding:A,link:h(H),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:se,resourceDestinationString:k,resourceTitleString:$,resource:X,setextHeading:h(C),setextHeadingLineSequence:w,setextHeadingText:_,strong:h(),thematicBreak:h()}};fc(t,(e||{}).mdastExtensions||[]);let s={};return r;function r(q){let ee={type:"root",children:[]},de={stack:[ee],tokenStack:[],config:t,enter:a,exit:l,buffer:n,resume:c,data:s},ve=[],pe=-1;for(;++pe<q.length;)if(q[pe][1].type==="listOrdered"||q[pe][1].type==="listUnordered")if(q[pe][0]==="enter")ve.push(pe);else{let vt=ve.pop();pe=o(q,vt,pe)}for(pe=-1;++pe<q.length;){let vt=t[q[pe][0]];pc.call(vt,q[pe][1].type)&&vt[q[pe][1].type].call(Object.assign({sliceSerialize:q[pe][2].sliceSerialize},de),q[pe][1])}if(de.tokenStack.length>0){let vt=de.tokenStack[de.tokenStack.length-1];(vt[1]||uc).call(de,void 0,vt[0])}for(ee.position={start:fs(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:fs(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},pe=-1;++pe<t.transforms.length;)ee=t.transforms[pe](ee)||ee;return ee}function o(q,ee,de){let ve=ee-1,pe=-1,vt=!1,Is,Gt,Or,Mr;for(;++ve<=de;){let bt=q[ve];switch(bt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{bt[0]==="enter"?pe++:pe--,Mr=void 0;break}case"lineEndingBlank":{bt[0]==="enter"&&(Is&&!Mr&&!pe&&!Or&&(Or=ve),Mr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Mr=void 0}if(!pe&&bt[0]==="enter"&&bt[1].type==="listItemPrefix"||pe===-1&&bt[0]==="exit"&&(bt[1].type==="listUnordered"||bt[1].type==="listOrdered")){if(Is){let lr=ve;for(Gt=void 0;lr--;){let Xt=q[lr];if(Xt[1].type==="lineEnding"||Xt[1].type==="lineEndingBlank"){if(Xt[0]==="exit")continue;Gt&&(q[Gt][1].type="lineEndingBlank",vt=!0),Xt[1].type="lineEnding",Gt=lr}else if(!(Xt[1].type==="linePrefix"||Xt[1].type==="blockQuotePrefix"||Xt[1].type==="blockQuotePrefixWhitespace"||Xt[1].type==="blockQuoteMarker"||Xt[1].type==="listItemIndent"))break}Or&&(!Gt||Or<Gt)&&(Is._spread=!0),Is.end=Object.assign({},Gt?q[Gt][1].start:bt[1].end),q.splice(Gt||ve,0,["exit",Is,bt[2]]),ve++,de++}if(bt[1].type==="listItemPrefix"){let lr={type:"listItem",_spread:!1,start:Object.assign({},bt[1].start),end:void 0};Is=lr,q.splice(ve,0,["enter",lr,bt[2]]),ve++,de++,Or=void 0,Mr=!0}}}return q[ee][1]._spread=vt,de}function i(q,ee){return de;function de(ve){a.call(this,q(ve),ve),ee&&ee.call(this,ve)}}function n(){this.stack.push({type:"fragment",children:[]})}function a(q,ee,de){this.stack[this.stack.length-1].children.push(q),this.stack.push(q),this.tokenStack.push([ee,de||void 0]),q.position={start:fs(ee.start),end:void 0}}function h(q){return ee;function ee(de){q&&q.call(this,de),l.call(this,de)}}function l(q,ee){let de=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==q.type&&(ee?ee.call(this,q,ve[0]):(ve[1]||uc).call(this,q,ve[0]));else throw new Error("Cannot close `"+q.type+"` ("+ds({start:q.start,end:q.end})+"): it\u2019s not open");de.position.end=fs(q.end)}function c(){return Bs(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function v(q){if(this.data.expectingFirstListItemValue){let ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize(q),10),this.data.expectingFirstListItemValue=void 0}}function g(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=q}function u(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=q}function d(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function m(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.value=q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function p(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.value=q.replace(/(\r?\n|\r)$/g,"")}function b(q){let ee=this.resume(),de=this.stack[this.stack.length-1];de.label=ee,de.identifier=Ze(this.sliceSerialize(q)).toLowerCase()}function x(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.title=q}function y(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.url=q}function S(q){let ee=this.stack[this.stack.length-1];if(!ee.depth){let de=this.sliceSerialize(q).length;ee.depth=de}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function w(q){let ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize(q).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function P(q){let de=this.stack[this.stack.length-1].children,ve=de[de.length-1];(!ve||ve.type!=="text")&&(ve=As(),ve.position={start:fs(q.start),end:void 0},de.push(ve)),this.stack.push(ve)}function T(q){let ee=this.stack.pop();ee.value+=this.sliceSerialize(q),ee.position.end=fs(q.end)}function A(q){let ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){let de=ee.children[ee.children.length-1];de.position.end=fs(q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ee.type)&&(P.call(this,q),T.call(this,q))}function F(){this.data.atHardBreak=!0}function B(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.value=q}function U(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.value=q}function N(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.value=q}function H(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let ee=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=ee,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function E(){let q=this.stack[this.stack.length-1];if(this.data.inReference){let ee=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=ee,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function R(q){let ee=this.sliceSerialize(q),de=this.stack[this.stack.length-2];de.label=dc(ee),de.identifier=Ze(ee).toLowerCase()}function L(){let q=this.stack[this.stack.length-1],ee=this.resume(),de=this.stack[this.stack.length-1];if(this.data.inReference=!0,de.type==="link"){let ve=q.children;de.children=ve}else de.alt=ee}function k(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.url=q}function $(){let q=this.resume(),ee=this.stack[this.stack.length-1];ee.title=q}function X(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function se(q){let ee=this.resume(),de=this.stack[this.stack.length-1];de.label=ee,de.identifier=Ze(this.sliceSerialize(q)).toLowerCase(),this.data.referenceType="full"}function z(q){this.data.characterReferenceType=q.type}function I(q){let ee=this.sliceSerialize(q),de=this.data.characterReferenceType,ve;de?(ve=Li(ee,de==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=cr(ee);let pe=this.stack[this.stack.length-1];pe.value+=ve}function J(q){let ee=this.stack.pop();ee.position.end=fs(q.end)}function Y(q){T.call(this,q);let ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize(q)}function V(q){T.call(this,q);let ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize(q)}function Q(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function ae(){return{type:"inlineCode",value:""}}function me(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function re(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function gt(){return{type:"html",value:""}}function hs(){return{type:"image",title:null,url:"",alt:null}}function Bt(){return{type:"link",title:null,url:"",children:[]}}function Ds(q){return{type:"list",ordered:q.type==="listOrdered",start:null,spread:q._spread,children:[]}}function ht(q){return{type:"listItem",spread:q._spread,checked:null,children:[]}}function Rs(){return{type:"paragraph",children:[]}}function Et(){return{type:"strong",children:[]}}function As(){return{type:"text",value:""}}function Lr(){return{type:"thematicBreak"}}}function fs(e){return{line:e.line,column:e.column,offset:e.offset}}function fc(e,t){let s=-1;for(;++s<t.length;){let r=t[s];Array.isArray(r)?fc(e,r):Wg(e,r)}}function Wg(e,t){let s;for(s in t)if(pc.call(t,s))switch(s){case"canContainEols":{let r=t[s];r&&e[s].push(...r);break}case"transforms":{let r=t[s];r&&e[s].push(...r);break}case"enter":case"exit":{let r=t[s];r&&Object.assign(e[s],r);break}}}function uc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ds({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ds({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ds({start:t.start,end:t.end})+") is still open")}function ji(e){let t=this;t.parser=s;function s(r){return Co(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function mc(e,t){let s={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,s),e.applyData(t,s)}function gc(e,t){let s={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,s),[e.applyData(t,s),{type:"text",value:`
|
|
14
|
+
`}]}function vc(e,t){let s=t.value?t.value+`
|
|
15
|
+
`:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:s}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function bc(e,t){let s={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function _c(e,t){let s={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function xc(e,t){let s=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Pt(r.toLowerCase()),i=e.footnoteOrder.indexOf(r),n,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),n=e.footnoteOrder.length):n=i+1,a+=1,e.footnoteCounts.set(r,a);let h={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+o,id:s+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,h);let l={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,l),e.applyData(t,l)}function yc(e,t){let s={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function wc(e,t){if(e.options.allowDangerousHtml){let s={type:"raw",value:t.value};return e.patch(t,s),e.applyData(t,s)}}function Wi(e,t){let s=t.referenceType,r="]";if(s==="collapsed"?r+="[]":s==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];let o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});let n=o[o.length-1];return n&&n.type==="text"?n.value+=r:o.push({type:"text",value:r}),o}function Sc(e,t){let s=String(t.identifier).toUpperCase(),r=e.definitionById.get(s);if(!r)return Wi(e,t);let o={src:Pt(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);let i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function kc(e,t){let s={src:Pt(t.url)};t.alt!==null&&t.alt!==void 0&&(s.alt=t.alt),t.title!==null&&t.title!==void 0&&(s.title=t.title);let r={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,r),e.applyData(t,r)}function Cc(e,t){let s={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,s);let r={type:"element",tagName:"code",properties:{},children:[s]};return e.patch(t,r),e.applyData(t,r)}function Ec(e,t){let s=String(t.identifier).toUpperCase(),r=e.definitionById.get(s);if(!r)return Wi(e,t);let o={href:Pt(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);let i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Tc(e,t){let s={href:Pt(t.url)};t.title!==null&&t.title!==void 0&&(s.title=t.title);let r={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Pc(e,t,s){let r=e.all(t),o=s?qg(s):Dc(t),i={},n=[];if(typeof t.checked=="boolean"){let c=r[0],f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){let c=r[a];(o||a!==0||c.type!=="element"||c.tagName!=="p")&&n.push({type:"text",value:`
|
|
16
|
+
`}),c.type==="element"&&c.tagName==="p"&&!o?n.push(...c.children):n.push(c)}let h=r[r.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&n.push({type:"text",value:`
|
|
17
|
+
`});let l={type:"element",tagName:"li",properties:i,children:n};return e.patch(t,l),e.applyData(t,l)}function qg(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let s=e.children,r=-1;for(;!t&&++r<s.length;)t=Dc(s[r])}return t}function Dc(e){let t=e.spread;return t??e.children.length>1}function Rc(e,t){let s={},r=e.all(t),o=-1;for(typeof t.start=="number"&&t.start!==1&&(s.start=t.start);++o<r.length;){let n=r[o];if(n.type==="element"&&n.tagName==="li"&&n.properties&&Array.isArray(n.properties.className)&&n.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}let i={type:"element",tagName:t.ordered?"ol":"ul",properties:s,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function Ac(e,t){let s={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Ic(e,t){let s={type:"root",children:e.wrap(e.all(t))};return e.patch(t,s),e.applyData(t,s)}function Lc(e,t){let s={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Oc(e,t){let s=e.all(t),r=s.shift(),o=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(s.length>0){let n={type:"element",tagName:"tbody",properties:{},children:e.wrap(s,!0)},a=hr(t.children[1]),h=Ai(t.children[t.children.length-1]);a&&h&&(n.position={start:a,end:h}),o.push(n)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function Mc(e,t,s){let r=s?s.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",n=s&&s.type==="table"?s.align:void 0,a=n?n.length:t.children.length,h=-1,l=[];for(;++h<a;){let f=t.children[h],v={},g=n?n[h]:void 0;g&&(v.align=g);let u={type:"element",tagName:i,properties:v,children:[]};f&&(u.children=e.all(f),e.patch(f,u),u=e.applyData(f,u)),l.push(u)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)}function Fc(e,t){let s={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Nc(e){let t=String(e),s=/\r?\n|\r/g,r=s.exec(t),o=0,i=[];for(;r;)i.push(Bc(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=s.exec(t);return i.push(Bc(t.slice(o),o>0,!1)),i.join("")}function Bc(e,t,s){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===9||i===32;)r++,i=e.codePointAt(r)}if(s){let i=e.codePointAt(o-1);for(;i===9||i===32;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function zc(e,t){let s={type:"text",value:Nc(String(t.value))};return e.patch(t,s),e.applyData(t,s)}function Hc(e,t){let s={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,s),e.applyData(t,s)}var $c={blockquote:mc,break:gc,code:vc,delete:bc,emphasis:_c,footnoteReference:xc,heading:yc,html:wc,imageReference:Sc,image:kc,inlineCode:Cc,linkReference:Ec,link:Tc,listItem:Pc,list:Rc,paragraph:Ac,root:Ic,strong:Lc,table:Oc,tableCell:Fc,tableRow:Mc,text:zc,thematicBreak:Hc,toml:qi,yaml:qi,definition:qi,footnoteDefinition:qi};function qi(){}var Kc=typeof self=="object"?self:globalThis,Uc=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Kc[e](t)},Jg=(e,t)=>{let s=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);let[i,n]=t[o];switch(i){case 0:case-1:return s(n,o);case 1:{let a=s([],o);for(let h of n)a.push(r(h));return a}case 2:{let a=s({},o);for(let[h,l]of n)a[r(h)]=r(l);return a}case 3:return s(new Date(n),o);case 4:{let{source:a,flags:h}=n;return s(new RegExp(a,h),o)}case 5:{let a=s(new Map,o);for(let[h,l]of n)a.set(r(h),r(l));return a}case 6:{let a=s(new Set,o);for(let h of n)a.add(r(h));return a}case 7:{let{name:a,message:h}=n;return s(typeof Kc[a]=="function"?Uc(a,h):new Error(h),o)}case 8:return s(BigInt(n),o);case"BigInt":return s(Object(BigInt(n)),o);case"ArrayBuffer":return s(new Uint8Array(n).buffer,n);case"DataView":{let{buffer:a}=new Uint8Array(n);return s(new DataView(a),n)}}return s(Uc(i,n),o)};return r},Po=e=>Jg(new Map,e)(0);var Vs="",{toString:Yg}={},{keys:Qg}=Object,Xr=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let s=Yg.call(e).slice(8,-1);switch(s){case"Array":return[1,Vs];case"Object":return[2,Vs];case"Date":return[3,Vs];case"RegExp":return[4,Vs];case"Map":return[5,Vs];case"Set":return[6,Vs];case"DataView":return[1,s]}return s.includes("Array")?[1,s]:e instanceof Error?[7,e.name||"Error"]:[2,s]},Gi=([e,t])=>e===0&&(t==="function"||t==="symbol"),Zg=(e,t,s,r)=>{let o=(n,a)=>{let h=r.push(n)-1;return s.set(a,h),h},i=n=>{if(s.has(n))return s.get(n);let[a,h]=Xr(n);switch(a){case 0:{let c=n;switch(h){case"bigint":a=8,c=n.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);c=null;break;case"undefined":return o([-1],n)}return o([a,c],n)}case 1:{if(h){let v=n;return h==="DataView"?v=new Uint8Array(n.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(n)),o([h,[...v]],n)}let c=[],f=o([a,c],n);for(let v of n)c.push(i(v));return f}case 2:{if(h)switch(h){case"BigInt":return o([h,n.toString()],n);case"Boolean":case"Number":case"String":return o([h,n.valueOf()],n)}if(t&&"toJSON"in n)return i(n.toJSON());let c=[],f=o([a,c],n);for(let v of Qg(n))(e||!Gi(Xr(n[v])))&&c.push([i(v),i(n[v])]);return f}case 3:return o([a,isNaN(n.getTime())?Vs:n.toISOString()],n);case 4:{let{source:c,flags:f}=n;return o([a,{source:c,flags:f}],n)}case 5:{let c=[],f=o([a,c],n);for(let[v,g]of n)(e||!(Gi(Xr(v))||Gi(Xr(g))))&&c.push([i(v),i(g)]);return f}case 6:{let c=[],f=o([a,c],n);for(let v of n)(e||!Gi(Xr(v)))&&c.push(i(v));return f}}let{message:l}=n;return o([a,{name:h,message:l}],n)};return i},Do=(e,{json:t,lossy:s}={})=>{let r=[];return Zg(!(t||s),!!t,new Map,r)(e),r};var dr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Po(Do(e,t)):structuredClone(e):(e,t)=>Po(Do(e,t));function ev(e,t){let s=[{type:"text",value:"\u21A9"}];return t>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),s}function tv(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Gc(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=e.options.footnoteBackContent||ev,r=e.options.footnoteBackLabel||tv,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",n=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[],h=-1;for(;++h<e.footnoteOrder.length;){let l=e.footnoteById.get(e.footnoteOrder[h]);if(!l)continue;let c=e.all(l),f=String(l.identifier).toUpperCase(),v=Pt(f.toLowerCase()),g=0,u=[],d=e.footnoteCounts.get(f);for(;d!==void 0&&++g<=d;){u.length>0&&u.push({type:"text",value:" "});let b=typeof s=="string"?s:s(h,g);typeof b=="string"&&(b={type:"text",value:b}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,g),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}let m=c[c.length-1];if(m&&m.type==="element"&&m.tagName==="p"){let b=m.children[m.children.length-1];b&&b.type==="text"?b.value+=" ":m.children.push({type:"text",value:" "}),m.children.push(...u)}else c.push(...u);let p={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(c,!0)};e.patch(l,p),a.push(p)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...dr(n),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
18
18
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
19
|
-
`}]}}var
|
|
20
|
-
`});++
|
|
21
|
-
`}),
|
|
22
|
-
`}),
|
|
23
|
-
`},o)),i}function Qi(e,t){return e&&"run"in e?async function(r,s){let o=Yi(r,{file:s,...t});await e.run(o,s)}:function(r,s){return Yi(r,{file:s,...e||t})}}function Ro(e){if(e)throw e}var tn=Ms(rd(),1);function Js(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ao(){let e=[],t={run:r,use:s};return t;function r(...o){let i=-1,n=o.pop();if(typeof n!="function")throw new TypeError("Expected function as last argument, not "+n);a(null,...o);function a(h,...l){let c=e[++i],f=-1;if(h){n(h);return}for(;++f<o.length;)(l[f]===null||l[f]===void 0)&&(l[f]=o[f]);o=l,c?sd(c,a)(...l):n(null,...l)}}function s(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function sd(e,t){let r;return s;function s(...n){let a=e.length>n.length,h;a&&n.push(o);try{h=e.apply(this,n)}catch(l){let c=l;if(a&&r)throw c;return o(c)}a||(h&&h.then&&typeof h.then=="function"?h.then(i,o):h instanceof Error?o(h):i(h))}function o(n,...a){r||(r=!0,t(n,...a))}function i(n){o(null,n)}}var It={basename:lv,dirname:hv,extname:cv,join:dv,sep:"/"};function lv(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ys(e);let r=0,s=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else s<0&&(i=!0,s=o+1);return s<0?"":e.slice(r,s)}if(t===e)return"";let n=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else n<0&&(i=!0,n=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(s=o):(a=-1,s=n));return r===s?s=n:s<0&&(s=e.length),e.slice(r,s)}function hv(e){if(Ys(e),e.length===0)return".";let t=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){t=r;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function cv(e){Ys(e);let t=e.length,r=-1,s=0,o=-1,i=0,n;for(;t--;){let a=e.codePointAt(t);if(a===47){if(n){s=t+1;break}continue}r<0&&(n=!0,r=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||r<0||i===0||i===1&&o===r-1&&o===s+1?"":e.slice(o,r)}function dv(...e){let t=-1,r;for(;++t<e.length;)Ys(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":uv(r)}function uv(e){Ys(e);let t=e.codePointAt(0)===47,r=pv(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function pv(e,t){let r="",s=0,o=-1,i=0,n=-1,a,h;for(;++n<=e.length;){if(n<e.length)a=e.codePointAt(n);else{if(a===47)break;a=47}if(a===47){if(!(o===n-1||i===1))if(o!==n-1&&i===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",s=0):(r=r.slice(0,h),s=r.length-1-r.lastIndexOf("/")),o=n,i=0;continue}}else if(r.length>0){r="",s=0,o=n,i=0;continue}}t&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(o+1,n):r=e.slice(o+1,n),s=n-o-1;o=n,i=0}else a===46&&i>-1?i++:i=-1}return r}function Ys(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var id={cwd:fv};function fv(){return"/"}function ds(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function nd(e){if(typeof e=="string")e=new URL(e);else if(!ds(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return mv(e)}function mv(e){if(e.hostname!==""){let s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}let t=e.pathname,r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){let s=t.codePointAt(r+2);if(s===70||s===102){let o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}var Io=["history","path","basename","stem","extname","dirname"],jr=class{constructor(t){let r;t?ds(t)?r={path:t}:typeof t=="string"||gv(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":id.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Io.length;){let i=Io[s];i in r&&r[i]!==void 0&&r[i]!==null&&(this[i]=i==="history"?[...r[i]]:r[i])}let o;for(o in r)Io.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?It.basename(this.path):void 0}set basename(t){Oo(t,"basename"),Lo(t,"basename"),this.path=It.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?It.dirname(this.path):void 0}set dirname(t){od(this.basename,"dirname"),this.path=It.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?It.extname(this.path):void 0}set extname(t){if(Lo(t,"extname"),od(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=It.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ds(t)&&(t=nd(t)),Oo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?It.basename(this.path,this.extname):void 0}set stem(t){Oo(t,"stem"),Lo(t,"stem"),this.path=It.join(this.dirname||"",t+(this.extname||""))}fail(t,r,s){let o=this.message(t,r,s);throw o.fatal=!0,o}info(t,r,s){let o=this.message(t,r,s);return o.fatal=void 0,o}message(t,r,s){let o=new ze(t,r,s);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}};function Lo(e,t){if(e&&e.includes(It.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+It.sep+"`")}function Oo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function od(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function gv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var ad=(function(e){let s=this.constructor.prototype,o=s[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,s),i});var vv={}.hasOwnProperty,No=class e extends ad{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ao()}copy(){let t=new e,r=-1;for(;++r<this.attachers.length;){let s=this.attachers[r];t.use(...s)}return t.data((0,tn.default)(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(Bo("data",this.frozen),this.namespace[t]=r,this):vv.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Bo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);let o=r.call(t,...s);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let r=en(t),s=this.parser||this.Parser;return Mo("parse",s),s(String(r),r)}process(t,r){let s=this;return this.freeze(),Mo("process",this.parser||this.Parser),Fo("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(i,n){let a=en(t),h=s.parse(a);s.run(h,a,function(c,f,v){if(c||!f||!v)return l(c);let g=f,u=s.stringify(g,v);_v(u)?v.value=u:v.result=u,l(c,v)});function l(c,f){c||!f?n(c):i?i(f):r(void 0,f)}}}processSync(t){let r=!1,s;return this.freeze(),Mo("processSync",this.parser||this.Parser),Fo("processSync",this.compiler||this.Compiler),this.process(t,o),hd("processSync","process",r),s;function o(i,n){r=!0,Ro(i),s=n}}run(t,r,s){ld(t),this.freeze();let o=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?i(void 0,s):new Promise(i);function i(n,a){let h=en(r);o.run(t,h,l);function l(c,f,v){let g=f||t;c?a(c):n?n(g):s(void 0,g,v)}}}runSync(t,r){let s=!1,o;return this.run(t,r,i),hd("runSync","run",s),o;function i(n,a){Ro(n),o=a,s=!0}}stringify(t,r){this.freeze();let s=en(r),o=this.compiler||this.Compiler;return Fo("stringify",o),ld(t),o(t,s)}use(t,...r){let s=this.attachers,o=this.namespace;if(Bo("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?a(t):n(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(l){if(typeof l=="function")h(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...f]=l;h(c,f)}else n(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function n(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(l.plugins),l.settings&&(o.settings=(0,tn.default)(!0,o.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let f=l[c];i(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function h(l,c){let f=-1,v=-1;for(;++f<s.length;)if(s[f][0]===l){v=f;break}if(v===-1)s.push([l,...c]);else if(c.length>0){let[g,...u]=c,d=s[v][1];Js(d)&&Js(g)&&(g=(0,tn.default)(!0,d,g)),s[v]=[l,g,...u]}}}},zo=new No().freeze();function Mo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Fo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Bo(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ld(e){if(!Js(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function hd(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function en(e){return bv(e)?e:new jr(e)}function bv(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _v(e){return typeof e=="string"||xv(e)}function xv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var yv="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",cd=[],dd={allowDangerousHtml:!0},wv=/^(https?|ircs?|mailto|xmpp)$/i,Sv=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ho(e){let t=kv(e),r=Cv(e);return Ev(t.runSync(t.parse(r),r),e)}function kv(e){let t=e.rehypePlugins||cd,r=e.remarkPlugins||cd,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dd}:dd;return zo().use(Vi).use(r).use(Qi,s).use(t)}function Cv(e){let t=e.children||"",r=new jr;return typeof t=="string"?r.value=t:(""+t,void 0),r}function Ev(e,t){let r=t.allowedElements,s=t.allowElement,o=t.components,i=t.disallowedElements,n=t.skipHtml,a=t.unwrapDisallowed,h=t.urlTransform||pd;for(let c of Sv)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+yv+c.id,void 0);return r&&i&&void 0,Vr(e,l),no(e,{Fragment:us.Fragment,components:o,ignoreInvalidStyle:!0,jsx:us.jsx,jsxs:us.jsxs,passKeys:!0,passNode:!0});function l(c,f,v){if(c.type==="raw"&&v&&typeof f=="number")return n?v.children.splice(f,1):v.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let g;for(g in $s)if(Object.hasOwn($s,g)&&Object.hasOwn(c.properties,g)){let u=c.properties[g],d=$s[g];(d===null||d.includes(c.tagName))&&(c.properties[g]=h(String(u||""),g,c))}}if(c.type==="element"){let g=r?!r.includes(c.tagName):i?i.includes(c.tagName):!1;if(!g&&s&&typeof f=="number"&&(g=!s(c,f,v)),g&&v&&typeof f=="number")return a&&c.children?v.children.splice(f,1,...c.children):v.children.splice(f,1),f}}}function pd(e){let t=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||s!==-1&&t>s||wv.test(e.slice(0,t))?e:""}function Uo(e,t){let r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,o=r.indexOf(t);for(;o!==-1;)s++,o=r.indexOf(t,o+t.length);return s}function $o(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Vo(e,t,r){let o=pr((r||{}).ignore||[]),i=Tv(t),n=-1;for(;++n<i.length;)Xs(e,"text",a);function a(l,c){let f=-1,v;for(;++f<c.length;){let g=c[f],u=v?v.children:void 0;if(o(g,u?u.indexOf(g):void 0,v))return;v=g}if(v)return h(l,c)}function h(l,c){let f=c[c.length-1],v=i[n][0],g=i[n][1],u=0,m=f.children.indexOf(l),p=!1,b=[];v.lastIndex=0;let x=v.exec(l.value);for(;x;){let y=x.index,w={index:x.index,input:x.input,stack:[...c,l]},_=g(...x,w);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?v.lastIndex=y+1:(u!==y&&b.push({type:"text",value:l.value.slice(u,y)}),Array.isArray(_)?b.push(..._):_&&b.push(_),u=y+x[0].length,p=!0),!v.global)break;x=v.exec(l.value)}return p?(u<l.value.length&&b.push({type:"text",value:l.value.slice(u)}),f.children.splice(m,1,...b)):b=[l],m+b.length}}function Tv(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!e[0]||Array.isArray(e[0])?e:[e],s=-1;for(;++s<r.length;){let o=r[s];t.push([Pv(o[0]),Dv(o[1])])}return t}function Pv(e){return typeof e=="string"?new RegExp($o(e),"g"):e}function Dv(e){return typeof e=="function"?e:function(){return e}}var jo="phrasing",Wo=["autolink","link","image","label"];function Ko(){return{transforms:[Mv],enter:{literalAutolink:Rv,literalAutolinkEmail:qo,literalAutolinkHttp:qo,literalAutolinkWww:qo},exit:{literalAutolink:Ov,literalAutolinkEmail:Lv,literalAutolinkHttp:Av,literalAutolinkWww:Iv}}}function Go(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:jo,notInConstruct:Wo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:jo,notInConstruct:Wo},{character:":",before:"[ps]",after:"\\/",inConstruct:jo,notInConstruct:Wo}]}}function Rv(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function qo(e){this.config.enter.autolinkProtocol.call(this,e)}function Av(e){this.config.exit.autolinkProtocol.call(this,e)}function Iv(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Lv(e){this.config.exit.autolinkEmail.call(this,e)}function Ov(e){this.exit(e)}function Mv(e){Vo(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Fv],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Bv]],{ignore:["link","linkReference"]})}function Fv(e,t,r,s,o){let i="";if(!fd(o)||(/^w/i.test(t)&&(r=t+r,t="",i="http://"),!Nv(r)))return!1;let n=zv(r+s);if(!n[0])return!1;let a={type:"link",title:null,url:i+t+n[0],children:[{type:"text",value:t+n[0]}]};return n[1]?[a,{type:"text",value:n[1]}]:a}function Bv(e,t,r,s){return!fd(s,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function Nv(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function zv(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],s=r.indexOf(")"),o=Uo(e,"("),i=Uo(e,")");for(;s!==-1&&o>i;)e+=r.slice(0,s+1),r=r.slice(s+1),s=r.indexOf(")"),i++;return[e,r]}function fd(e,t){let r=e.input.charCodeAt(e.index-1);return(e.index===0||Mt(r)||Br(r))&&(!t||r!==47)}md.peek=Gv;function Hv(){this.buffer()}function Uv(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function $v(){this.buffer()}function Vv(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function jv(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ye(this.sliceSerialize(e)).toLowerCase(),r.label=t}function Wv(e){this.exit(e)}function qv(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ye(this.sliceSerialize(e)).toLowerCase(),r.label=t}function Kv(e){this.exit(e)}function Gv(){return"["}function md(e,t,r,s){let o=r.createTracker(s),i=o.move("[^"),n=r.enter("footnoteReference"),a=r.enter("reference");return i+=o.move(r.safe(r.associationId(e),{after:"]",before:i})),a(),n(),i+=o.move("]"),i}function Xo(){return{enter:{gfmFootnoteCallString:Hv,gfmFootnoteCall:Uv,gfmFootnoteDefinitionLabelString:$v,gfmFootnoteDefinition:Vv},exit:{gfmFootnoteCallString:jv,gfmFootnoteCall:Wv,gfmFootnoteDefinitionLabelString:qv,gfmFootnoteDefinition:Kv}}}function Jo(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:md},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(s,o,i,n){let a=i.createTracker(n),h=a.move("[^"),l=i.enter("footnoteDefinition"),c=i.enter("label");return h+=a.move(i.safe(i.associationId(s),{before:h,after:"]"})),c(),h+=a.move("]:"),s.children&&s.children.length>0&&(a.shift(4),h+=a.move((t?`
|
|
24
|
-
`:" ")+i.indentLines(i.containerFlow(
|
|
25
|
-
`)}function
|
|
26
|
-
`&&
|
|
27
|
-
`}function
|
|
19
|
+
`}]}}var ms=(function(e){if(e==null)return nv;if(typeof e=="function")return Xi(e);if(typeof e=="object")return Array.isArray(e)?sv(e):rv(e);if(typeof e=="string")return iv(e);throw new Error("Expected function, string, or object as test")});function sv(e){let t=[],s=-1;for(;++s<e.length;)t[s]=ms(e[s]);return Xi(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function rv(e){let t=e;return Xi(s);function s(r){let o=r,i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function iv(e){return Xi(t);function t(s){return s&&s.type===e}}function Xi(e){return t;function t(s,r,o){return!!(ov(s)&&e.call(this,s,typeof r=="number"?r:void 0,o||void 0))}}function nv(){return!0}function ov(e){return e!==null&&typeof e=="object"&&"type"in e}var Xc=[],Ji=!0,js=!1,Yi="skip";function Jr(e,t,s,r){let o;typeof t=="function"&&typeof s!="function"?(r=s,s=t):o=t;let i=ms(o),n=r?-1:1;a(e,void 0,[])();function a(h,l,c){let f=h&&typeof h=="object"?h:{};if(typeof f.type=="string"){let g=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(g?"<"+g+">":""))+")"})}return v;function v(){let g=Xc,u,d,m;if((!t||i(h,l,c[c.length-1]||void 0))&&(g=av(s(h,c)),g[0]===js))return g;if("children"in h&&h.children){let p=h;if(p.children&&g[0]!==Yi)for(d=(r?p.children.length:-1)+n,m=c.concat(p);d>-1&&d<p.children.length;){let b=p.children[d];if(u=a(b,d,m)(),u[0]===js)return u;d=typeof u[1]=="number"?u[1]:d+n}}return g}}}function av(e){return Array.isArray(e)?e:typeof e=="number"?[Ji,e]:e==null?Xc:[e]}function Ws(e,t,s,r){let o,i,n;typeof t=="function"&&typeof s!="function"?(i=void 0,n=t,o=s):(i=t,n=s,o=r),Jr(e,i,a,o);function a(h,l){let c=l[l.length-1],f=c?c.children.indexOf(h):void 0;return n(h,f,c)}}var Ro={}.hasOwnProperty,lv={};function Yc(e,t){let s=t||lv,r=new Map,o=new Map,i=new Map,n={...$c,...s.handlers},a={all:l,applyData:cv,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:n,one:h,options:s,patch:hv,wrap:uv};return Ws(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){let f=c.type==="definition"?r:o,v=String(c.identifier).toUpperCase();f.has(v)||f.set(v,c)}}),a;function h(c,f){let v=c.type,g=a.handlers[v];if(Ro.call(a.handlers,v)&&g)return g(a,c,f);if(a.options.passThrough&&a.options.passThrough.includes(v)){if("children"in c){let{children:d,...m}=c,p=dr(m);return p.children=a.all(c),p}return dr(c)}return(a.options.unknownHandler||dv)(a,c,f)}function l(c){let f=[];if("children"in c){let v=c.children,g=-1;for(;++g<v.length;){let u=a.one(v[g],c);if(u){if(g&&v[g-1].type==="break"&&(!Array.isArray(u)&&u.type==="text"&&(u.value=Jc(u.value)),!Array.isArray(u)&&u.type==="element")){let d=u.children[0];d&&d.type==="text"&&(d.value=Jc(d.value))}Array.isArray(u)?f.push(...u):f.push(u)}}}return f}}function hv(e,t){e.position&&(t.position=ro(e))}function cv(e,t){let s=t;if(e&&e.data){let r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(s.type==="element")s.tagName=r;else{let n="children"in s?s.children:[s];s={type:"element",tagName:r,properties:{},children:n}}s.type==="element"&&i&&Object.assign(s.properties,dr(i)),"children"in s&&s.children&&o!==null&&o!==void 0&&(s.children=o)}return s}function dv(e,t){let s=t.data||{},r="value"in t&&!(Ro.call(s,"hProperties")||Ro.call(s,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function uv(e,t){let s=[],r=-1;for(t&&s.push({type:"text",value:`
|
|
20
|
+
`});++r<e.length;)r&&s.push({type:"text",value:`
|
|
21
|
+
`}),s.push(e[r]);return t&&e.length>0&&s.push({type:"text",value:`
|
|
22
|
+
`}),s}function Jc(e){let t=0,s=e.charCodeAt(t);for(;s===9||s===32;)t++,s=e.charCodeAt(t);return e.slice(t)}function Qi(e,t){let s=Yc(e,t),r=s.one(e,void 0),o=Gc(s),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&("children"in i,i.children.push({type:"text",value:`
|
|
23
|
+
`},o)),i}function Zi(e,t){return e&&"run"in e?async function(s,r){let o=Qi(s,{file:r,...t});await e.run(o,r)}:function(s,r){return Qi(s,{file:r,...e||t})}}function Ao(e){if(e)throw e}var sn=Fr(od(),1);function Yr(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Io(){let e=[],t={run:s,use:r};return t;function s(...o){let i=-1,n=o.pop();if(typeof n!="function")throw new TypeError("Expected function as last argument, not "+n);a(null,...o);function a(h,...l){let c=e[++i],f=-1;if(h){n(h);return}for(;++f<o.length;)(l[f]===null||l[f]===void 0)&&(l[f]=o[f]);o=l,c?ad(c,a)(...l):n(null,...l)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function ad(e,t){let s;return r;function r(...n){let a=e.length>n.length,h;a&&n.push(o);try{h=e.apply(this,n)}catch(l){let c=l;if(a&&s)throw c;return o(c)}a||(h&&h.then&&typeof h.then=="function"?h.then(i,o):h instanceof Error?o(h):i(h))}function o(n,...a){s||(s=!0,t(n,...a))}function i(n){o(null,n)}}var Mt={basename:pv,dirname:fv,extname:mv,join:gv,sep:"/"};function pv(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Qr(e);let s=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){s=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(s,r)}if(t===e)return"";let n=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){s=o+1;break}}else n<0&&(i=!0,n=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=n));return s===r?r=n:r<0&&(r=e.length),e.slice(s,r)}function fv(e){if(Qr(e),e.length===0)return".";let t=-1,s=e.length,r;for(;--s;)if(e.codePointAt(s)===47){if(r){t=s;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function mv(e){Qr(e);let t=e.length,s=-1,r=0,o=-1,i=0,n;for(;t--;){let a=e.codePointAt(t);if(a===47){if(n){r=t+1;break}continue}s<0&&(n=!0,s=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||s<0||i===0||i===1&&o===s-1&&o===r+1?"":e.slice(o,s)}function gv(...e){let t=-1,s;for(;++t<e.length;)Qr(e[t]),e[t]&&(s=s===void 0?e[t]:s+"/"+e[t]);return s===void 0?".":vv(s)}function vv(e){Qr(e);let t=e.codePointAt(0)===47,s=bv(e,!t);return s.length===0&&!t&&(s="."),s.length>0&&e.codePointAt(e.length-1)===47&&(s+="/"),t?"/"+s:s}function bv(e,t){let s="",r=0,o=-1,i=0,n=-1,a,h;for(;++n<=e.length;){if(n<e.length)a=e.codePointAt(n);else{if(a===47)break;a=47}if(a===47){if(!(o===n-1||i===1))if(o!==n-1&&i===2){if(s.length<2||r!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(h=s.lastIndexOf("/"),h!==s.length-1){h<0?(s="",r=0):(s=s.slice(0,h),r=s.length-1-s.lastIndexOf("/")),o=n,i=0;continue}}else if(s.length>0){s="",r=0,o=n,i=0;continue}}t&&(s=s.length>0?s+"/..":"..",r=2)}else s.length>0?s+="/"+e.slice(o+1,n):s=e.slice(o+1,n),r=n-o-1;o=n,i=0}else a===46&&i>-1?i++:i=-1}return s}function Qr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var ld={cwd:_v};function _v(){return"/"}function ur(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function hd(e){if(typeof e=="string")e=new URL(e);else if(!ur(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return xv(e)}function xv(e){if(e.hostname!==""){let r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let t=e.pathname,s=-1;for(;++s<t.length;)if(t.codePointAt(s)===37&&t.codePointAt(s+1)===50){let r=t.codePointAt(s+2);if(r===70||r===102){let o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}var Lo=["history","path","basename","stem","extname","dirname"],qs=class{constructor(t){let s;t?ur(t)?s={path:t}:typeof t=="string"||yv(t)?s={value:t}:s=t:s={},this.cwd="cwd"in s?"":ld.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Lo.length;){let i=Lo[r];i in s&&s[i]!==void 0&&s[i]!==null&&(this[i]=i==="history"?[...s[i]]:s[i])}let o;for(o in s)Lo.includes(o)||(this[o]=s[o])}get basename(){return typeof this.path=="string"?Mt.basename(this.path):void 0}set basename(t){Mo(t,"basename"),Oo(t,"basename"),this.path=Mt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mt.dirname(this.path):void 0}set dirname(t){cd(this.basename,"dirname"),this.path=Mt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mt.extname(this.path):void 0}set extname(t){if(Oo(t,"extname"),cd(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Mt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ur(t)&&(t=hd(t)),Mo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mt.basename(this.path,this.extname):void 0}set stem(t){Mo(t,"stem"),Oo(t,"stem"),this.path=Mt.join(this.dirname||"",t+(this.extname||""))}fail(t,s,r){let o=this.message(t,s,r);throw o.fatal=!0,o}info(t,s,r){let o=this.message(t,s,r);return o.fatal=void 0,o}message(t,s,r){let o=new He(t,s,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}};function Oo(e,t){if(e&&e.includes(Mt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mt.sep+"`")}function Mo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function cd(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function yv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var dd=(function(e){let r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i});var wv={}.hasOwnProperty,zo=class e extends dd{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Io()}copy(){let t=new e,s=-1;for(;++s<this.attachers.length;){let r=this.attachers[s];t.use(...r)}return t.data((0,sn.default)(!0,{},this.namespace)),t}data(t,s){return typeof t=="string"?arguments.length===2?(No("data",this.frozen),this.namespace[t]=s,this):wv.call(this.namespace,t)&&this.namespace[t]||void 0:t?(No("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[s,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);let o=s.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let s=tn(t),r=this.parser||this.Parser;return Fo("parse",r),r(String(s),s)}process(t,s){let r=this;return this.freeze(),Fo("process",this.parser||this.Parser),Bo("process",this.compiler||this.Compiler),s?o(void 0,s):new Promise(o);function o(i,n){let a=tn(t),h=r.parse(a);r.run(h,a,function(c,f,v){if(c||!f||!v)return l(c);let g=f,u=r.stringify(g,v);kv(u)?v.value=u:v.result=u,l(c,v)});function l(c,f){c||!f?n(c):i?i(f):s(void 0,f)}}}processSync(t){let s=!1,r;return this.freeze(),Fo("processSync",this.parser||this.Parser),Bo("processSync",this.compiler||this.Compiler),this.process(t,o),pd("processSync","process",s),r;function o(i,n){s=!0,Ao(i),r=n}}run(t,s,r){ud(t),this.freeze();let o=this.transformers;return!r&&typeof s=="function"&&(r=s,s=void 0),r?i(void 0,r):new Promise(i);function i(n,a){let h=tn(s);o.run(t,h,l);function l(c,f,v){let g=f||t;c?a(c):n?n(g):r(void 0,g,v)}}}runSync(t,s){let r=!1,o;return this.run(t,s,i),pd("runSync","run",r),o;function i(n,a){Ao(n),o=a,r=!0}}stringify(t,s){this.freeze();let r=tn(s),o=this.compiler||this.Compiler;return Bo("stringify",o),ud(t),o(t,r)}use(t,...s){let r=this.attachers,o=this.namespace;if(No("use",this.frozen),t!=null)if(typeof t=="function")h(t,s);else if(typeof t=="object")Array.isArray(t)?a(t):n(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(l){if(typeof l=="function")h(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...f]=l;h(c,f)}else n(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function n(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(l.plugins),l.settings&&(o.settings=(0,sn.default)(!0,o.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let f=l[c];i(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function h(l,c){let f=-1,v=-1;for(;++f<r.length;)if(r[f][0]===l){v=f;break}if(v===-1)r.push([l,...c]);else if(c.length>0){let[g,...u]=c,d=r[v][1];Yr(d)&&Yr(g)&&(g=(0,sn.default)(!0,d,g)),r[v]=[l,g,...u]}}}},Ho=new zo().freeze();function Fo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function No(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ud(e){if(!Yr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function pd(e,t,s){if(!s)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function tn(e){return Sv(e)?e:new qs(e)}function Sv(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function kv(e){return typeof e=="string"||Cv(e)}function Cv(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Ev="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",fd=[],md={allowDangerousHtml:!0},Tv=/^(https?|ircs?|mailto|xmpp)$/i,Pv=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function $o(e){let t=Dv(e),s=Rv(e);return Av(t.runSync(t.parse(s),s),e)}function Dv(e){let t=e.rehypePlugins||fd,s=e.remarkPlugins||fd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...md}:md;return Ho().use(ji).use(s).use(Zi,r).use(t)}function Rv(e){let t=e.children||"",s=new qs;return typeof t=="string"?s.value=t:(""+t,void 0),s}function Av(e,t){let s=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,n=t.skipHtml,a=t.unwrapDisallowed,h=t.urlTransform||vd;for(let c of Pv)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+Ev+c.id,void 0);return s&&i&&void 0,Ws(e,l),oo(e,{Fragment:pr.Fragment,components:o,ignoreInvalidStyle:!0,jsx:pr.jsx,jsxs:pr.jsxs,passKeys:!0,passNode:!0});function l(c,f,v){if(c.type==="raw"&&v&&typeof f=="number")return n?v.children.splice(f,1):v.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let g;for(g in Vr)if(Object.hasOwn(Vr,g)&&Object.hasOwn(c.properties,g)){let u=c.properties[g],d=Vr[g];(d===null||d.includes(c.tagName))&&(c.properties[g]=h(String(u||""),g,c))}}if(c.type==="element"){let g=s?!s.includes(c.tagName):i?i.includes(c.tagName):!1;if(!g&&r&&typeof f=="number"&&(g=!r(c,f,v)),g&&v&&typeof f=="number")return a&&c.children?v.children.splice(f,1,...c.children):v.children.splice(f,1),f}}}function vd(e){let t=e.indexOf(":"),s=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||s!==-1&&t>s||r!==-1&&t>r||Tv.test(e.slice(0,t))?e:""}function Uo(e,t){let s=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=s.indexOf(t);for(;o!==-1;)r++,o=s.indexOf(t,o+t.length);return r}function Vo(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function jo(e,t,s){let o=ms((s||{}).ignore||[]),i=Iv(t),n=-1;for(;++n<i.length;)Jr(e,"text",a);function a(l,c){let f=-1,v;for(;++f<c.length;){let g=c[f],u=v?v.children:void 0;if(o(g,u?u.indexOf(g):void 0,v))return;v=g}if(v)return h(l,c)}function h(l,c){let f=c[c.length-1],v=i[n][0],g=i[n][1],u=0,m=f.children.indexOf(l),p=!1,b=[];v.lastIndex=0;let x=v.exec(l.value);for(;x;){let y=x.index,S={index:x.index,input:x.input,stack:[...c,l]},_=g(...x,S);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?v.lastIndex=y+1:(u!==y&&b.push({type:"text",value:l.value.slice(u,y)}),Array.isArray(_)?b.push(..._):_&&b.push(_),u=y+x[0].length,p=!0),!v.global)break;x=v.exec(l.value)}return p?(u<l.value.length&&b.push({type:"text",value:l.value.slice(u)}),f.children.splice(m,1,...b)):b=[l],m+b.length}}function Iv(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let s=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<s.length;){let o=s[r];t.push([Lv(o[0]),Ov(o[1])])}return t}function Lv(e){return typeof e=="string"?new RegExp(Vo(e),"g"):e}function Ov(e){return typeof e=="function"?e:function(){return e}}var Wo="phrasing",qo=["autolink","link","image","label"];function Go(){return{transforms:[Hv],enter:{literalAutolink:Mv,literalAutolinkEmail:Ko,literalAutolinkHttp:Ko,literalAutolinkWww:Ko},exit:{literalAutolink:zv,literalAutolinkEmail:Nv,literalAutolinkHttp:Fv,literalAutolinkWww:Bv}}}function Xo(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Wo,notInConstruct:qo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Wo,notInConstruct:qo},{character:":",before:"[ps]",after:"\\/",inConstruct:Wo,notInConstruct:qo}]}}function Mv(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ko(e){this.config.enter.autolinkProtocol.call(this,e)}function Fv(e){this.config.exit.autolinkProtocol.call(this,e)}function Bv(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Nv(e){this.config.exit.autolinkEmail.call(this,e)}function zv(e){this.exit(e)}function Hv(e){jo(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$v],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Uv]],{ignore:["link","linkReference"]})}function $v(e,t,s,r,o){let i="";if(!bd(o)||(/^w/i.test(t)&&(s=t+s,t="",i="http://"),!Vv(s)))return!1;let n=jv(s+r);if(!n[0])return!1;let a={type:"link",title:null,url:i+t+n[0],children:[{type:"text",value:t+n[0]}]};return n[1]?[a,{type:"text",value:n[1]}]:a}function Uv(e,t,s,r){return!bd(r,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+s,children:[{type:"text",value:t+"@"+s}]}}function Vv(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function jv(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let s=t[0],r=s.indexOf(")"),o=Uo(e,"("),i=Uo(e,")");for(;r!==-1&&o>i;)e+=s.slice(0,r+1),s=s.slice(r+1),r=s.indexOf(")"),i++;return[e,s]}function bd(e,t){let s=e.input.charCodeAt(e.index-1);return(e.index===0||Nt(s)||zs(s))&&(!t||s!==47)}_d.peek=Zv;function Wv(){this.buffer()}function qv(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Kv(){this.buffer()}function Gv(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Xv(e){let t=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Ze(this.sliceSerialize(e)).toLowerCase(),s.label=t}function Jv(e){this.exit(e)}function Yv(e){let t=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Ze(this.sliceSerialize(e)).toLowerCase(),s.label=t}function Qv(e){this.exit(e)}function Zv(){return"["}function _d(e,t,s,r){let o=s.createTracker(r),i=o.move("[^"),n=s.enter("footnoteReference"),a=s.enter("reference");return i+=o.move(s.safe(s.associationId(e),{after:"]",before:i})),a(),n(),i+=o.move("]"),i}function Jo(){return{enter:{gfmFootnoteCallString:Wv,gfmFootnoteCall:qv,gfmFootnoteDefinitionLabelString:Kv,gfmFootnoteDefinition:Gv},exit:{gfmFootnoteCallString:Xv,gfmFootnoteCall:Jv,gfmFootnoteDefinitionLabelString:Yv,gfmFootnoteDefinition:Qv}}}function Yo(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:s,footnoteReference:_d},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(r,o,i,n){let a=i.createTracker(n),h=a.move("[^"),l=i.enter("footnoteDefinition"),c=i.enter("label");return h+=a.move(i.safe(i.associationId(r),{before:h,after:"]"})),c(),h+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),h+=a.move((t?`
|
|
24
|
+
`:" ")+i.indentLines(i.containerFlow(r,a.current()),t?xd:eb))),l(),h}}function eb(e,t,s){return t===0?e:xd(e,t,s)}function xd(e,t,s){return(s?"":" ")+e}var tb=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];yd.peek=ib;function Qo(){return{canContainEols:["delete"],enter:{strikethrough:sb},exit:{strikethrough:rb}}}function Zo(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:tb}],handlers:{delete:yd}}}function sb(e){this.enter({type:"delete",children:[]},e)}function rb(e){this.exit(e)}function yd(e,t,s,r){let o=s.createTracker(r),i=s.enter("strikethrough"),n=o.move("~~");return n+=s.containerPhrasing(e,{...o.current(),before:n,after:"~"}),n+=o.move("~~"),i(),n}function ib(){return"~"}function nb(e){return e.length}function Sd(e,t){let s=t||{},r=(s.align||[]).concat(),o=s.stringLength||nb,i=[],n=[],a=[],h=[],l=0,c=-1;for(;++c<e.length;){let d=[],m=[],p=-1;for(e[c].length>l&&(l=e[c].length);++p<e[c].length;){let b=ob(e[c][p]);if(s.alignDelimiters!==!1){let x=o(b);m[p]=x,(h[p]===void 0||x>h[p])&&(h[p]=x)}d.push(b)}n[c]=d,a[c]=m}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<l;)i[f]=wd(r[f]);else{let d=wd(r);for(;++f<l;)i[f]=d}f=-1;let v=[],g=[];for(;++f<l;){let d=i[f],m="",p="";d===99?(m=":",p=":"):d===108?m=":":d===114&&(p=":");let b=s.alignDelimiters===!1?1:Math.max(1,h[f]-m.length-p.length),x=m+"-".repeat(b)+p;s.alignDelimiters!==!1&&(b=m.length+b+p.length,b>h[f]&&(h[f]=b),g[f]=b),v[f]=x}n.splice(1,0,v),a.splice(1,0,g),c=-1;let u=[];for(;++c<n.length;){let d=n[c],m=a[c];f=-1;let p=[];for(;++f<l;){let b=d[f]||"",x="",y="";if(s.alignDelimiters!==!1){let S=h[f]-(m[f]||0),_=i[f];_===114?x=" ".repeat(S):_===99?S%2?(x=" ".repeat(S/2+.5),y=" ".repeat(S/2-.5)):(x=" ".repeat(S/2),y=x):y=" ".repeat(S)}s.delimiterStart!==!1&&!f&&p.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&b==="")&&(s.delimiterStart!==!1||f)&&p.push(" "),s.alignDelimiters!==!1&&p.push(x),p.push(b),s.alignDelimiters!==!1&&p.push(y),s.padding!==!1&&p.push(" "),(s.delimiterEnd!==!1||f!==l-1)&&p.push("|")}u.push(s.delimiterEnd===!1?p.join("").replace(/ +$/,""):p.join(""))}return u.join(`
|
|
25
|
+
`)}function ob(e){return e==null?"":String(e)}function wd(e){let t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function kd(e,t,s,r){let o=s.enter("blockquote"),i=s.createTracker(r);i.move("> "),i.shift(2);let n=s.indentLines(s.containerFlow(e,i.current()),ab);return o(),n}function ab(e,t,s){return">"+(s?"":" ")+e}function Ed(e,t){return Cd(e,t.inConstruct,!0)&&!Cd(e,t.notInConstruct,!1)}function Cd(e,t,s){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return s;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ea(e,t,s,r){let o=-1;for(;++o<s.unsafe.length;)if(s.unsafe[o].character===`
|
|
26
|
+
`&&Ed(s.stack,s.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
27
|
+
`}function Td(e,t){let s=String(e),r=s.indexOf(t),o=r,i=0,n=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++i>n&&(n=i):i=1,o=r+t.length,r=s.indexOf(t,o);return n}function Pd(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Dd(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Rd(e,t,s,r){let o=Dd(s),i=e.value||"",n=o==="`"?"GraveAccent":"Tilde";if(Pd(e,s)){let f=s.enter("codeIndented"),v=s.indentLines(i,lb);return f(),v}let a=s.createTracker(r),h=o.repeat(Math.max(Td(i,o)+1,3)),l=s.enter("codeFenced"),c=a.move(h);if(e.lang){let f=s.enter(`codeFencedLang${n}`);c+=a.move(s.safe(e.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){let f=s.enter(`codeFencedMeta${n}`);c+=a.move(" "),c+=a.move(s.safe(e.meta,{before:c,after:`
|
|
28
28
|
`,encode:["`"],...a.current()})),f()}return c+=a.move(`
|
|
29
29
|
`),i&&(c+=a.move(i+`
|
|
30
|
-
`)),c+=a.move(h),l(),c}function
|
|
31
|
-
`,...h.current()}))),a(),e.title&&(a=
|
|
30
|
+
`)),c+=a.move(h),l(),c}function lb(e,t,s){return(s?"":" ")+e}function fr(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ad(e,t,s,r){let o=fr(s),i=o==='"'?"Quote":"Apostrophe",n=s.enter("definition"),a=s.enter("label"),h=s.createTracker(r),l=h.move("[");return l+=h.move(s.safe(s.associationId(e),{before:l,after:"]",...h.current()})),l+=h.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=s.enter("destinationLiteral"),l+=h.move("<"),l+=h.move(s.safe(e.url,{before:l,after:">",...h.current()})),l+=h.move(">")):(a=s.enter("destinationRaw"),l+=h.move(s.safe(e.url,{before:l,after:e.title?" ":`
|
|
31
|
+
`,...h.current()}))),a(),e.title&&(a=s.enter(`title${i}`),l+=h.move(" "+o),l+=h.move(s.safe(e.title,{before:l,after:o,...h.current()})),l+=h.move(o),a()),n(),l}function Id(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function gs(e){return"&#x"+e.toString(16).toUpperCase()+";"}function mr(e,t,s){let r=es(e),o=es(t);return r===void 0?o===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ta.peek=hb;function ta(e,t,s,r){let o=Id(s),i=s.enter("emphasis"),n=s.createTracker(r),a=n.move(o),h=n.move(s.containerPhrasing(e,{after:o,before:a,...n.current()})),l=h.charCodeAt(0),c=mr(r.before.charCodeAt(r.before.length-1),l,o);c.inside&&(h=gs(l)+h.slice(1));let f=h.charCodeAt(h.length-1),v=mr(r.after.charCodeAt(0),f,o);v.inside&&(h=h.slice(0,-1)+gs(f));let g=n.move(o);return i(),s.attentionEncodeSurroundingInfo={after:v.outside,before:c.outside},a+h+g}function hb(e,t,s){return s.options.emphasis||"*"}function Ld(e,t){let s=!1;return Ws(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return s=!0,js}),!!((!e.depth||e.depth<3)&&Bs(e)&&(t.options.setext||s))}function Od(e,t,s,r){let o=Math.max(Math.min(6,e.depth||1),1),i=s.createTracker(r);if(Ld(e,s)){let c=s.enter("headingSetext"),f=s.enter("phrasing"),v=s.containerPhrasing(e,{...i.current(),before:`
|
|
32
32
|
`,after:`
|
|
33
33
|
`});return f(),c(),v+`
|
|
34
34
|
`+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
35
|
-
`))+1))}let n="#".repeat(o),a=
|
|
36
|
-
`,...i.current()});return/^[\t ]/.test(l)&&(l=
|
|
35
|
+
`))+1))}let n="#".repeat(o),a=s.enter("headingAtx"),h=s.enter("phrasing");i.move(n+" ");let l=s.containerPhrasing(e,{before:"# ",after:`
|
|
36
|
+
`,...i.current()});return/^[\t ]/.test(l)&&(l=gs(l.charCodeAt(0))+l.slice(1)),l=l?n+" "+l:n,s.options.closeAtx&&(l+=" "+n),h(),a(),l}sa.peek=cb;function sa(e){return e.value||""}function cb(){return"<"}ra.peek=db;function ra(e,t,s,r){let o=fr(s),i=o==='"'?"Quote":"Apostrophe",n=s.enter("image"),a=s.enter("label"),h=s.createTracker(r),l=h.move("![");return l+=h.move(s.safe(e.alt,{before:l,after:"]",...h.current()})),l+=h.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=s.enter("destinationLiteral"),l+=h.move("<"),l+=h.move(s.safe(e.url,{before:l,after:">",...h.current()})),l+=h.move(">")):(a=s.enter("destinationRaw"),l+=h.move(s.safe(e.url,{before:l,after:e.title?" ":")",...h.current()}))),a(),e.title&&(a=s.enter(`title${i}`),l+=h.move(" "+o),l+=h.move(s.safe(e.title,{before:l,after:o,...h.current()})),l+=h.move(o),a()),l+=h.move(")"),n(),l}function db(){return"!"}ia.peek=ub;function ia(e,t,s,r){let o=e.referenceType,i=s.enter("imageReference"),n=s.enter("label"),a=s.createTracker(r),h=a.move("!["),l=s.safe(e.alt,{before:h,after:"]",...a.current()});h+=a.move(l+"]["),n();let c=s.stack;s.stack=[],n=s.enter("reference");let f=s.safe(s.associationId(e),{before:h,after:"]",...a.current()});return n(),s.stack=c,i(),o==="full"||!l||l!==f?h+=a.move(f+"]"):o==="shortcut"?h=h.slice(0,-1):h+=a.move("]"),h}function ub(){return"!"}na.peek=pb;function na(e,t,s){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<s.unsafe.length;){let n=s.unsafe[i],a=s.compilePattern(n),h;if(n.atBreak)for(;h=a.exec(r);){let l=h.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(h.index+1)}}return o+r+o}function pb(){return"`"}function oa(e,t){let s=Bs(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(s===e.url||"mailto:"+s===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}aa.peek=fb;function aa(e,t,s,r){let o=fr(s),i=o==='"'?"Quote":"Apostrophe",n=s.createTracker(r),a,h;if(oa(e,s)){let c=s.stack;s.stack=[],a=s.enter("autolink");let f=n.move("<");return f+=n.move(s.containerPhrasing(e,{before:f,after:">",...n.current()})),f+=n.move(">"),a(),s.stack=c,f}a=s.enter("link"),h=s.enter("label");let l=n.move("[");return l+=n.move(s.containerPhrasing(e,{before:l,after:"](",...n.current()})),l+=n.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=s.enter("destinationLiteral"),l+=n.move("<"),l+=n.move(s.safe(e.url,{before:l,after:">",...n.current()})),l+=n.move(">")):(h=s.enter("destinationRaw"),l+=n.move(s.safe(e.url,{before:l,after:e.title?" ":")",...n.current()}))),h(),e.title&&(h=s.enter(`title${i}`),l+=n.move(" "+o),l+=n.move(s.safe(e.title,{before:l,after:o,...n.current()})),l+=n.move(o),h()),l+=n.move(")"),a(),l}function fb(e,t,s){return oa(e,s)?"<":"["}la.peek=mb;function la(e,t,s,r){let o=e.referenceType,i=s.enter("linkReference"),n=s.enter("label"),a=s.createTracker(r),h=a.move("["),l=s.containerPhrasing(e,{before:h,after:"]",...a.current()});h+=a.move(l+"]["),n();let c=s.stack;s.stack=[],n=s.enter("reference");let f=s.safe(s.associationId(e),{before:h,after:"]",...a.current()});return n(),s.stack=c,i(),o==="full"||!l||l!==f?h+=a.move(f+"]"):o==="shortcut"?h=h.slice(0,-1):h+=a.move("]"),h}function mb(){return"["}function gr(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Md(e){let t=gr(e),s=e.options.bulletOther;if(!s)return t==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+s+"`) to be different");return s}function Fd(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function rn(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Bd(e,t,s,r){let o=s.enter("list"),i=s.bulletCurrent,n=e.ordered?Fd(s):gr(s),a=e.ordered?n==="."?")":".":Md(s),h=t&&s.bulletLastUsed?n===s.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((n==="*"||n==="-")&&c&&(!c.children||!c.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(h=!0),rn(s)===n&&c){let f=-1;for(;++f<e.children.length;){let v=e.children[f];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(n=a),s.bulletCurrent=n;let l=s.containerFlow(e,r);return s.bulletLastUsed=n,s.bulletCurrent=i,o(),l}function Nd(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function zd(e,t,s,r){let o=Nd(s),i=s.bulletCurrent||gr(s);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(s.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let n=i.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(n=Math.ceil(n/4)*4);let a=s.createTracker(r);a.move(i+" ".repeat(n-i.length)),a.shift(n);let h=s.enter("listItem"),l=s.indentLines(s.containerFlow(e,a.current()),c);return h(),l;function c(f,v,g){return v?(g?"":" ".repeat(n))+f:(g?i:i+" ".repeat(n-i.length))+f}}function Hd(e,t,s,r){let o=s.enter("paragraph"),i=s.enter("phrasing"),n=s.containerPhrasing(e,r);return i(),o(),n}var ha=ms(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function $d(e,t,s,r){return(e.children.some(function(n){return ha(n)})?s.containerPhrasing:s.containerFlow).call(s,e,r)}function Ud(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ca.peek=gb;function ca(e,t,s,r){let o=Ud(s),i=s.enter("strong"),n=s.createTracker(r),a=n.move(o+o),h=n.move(s.containerPhrasing(e,{after:o,before:a,...n.current()})),l=h.charCodeAt(0),c=mr(r.before.charCodeAt(r.before.length-1),l,o);c.inside&&(h=gs(l)+h.slice(1));let f=h.charCodeAt(h.length-1),v=mr(r.after.charCodeAt(0),f,o);v.inside&&(h=h.slice(0,-1)+gs(f));let g=n.move(o+o);return i(),s.attentionEncodeSurroundingInfo={after:v.outside,before:c.outside},a+h+g}function gb(e,t,s){return s.options.strong||"*"}function Vd(e,t,s,r){return s.safe(e.value,r)}function jd(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Wd(e,t,s){let r=(rn(s)+(s.options.ruleSpaces?" ":"")).repeat(jd(s));return s.options.ruleSpaces?r.slice(0,-1):r}var Zr={blockquote:kd,break:ea,code:Rd,definition:Ad,emphasis:ta,hardBreak:ea,heading:Od,html:sa,image:ra,imageReference:ia,inlineCode:na,link:aa,linkReference:la,list:Bd,listItem:zd,paragraph:Hd,root:$d,strong:ca,text:Vd,thematicBreak:Wd};function ua(){return{enter:{table:vb,tableData:qd,tableHeader:qd,tableRow:_b},exit:{codeText:xb,table:bb,tableData:da,tableHeader:da,tableRow:da}}}function vb(e){let t=e._align;this.enter({type:"table",align:t.map(function(s){return s==="none"?null:s}),children:[]},e),this.data.inTable=!0}function bb(e){this.exit(e),this.data.inTable=void 0}function _b(e){this.enter({type:"tableRow",children:[]},e)}function da(e){this.exit(e)}function qd(e){this.enter({type:"tableCell",children:[]},e)}function xb(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,yb));let s=this.stack[this.stack.length-1];s.type,s.value=t,this.exit(e)}function yb(e,t){return t==="|"?t:e}function pa(e){let t=e||{},s=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
37
37
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:n,tableCell:h,tableRow:a}};function n(g,u,d,m){return l(c(g,d,m),g.align)}function a(g,u,d,m){let p=f(g,d,m),b=l([p]);return b.slice(0,b.indexOf(`
|
|
38
|
-
`))}function h(g,u,d,m){let p=d.enter("tableCell"),b=d.enter("phrasing"),x=d.containerPhrasing(g,{...m,before:i,after:i});return b(),p(),x}function l(g,u){return _d(g,{align:u,alignDelimiters:s,padding:r,stringLength:o})}function c(g,u,d){let m=g.children,p=-1,b=[],x=u.enter("table");for(;++p<m.length;)b[p]=f(m[p],u,d);return x(),b}function f(g,u,d){let m=g.children,p=-1,b=[],x=u.enter("tableRow");for(;++p<m.length;)b[p]=h(m[p],g,u,d);return x(),b}function v(g,u,d){let m=Qs.inlineCode(g,u,d);return d.stack.includes("tableCell")&&(m=m.replace(/\|/g,"\\$&")),m}}function pa(){return{exit:{taskListCheckValueChecked:Vd,taskListCheckValueUnchecked:Vd,paragraph:vb}}}function fa(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:bb}}}function Vd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function vb(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let s=r.children[0];if(s&&s.type==="text"){let o=t.children,i=-1,n;for(;++i<o.length;){let a=o[i];if(a.type==="paragraph"){n=a;break}}n===r&&(s.value=s.value.slice(1),s.value.length===0?r.children.shift():r.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,r.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function bb(e,t,r,s){let o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",n="["+(e.checked?"x":" ")+"] ",a=r.createTracker(s);i&&a.move(n);let h=Qs.listItem(e,t,r,{...s,...a.current()});return i&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),h;function l(c){return c+n}}function ma(){return[Ko(),Xo(),Yo(),da(),pa()]}function ga(e){return{extensions:[Go(),Jo(e),Qo(),ua(e),fa()]}}var _b={tokenize:kb,partial:!0},jd={tokenize:Cb,partial:!0},Wd={tokenize:Eb,partial:!0},qd={tokenize:Tb,partial:!0},xb={tokenize:Pb,partial:!0},Kd={name:"wwwAutolink",tokenize:wb,previous:Xd},Gd={name:"protocolAutolink",tokenize:Sb,previous:Jd},Qt={name:"emailAutolink",tokenize:yb,previous:Yd},Bt={};function ba(){return{text:Bt}}var Wr=48;for(;Wr<123;)Bt[Wr]=Qt,Wr++,Wr===58?Wr=65:Wr===91&&(Wr=97);Bt[43]=Qt;Bt[45]=Qt;Bt[46]=Qt;Bt[95]=Qt;Bt[72]=[Qt,Gd];Bt[104]=[Qt,Gd];Bt[87]=[Qt,Kd];Bt[119]=[Qt,Kd];function yb(e,t,r){let s=this,o,i;return n;function n(f){return!va(f)||!Yd.call(s,s.previous)||_a(s.events)?r(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return va(f)?(e.consume(f),a):f===64?(e.consume(f),h):r(f)}function h(f){return f===46?e.check(xb,c,l)(f):f===45||f===95||Fe(f)?(i=!0,e.consume(f),h):c(f)}function l(f){return e.consume(f),o=!0,h}function c(f){return i&&o&&je(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):r(f)}}function wb(e,t,r){let s=this;return o;function o(n){return n!==87&&n!==119||!Xd.call(s,s.previous)||_a(s.events)?r(n):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(_b,e.attempt(jd,e.attempt(Wd,i),r),r)(n))}function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}}function Sb(e,t,r){let s=this,o="",i=!1;return n;function n(f){return(f===72||f===104)&&Jd.call(s,s.previous)&&!_a(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(f),e.consume(f),a):r(f)}function a(f){if(je(f)&&o.length<5)return o+=String.fromCodePoint(f),e.consume(f),a;if(f===58){let v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(f),h}return r(f)}function h(f){return f===47?(e.consume(f),i?l:(i=!0,h)):r(f)}function l(f){return f===null||Fr(f)||_e(f)||Mt(f)||Br(f)?r(f):e.attempt(jd,e.attempt(Wd,c),r)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function kb(e,t,r){let s=0;return o;function o(n){return(n===87||n===119)&&s<3?(s++,e.consume(n),o):n===46&&s===3?(e.consume(n),i):r(n)}function i(n){return n===null?r(n):t(n)}}function Cb(e,t,r){let s,o,i;return n;function n(l){return l===46||l===95?e.check(qd,h,a)(l):l===null||_e(l)||Mt(l)||l!==45&&Br(l)?h(l):(i=!0,e.consume(l),n)}function a(l){return l===95?s=!0:(o=s,s=void 0),e.consume(l),n}function h(l){return o||s||!i?r(l):t(l)}}function Eb(e,t){let r=0,s=0;return o;function o(n){return n===40?(r++,e.consume(n),o):n===41&&s<r?i(n):n===33||n===34||n===38||n===39||n===41||n===42||n===44||n===46||n===58||n===59||n===60||n===63||n===93||n===95||n===126?e.check(qd,t,i)(n):n===null||_e(n)||Mt(n)?t(n):(e.consume(n),o)}function i(n){return n===41&&s++,e.consume(n),o}}function Tb(e,t,r){return s;function s(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),s):a===38?(e.consume(a),i):a===93?(e.consume(a),o):a===60||a===null||_e(a)||Mt(a)?t(a):r(a)}function o(a){return a===null||a===40||a===91||_e(a)||Mt(a)?t(a):s(a)}function i(a){return je(a)?n(a):r(a)}function n(a){return a===59?(e.consume(a),s):je(a)?(e.consume(a),n):r(a)}}function Pb(e,t,r){return s;function s(i){return e.consume(i),o}function o(i){return Fe(i)?r(i):t(i)}}function Xd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||_e(e)}function Jd(e){return!je(e)}function Yd(e){return!(e===47||va(e))}function va(e){return e===43||e===45||e===46||e===95||Fe(e)}function _a(e){let t=e.length,r=!1;for(;t--;){let s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){r=!0;break}if(s._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var Db={tokenize:Fb,partial:!0};function xa(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Lb,continuation:{tokenize:Ob},exit:Mb}},text:{91:{name:"gfmFootnoteCall",tokenize:Ib},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Rb,resolveTo:Ab}}}}function Rb(e,t,r){let s=this,o=s.events.length,i=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),n;for(;o--;){let h=s.events[o][1];if(h.type==="labelImage"){n=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return a;function a(h){if(!n||!n._balanced)return r(h);let l=Ye(s.sliceSerialize({start:n.end,end:s.now()}));return l.codePointAt(0)!==94||!i.includes(l.slice(1))?r(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function Ab(e,t){let r=e.length,s;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){s=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";let o={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let n={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},n.start),end:Object.assign({},n.end)},h=[e[r+1],e[r+2],["enter",o,t],e[r+3],e[r+4],["enter",i,t],["exit",i,t],["enter",n,t],["enter",a,t],["exit",a,t],["exit",n,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(r,e.length-r+1,...h),e}function Ib(e,t,r){let s=this,o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),i=0,n;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),h}function h(f){return f!==94?r(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(f){if(i>999||f===93&&!n||f===null||f===91||_e(f))return r(f);if(f===93){e.exit("chunkString");let v=e.exit("gfmFootnoteCallString");return o.includes(Ye(s.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(f)}return _e(f)||(n=!0),i++,e.consume(f),f===92?c:l}function c(f){return f===91||f===92||f===93?(e.consume(f),i++,l):l(f)}}function Lb(e,t,r){let s=this,o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),i,n=0,a;return h;function h(u){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(u){return u===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):r(u)}function c(u){if(n>999||u===93&&!a||u===null||u===91||_e(u))return r(u);if(u===93){e.exit("chunkString");let d=e.exit("gfmFootnoteDefinitionLabelString");return i=Ye(s.sliceSerialize(d)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return _e(u)||(a=!0),n++,e.consume(u),u===92?f:c}function f(u){return u===91||u===92||u===93?(e.consume(u),n++,c):c(u)}function v(u){return u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),o.includes(i)||o.push(i),le(e,g,"gfmFootnoteDefinitionWhitespace")):r(u)}function g(u){return t(u)}}function Ob(e,t,r){return e.check(Ft,t,e.attempt(Db,t,r))}function Mb(e){e.exit("gfmFootnoteDefinition")}function Fb(e,t,r){let s=this;return le(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){let n=s.events[s.events.length-1];return n&&n[1].type==="gfmFootnoteDefinitionIndent"&&n[2].sliceSerialize(n[1],!0).length===4?t(i):r(i)}}function ya(e){let r=(e||{}).singleTilde,s={name:"strikethrough",tokenize:i,resolveAll:o};return r==null&&(r=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function o(n,a){let h=-1;for(;++h<n.length;)if(n[h][0]==="enter"&&n[h][1].type==="strikethroughSequenceTemporary"&&n[h][1]._close){let l=h;for(;l--;)if(n[l][0]==="exit"&&n[l][1].type==="strikethroughSequenceTemporary"&&n[l][1]._open&&n[h][1].end.offset-n[h][1].start.offset===n[l][1].end.offset-n[l][1].start.offset){n[h][1].type="strikethroughSequence",n[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},n[l][1].start),end:Object.assign({},n[h][1].end)},f={type:"strikethroughText",start:Object.assign({},n[l][1].end),end:Object.assign({},n[h][1].start)},v=[["enter",c,a],["enter",n[l][1],a],["exit",n[l][1],a],["enter",f,a]],g=a.parser.constructs.insideSpan.null;g&&He(v,v.length,0,dr(g,n.slice(l+1,h),a)),He(v,v.length,0,[["exit",f,a],["enter",n[h][1],a],["exit",n[h][1],a],["exit",c,a]]),He(n,l-1,h-l+3,v),h=l+v.length-2;break}}for(h=-1;++h<n.length;)n[h][1].type==="strikethroughSequenceTemporary"&&(n[h][1].type="data");return n}function i(n,a,h){let l=this.previous,c=this.events,f=0;return v;function v(u){return l===126&&c[c.length-1][1].type!=="characterEscape"?h(u):(n.enter("strikethroughSequenceTemporary"),g(u))}function g(u){let d=Yt(l);if(u===126)return f>1?h(u):(n.consume(u),f++,g);if(f<2&&!r)return h(u);let m=n.exit("strikethroughSequenceTemporary"),p=Yt(u);return m._open=!p||p===2&&!!d,m._close=!d||d===2&&!!p,a(u)}}}var sn=class{constructor(){this.map=[]}add(t,r,s){Bb(this,t,r,s)}consume(t){if(this.map.sort(function(i,n){return i[0]-n[0]}),this.map.length===0)return;let r=this.map.length,s=[];for(;r>0;)r-=1,s.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];s.push(t.slice()),t.length=0;let o=s.pop();for(;o;){for(let i of o)t.push(i);o=s.pop()}this.map.length=0}};function Bb(e,t,r,s){let o=0;if(!(r===0&&s.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=r,e.map[o][2].push(...s);return}o+=1}e.map.push([t,r,s])}}function Qd(e,t){let r=!1,s=[];for(;t<e.length;){let o=e[t];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let i=s.length-1;s[i]=s[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return s}function wa(){return{flow:{null:{name:"table",tokenize:Nb,resolveAll:zb}}}}function Nb(e,t,r){let s=this,o=0,i=0,n;return a;function a(P){let A=s.events.length-1;for(;A>-1;){let $=s.events[A][1].type;if($==="lineEnding"||$==="linePrefix")A--;else break}let F=A>-1?s.events[A][1].type:null,B=F==="tableHead"||F==="tableRow"?_:h;return B===_&&s.parser.lazy[s.now().line]?r(P):B(P)}function h(P){return e.enter("tableHead"),e.enter("tableRow"),l(P)}function l(P){return P===124||(n=!0,i+=1),c(P)}function c(P){return P===null?r(P):ie(P)?i>1?(i=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),g):r(P):ue(P)?le(e,c,"whitespace")(P):(i+=1,n&&(n=!1,o+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),n=!0,c):(e.enter("data"),f(P)))}function f(P){return P===null||P===124||_e(P)?(e.exit("data"),c(P)):(e.consume(P),P===92?v:f)}function v(P){return P===92||P===124?(e.consume(P),f):f(P)}function g(P){return s.interrupt=!1,s.parser.lazy[s.now().line]?r(P):(e.enter("tableDelimiterRow"),n=!1,ue(P)?le(e,u,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):u(P))}function u(P){return P===45||P===58?m(P):P===124?(n=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),d):w(P)}function d(P){return ue(P)?le(e,m,"whitespace")(P):m(P)}function m(P){return P===58?(i+=1,n=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),p):P===45?(i+=1,p(P)):P===null||ie(P)?y(P):w(P)}function p(P){return P===45?(e.enter("tableDelimiterFiller"),b(P)):w(P)}function b(P){return P===45?(e.consume(P),b):P===58?(n=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(P))}function x(P){return ue(P)?le(e,y,"whitespace")(P):y(P)}function y(P){return P===124?u(P):P===null||ie(P)?!n||o!==i?w(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):w(P)}function w(P){return r(P)}function _(P){return e.enter("tableRow"),S(P)}function S(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),S):P===null||ie(P)?(e.exit("tableRow"),t(P)):ue(P)?le(e,S,"whitespace")(P):(e.enter("data"),T(P))}function T(P){return P===null||P===124||_e(P)?(e.exit("data"),S(P)):(e.consume(P),P===92?D:T)}function D(P){return P===92||P===124?(e.consume(P),T):T(P)}}function zb(e,t){let r=-1,s=!0,o=0,i=[0,0,0,0],n=[0,0,0,0],a=!1,h=0,l,c,f,v=new sn;for(;++r<e.length;){let g=e[r],u=g[1];g[0]==="enter"?u.type==="tableHead"?(a=!1,h!==0&&(Zd(v,t,h,l,c),c=void 0,h=0),l={type:"table",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(r,0,[["enter",l,t]])):u.type==="tableRow"||u.type==="tableDelimiterRow"?(s=!0,f=void 0,i=[0,0,0,0],n=[0,r+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(r,0,[["enter",c,t]])),o=u.type==="tableDelimiterRow"?2:c?3:1):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")?(s=!1,n[2]===0&&(i[1]!==0&&(n[0]=n[1],f=nn(v,t,i,o,void 0,f),i=[0,0,0,0]),n[2]=r)):u.type==="tableCellDivider"&&(s?s=!1:(i[1]!==0&&(n[0]=n[1],f=nn(v,t,i,o,void 0,f)),i=n,n=[i[1],r,0,0])):u.type==="tableHead"?(a=!0,h=r):u.type==="tableRow"||u.type==="tableDelimiterRow"?(h=r,i[1]!==0?(n[0]=n[1],f=nn(v,t,i,o,r,f)):n[1]!==0&&(f=nn(v,t,n,o,r,f)),o=0):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")&&(n[3]=r)}for(h!==0&&Zd(v,t,h,l,c),v.consume(t.events),r=-1;++r<t.events.length;){let g=t.events[r];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=Qd(t.events,r))}return e}function nn(e,t,r,s,o,i){let n=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(i.end=Object.assign({},gs(t.events,r[0])),e.add(r[0],0,[["exit",i,t]]));let h=gs(t.events,r[1]);if(i={type:n,start:Object.assign({},h),end:Object.assign({},h)},e.add(r[1],0,[["enter",i,t]]),r[2]!==0){let l=gs(t.events,r[2]),c=gs(t.events,r[3]),f={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(e.add(r[2],0,[["enter",f,t]]),s!==2){let v=t.events[r[2]],g=t.events[r[3]];if(v[1].end=Object.assign({},g[1].end),v[1].type="chunkText",v[1].contentType="text",r[3]>r[2]+1){let u=r[2]+1,d=r[3]-r[2]-1;e.add(u,d,[])}}e.add(r[3]+1,0,[["exit",f,t]])}return o!==void 0&&(i.end=Object.assign({},gs(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function Zd(e,t,r,s,o){let i=[],n=gs(t.events,r);o&&(o.end=Object.assign({},n),i.push(["exit",o,t])),s.end=Object.assign({},n),i.push(["exit",s,t]),e.add(r+1,0,i)}function gs(e,t){let r=e[t],s=r[0]==="enter"?"start":"end";return r[1][s]}var Hb={name:"tasklistCheck",tokenize:Ub};function Sa(){return{text:{91:Hb}}}function Ub(e,t,r){let s=this;return o;function o(h){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?r(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),i)}function i(h){return _e(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),n):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),n):r(h)}function n(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):r(h)}function a(h){return ie(h)?t(h):ue(h)?e.check({tokenize:$b},t,r)(h):r(h)}}function $b(e,t,r){return le(e,s,"whitespace");function s(o){return o===null?r(o):t(o)}}function eu(e){return Ai([ba(),xa(),ya(e),wa(),Sa()])}var Vb={};function on(e){let t=this,r=e||Vb,s=t.data(),o=s.micromarkExtensions||(s.micromarkExtensions=[]),i=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),n=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);o.push(eu(r)),i.push(ma()),n.push(ga(r))}var ke=require("@deepseek-ai/dsh-client-ui-primitives");var Lt="application/x-dsh-remote-files";function ln(e){return e.kind==="directory"||e.navigable===!0}function Zs(e,t){return e.endpointId===t.endpointId&&an(e.directory)===an(t.directory)}function ei(e,t,r){if(e.endpointId!==r.endpointId)return!0;let s=an(r.directory);return!t.some(o=>{let i=an(o);return s===i||s.startsWith(`${i}/`)})}function ti(e,t){return Zs(e,t)?"none":ei(e,e.paths,t)?e.endpointId===t.endpointId?"move":"copy":"invalid"}function vs(e){try{let t=JSON.parse(e);return typeof t.paneId=="string"&&typeof t.endpointId=="string"&&typeof t.directory=="string"&&Array.isArray(t.paths)&&t.paths.every(r=>typeof r=="string")?{paneId:t.paneId,endpointId:t.endpointId,directory:t.directory,paths:t.paths}:void 0}catch{return}}function an(e){return e.replaceAll("\\","/").replace(/\/{2,}/g,"/").replace(/\/$/,"")||"/"}async function hn(e,t){let r=ti(e,t);if(r==="none")return{operation:r};if(r==="invalid")throw new Error("\u4E0D\u80FD\u628A\u76EE\u5F55\u79FB\u52A8\u5230\u81EA\u8EAB\u6216\u5176\u5B50\u76EE\u5F55");if(r==="move")return await Nl({paneId:t.paneId,endpointId:t.endpointId,sourceDirectory:e.directory,destinationDirectory:t.directory,paths:e.paths}),{operation:r};let s=await Bs({sourceEndpointId:e.endpointId,sourcePaths:e.paths,destinationEndpointId:t.endpointId,destinationDirectory:t.directory,conflictPolicy:"fail"});return{operation:r,job:s}}var _l=require("react"),Rs=require("@deepseek-ai/dsh-client-ui-primitives");var ss=require("react"),Ds=require("@deepseek-ai/dsh-client-ui-primitives");var Nt=require("react"),ri=require("react/jsx-runtime"),jb=28;function ka(e,t,r){return Math.min(Math.max(e,t),r)}function bs(){let e=(0,Nt.useRef)(null),t=(0,Nt.useRef)(void 0),r=(0,Nt.useRef)(void 0),s=(0,Nt.useCallback)(()=>{t.current=void 0;let n=e.current,a=r.current;if(n===null||a===void 0)return;let h=n.getBoundingClientRect(),l=ka(a.clientX-h.left,0,h.width),c=ka(a.clientY-h.top,0,h.height),f=Math.min(l,h.width-l,c,h.height-c),v=ka(1-f/jb,0,1),g=Math.atan2(c-h.height/2,l-h.width/2)*(180/Math.PI)+90;n.style.setProperty("--ssh-border-glow-proximity",v.toFixed(3)),n.style.setProperty("--ssh-border-glow-angle",`${g.toFixed(2)}deg`)},[]),o=(0,Nt.useCallback)(n=>{r.current={clientX:n.clientX,clientY:n.clientY},t.current===void 0&&(t.current=requestAnimationFrame(s))},[s]),i=(0,Nt.useCallback)(()=>{r.current=void 0;let n=e.current;n!==null&&n.style.setProperty("--ssh-border-glow-proximity","0")},[]);return(0,Nt.useEffect)(()=>()=>{t.current!==void 0&&cancelAnimationFrame(t.current)},[]),{ref:e,onPointerMove:o,onPointerLeave:i}}function tu({children:e,className:t}){let r=bs();return(0,ri.jsxs)("div",{ref:r.ref,className:`dsh-ssh-border-glow${t===void 0?"":` ${t}`}`,onPointerMove:r.onPointerMove,onPointerLeave:r.onPointerLeave,children:[(0,ri.jsx)("span",{className:"dsh-ssh-border-glow-edge","aria-hidden":"true"}),(0,ri.jsx)("div",{className:"dsh-ssh-border-glow-inner",children:e})]})}var Ca=require("react/jsx-runtime");function Wb(e,t){let r=e.trim().replace(/^#/,"");if(/^[\da-f]{3}$/i.test(r)){let[s="0",o="0",i="0"]=r;return`rgba(${parseInt(s+s,16)}, ${parseInt(o+o,16)}, ${parseInt(i+i,16)}, ${t})`}return/^[\da-f]{6}$/i.test(r)?`rgba(${parseInt(r.slice(0,2),16)}, ${parseInt(r.slice(2,4),16)}, ${parseInt(r.slice(4,6),16)}, ${t})`:`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`}function ru({children:e,className:t,glareColor:r="#ffffff",glareOpacity:s=.28,glareAngle:o=-30,glareSize:i=300,transitionDuration:n=800}){let a={"--dsh-ssh-glare-angle":`${o}deg`,"--dsh-ssh-glare-color":Wb(r,s),"--dsh-ssh-glare-duration":`${n}ms`,"--dsh-ssh-glare-size":`${i}px`};return(0,Ca.jsx)("div",{className:`dsh-ssh-glare-hover${t===void 0?"":` ${t}`}`,style:a,children:(0,Ca.jsx)("div",{className:"dsh-ssh-glare-hover-inner",children:e})})}var bl=require("react");function Zt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function du(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var dt={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},li={duration:.5,overwrite:!1,delay:0},Va,Ge,Re,Pt=1e8,Ee=1/Pt,La=Math.PI*2,qb=La/4,Kb=0,uu=Math.sqrt,Gb=Math.cos,Xb=Math.sin,We=function(t){return typeof t=="string"},Be=function(t){return typeof t=="function"},tr=function(t){return typeof t=="number"},_n=function(t){return typeof t>"u"},Ut=function(t){return typeof t=="object"},ct=function(t){return t!==!1},ja=function(){return typeof window<"u"},cn=function(t){return Be(t)||We(t)},pu=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},et=Array.isArray,Jb=/random\([^)]+\)/g,Yb=/,\s*/g,su=/(?:-?\.?\d|\.)+/gi,Wa=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Xr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ea=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,qa=/[+-]=-?[.\d]+/,Qb=/[^,'"\[\]\s]+/gi,Zb=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ie,zt,Oa,Ka,bt={},fn={},fu,mu=function(t){return(fn=xs(t,bt))&&tt},xn=function(t,r){return console.warn("Invalid property",t,"set to",r,"Missing plugin? gsap.registerPlugin()")},hi=function(t,r){return!r&&console.warn(t)},gu=function(t,r){return t&&(bt[t]=r)&&fn&&(fn[t]=r)||bt},ci=function(){return 0},e_={suppressEvents:!0,isStart:!0,kill:!1},dn={suppressEvents:!0,kill:!1},t_={suppressEvents:!0},Ga={},gr=[],Ma={},vu,lt={},Ta={},iu=30,un=[],Xa="",Ja=function(t){var r=t[0],s,o;if(Ut(r)||Be(r)||(t=[t]),!(s=(r._gsap||{}).harness)){for(o=un.length;o--&&!un[o].targetTest(r););s=un[o]}for(o=t.length;o--;)t[o]&&(t[o]._gsap||(t[o]._gsap=new el(t[o],s)))||t.splice(o,1);return t},vr=function(t){return t._gsap||Ja(Dt(t))[0]._gsap},Ya=function(t,r,s){return(s=t[r])&&Be(s)?t[r]():_n(s)&&t.getAttribute&&t.getAttribute(r)||s},st=function(t,r){return(t=t.split(",")).forEach(r)||t},Ne=function(t){return Math.round(t*1e5)/1e5||0},Ae=function(t){return Math.round(t*1e7)/1e7||0},Jr=function(t,r){var s=r.charAt(0),o=parseFloat(r.substr(2));return t=parseFloat(t),s==="+"?t+o:s==="-"?t-o:s==="*"?t*o:t/o},r_=function(t,r){for(var s=r.length,o=0;t.indexOf(r[o])<0&&++o<s;);return o<s},mn=function(){var t=gr.length,r=gr.slice(0),s,o;for(Ma={},gr.length=0,s=0;s<t;s++)o=r[s],o&&o._lazy&&(o.render(o._lazy[0],o._lazy[1],!0)._lazy=0)},Qa=function(t){return!!(t._initted||t._startAt||t.add)},bu=function(t,r,s,o){gr.length&&!Ge&&mn(),t.render(r,s,o||!!(Ge&&r<0&&Qa(t))),gr.length&&!Ge&&mn()},_u=function(t){var r=parseFloat(t);return(r||r===0)&&(t+"").match(Qb).length<2?r:We(t)?t.trim():t},xu=function(t){return t},_t=function(t,r){for(var s in r)s in t||(t[s]=r[s]);return t},s_=function(t){return function(r,s){for(var o in s)o in r||o==="duration"&&t||o==="ease"||(r[o]=s[o])}},xs=function(t,r){for(var s in r)t[s]=r[s];return t},nu=function e(t,r){for(var s in r)s!=="__proto__"&&s!=="constructor"&&s!=="prototype"&&(t[s]=Ut(r[s])?e(t[s]||(t[s]={}),r[s]):r[s]);return t},gn=function(t,r){var s={},o;for(o in t)o in r||(s[o]=t[o]);return s},ni=function(t){var r=t.parent||Ie,s=t.keyframes?s_(et(t.keyframes)):_t;if(ct(t.inherit))for(;r;)s(t,r.vars.defaults),r=r.parent||r._dp;return t},i_=function(t,r){for(var s=t.length,o=s===r.length;o&&s--&&t[s]===r[s];);return s<0},yu=function(t,r,s,o,i){s===void 0&&(s="_first"),o===void 0&&(o="_last");var n=t[o],a;if(i)for(a=r[i];n&&n[i]>a;)n=n._prev;return n?(r._next=n._next,n._next=r):(r._next=t[s],t[s]=r),r._next?r._next._prev=r:t[o]=r,r._prev=n,r.parent=r._dp=t,r},yn=function(t,r,s,o){s===void 0&&(s="_first"),o===void 0&&(o="_last");var i=r._prev,n=r._next;i?i._next=n:t[s]===r&&(t[s]=n),n?n._prev=i:t[o]===r&&(t[o]=i),r._next=r._prev=r.parent=null},br=function(t,r){t.parent&&(!r||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},qr=function(t,r){if(t&&(!r||r._end>t._dur||r._start<0))for(var s=t;s;)s._dirty=1,s=s.parent;return t},n_=function(t){for(var r=t.parent;r&&r.parent;)r._dirty=1,r.totalDuration(),r=r.parent;return t},Fa=function(t,r,s,o){return t._startAt&&(Ge?t._startAt.revert(dn):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(r,!0,o))},o_=function e(t){return!t||t._ts&&e(t.parent)},ou=function(t){return t._repeat?ys(t._tTime,t=t.duration()+t._rDelay)*t:0},ys=function(t,r){var s=Math.floor(t=Ae(t/r));return t&&s===t?s-1:s},vn=function(t,r){return(t-r._start)*r._ts+(r._ts>=0?0:r._dirty?r.totalDuration():r._tDur)},wn=function(t){return t._end=Ae(t._start+(t._tDur/Math.abs(t._ts||t._rts||Ee)||0))},Sn=function(t,r){var s=t._dp;return s&&s.smoothChildTiming&&t._ts&&(t._start=Ae(s._time-(t._ts>0?r/t._ts:((t._dirty?t.totalDuration():t._tDur)-r)/-t._ts)),wn(t),s._dirty||qr(s,t)),t},wu=function(t,r){var s;if((r._time||!r._dur&&r._initted||r._start<t._time&&(r._dur||!r.add))&&(s=vn(t.rawTime(),r),(!r._dur||pi(0,r.totalDuration(),s)-r._tTime>Ee)&&r.render(s,!0)),qr(t,r)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(s=t;s._dp;)s.rawTime()>=0&&s.totalTime(s._tTime),s=s._dp;t._zTime=-Ee}},Ht=function(t,r,s,o){return r.parent&&br(r),r._start=Ae((tr(s)?s:s||t!==Ie?Tt(t,s,r):t._time)+r._delay),r._end=Ae(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),yu(t,r,"_first","_last",t._sort?"_start":0),Ba(r)||(t._recent=r),o||wu(t,r),t._ts<0&&Sn(t,t._tTime),t},Su=function(t,r){return(bt.ScrollTrigger||xn("scrollTrigger",r))&&bt.ScrollTrigger.create(r,t)},ku=function(t,r,s,o,i){if(sl(t,r,i),!t._initted)return 1;if(!s&&t._pt&&!Ge&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&vu!==ht.frame)return gr.push(t),t._lazy=[i,o],1},a_=function e(t){var r=t.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||e(r))},Ba=function(t){var r=t.data;return r==="isFromStart"||r==="isStart"},l_=function(t,r,s,o){var i=t.ratio,n=r<0||!r&&(!t._start&&a_(t)&&!(!t._initted&&Ba(t))||(t._ts<0||t._dp._ts<0)&&!Ba(t))?0:1,a=t._rDelay,h=0,l,c,f;if(a&&t._repeat&&(h=pi(0,t._tDur,r),c=ys(h,a),t._yoyo&&c&1&&(n=1-n),c!==ys(t._tTime,a)&&(i=1-n,t.vars.repeatRefresh&&t._initted&&t.invalidate())),n!==i||Ge||o||t._zTime===Ee||!r&&t._zTime){if(!t._initted&&ku(t,r,o,s,h))return;for(f=t._zTime,t._zTime=r||(s?Ee:0),s||(s=r&&!f),t.ratio=n,t._from&&(n=1-n),t._time=0,t._tTime=h,l=t._pt;l;)l.r(n,l.d),l=l._next;r<0&&Fa(t,r,s,!0),t._onUpdate&&!s&&vt(t,"onUpdate"),h&&t._repeat&&!s&&t.parent&&vt(t,"onRepeat"),(r>=t._tDur||r<0)&&t.ratio===n&&(n&&br(t,1),!s&&!Ge&&(vt(t,n?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=r)},h_=function(t,r,s){var o;if(s>r)for(o=t._first;o&&o._start<=s;){if(o.data==="isPause"&&o._start>r)return o;o=o._next}else for(o=t._last;o&&o._start>=s;){if(o.data==="isPause"&&o._start<r)return o;o=o._prev}},ws=function(t,r,s,o){var i=t._repeat,n=Ae(r)||0,a=t._tTime/t._tDur;return a&&!o&&(t._time*=n/t._dur),t._dur=n,t._tDur=i?i<0?1e10:Ae(n*(i+1)+t._rDelay*i):n,a>0&&!o&&Sn(t,t._tTime=t._tDur*a),t.parent&&wn(t),s||qr(t.parent,t),t},au=function(t){return t instanceof Ze?qr(t):ws(t,t._dur)},c_={_start:0,endTime:ci,totalDuration:ci},Tt=function e(t,r,s){var o=t.labels,i=t._recent||c_,n=t.duration()>=Pt?i.endTime(!1):t._dur,a,h,l;return We(r)&&(isNaN(r)||r in o)?(h=r.charAt(0),l=r.substr(-1)==="%",a=r.indexOf("="),h==="<"||h===">"?(a>=0&&(r=r.replace(/=/,"")),(h==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(r.substr(1))||0)*(l?(a<0?i:s).totalDuration()/100:1)):a<0?(r in o||(o[r]=n),o[r]):(h=parseFloat(r.charAt(a-1)+r.substr(a+1)),l&&s&&(h=h/100*(et(s)?s[0]:s).totalDuration()),a>1?e(t,r.substr(0,a-1),s)+h:n+h)):r==null?n:+r},oi=function(t,r,s){var o=tr(r[1]),i=(o?2:1)+(t<2?0:1),n=r[i],a,h;if(o&&(n.duration=r[1]),n.parent=s,t){for(a=n,h=s;h&&!("immediateRender"in a);)a=h.vars.defaults||{},h=ct(h.vars.inherit)&&h.parent;n.immediateRender=ct(a.immediateRender),t<2?n.runBackwards=1:n.startAt=r[i-1]}return new Ue(r[0],n,r[i+1])},_r=function(t,r){return t||t===0?r(t):r},pi=function(t,r,s){return s<t?t:s>r?r:s},Xe=function(t,r){return!We(t)||!(r=Zb.exec(t))?"":r[1]},d_=function(t,r,s){return _r(s,function(o){return pi(t,r,o)})},Na=[].slice,Cu=function(t,r){return t&&Ut(t)&&"length"in t&&(!r&&!t.length||t.length-1 in t&&Ut(t[0]))&&!t.nodeType&&t!==zt},u_=function(t,r,s){return s===void 0&&(s=[]),t.forEach(function(o){var i;return We(o)&&!r||Cu(o,1)?(i=s).push.apply(i,Dt(o)):s.push(o)})||s},Dt=function(t,r,s){return Re&&!r&&Re.selector?Re.selector(t):We(t)&&!s&&(Oa||!Ss())?Na.call((r||Ka).querySelectorAll(t),0):et(t)?u_(t,s):Cu(t)?Na.call(t,0):t?[t]:[]},za=function(t){return t=Dt(t)[0]||hi("Invalid scope")||{},function(r){var s=t.current||t.nativeElement||t;return Dt(r,s.querySelectorAll?s:s===t?hi("Invalid scope")||Ka.createElement("div"):t)}},Eu=function(t){return t.sort(function(){return .5-Math.random()})},Tu=function(t){if(Be(t))return t;var r=Ut(t)?t:{each:t},s=Kr(r.ease),o=r.from||0,i=parseFloat(r.base)||0,n={},a=o>0&&o<1,h=isNaN(o)||a,l=r.axis,c=o,f=o;return We(o)?c=f={center:.5,edges:.5,end:1}[o]||0:!a&&h&&(c=o[0],f=o[1]),function(v,g,u){var d=(u||r).length,m=n[d],p,b,x,y,w,_,S,T,D;if(!m){if(D=r.grid==="auto"?0:(r.grid||[1,Pt])[1],!D){for(S=-Pt;S<(S=u[D++].getBoundingClientRect().left)&&D<d;);D<d&&D--}for(m=n[d]=[],p=h?Math.min(D,d)*c-.5:o%D,b=D===Pt?0:h?d*f/D-.5:o/D|0,S=0,T=Pt,_=0;_<d;_++)x=_%D-p,y=b-(_/D|0),m[_]=w=l?Math.abs(l==="y"?y:x):uu(x*x+y*y),w>S&&(S=w),w<T&&(T=w);o==="random"&&Eu(m),m.max=S-T,m.min=T,m.v=d=(parseFloat(r.amount)||parseFloat(r.each)*(D>d?d-1:l?l==="y"?d/D:D:Math.max(D,d/D))||0)*(o==="edges"?-1:1),m.b=d<0?i-d:i,m.u=Xe(r.amount||r.each)||0,s=s&&d<0?C_(s):s}return d=(m[v]-m.min)/m.max||0,Ae(m.b+(s?s(d):d)*m.v)+m.u}},Ha=function(t){var r=Math.pow(10,((t+"").split(".")[1]||"").length);return function(s){var o=Ae(Math.round(parseFloat(s)/t)*t*r);return(o-o%1)/r+(tr(s)?0:Xe(s))}},Pu=function(t,r){var s=et(t),o,i;return!s&&Ut(t)&&(o=s=t.radius||Pt,t.values?(t=Dt(t.values),(i=!tr(t[0]))&&(o*=o)):t=Ha(t.increment)),_r(r,s?Be(t)?function(n){return i=t(n),Math.abs(i-n)<=o?i:n}:function(n){for(var a=parseFloat(i?n.x:n),h=parseFloat(i?n.y:0),l=Pt,c=0,f=t.length,v,g;f--;)i?(v=t[f].x-a,g=t[f].y-h,v=v*v+g*g):v=Math.abs(t[f]-a),v<l&&(l=v,c=f);return c=!o||l<=o?t[c]:n,i||c===n||tr(n)?c:c+Xe(n)}:Ha(t))},Du=function(t,r,s,o){return _r(et(t)?!r:s===!0?!!(s=0):!o,function(){return et(t)?t[~~(Math.random()*t.length)]:(s=s||1e-5)&&(o=s<1?Math.pow(10,(s+"").length-2):1)&&Math.floor(Math.round((t-s/2+Math.random()*(r-t+s*.99))/s)*s*o)/o})},p_=function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];return function(o){return r.reduce(function(i,n){return n(i)},o)}},f_=function(t,r){return function(s){return t(parseFloat(s))+(r||Xe(s))}},m_=function(t,r,s){return Au(t,r,0,1,s)},Ru=function(t,r,s){return _r(s,function(o){return t[~~r(o)]})},g_=function e(t,r,s){var o=r-t;return et(t)?Ru(t,e(0,t.length),r):_r(s,function(i){return(o+(i-t)%o)%o+t})},v_=function e(t,r,s){var o=r-t,i=o*2;return et(t)?Ru(t,e(0,t.length-1),r):_r(s,function(n){return n=(i+(n-t)%i)%i||0,t+(n>o?i-n:n)})},ks=function(t){return t.replace(Jb,function(r){var s=r.indexOf("[")+1,o=r.substring(s||7,s?r.indexOf("]"):r.length-1).split(Yb);return Du(s?o:+o[0],s?0:+o[1],+o[2]||1e-5)})},Au=function(t,r,s,o,i){var n=r-t,a=o-s;return _r(i,function(h){return s+((h-t)/n*a||0)})},b_=function e(t,r,s,o){var i=isNaN(t+r)?0:function(g){return(1-g)*t+g*r};if(!i){var n=We(t),a={},h,l,c,f,v;if(s===!0&&(o=1)&&(s=null),n)t={p:t},r={p:r};else if(et(t)&&!et(r)){for(c=[],f=t.length,v=f-2,l=1;l<f;l++)c.push(e(t[l-1],t[l]));f--,i=function(u){u*=f;var d=Math.min(v,~~u);return c[d](u-d)},s=r}else o||(t=xs(et(t)?[]:{},t));if(!c){for(h in r)tl.call(a,t,h,"get",r[h]);i=function(u){return ol(u,a)||(n?t.p:t)}}}return _r(s,i)},lu=function(t,r,s){var o=t.labels,i=Pt,n,a,h;for(n in o)a=o[n]-r,a<0==!!s&&a&&i>(a=Math.abs(a))&&(h=n,i=a);return h},vt=function(t,r,s){var o=t.vars,i=o[r],n=Re,a=t._ctx,h,l,c;if(i)return h=o[r+"Params"],l=o.callbackScope||t,s&&gr.length&&mn(),a&&(Re=a),c=h?i.apply(l,h):i.call(l),Re=n,c},si=function(t){return br(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Ge),t.progress()<1&&vt(t,"onInterrupt"),t},_s,Iu=[],Lu=function(t){if(t)if(t=!t.name&&t.default||t,ja()||t.headless){var r=t.name,s=Be(t),o=r&&!s&&t.init?function(){this._props=[]}:t,i={init:ci,render:ol,add:tl,kill:M_,modifier:O_,rawVars:0},n={targetTest:0,get:0,getSetter:kn,aliases:{},register:0};if(Ss(),t!==o){if(lt[r])return;_t(o,_t(gn(t,i),n)),xs(o.prototype,xs(i,gn(t,n))),lt[o.prop=r]=o,t.targetTest&&(un.push(o),Ga[r]=1),r=(r==="css"?"CSS":r.charAt(0).toUpperCase()+r.substr(1))+"Plugin"}gu(r,o),t.register&&t.register(tt,o,it)}else Iu.push(t)},Ce=255,ii={aqua:[0,Ce,Ce],lime:[0,Ce,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ce],navy:[0,0,128],white:[Ce,Ce,Ce],olive:[128,128,0],yellow:[Ce,Ce,0],orange:[Ce,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ce,0,0],pink:[Ce,192,203],cyan:[0,Ce,Ce],transparent:[Ce,Ce,Ce,0]},Pa=function(t,r,s){return t+=t<0?1:t>1?-1:0,(t*6<1?r+(s-r)*t*6:t<.5?s:t*3<2?r+(s-r)*(2/3-t)*6:r)*Ce+.5|0},Ou=function(t,r,s){var o=t?tr(t)?[t>>16,t>>8&Ce,t&Ce]:0:ii.black,i,n,a,h,l,c,f,v,g,u;if(!o){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),ii[t])o=ii[t];else if(t.charAt(0)==="#"){if(t.length<6&&(i=t.charAt(1),n=t.charAt(2),a=t.charAt(3),t="#"+i+i+n+n+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return o=parseInt(t.substr(1,6),16),[o>>16,o>>8&Ce,o&Ce,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),o=[t>>16,t>>8&Ce,t&Ce]}else if(t.substr(0,3)==="hsl"){if(o=u=t.match(su),!r)h=+o[0]%360/360,l=+o[1]/100,c=+o[2]/100,n=c<=.5?c*(l+1):c+l-c*l,i=c*2-n,o.length>3&&(o[3]*=1),o[0]=Pa(h+1/3,i,n),o[1]=Pa(h,i,n),o[2]=Pa(h-1/3,i,n);else if(~t.indexOf("="))return o=t.match(Wa),s&&o.length<4&&(o[3]=1),o}else o=t.match(su)||ii.transparent;o=o.map(Number)}return r&&!u&&(i=o[0]/Ce,n=o[1]/Ce,a=o[2]/Ce,f=Math.max(i,n,a),v=Math.min(i,n,a),c=(f+v)/2,f===v?h=l=0:(g=f-v,l=c>.5?g/(2-f-v):g/(f+v),h=f===i?(n-a)/g+(n<a?6:0):f===n?(a-i)/g+2:(i-n)/g+4,h*=60),o[0]=~~(h+.5),o[1]=~~(l*100+.5),o[2]=~~(c*100+.5)),s&&o.length<4&&(o[3]=1),o},Mu=function(t){var r=[],s=[],o=-1;return t.split(er).forEach(function(i){var n=i.match(Xr)||[];r.push.apply(r,n),s.push(o+=n.length+1)}),r.c=s,r},hu=function(t,r,s){var o="",i=(t+o).match(er),n=r?"hsla(":"rgba(",a=0,h,l,c,f;if(!i)return t;if(i=i.map(function(v){return(v=Ou(v,r,1))&&n+(r?v[0]+","+v[1]+"%,"+v[2]+"%,"+v[3]:v.join(","))+")"}),s&&(c=Mu(t),h=s.c,h.join(o)!==c.c.join(o)))for(l=t.replace(er,"1").split(Xr),f=l.length-1;a<f;a++)o+=l[a]+(~h.indexOf(a)?i.shift()||n+"0,0,0,0)":(c.length?c:i.length?i:s).shift());if(!l)for(l=t.split(er),f=l.length-1;a<f;a++)o+=l[a]+i[a];return o+l[f]},er=(function(){var e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in ii)e+="|"+t+"\\b";return new RegExp(e+")","gi")})(),__=/hsl[a]?\(/,Za=function(t){var r=t.join(" "),s;if(er.lastIndex=0,er.test(r))return s=__.test(r),t[1]=hu(t[1],s),t[0]=hu(t[0],s,Mu(t[1])),!0},di,ht=(function(){var e=Date.now,t=500,r=33,s=e(),o=s,i=1e3/240,n=i,a=[],h,l,c,f,v,g,u=function d(m){var p=e()-o,b=m===!0,x,y,w,_;if((p>t||p<0)&&(s+=p-r),o+=p,w=o-s,x=w-n,(x>0||b)&&(_=++f.frame,v=w-f.time*1e3,f.time=w=w/1e3,n+=x+(x>=i?4:i-x),y=1),b||(h=l(d)),y)for(g=0;g<a.length;g++)a[g](w,v,_,m)};return f={time:0,frame:0,tick:function(){u(!0)},deltaRatio:function(m){return v/(1e3/(m||60))},wake:function(){fu&&(!Oa&&ja()&&(zt=Oa=window,Ka=zt.document||{},bt.gsap=tt,(zt.gsapVersions||(zt.gsapVersions=[])).push(tt.version),mu(fn||zt.GreenSockGlobals||!zt.gsap&&zt||{}),Iu.forEach(Lu)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&f.sleep(),l=c||function(m){return setTimeout(m,n-f.time*1e3+1|0)},di=1,u(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(h),di=0,l=ci},lagSmoothing:function(m,p){t=m||1/0,r=Math.min(p||33,t)},fps:function(m){i=1e3/(m||240),n=f.time*1e3+i},add:function(m,p,b){var x=p?function(y,w,_,S){m(y,w,_,S),f.remove(x)}:m;return f.remove(m),a[b?"unshift":"push"](x),Ss(),x},remove:function(m,p){~(p=a.indexOf(m))&&a.splice(p,1)&&g>=p&&g--},_listeners:a},f})(),Ss=function(){return!di&&ht.wake()},we={},x_=/^[\d.\-M][\d.\-,\s]/,y_=/["']/g,w_=function(t){for(var r={},s=t.substr(1,t.length-3).split(":"),o=s[0],i=1,n=s.length,a,h,l;i<n;i++)h=s[i],a=i!==n-1?h.lastIndexOf(","):h.length,l=h.substr(0,a),r[o]=isNaN(l)?l.replace(y_,"").trim():+l,o=h.substr(a+1).trim();return r},S_=function(t){var r=t.indexOf("(")+1,s=t.indexOf(")"),o=t.indexOf("(",r);return t.substring(r,~o&&o<s?t.indexOf(")",s+1):s)},k_=function(t){var r=(t+"").split("("),s=we[r[0]];return s&&r.length>1&&s.config?s.config.apply(null,~t.indexOf("{")?[w_(r[1])]:S_(t).split(",").map(_u)):we._CE&&x_.test(t)?we._CE("",t):s},C_=function(t){return function(r){return 1-t(1-r)}},Kr=function(t,r){return t&&(Be(t)?t:we[t]||k_(t))||r},Yr=function(t,r,s,o){s===void 0&&(s=function(h){return 1-r(1-h)}),o===void 0&&(o=function(h){return h<.5?r(h*2)/2:1-r((1-h)*2)/2});var i={easeIn:r,easeOut:s,easeInOut:o},n;return st(t,function(a){we[a]=bt[a]=i,we[n=a.toLowerCase()]=s;for(var h in i)we[n+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=we[a+"."+h]=i[h]}),i},Fu=function(t){return function(r){return r<.5?(1-t(1-r*2))/2:.5+t((r-.5)*2)/2}},Da=function e(t,r,s){var o=r>=1?r:1,i=(s||(t?.3:.45))/(r<1?r:1),n=i/La*(Math.asin(1/o)||0),a=function(c){return c===1?1:o*Math.pow(2,-10*c)*Xb((c-n)*i)+1},h=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:Fu(a);return i=La/i,h.config=function(l,c){return e(t,l,c)},h},Ra=function e(t,r){r===void 0&&(r=1.70158);var s=function(n){return n?--n*n*((r+1)*n+r)+1:0},o=t==="out"?s:t==="in"?function(i){return 1-s(1-i)}:Fu(s);return o.config=function(i){return e(t,i)},o};st("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var r=t<5?t+1:t;Yr(e+",Power"+(r-1),t?function(s){return Math.pow(s,r)}:function(s){return s},function(s){return 1-Math.pow(1-s,r)},function(s){return s<.5?Math.pow(s*2,r)/2:1-Math.pow((1-s)*2,r)/2})});we.Linear.easeNone=we.none=we.Linear.easeIn;Yr("Elastic",Da("in"),Da("out"),Da());(function(e,t){var r=1/t,s=2*r,o=2.5*r,i=function(a){return a<r?e*a*a:a<s?e*Math.pow(a-1.5/t,2)+.75:a<o?e*(a-=2.25/t)*a+.9375:e*Math.pow(a-2.625/t,2)+.984375};Yr("Bounce",function(n){return 1-i(1-n)},i)})(7.5625,2.75);Yr("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)});Yr("Circ",function(e){return-(uu(1-e*e)-1)});Yr("Sine",function(e){return e===1?1:-Gb(e*qb)+1});Yr("Back",Ra("in"),Ra("out"),Ra());we.SteppedEase=we.steps=bt.SteppedEase={config:function(t,r){t===void 0&&(t=1);var s=1/t,o=t+(r?0:1),i=r?1:0,n=1-Ee;return function(a){return((o*pi(0,n,a)|0)+i)*s}}};li.ease=we["quad.out"];st("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return Xa+=e+","+e+"Params,"});var el=function(t,r){this.id=Kb++,t._gsap=this,this.target=t,this.harness=r,this.get=r?r.get:Ya,this.set=r?r.getSetter:kn},ui=(function(){function e(r){this.vars=r,this._delay=+r.delay||0,(this._repeat=r.repeat===1/0?-2:r.repeat||0)&&(this._rDelay=r.repeatDelay||0,this._yoyo=!!r.yoyo||!!r.yoyoEase),this._ts=1,ws(this,+r.duration,1,1),this.data=r.data,Re&&(this._ctx=Re,Re.data.push(this)),di||ht.wake()}var t=e.prototype;return t.delay=function(s){return s||s===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+s-this._delay),this._delay=s,this):this._delay},t.duration=function(s){return arguments.length?this.totalDuration(this._repeat>0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},t.totalDuration=function(s){return arguments.length?(this._dirty=0,ws(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(s,o){if(Ss(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Sn(this,s),!i._dp||i.parent||wu(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&s<this._tDur||this._ts<0&&s>0||!this._tDur&&!s)&&Ht(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!o||this._initted&&Math.abs(this._zTime)===Ee||!this._initted&&this._dur&&s||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),bu(this,s,o)),this},t.time=function(s,o){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+ou(this))%(this._dur+this._rDelay)||(s?this._dur:0),o):this._time},t.totalProgress=function(s,o){return arguments.length?this.totalTime(this.totalDuration()*s,o):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(s,o){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+ou(this),o):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(s,o){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*i,o):this._repeat?ys(this._tTime,i)+1:1},t.timeScale=function(s,o){if(!arguments.length)return this._rts===-Ee?0:this._rts;if(this._rts===s)return this;var i=this.parent&&this._ts?vn(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-Ee?0:this._rts,this.totalTime(pi(-Math.abs(this._delay),this.totalDuration(),i),o!==!1),wn(this),n_(this)},t.paused=function(s){return arguments.length?(this._ps!==s&&(this._ps=s,s?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ss(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ee&&(this._tTime-=Ee)))),this):this._ps},t.startTime=function(s){if(arguments.length){this._start=Ae(s);var o=this.parent||this._dp;return o&&(o._sort||!this.parent)&&Ht(o,this,this._start-this._delay),this}return this._start},t.endTime=function(s){return this._start+(ct(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(s){var o=this.parent||this._dp;return o?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?vn(o.rawTime(s),this):this._tTime:this._tTime},t.revert=function(s){s===void 0&&(s=t_);var o=Ge;return Ge=s,Qa(this)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),Ge=o,this},t.globalTime=function(s){for(var o=this,i=arguments.length?s:o.rawTime();o;)i=o._start+i/(Math.abs(o._ts)||1),o=o._dp;return!this.parent&&this._sat?this._sat.globalTime(s):i},t.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,au(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(s){if(arguments.length){var o=this._time;return this._rDelay=s,au(this),o?this.time(o):this}return this._rDelay},t.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},t.seek=function(s,o){return this.totalTime(Tt(this,s),ct(o))},t.restart=function(s,o){return this.play().totalTime(s?-this._delay:0,ct(o)),this._dur||(this._zTime=-Ee),this},t.play=function(s,o){return s!=null&&this.seek(s,o),this.reversed(!1).paused(!1)},t.reverse=function(s,o){return s!=null&&this.seek(s||this.totalDuration(),o),this.reversed(!0).paused(!1)},t.pause=function(s,o){return s!=null&&this.seek(s,o),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-Ee:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ee,this},t.isActive=function(){var s=this.parent||this._dp,o=this._start,i;return!!(!s||this._ts&&this._initted&&s.isActive()&&(i=s.rawTime(!0))>=o&&i<this.endTime(!0)-Ee)},t.eventCallback=function(s,o,i){var n=this.vars;return arguments.length>1?(o?(n[s]=o,i&&(n[s+"Params"]=i),s==="onUpdate"&&(this._onUpdate=o)):delete n[s],this):n[s]},t.then=function(s){var o=this,i=o._prom;return new Promise(function(n){var a=Be(s)?s:xu,h=function(){var c=o.then;o.then=null,i&&i(),Be(a)&&(a=a(o))&&(a.then||a===o)&&(o.then=c),n(a),o.then=c};o._initted&&o.totalProgress()===1&&o._ts>=0||!o._tTime&&o._ts<0?h():o._prom=h})},t.kill=function(){si(this)},e})();_t(ui.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Ee,_prom:0,_ps:!1,_rts:1});var Ze=(function(e){du(t,e);function t(s,o){var i;return s===void 0&&(s={}),i=e.call(this,s)||this,i.labels={},i.smoothChildTiming=!!s.smoothChildTiming,i.autoRemoveChildren=!!s.autoRemoveChildren,i._sort=ct(s.sortChildren),Ie&&Ht(s.parent||Ie,Zt(i),o),s.reversed&&i.reverse(),s.paused&&i.paused(!0),s.scrollTrigger&&Su(Zt(i),s.scrollTrigger),i}var r=t.prototype;return r.to=function(o,i,n){return oi(0,arguments,this),this},r.from=function(o,i,n){return oi(1,arguments,this),this},r.fromTo=function(o,i,n,a){return oi(2,arguments,this),this},r.set=function(o,i,n){return i.duration=0,i.parent=this,ni(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Ue(o,i,Tt(this,n),1),this},r.call=function(o,i,n){return Ht(this,Ue.delayedCall(0,o,i),n)},r.staggerTo=function(o,i,n,a,h,l,c){return n.duration=i,n.stagger=n.stagger||a,n.onComplete=l,n.onCompleteParams=c,n.parent=this,new Ue(o,n,Tt(this,h)),this},r.staggerFrom=function(o,i,n,a,h,l,c){return n.runBackwards=1,ni(n).immediateRender=ct(n.immediateRender),this.staggerTo(o,i,n,a,h,l,c)},r.staggerFromTo=function(o,i,n,a,h,l,c,f){return a.startAt=n,ni(a).immediateRender=ct(a.immediateRender),this.staggerTo(o,i,a,h,l,c,f)},r.render=function(o,i,n){var a=this._time,h=this._dirty?this.totalDuration():this._tDur,l=this._dur,c=o<=0?0:Ae(o),f=this._zTime<0!=o<0&&(this._initted||!l),v,g,u,d,m,p,b,x,y,w,_,S;if(this!==Ie&&c>h&&o>=0&&(c=h),c!==this._tTime||n||f){if(a!==this._time&&l&&(c+=this._time-a,o+=this._time-a),v=c,y=this._start,x=this._ts,p=!x,f&&(l||(a=this._zTime),(o||!i)&&(this._zTime=o)),this._repeat){if(_=this._yoyo,m=l+this._rDelay,this._repeat<-1&&o<0)return this.totalTime(m*100+o,i,n);if(v=Ae(c%m),c===h?(d=this._repeat,v=l):(w=Ae(c/m),d=~~w,d&&d===w&&(v=l,d--),v>l&&(v=l)),w=ys(this._tTime,m),!a&&this._tTime&&w!==d&&this._tTime-w*m-this._dur<=0&&(w=d),_&&d&1&&(v=l-v,S=1),d!==w&&!this._lock){var T=_&&w&1,D=T===(_&&d&1);if(d<w&&(T=!T),a=T?0:c%l?l:c,this._lock=1,this.render(a||(S?0:Ae(d*m)),i,!l)._lock=0,this._tTime=c,!i&&this.parent&&vt(this,"onRepeat"),this.vars.repeatRefresh&&!S&&(this.invalidate()._lock=1,w=d),a&&a!==this._time||p!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,h=this._tDur,D&&(this._lock=2,a=T?l:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!S&&this.invalidate()),this._lock=0,!this._ts&&!p)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=h_(this,Ae(a),Ae(v)),b&&(c-=v-(v=b._start))),this._tTime=c,this._time=v,this._act=!!x,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=o,a=0),!a&&c&&l&&!i&&!w&&(vt(this,"onStart"),this._tTime!==c))return this;if(v>=a&&o>=0)for(g=this._first;g;){if(u=g._next,(g._act||v>=g._start)&&g._ts&&b!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(v-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(v-g._start)*g._ts,i,n),v!==this._time||!this._ts&&!p){b=0,u&&(c+=this._zTime=-Ee);break}}g=u}else{g=this._last;for(var P=o<0?o:v;g;){if(u=g._prev,(g._act||P<=g._end)&&g._ts&&b!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(P-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(P-g._start)*g._ts,i,n||Ge&&Qa(g)),v!==this._time||!this._ts&&!p){b=0,u&&(c+=this._zTime=P?-Ee:Ee);break}}g=u}}if(b&&!i&&(this.pause(),b.render(v>=a?0:-Ee)._zTime=v>=a?1:-1,this._ts))return this._start=y,wn(this),this.render(o,i,n);this._onUpdate&&!i&&vt(this,"onUpdate",!0),(c===h&&this._tTime>=this.totalDuration()||!c&&a)&&(y===this._start||Math.abs(x)!==Math.abs(this._ts))&&(this._lock||((o||!l)&&(c===h&&this._ts>0||!c&&this._ts<0)&&br(this,1),!i&&!(o<0&&!a)&&(c||a||!h)&&(vt(this,c===h&&o>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<h&&this.timeScale()>0)&&this._prom())))}return this},r.add=function(o,i){var n=this;if(tr(i)||(i=Tt(this,i,o)),!(o instanceof ui)){if(et(o))return o.forEach(function(a){return n.add(a,i)}),this;if(We(o))return this.addLabel(o,i);if(Be(o))o=Ue.delayedCall(0,o);else return this}return this!==o?Ht(this,o,i):this},r.getChildren=function(o,i,n,a){o===void 0&&(o=!0),i===void 0&&(i=!0),n===void 0&&(n=!0),a===void 0&&(a=-Pt);for(var h=[],l=this._first;l;)l._start>=a&&(l instanceof Ue?i&&h.push(l):(n&&h.push(l),o&&h.push.apply(h,l.getChildren(!0,i,n)))),l=l._next;return h},r.getById=function(o){for(var i=this.getChildren(1,1,1),n=i.length;n--;)if(i[n].vars.id===o)return i[n]},r.remove=function(o){return We(o)?this.removeLabel(o):Be(o)?this.killTweensOf(o):(o.parent===this&&yn(this,o),o===this._recent&&(this._recent=this._last),qr(this))},r.totalTime=function(o,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ae(ht.time-(this._ts>0?o/this._ts:(this.totalDuration()-o)/-this._ts))),e.prototype.totalTime.call(this,o,i),this._forcing=0,this):this._tTime},r.addLabel=function(o,i){return this.labels[o]=Tt(this,i),this},r.removeLabel=function(o){return delete this.labels[o],this},r.addPause=function(o,i,n){var a=Ue.delayedCall(0,i||ci,n);return a.data="isPause",this._hasPause=1,Ht(this,a,Tt(this,o))},r.removePause=function(o){var i=this._first;for(o=Tt(this,o);i;)i._start===o&&i.data==="isPause"&&br(i),i=i._next},r.killTweensOf=function(o,i,n){for(var a=this.getTweensOf(o,n),h=a.length;h--;)mr!==a[h]&&a[h].kill(o,i);return this},r.getTweensOf=function(o,i){for(var n=[],a=Dt(o),h=this._first,l=tr(i),c;h;)h instanceof Ue?r_(h._targets,a)&&(l?(!mr||h._initted&&h._ts)&&h.globalTime(0)<=i&&h.globalTime(h.totalDuration())>i:!i||h.isActive())&&n.push(h):(c=h.getTweensOf(a,i)).length&&n.push.apply(n,c),h=h._next;return n},r.tweenTo=function(o,i){i=i||{};var n=this,a=Tt(n,o),h=i,l=h.startAt,c=h.onStart,f=h.onStartParams,v=h.immediateRender,g,u=Ue.to(n,_t({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale())||Ee,onStart:function(){if(n.pause(),!g){var m=i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale());u._dur!==m&&ws(u,m,0,1).render(u._time,!0,!0),g=1}c&&c.apply(u,f||[])}},i));return v?u.render(0):u},r.tweenFromTo=function(o,i,n){return this.tweenTo(i,_t({startAt:{time:Tt(this,o)}},n))},r.recent=function(){return this._recent},r.nextLabel=function(o){return o===void 0&&(o=this._time),lu(this,Tt(this,o))},r.previousLabel=function(o){return o===void 0&&(o=this._time),lu(this,Tt(this,o),1)},r.currentLabel=function(o){return arguments.length?this.seek(o,!0):this.previousLabel(this._time+Ee)},r.shiftChildren=function(o,i,n){n===void 0&&(n=0);var a=this._first,h=this.labels,l;for(o=Ae(o);a;)a._start>=n&&(a._start+=o,a._end+=o),a=a._next;if(i)for(l in h)h[l]>=n&&(h[l]+=o);return qr(this)},r.invalidate=function(o){var i=this._first;for(this._lock=0;i;)i.invalidate(o),i=i._next;return e.prototype.invalidate.call(this,o)},r.clear=function(o){o===void 0&&(o=!0);for(var i=this._first,n;i;)n=i._next,this.remove(i),i=n;return this._dp&&(this._time=this._tTime=this._pTime=0),o&&(this.labels={}),qr(this)},r.totalDuration=function(o){var i=0,n=this,a=n._last,h=Pt,l,c,f;if(arguments.length)return n.timeScale((n._repeat<0?n.duration():n.totalDuration())/(n.reversed()?-o:o));if(n._dirty){for(f=n.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),c=a._start,c>h&&n._sort&&a._ts&&!n._lock?(n._lock=1,Ht(n,a,c-a._delay,1)._lock=0):h=c,c<0&&a._ts&&(i-=c,(!f&&!n._dp||f&&f.smoothChildTiming)&&(n._start+=Ae(c/n._ts),n._time-=c,n._tTime-=c),n.shiftChildren(-c,!1,-1/0),h=0),a._end>i&&a._ts&&(i=a._end),a=l;ws(n,n===Ie&&n._time>i?n._time:i,1,1),n._dirty=0}return n._tDur},t.updateRoot=function(o){if(Ie._ts&&(bu(Ie,vn(o,Ie)),vu=ht.frame),ht.frame>=iu){iu+=dt.autoSleep||120;var i=Ie._first;if((!i||!i._ts)&&dt.autoSleep&&ht._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||ht.sleep()}}},t})(ui);_t(Ze.prototype,{_lock:0,_hasPause:0,_forcing:0});var E_=function(t,r,s,o,i,n,a){var h=new it(this._pt,t,r,0,1,nl,null,i),l=0,c=0,f,v,g,u,d,m,p,b;for(h.b=s,h.e=o,s+="",o+="",(p=~o.indexOf("random("))&&(o=ks(o)),n&&(b=[s,o],n(b,t,r),s=b[0],o=b[1]),v=s.match(Ea)||[];f=Ea.exec(o);)u=f[0],d=o.substring(l,f.index),g?g=(g+1)%5:d.substr(-5)==="rgba("&&(g=1),u!==v[c++]&&(m=parseFloat(v[c-1])||0,h._pt={_next:h._pt,p:d||c===1?d:",",s:m,c:u.charAt(1)==="="?Jr(m,u)-m:parseFloat(u)-m,m:g&&g<4?Math.round:0},l=Ea.lastIndex);return h.c=l<o.length?o.substring(l,o.length):"",h.fp=a,(qa.test(o)||p)&&(h.e=0),this._pt=h,h},tl=function(t,r,s,o,i,n,a,h,l,c){Be(o)&&(o=o(i||0,t,n));var f=t[r],v=s!=="get"?s:Be(f)?l?t[r.indexOf("set")||!Be(t["get"+r.substr(3)])?r:"get"+r.substr(3)](l):t[r]():f,g=Be(f)?l?A_:zu:il,u;if(We(o)&&(~o.indexOf("random(")&&(o=ks(o)),o.charAt(1)==="="&&(u=Jr(v,o)+(Xe(v)||0),(u||u===0)&&(o=u))),!c||v!==o||Ua)return!isNaN(v*o)&&o!==""?(u=new it(this._pt,t,r,+v||0,o-(v||0),typeof f=="boolean"?L_:Hu,0,g),l&&(u.fp=l),a&&u.modifier(a,this,t),this._pt=u):(!f&&!(r in t)&&xn(r,o),E_.call(this,t,r,v,o,g,h||dt.stringFilter,l))},T_=function(t,r,s,o,i){if(Be(t)&&(t=ai(t,i,r,s,o)),!Ut(t)||t.style&&t.nodeType||et(t)||pu(t))return We(t)?ai(t,i,r,s,o):t;var n={},a;for(a in t)n[a]=ai(t[a],i,r,s,o);return n},rl=function(t,r,s,o,i,n){var a,h,l,c;if(lt[t]&&(a=new lt[t]).init(i,a.rawVars?r[t]:T_(r[t],o,i,n,s),s,o,n)!==!1&&(s._pt=h=new it(s._pt,i,t,0,1,a.render,a,0,a.priority),s!==_s))for(l=s._ptLookup[s._targets.indexOf(i)],c=a._props.length;c--;)l[a._props[c]]=h;return a},mr,Ua,sl=function e(t,r,s){var o=t.vars,i=o.ease,n=o.startAt,a=o.immediateRender,h=o.lazy,l=o.onUpdate,c=o.runBackwards,f=o.yoyoEase,v=o.keyframes,g=o.autoRevert,u=t._dur,d=t._startAt,m=t._targets,p=t.parent,b=p&&p.data==="nested"?p.vars.targets:m,x=t._overwrite==="auto"&&!Va,y=t.timeline,w=o.easeReverse||f,_,S,T,D,P,A,F,B,$,z,H,C,R;if(y&&(!v||!i)&&(i="none"),t._ease=Kr(i,li.ease),t._rEase=w&&(Kr(w)||t._ease),t._from=!y&&!!o.runBackwards,t._from&&(t.ratio=1),!y||v&&!o.stagger){if(B=m[0]?vr(m[0]).harness:0,C=B&&o[B.prop],_=gn(o,Ga),d&&(d._zTime<0&&d.progress(1),r<0&&c&&a&&!g?d.render(-1,!0):d.revert(c&&u?dn:e_),d._lazy=0),n){if(br(t._startAt=Ue.set(m,_t({data:"isStart",overwrite:!1,parent:p,immediateRender:!0,lazy:!d&&ct(h),startAt:null,delay:0,onUpdate:l&&function(){return vt(t,"onUpdate")},stagger:0},n))),t._startAt._dp=0,t._startAt._sat=t,r<0&&(Ge||!a&&!g)&&t._startAt.revert(dn),a&&u&&r<=0&&s<=0){r&&(t._zTime=r);return}}else if(c&&u&&!d){if(r&&(a=!1),T=_t({overwrite:!1,data:"isFromStart",lazy:a&&!d&&ct(h),immediateRender:a,stagger:0,parent:p},_),C&&(T[B.prop]=C),br(t._startAt=Ue.set(m,T)),t._startAt._dp=0,t._startAt._sat=t,r<0&&(Ge?t._startAt.revert(dn):t._startAt.render(-1,!0)),t._zTime=r,!a)e(t._startAt,Ee,Ee);else if(!r)return}for(t._pt=t._ptCache=0,h=u&&ct(h)||h&&!u,S=0;S<m.length;S++){if(P=m[S],F=P._gsap||Ja(m)[S]._gsap,t._ptLookup[S]=z={},Ma[F.id]&&gr.length&&mn(),H=b===m?S:b.indexOf(P),B&&($=new B).init(P,C||_,t,H,b)!==!1&&(t._pt=D=new it(t._pt,P,$.name,0,1,$.render,$,0,$.priority),$._props.forEach(function(L){z[L]=D}),$.priority&&(A=1)),!B||C)for(T in _)lt[T]&&($=rl(T,_,t,H,P,b))?$.priority&&(A=1):z[T]=D=tl.call(t,P,T,"get",_[T],H,b,0,o.stringFilter);t._op&&t._op[S]&&t.kill(P,t._op[S]),x&&t._pt&&(mr=t,Ie.killTweensOf(P,z,t.globalTime(r)),R=!t.parent,mr=0),t._pt&&h&&(Ma[F.id]=1)}A&&al(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!R,v&&r<=0&&y.render(Pt,!0,!0)},P_=function(t,r,s,o,i,n,a,h){var l=(t._pt&&t._ptCache||(t._ptCache={}))[r],c,f,v,g;if(!l)for(l=t._ptCache[r]=[],v=t._ptLookup,g=t._targets.length;g--;){if(c=v[g][r],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==r&&c.fp!==r;)c=c._next;if(!c)return Ua=1,t.vars[r]="+=0",sl(t,a),Ua=0,h?hi(r+" not eligible for reset. Try splitting into individual properties"):1;l.push(c)}for(g=l.length;g--;)f=l[g],c=f._pt||f,c.s=(o||o===0)&&!i?o:c.s+(o||0)+n*c.c,c.c=s-c.s,f.e&&(f.e=Ne(s)+Xe(f.e)),f.b&&(f.b=c.s+Xe(f.b))},D_=function(t,r){var s=t[0]?vr(t[0]).harness:0,o=s&&s.aliases,i,n,a,h;if(!o)return r;i=xs({},r);for(n in o)if(n in i)for(h=o[n].split(","),a=h.length;a--;)i[h[a]]=i[n];return i},R_=function(t,r,s,o){var i=r.ease||o||"power1.inOut",n,a;if(et(r))a=s[t]||(s[t]=[]),r.forEach(function(h,l){return a.push({t:l/(r.length-1)*100,v:h,e:i})});else for(n in r)a=s[n]||(s[n]=[]),n==="ease"||a.push({t:parseFloat(t),v:r[n],e:i})},ai=function(t,r,s,o,i){return Be(t)?t.call(r,s,o,i):We(t)&&~t.indexOf("random(")?ks(t):t},Bu=Xa+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",Nu={};st(Bu+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return Nu[e]=1});var Ue=(function(e){du(t,e);function t(s,o,i,n){var a;typeof o=="number"&&(i.duration=o,o=i,i=null),a=e.call(this,n?o:ni(o))||this;var h=a.vars,l=h.duration,c=h.delay,f=h.immediateRender,v=h.stagger,g=h.overwrite,u=h.keyframes,d=h.defaults,m=h.scrollTrigger,p=o.parent||Ie,b=(et(s)||pu(s)?tr(s[0]):"length"in o)?[s]:Dt(s),x,y,w,_,S,T,D,P;if(a._targets=b.length?Ja(b):hi("GSAP target "+s+" not found. https://gsap.com",!dt.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=g,u||v||cn(l)||cn(c)){o=a.vars;var A=o.easeReverse||o.yoyoEase;if(x=a.timeline=new Ze({data:"nested",defaults:d||{},targets:p&&p.data==="nested"?p.vars.targets:b}),x.kill(),x.parent=x._dp=Zt(a),x._start=0,v||cn(l)||cn(c)){if(_=b.length,D=v&&Tu(v),Ut(v))for(S in v)~Bu.indexOf(S)&&(P||(P={}),P[S]=v[S]);for(y=0;y<_;y++)w=gn(o,Nu),w.stagger=0,A&&(w.easeReverse=A),P&&xs(w,P),T=b[y],w.duration=+ai(l,Zt(a),y,T,b),w.delay=(+ai(c,Zt(a),y,T,b)||0)-a._delay,!v&&_===1&&w.delay&&(a._delay=c=w.delay,a._start+=c,w.delay=0),x.to(T,w,D?D(y,T,b):0),x._ease=we.none;x.duration()?l=c=0:a.timeline=0}else if(u){ni(_t(x.vars.defaults,{ease:"none"})),x._ease=Kr(u.ease||o.ease||"none");var F=0,B,$,z;if(et(u))u.forEach(function(H){return x.to(b,H,">")}),x.duration();else{w={};for(S in u)S==="ease"||S==="easeEach"||R_(S,u[S],w,u.easeEach);for(S in w)for(B=w[S].sort(function(H,C){return H.t-C.t}),F=0,y=0;y<B.length;y++)$=B[y],z={ease:$.e,duration:($.t-(y?B[y-1].t:0))/100*l},z[S]=$.v,x.to(b,z,F),F+=z.duration;x.duration()<l&&x.to({},{duration:l-x.duration()})}}l||a.duration(l=x.duration())}else a.timeline=0;return g===!0&&!Va&&(mr=Zt(a),Ie.killTweensOf(b),mr=0),Ht(p,Zt(a),i),o.reversed&&a.reverse(),o.paused&&a.paused(!0),(f||!l&&!u&&a._start===Ae(p._time)&&ct(f)&&o_(Zt(a))&&p.data!=="nested")&&(a._tTime=-Ee,a.render(Math.max(0,-c)||0)),m&&Su(Zt(a),m),a}var r=t.prototype;return r.render=function(o,i,n){var a=this._time,h=this._tDur,l=this._dur,c=o<0,f=o>h-Ee&&!c?h:o<Ee?0:o,v,g,u,d,m,p,b,x;if(!l)l_(this,o,i,n);else if(f!==this._tTime||!o||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(v=f,x=this.timeline,this._repeat){if(d=l+this._rDelay,this._repeat<-1&&c)return this.totalTime(d*100+o,i,n);if(v=Ae(f%d),f===h?(u=this._repeat,v=l):(m=Ae(f/d),u=~~m,u&&u===m?(v=l,u--):v>l&&(v=l)),p=this._yoyo&&u&1,p&&(v=l-v),m=ys(this._tTime,d),v===a&&!n&&this._initted&&u===m)return this._tTime=f,this;u!==m&&this.vars.repeatRefresh&&!p&&!this._lock&&v!==d&&this._initted&&(this._lock=n=1,this.render(Ae(d*u),!0).invalidate()._lock=0)}if(!this._initted){if(ku(this,c?o:v,n,i,f))return this._tTime=0,this;if(a!==this._time&&!(n&&this.vars.repeatRefresh&&u!==m))return this;if(l!==this._dur)return this.render(o,i,n)}if(this._rEase){var y=v<a;if(y!==this._inv){var w=y?a:l-a;this._inv=y,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=a,this._invRecip=w?(y?-1:1)/w:0,this._invScale=y?-this.ratio:1-this.ratio,this._invEase=y?this._rEase:this._ease}this.ratio=b=this._invRatio+this._invScale*this._invEase((v-this._invTime)*this._invRecip)}else this.ratio=b=this._ease(v/l);if(this._from&&(this.ratio=b=1-b),this._tTime=f,this._time=v,!this._act&&this._ts&&(this._act=1,this._lazy=0),!a&&f&&!i&&!m&&(vt(this,"onStart"),this._tTime!==f))return this;for(g=this._pt;g;)g.r(b,g.d),g=g._next;x&&x.render(o<0?o:x._dur*x._ease(v/this._dur),i,n)||this._startAt&&(this._zTime=o),this._onUpdate&&!i&&(c&&Fa(this,o,i,n),vt(this,"onUpdate")),this._repeat&&u!==m&&this.vars.onRepeat&&!i&&this.parent&&vt(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(c&&!this._onUpdate&&Fa(this,o,!0,!0),(o||!l)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&br(this,1),!i&&!(c&&!a)&&(f||a||p)&&(vt(this,f===h?"onComplete":"onReverseComplete",!0),this._prom&&!(f<h&&this.timeScale()>0)&&this._prom()))}return this},r.targets=function(){return this._targets},r.invalidate=function(o){return(!o||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(o),e.prototype.invalidate.call(this,o)},r.resetTo=function(o,i,n,a,h){di||ht.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||sl(this,l),c=this._ease(l/this._dur),P_(this,o,i,n,a,c,l,h)?this.resetTo(o,i,n,a,1):(Sn(this,0),this.parent||yu(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(o,i){if(i===void 0&&(i="all"),!o&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?si(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Ge),this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(o,i,mr&&mr.vars.overwrite!==!0)._first||si(this),this.parent&&n!==this.timeline.totalDuration()&&ws(this,this._dur*this.timeline._tDur/n,0,1),this}var a=this._targets,h=o?Dt(o):a,l=this._ptLookup,c=this._pt,f,v,g,u,d,m,p;if((!i||i==="all")&&i_(a,h))return i==="all"&&(this._pt=0),si(this);for(f=this._op=this._op||[],i!=="all"&&(We(i)&&(d={},st(i,function(b){return d[b]=1}),i=d),i=D_(a,i)),p=a.length;p--;)if(~h.indexOf(a[p])){v=l[p],i==="all"?(f[p]=i,u=v,g={}):(g=f[p]=f[p]||{},u=i);for(d in u)m=v&&v[d],m&&((!("kill"in m.d)||m.d.kill(d)===!0)&&yn(this,m,"_pt"),delete v[d]),g!=="all"&&(g[d]=1)}return this._initted&&!this._pt&&c&&si(this),this},t.to=function(o,i){return new t(o,i,arguments[2])},t.from=function(o,i){return oi(1,arguments)},t.delayedCall=function(o,i,n,a){return new t(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:o,onComplete:i,onReverseComplete:i,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:a})},t.fromTo=function(o,i,n){return oi(2,arguments)},t.set=function(o,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new t(o,i)},t.killTweensOf=function(o,i,n){return Ie.killTweensOf(o,i,n)},t})(ui);_t(Ue.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});st("staggerTo,staggerFrom,staggerFromTo",function(e){Ue[e]=function(){var t=new Ze,r=Na.call(arguments,0);return r.splice(e==="staggerFromTo"?5:4,0,0),t[e].apply(t,r)}});var il=function(t,r,s){return t[r]=s},zu=function(t,r,s){return t[r](s)},A_=function(t,r,s,o){return t[r](o.fp,s)},I_=function(t,r,s){return t.setAttribute(r,s)},kn=function(t,r){return Be(t[r])?zu:_n(t[r])&&t.setAttribute?I_:il},Hu=function(t,r){return r.set(r.t,r.p,Math.round((r.s+r.c*t)*1e6)/1e6,r)},L_=function(t,r){return r.set(r.t,r.p,!!(r.s+r.c*t),r)},nl=function(t,r){var s=r._pt,o="";if(!t&&r.b)o=r.b;else if(t===1&&r.e)o=r.e;else{for(;s;)o=s.p+(s.m?s.m(s.s+s.c*t):Math.round((s.s+s.c*t)*1e4)/1e4)+o,s=s._next;o+=r.c}r.set(r.t,r.p,o,r)},ol=function(t,r){for(var s=r._pt;s;)s.r(t,s.d),s=s._next},O_=function(t,r,s,o){for(var i=this._pt,n;i;)n=i._next,i.p===o&&i.modifier(t,r,s),i=n},M_=function(t){for(var r=this._pt,s,o;r;)o=r._next,r.p===t&&!r.op||r.op===t?yn(this,r,"_pt"):r.dep||(s=1),r=o;return!s},F_=function(t,r,s,o){o.mSet(t,r,o.m.call(o.tween,s,o.mt),o)},al=function(t){for(var r=t._pt,s,o,i,n;r;){for(s=r._next,o=i;o&&o.pr>r.pr;)o=o._next;(r._prev=o?o._prev:n)?r._prev._next=r:i=r,(r._next=o)?o._prev=r:n=r,r=s}t._pt=i},it=(function(){function e(r,s,o,i,n,a,h,l,c){this.t=s,this.s=i,this.c=n,this.p=o,this.r=a||Hu,this.d=h||this,this.set=l||il,this.pr=c||0,this._next=r,r&&(r._prev=this)}var t=e.prototype;return t.modifier=function(s,o,i){this.mSet=this.mSet||this.set,this.set=F_,this.m=s,this.mt=i,this.tween=o},e})();st(Xa+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(e){return Ga[e]=1});bt.TweenMax=bt.TweenLite=Ue;bt.TimelineLite=bt.TimelineMax=Ze;Ie=new Ze({sortChildren:!1,defaults:li,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});dt.stringFilter=Za;var Gr=[],pn={},B_=[],cu=0,N_=0,Aa=function(t){return(pn[t]||B_).map(function(r){return r()})},$a=function(){var t=Date.now(),r=[];t-cu>2&&(Aa("matchMediaInit"),Gr.forEach(function(s){var o=s.queries,i=s.conditions,n,a,h,l;for(a in o)n=zt.matchMedia(o[a]).matches,n&&(h=1),n!==i[a]&&(i[a]=n,l=1);l&&(s.revert(),h&&r.push(s))}),Aa("matchMediaRevert"),r.forEach(function(s){return s.onMatch(s,function(o){return s.add(null,o)})}),cu=t,Aa("matchMedia"))},Uu=(function(){function e(r,s){this.selector=s&&za(s),this.data=[],this._r=[],this.isReverted=!1,this.id=N_++,r&&this.add(r)}var t=e.prototype;return t.add=function(s,o,i){Be(s)&&(i=o,o=s,s=Be);var n=this,a=function(){var l=Re,c=n.selector,f;return l&&l!==n&&l.data.push(n),i&&(n.selector=za(i)),Re=n,f=o.apply(n,arguments),Be(f)&&n._r.push(f),Re=l,n.selector=c,n.isReverted=!1,f};return n.last=a,s===Be?a(n,function(h){return n.add(null,h)}):s?n[s]=a:a},t.ignore=function(s){var o=Re;Re=null,s(this),Re=o},t.getTweens=function(){var s=[];return this.data.forEach(function(o){return o instanceof e?s.push.apply(s,o.getTweens()):o instanceof Ue&&!(o.parent&&o.parent.data==="nested")&&s.push(o)}),s},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(s,o){var i=this;if(s?(function(){for(var a=i.getTweens(),h=i.data.length,l;h--;)l=i.data[h],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(c){return a.splice(a.indexOf(c),1)}));for(a.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,f){return f.g-c.g||-1/0}).forEach(function(c){return c.t.revert(s)}),h=i.data.length;h--;)l=i.data[h],l instanceof Ze?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Ue)&&l.revert&&l.revert(s);i._r.forEach(function(c){return c(s,i)}),i.isReverted=!0})():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),o)for(var n=Gr.length;n--;)Gr[n].id===this.id&&Gr.splice(n,1)},t.revert=function(s){this.kill(s||{})},e})(),z_=(function(){function e(r){this.contexts=[],this.scope=r,Re&&Re.data.push(this)}var t=e.prototype;return t.add=function(s,o,i){Ut(s)||(s={matches:s});var n=new Uu(0,i||this.scope),a=n.conditions={},h,l,c;Re&&!n.selector&&(n.selector=Re.selector),this.contexts.push(n),o=n.add("onMatch",o),n.queries=s;for(l in s)l==="all"?c=1:(h=zt.matchMedia(s[l]),h&&(Gr.indexOf(n)<0&&Gr.push(n),(a[l]=h.matches)&&(c=1),h.addListener?h.addListener($a):h.addEventListener("change",$a)));return c&&o(n,function(f){return n.add(null,f)}),this},t.revert=function(s){this.kill(s||{})},t.kill=function(s){this.contexts.forEach(function(o){return o.kill(s,!0)})},e})(),bn={registerPlugin:function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];r.forEach(function(o){return Lu(o)})},timeline:function(t){return new Ze(t)},getTweensOf:function(t,r){return Ie.getTweensOf(t,r)},getProperty:function(t,r,s,o){We(t)&&(t=Dt(t)[0]);var i=vr(t||{}).get,n=s?xu:_u;return s==="native"&&(s=""),t&&(r?n((lt[r]&<[r].get||i)(t,r,s,o)):function(a,h,l){return n((lt[a]&<[a].get||i)(t,a,h,l))})},quickSetter:function(t,r,s){if(t=Dt(t),t.length>1){var o=t.map(function(c){return tt.quickSetter(c,r,s)}),i=o.length;return function(c){for(var f=i;f--;)o[f](c)}}t=t[0]||{};var n=lt[r],a=vr(t),h=a.harness&&(a.harness.aliases||{})[r]||r,l=n?function(c){var f=new n;_s._pt=0,f.init(t,s?c+s:c,_s,0,[t]),f.render(1,f),_s._pt&&ol(1,_s)}:a.set(t,h);return n?l:function(c){return l(t,h,s?c+s:c,a,1)}},quickTo:function(t,r,s){var o,i=tt.to(t,_t((o={},o[r]="+=0.1",o.paused=!0,o.stagger=0,o),s||{})),n=function(h,l,c){return i.resetTo(r,h,l,c)};return n.tween=i,n},isTweening:function(t){return Ie.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Kr(t.ease,li.ease)),nu(li,t||{})},config:function(t){return nu(dt,t||{})},registerEffect:function(t){var r=t.name,s=t.effect,o=t.plugins,i=t.defaults,n=t.extendTimeline;(o||"").split(",").forEach(function(a){return a&&!lt[a]&&!bt[a]&&hi(r+" effect requires "+a+" plugin.")}),Ta[r]=function(a,h,l){return s(Dt(a),_t(h||{},i),l)},n&&(Ze.prototype[r]=function(a,h,l){return this.add(Ta[r](a,Ut(h)?h:(l=h)&&{},this),l)})},registerEase:function(t,r){we[t]=Kr(r)},parseEase:function(t,r){return arguments.length?Kr(t,r):we},getById:function(t){return Ie.getById(t)},exportRoot:function(t,r){t===void 0&&(t={});var s=new Ze(t),o,i;for(s.smoothChildTiming=ct(t.smoothChildTiming),Ie.remove(s),s._dp=0,s._time=s._tTime=Ie._time,o=Ie._first;o;)i=o._next,(r||!(!o._dur&&o instanceof Ue&&o.vars.onComplete===o._targets[0]))&&Ht(s,o,o._start-o._delay),o=i;return Ht(Ie,s,0),s},context:function(t,r){return t?new Uu(t,r):Re},matchMedia:function(t){return new z_(t)},matchMediaRefresh:function(){return Gr.forEach(function(t){var r=t.conditions,s,o;for(o in r)r[o]&&(r[o]=!1,s=1);s&&t.revert()})||$a()},addEventListener:function(t,r){var s=pn[t]||(pn[t]=[]);~s.indexOf(r)||s.push(r)},removeEventListener:function(t,r){var s=pn[t],o=s&&s.indexOf(r);o>=0&&s.splice(o,1)},utils:{wrap:g_,wrapYoyo:v_,distribute:Tu,random:Du,snap:Pu,normalize:m_,getUnit:Xe,clamp:d_,splitColor:Ou,toArray:Dt,selector:za,mapRange:Au,pipe:p_,unitize:f_,interpolate:b_,shuffle:Eu},install:mu,effects:Ta,ticker:ht,updateRoot:Ze.updateRoot,plugins:lt,globalTimeline:Ie,core:{PropTween:it,globals:gu,Tween:Ue,Timeline:Ze,Animation:ui,getCache:vr,_removeLinkedListItem:yn,reverting:function(){return Ge},context:function(t){return t&&Re&&(Re.data.push(t),t._ctx=Re),Re},suppressOverwrites:function(t){return Va=t}}};st("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return bn[e]=Ue[e]});ht.add(Ze.updateRoot);_s=bn.to({},{duration:0});var H_=function(t,r){for(var s=t._pt;s&&s.p!==r&&s.op!==r&&s.fp!==r;)s=s._next;return s},U_=function(t,r){var s=t._targets,o,i,n;for(o in r)for(i=s.length;i--;)n=t._ptLookup[i][o],n&&(n=n.d)&&(n._pt&&(n=H_(n,o)),n&&n.modifier&&n.modifier(r[o],t,s[i],o))},Ia=function(t,r){return{name:t,headless:1,rawVars:1,init:function(o,i,n){n._onInit=function(a){var h,l;if(We(i)&&(h={},st(i,function(c){return h[c]=1}),i=h),r){h={};for(l in i)h[l]=r(i[l]);i=h}U_(a,i)}}}},tt=bn.registerPlugin({name:"attr",init:function(t,r,s,o,i){var n,a,h;this.tween=s;for(n in r)h=t.getAttribute(n)||"",a=this.add(t,"setAttribute",(h||0)+"",r[n],o,i,0,0,n),a.op=n,a.b=h,this._props.push(n)},render:function(t,r){for(var s=r._pt;s;)Ge?s.set(s.t,s.p,s.b,s):s.r(t,s.d),s=s._next}},{name:"endArray",headless:1,init:function(t,r){for(var s=r.length;s--;)this.add(t,s,t[s]||0,r[s],0,0,0,0,0,1)}},Ia("roundProps",Ha),Ia("modifiers"),Ia("snap",Pu))||bn;Ue.version=Ze.version=tt.version="3.15.0";fu=1;ja()&&Ss();var $_=we.Power0,V_=we.Power1,j_=we.Power2,W_=we.Power3,q_=we.Power4,K_=we.Linear,G_=we.Quad,X_=we.Cubic,J_=we.Quart,Y_=we.Quint,Q_=we.Strong,Z_=we.Elastic,e0=we.Back,t0=we.SteppedEase,r0=we.Bounce,s0=we.Sine,i0=we.Expo,n0=we.Circ;var $u,xr,Es,pl,ts,o0,Vu,fl,a0=function(){return typeof window<"u"},sr={},es=180/Math.PI,Ts=Math.PI/180,Cs=Math.atan2,ju=1e8,ml=/([A-Z])/g,l0=/(left|right|width|margin|padding|x)/i,h0=/[\s,\(]\S/,$t={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},hl=function(t,r){return r.set(r.t,r.p,Math.round((r.s+r.c*t)*1e4)/1e4+r.u,r)},c0=function(t,r){return r.set(r.t,r.p,t===1?r.e:Math.round((r.s+r.c*t)*1e4)/1e4+r.u,r)},d0=function(t,r){return r.set(r.t,r.p,t?Math.round((r.s+r.c*t)*1e4)/1e4+r.u:r.b,r)},u0=function(t,r){return r.set(r.t,r.p,t===1?r.e:t?Math.round((r.s+r.c*t)*1e4)/1e4+r.u:r.b,r)},p0=function(t,r){var s=r.s+r.c*t;r.set(r.t,r.p,~~(s+(s<0?-.5:.5))+r.u,r)},Qu=function(t,r){return r.set(r.t,r.p,t?r.e:r.b,r)},Zu=function(t,r){return r.set(r.t,r.p,t!==1?r.b:r.e,r)},f0=function(t,r,s){return t.style[r]=s},m0=function(t,r,s){return t.style.setProperty(r,s)},g0=function(t,r,s){return t._gsap[r]=s},v0=function(t,r,s){return t._gsap.scaleX=t._gsap.scaleY=s},b0=function(t,r,s,o,i){var n=t._gsap;n.scaleX=n.scaleY=s,n.renderTransform(i,n)},_0=function(t,r,s,o,i){var n=t._gsap;n[r]=s,n.renderTransform(i,n)},Le="transform",ut=Le+"Origin",x0=function e(t,r){var s=this,o=this.target,i=o.style,n=o._gsap;if(t in sr&&i){if(this.tfm=this.tfm||{},t!=="transform")t=$t[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return s.tfm[a]=rr(o,a)}):this.tfm[t]=n.x?n[t]:rr(o,t),t===ut&&(this.tfm.zOrigin=n.zOrigin);else return $t.transform.split(",").forEach(function(a){return e.call(s,a,r)});if(this.props.indexOf(Le)>=0)return;n.svg&&(this.svgo=o.getAttribute("data-svg-origin"),this.props.push(ut,r,"")),t=Le}(i||r)&&this.props.push(t,r,i[t])},ep=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},y0=function(){var t=this.props,r=this.target,s=r.style,o=r._gsap,i,n;for(i=0;i<t.length;i+=3)t[i+1]?t[i+1]===2?r[t[i]](t[i+2]):r[t[i]]=t[i+2]:t[i+2]?s[t[i]]=t[i+2]:s.removeProperty(t[i].substr(0,2)==="--"?t[i]:t[i].replace(ml,"-$1").toLowerCase());if(this.tfm){for(n in this.tfm)o[n]=this.tfm[n];o.svg&&(o.renderTransform(),r.setAttribute("data-svg-origin",this.svgo||"")),i=fl(),(!i||!i.isStart)&&!s[Le]&&(ep(s),o.zOrigin&&s[ut]&&(s[ut]+=" "+o.zOrigin+"px",o.zOrigin=0,o.renderTransform()),o.uncache=1)}},tp=function(t,r){var s={target:t,props:[],revert:y0,save:x0};return t._gsap||tt.core.getCache(t),r&&t.style&&t.nodeType&&r.split(",").forEach(function(o){return s.save(o)}),s},rp,cl=function(t,r){var s=xr.createElementNS?xr.createElementNS((r||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):xr.createElement(t);return s&&s.style?s:xr.createElement(t)},xt=function e(t,r,s){var o=getComputedStyle(t);return o[r]||o.getPropertyValue(r.replace(ml,"-$1").toLowerCase())||o.getPropertyValue(r)||!s&&e(t,Ps(r)||r,1)||""},Wu="O,Moz,ms,Ms,Webkit".split(","),Ps=function(t,r,s){var o=r||ts,i=o.style,n=5;if(t in i&&!s)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(Wu[n]+t in i););return n<0?null:(n===3?"ms":n>=0?Wu[n]:"")+t},dl=function(){a0()&&window.document&&($u=window,xr=$u.document,Es=xr.documentElement,ts=cl("div")||{style:{}},o0=cl("div"),Le=Ps(Le),ut=Le+"Origin",ts.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",rp=!!Ps("perspective"),fl=tt.core.reverting,pl=1)},qu=function(t){var r=t.ownerSVGElement,s=cl("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),o=t.cloneNode(!0),i;o.style.display="block",s.appendChild(o),Es.appendChild(s);try{i=o.getBBox()}catch{}return s.removeChild(o),Es.removeChild(s),i},Ku=function(t,r){for(var s=r.length;s--;)if(t.hasAttribute(r[s]))return t.getAttribute(r[s])},sp=function(t){var r,s;try{r=t.getBBox()}catch{r=qu(t),s=1}return r&&(r.width||r.height)||s||(r=qu(t)),r&&!r.width&&!r.x&&!r.y?{x:+Ku(t,["x","cx","x1"])||0,y:+Ku(t,["y","cy","y1"])||0,width:0,height:0}:r},ip=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&sp(t))},wr=function(t,r){if(r){var s=t.style,o;r in sr&&r!==ut&&(r=Le),s.removeProperty?(o=r.substr(0,2),(o==="ms"||r.substr(0,6)==="webkit")&&(r="-"+r),s.removeProperty(o==="--"?r:r.replace(ml,"-$1").toLowerCase())):s.removeAttribute(r)}},yr=function(t,r,s,o,i,n){var a=new it(t._pt,r,s,0,1,n?Zu:Qu);return t._pt=a,a.b=o,a.e=i,t._props.push(s),a},Gu={deg:1,rad:1,turn:1},w0={grid:1,flex:1},Sr=function e(t,r,s,o){var i=parseFloat(s)||0,n=(s+"").trim().substr((i+"").length)||"px",a=ts.style,h=l0.test(r),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),f=100,v=o==="px",g=o==="%",u,d,m,p;if(o===n||!i||Gu[o]||Gu[n])return i;if(n!=="px"&&!v&&(i=e(t,r,s,"px")),p=t.getCTM&&ip(t),(g||n==="%")&&(sr[r]||~r.indexOf("adius")))return u=p?t.getBBox()[h?"width":"height"]:t[c],Ne(g?i/u*f:i/100*u);if(a[h?"width":"height"]=f+(v?n:o),d=o!=="rem"&&~r.indexOf("adius")||o==="em"&&t.appendChild&&!l?t:t.parentNode,p&&(d=(t.ownerSVGElement||{}).parentNode),(!d||d===xr||!d.appendChild)&&(d=xr.body),m=d._gsap,m&&g&&m.width&&h&&m.time===ht.time&&!m.uncache)return Ne(i/m.width*f);if(g&&(r==="height"||r==="width")){var b=t.style[r];t.style[r]=f+o,u=t[c],b?t.style[r]=b:wr(t,r)}else(g||n==="%")&&!w0[xt(d,"display")]&&(a.position=xt(t,"position")),d===t&&(a.position="static"),d.appendChild(ts),u=ts[c],d.removeChild(ts),a.position="absolute";return h&&g&&(m=vr(d),m.time=ht.time,m.width=d[c]),Ne(v?u*i/f:u&&i?f/u*i:0)},rr=function(t,r,s,o){var i;return pl||dl(),r in $t&&r!=="transform"&&(r=$t[r],~r.indexOf(",")&&(r=r.split(",")[0])),sr[r]&&r!=="transform"?(i=gi(t,o),i=r!=="transformOrigin"?i[r]:i.svg?i.origin:En(xt(t,ut))+" "+i.zOrigin+"px"):(i=t.style[r],(!i||i==="auto"||o||~(i+"").indexOf("calc("))&&(i=Cn[r]&&Cn[r](t,r,s)||xt(t,r)||Ya(t,r)||(r==="opacity"?1:0))),s&&!~(i+"").trim().indexOf(" ")?Sr(t,r,i,s)+s:i},S0=function(t,r,s,o){if(!s||s==="none"){var i=Ps(r,t,1),n=i&&xt(t,i,1);n&&n!==s?(r=i,s=n):r==="borderColor"&&(s=xt(t,"borderTopColor"))}var a=new it(this._pt,t.style,r,0,1,nl),h=0,l=0,c,f,v,g,u,d,m,p,b,x,y,w;if(a.b=s,a.e=o,s+="",o+="",o.substring(0,6)==="var(--"&&(o=xt(t,o.substring(4,o.indexOf(")")))),o==="auto"&&(d=t.style[r],t.style[r]=o,o=xt(t,r)||o,d?t.style[r]=d:wr(t,r)),c=[s,o],Za(c),s=c[0],o=c[1],v=s.match(Xr)||[],w=o.match(Xr)||[],w.length){for(;f=Xr.exec(o);)m=f[0],b=o.substring(h,f.index),u?u=(u+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(u=1),m!==(d=v[l++]||"")&&(g=parseFloat(d)||0,y=d.substr((g+"").length),m.charAt(1)==="="&&(m=Jr(g,m)+y),p=parseFloat(m),x=m.substr((p+"").length),h=Xr.lastIndex-x.length,x||(x=x||dt.units[r]||y,h===o.length&&(o+=x,a.e+=x)),y!==x&&(g=Sr(t,r,d,x)||0),a._pt={_next:a._pt,p:b||l===1?b:",",s:g,c:p-g,m:u&&u<4||r==="zIndex"?Math.round:0});a.c=h<o.length?o.substring(h,o.length):""}else a.r=r==="display"&&o==="none"?Zu:Qu;return qa.test(o)&&(a.e=0),this._pt=a,a},Xu={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},k0=function(t){var r=t.split(" "),s=r[0],o=r[1]||"50%";return(s==="top"||s==="bottom"||o==="left"||o==="right")&&(t=s,s=o,o=t),r[0]=Xu[s]||s,r[1]=Xu[o]||o,r.join(" ")},C0=function(t,r){if(r.tween&&r.tween._time===r.tween._dur){var s=r.t,o=s.style,i=r.u,n=s._gsap,a,h,l;if(i==="all"||i===!0)o.cssText="",h=1;else for(i=i.split(","),l=i.length;--l>-1;)a=i[l],sr[a]&&(h=1,a=a==="transformOrigin"?ut:Le),wr(s,a);h&&(wr(s,Le),n&&(n.svg&&s.removeAttribute("transform"),o.scale=o.rotate=o.translate="none",gi(s,1),n.uncache=1,ep(o)))}},Cn={clearProps:function(t,r,s,o,i){if(i.data!=="isFromStart"){var n=t._pt=new it(t._pt,r,s,0,0,C0);return n.u=o,n.pr=-10,n.tween=i,t._props.push(s),1}}},mi=[1,0,0,1,0,0],np={},op=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Ju=function(t){var r=xt(t,Le);return op(r)?mi:r.substr(7).match(Wa).map(Ne)},gl=function(t,r){var s=t._gsap||vr(t),o=t.style,i=Ju(t),n,a,h,l;return s.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,i=[h.a,h.b,h.c,h.d,h.e,h.f],i.join(",")==="1,0,0,1,0,0"?mi:i):(i===mi&&!t.offsetParent&&t!==Es&&!s.svg&&(h=o.display,o.display="block",n=t.parentNode,(!n||!t.offsetParent&&!t.getBoundingClientRect().width)&&(l=1,a=t.nextElementSibling,Es.appendChild(t)),i=Ju(t),h?o.display=h:wr(t,"display"),l&&(a?n.insertBefore(t,a):n?n.appendChild(t):Es.removeChild(t))),r&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},ul=function(t,r,s,o,i,n){var a=t._gsap,h=i||gl(t,!0),l=a.xOrigin||0,c=a.yOrigin||0,f=a.xOffset||0,v=a.yOffset||0,g=h[0],u=h[1],d=h[2],m=h[3],p=h[4],b=h[5],x=r.split(" "),y=parseFloat(x[0])||0,w=parseFloat(x[1])||0,_,S,T,D;s?h!==mi&&(S=g*m-u*d)&&(T=y*(m/S)+w*(-d/S)+(d*b-m*p)/S,D=y*(-u/S)+w*(g/S)-(g*b-u*p)/S,y=T,w=D):(_=sp(t),y=_.x+(~x[0].indexOf("%")?y/100*_.width:y),w=_.y+(~(x[1]||x[0]).indexOf("%")?w/100*_.height:w)),o||o!==!1&&a.smooth?(p=y-l,b=w-c,a.xOffset=f+(p*g+b*d)-p,a.yOffset=v+(p*u+b*m)-b):a.xOffset=a.yOffset=0,a.xOrigin=y,a.yOrigin=w,a.smooth=!!o,a.origin=r,a.originIsAbsolute=!!s,t.style[ut]="0px 0px",n&&(yr(n,a,"xOrigin",l,y),yr(n,a,"yOrigin",c,w),yr(n,a,"xOffset",f,a.xOffset),yr(n,a,"yOffset",v,a.yOffset)),t.setAttribute("data-svg-origin",y+" "+w)},gi=function(t,r){var s=t._gsap||new el(t);if("x"in s&&!r&&!s.uncache)return s;var o=t.style,i=s.scaleX<0,n="px",a="deg",h=getComputedStyle(t),l=xt(t,ut)||"0",c,f,v,g,u,d,m,p,b,x,y,w,_,S,T,D,P,A,F,B,$,z,H,C,R,L,k,U,X,O,te,N;return c=f=v=d=m=p=b=x=y=0,g=u=1,s.svg=!!(t.getCTM&&ip(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(o[Le]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[Le]!=="none"?h[Le]:"")),o.scale=o.rotate=o.translate="none"),S=gl(t,s.svg),s.svg&&(s.uncache?(R=t.getBBox(),l=s.xOrigin-R.x+"px "+(s.yOrigin-R.y)+"px",C=""):C=!r&&t.getAttribute("data-svg-origin"),ul(t,C||l,!!C||s.originIsAbsolute,s.smooth!==!1,S)),w=s.xOrigin||0,_=s.yOrigin||0,S!==mi&&(A=S[0],F=S[1],B=S[2],$=S[3],c=z=S[4],f=H=S[5],S.length===6?(g=Math.sqrt(A*A+F*F),u=Math.sqrt($*$+B*B),d=A||F?Cs(F,A)*es:0,b=B||$?Cs(B,$)*es+d:0,b&&(u*=Math.abs(Math.cos(b*Ts))),s.svg&&(c-=w-(w*A+_*B),f-=_-(w*F+_*$))):(N=S[6],O=S[7],k=S[8],U=S[9],X=S[10],te=S[11],c=S[12],f=S[13],v=S[14],T=Cs(N,X),m=T*es,T&&(D=Math.cos(-T),P=Math.sin(-T),C=z*D+k*P,R=H*D+U*P,L=N*D+X*P,k=z*-P+k*D,U=H*-P+U*D,X=N*-P+X*D,te=O*-P+te*D,z=C,H=R,N=L),T=Cs(-B,X),p=T*es,T&&(D=Math.cos(-T),P=Math.sin(-T),C=A*D-k*P,R=F*D-U*P,L=B*D-X*P,te=$*P+te*D,A=C,F=R,B=L),T=Cs(F,A),d=T*es,T&&(D=Math.cos(T),P=Math.sin(T),C=A*D+F*P,R=z*D+H*P,F=F*D-A*P,H=H*D-z*P,A=C,z=R),m&&Math.abs(m)+Math.abs(d)>359.9&&(m=d=0,p=180-p),g=Ne(Math.sqrt(A*A+F*F+B*B)),u=Ne(Math.sqrt(H*H+N*N)),T=Cs(z,H),b=Math.abs(T)>2e-4?T*es:0,y=te?1/(te<0?-te:te):0),s.svg&&(C=t.getAttribute("transform"),s.forceCSS=t.setAttribute("transform","")||!op(xt(t,Le)),C&&t.setAttribute("transform",C))),Math.abs(b)>90&&Math.abs(b)<270&&(i?(g*=-1,b+=d<=0?180:-180,d+=d<=0?180:-180):(u*=-1,b+=b<=0?180:-180)),r=r||s.uncache,s.x=c-((s.xPercent=c&&(!r&&s.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*s.xPercent/100:0)+n,s.y=f-((s.yPercent=f&&(!r&&s.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-f)?-50:0)))?t.offsetHeight*s.yPercent/100:0)+n,s.z=v+n,s.scaleX=Ne(g),s.scaleY=Ne(u),s.rotation=Ne(d)+a,s.rotationX=Ne(m)+a,s.rotationY=Ne(p)+a,s.skewX=b+a,s.skewY=x+a,s.transformPerspective=y+n,(s.zOrigin=parseFloat(l.split(" ")[2])||!r&&s.zOrigin||0)&&(o[ut]=En(l)),s.xOffset=s.yOffset=0,s.force3D=dt.force3D,s.renderTransform=s.svg?T0:rp?ap:E0,s.uncache=0,s},En=function(t){return(t=t.split(" "))[0]+" "+t[1]},ll=function(t,r,s){var o=Xe(r);return Ne(parseFloat(r)+parseFloat(Sr(t,"x",s+"px",o)))+o},E0=function(t,r){r.z="0px",r.rotationY=r.rotationX="0deg",r.force3D=0,ap(t,r)},Qr="0deg",fi="0px",Zr=") ",ap=function(t,r){var s=r||this,o=s.xPercent,i=s.yPercent,n=s.x,a=s.y,h=s.z,l=s.rotation,c=s.rotationY,f=s.rotationX,v=s.skewX,g=s.skewY,u=s.scaleX,d=s.scaleY,m=s.transformPerspective,p=s.force3D,b=s.target,x=s.zOrigin,y="",w=p==="auto"&&t&&t!==1||p===!0;if(x&&(f!==Qr||c!==Qr)){var _=parseFloat(c)*Ts,S=Math.sin(_),T=Math.cos(_),D;_=parseFloat(f)*Ts,D=Math.cos(_),n=ll(b,n,S*D*-x),a=ll(b,a,-Math.sin(_)*-x),h=ll(b,h,T*D*-x+x)}m!==fi&&(y+="perspective("+m+Zr),(o||i)&&(y+="translate("+o+"%, "+i+"%) "),(w||n!==fi||a!==fi||h!==fi)&&(y+=h!==fi||w?"translate3d("+n+", "+a+", "+h+") ":"translate("+n+", "+a+Zr),l!==Qr&&(y+="rotate("+l+Zr),c!==Qr&&(y+="rotateY("+c+Zr),f!==Qr&&(y+="rotateX("+f+Zr),(v!==Qr||g!==Qr)&&(y+="skew("+v+", "+g+Zr),(u!==1||d!==1)&&(y+="scale("+u+", "+d+Zr),b.style[Le]=y||"translate(0, 0)"},T0=function(t,r){var s=r||this,o=s.xPercent,i=s.yPercent,n=s.x,a=s.y,h=s.rotation,l=s.skewX,c=s.skewY,f=s.scaleX,v=s.scaleY,g=s.target,u=s.xOrigin,d=s.yOrigin,m=s.xOffset,p=s.yOffset,b=s.forceCSS,x=parseFloat(n),y=parseFloat(a),w,_,S,T,D;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=Ts,l*=Ts,w=Math.cos(h)*f,_=Math.sin(h)*f,S=Math.sin(h-l)*-v,T=Math.cos(h-l)*v,l&&(c*=Ts,D=Math.tan(l-c),D=Math.sqrt(1+D*D),S*=D,T*=D,c&&(D=Math.tan(c),D=Math.sqrt(1+D*D),w*=D,_*=D)),w=Ne(w),_=Ne(_),S=Ne(S),T=Ne(T)):(w=f,T=v,_=S=0),(x&&!~(n+"").indexOf("px")||y&&!~(a+"").indexOf("px"))&&(x=Sr(g,"x",n,"px"),y=Sr(g,"y",a,"px")),(u||d||m||p)&&(x=Ne(x+u-(u*w+d*S)+m),y=Ne(y+d-(u*_+d*T)+p)),(o||i)&&(D=g.getBBox(),x=Ne(x+o/100*D.width),y=Ne(y+i/100*D.height)),D="matrix("+w+","+_+","+S+","+T+","+x+","+y+")",g.setAttribute("transform",D),b&&(g.style[Le]=D)},P0=function(t,r,s,o,i){var n=360,a=We(i),h=parseFloat(i)*(a&&~i.indexOf("rad")?es:1),l=h-o,c=o+l+"deg",f,v;return a&&(f=i.split("_")[1],f==="short"&&(l%=n,l!==l%(n/2)&&(l+=l<0?n:-n)),f==="cw"&&l<0?l=(l+n*ju)%n-~~(l/n)*n:f==="ccw"&&l>0&&(l=(l-n*ju)%n-~~(l/n)*n)),t._pt=v=new it(t._pt,r,s,o,l,c0),v.e=c,v.u="deg",t._props.push(s),v},Yu=function(t,r){for(var s in r)t[s]=r[s];return t},D0=function(t,r,s){var o=Yu({},s._gsap),i="perspective,force3D,transformOrigin,svgOrigin",n=s.style,a,h,l,c,f,v,g,u;o.svg?(l=s.getAttribute("transform"),s.setAttribute("transform",""),n[Le]=r,a=gi(s,1),wr(s,Le),s.setAttribute("transform",l)):(l=getComputedStyle(s)[Le],n[Le]=r,a=gi(s,1),n[Le]=l);for(h in sr)l=o[h],c=a[h],l!==c&&i.indexOf(h)<0&&(g=Xe(l),u=Xe(c),f=g!==u?Sr(s,h,l,u):parseFloat(l),v=parseFloat(c),t._pt=new it(t._pt,a,h,f,v-f,hl),t._pt.u=u||0,t._props.push(h));Yu(a,o)};st("padding,margin,Width,Radius",function(e,t){var r="Top",s="Right",o="Bottom",i="Left",n=(t<3?[r,s,o,i]:[r+i,r+s,o+s,o+i]).map(function(a){return t<2?e+a:"border"+a+e});Cn[t>1?"border"+e:e]=function(a,h,l,c,f){var v,g;if(arguments.length<4)return v=n.map(function(u){return rr(a,u,l)}),g=v.join(" "),g.split(v[0]).length===5?v[0]:g;v=(c+"").split(" "),g={},n.forEach(function(u,d){return g[u]=v[d]=v[d]||v[(d-1)/2|0]}),a.init(h,g,f)}});var vl={name:"css",register:dl,targetTest:function(t){return t.style&&t.nodeType},init:function(t,r,s,o,i){var n=this._props,a=t.style,h=s.vars.startAt,l,c,f,v,g,u,d,m,p,b,x,y,w,_,S,T,D;pl||dl(),this.styles=this.styles||tp(t),T=this.styles.props,this.tween=s;for(d in r)if(d!=="autoRound"&&(c=r[d],!(lt[d]&&rl(d,r,s,o,t,i)))){if(g=typeof c,u=Cn[d],g==="function"&&(c=c.call(s,o,t,i),g=typeof c),g==="string"&&~c.indexOf("random(")&&(c=ks(c)),u)u(this,t,d,c,s)&&(S=1);else if(d.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(d)+"").trim(),c+="",er.lastIndex=0,er.test(l)||(m=Xe(l),p=Xe(c),p?m!==p&&(l=Sr(t,d,l,p)+p):m&&(c+=m)),this.add(a,"setProperty",l,c,o,i,0,0,d),n.push(d),T.push(d,0,a[d]);else if(g!=="undefined"){if(h&&d in h?(l=typeof h[d]=="function"?h[d].call(s,o,t,i):h[d],We(l)&&~l.indexOf("random(")&&(l=ks(l)),Xe(l+"")||l==="auto"||(l+=dt.units[d]||Xe(rr(t,d))||""),(l+"").charAt(1)==="="&&(l=rr(t,d))):l=rr(t,d),v=parseFloat(l),b=g==="string"&&c.charAt(1)==="="&&c.substr(0,2),b&&(c=c.substr(2)),f=parseFloat(c),d in $t&&(d==="autoAlpha"&&(v===1&&rr(t,"visibility")==="hidden"&&f&&(v=0),T.push("visibility",0,a.visibility),yr(this,a,"visibility",v?"inherit":"hidden",f?"inherit":"hidden",!f)),d!=="scale"&&d!=="transform"&&(d=$t[d],~d.indexOf(",")&&(d=d.split(",")[0]))),x=d in sr,x){if(this.styles.save(d),D=c,g==="string"&&c.substring(0,6)==="var(--"){if(c=xt(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var P=t.style.perspective;t.style.perspective=c,c=xt(t,"perspective"),P?t.style.perspective=P:wr(t,"perspective")}f=parseFloat(c)}if(y||(w=t._gsap,w.renderTransform&&!r.parseTransform||gi(t,r.parseTransform),_=r.smoothOrigin!==!1&&w.smooth,y=this._pt=new it(this._pt,a,Le,0,1,w.renderTransform,w,0,-1),y.dep=1),d==="scale")this._pt=new it(this._pt,w,"scaleY",w.scaleY,(b?Jr(w.scaleY,b+f):f)-w.scaleY||0,hl),this._pt.u=0,n.push("scaleY",d),d+="X";else if(d==="transformOrigin"){T.push(ut,0,a[ut]),c=k0(c),w.svg?ul(t,c,0,_,0,this):(p=parseFloat(c.split(" ")[2])||0,p!==w.zOrigin&&yr(this,w,"zOrigin",w.zOrigin,p),yr(this,a,d,En(l),En(c)));continue}else if(d==="svgOrigin"){ul(t,c,1,_,0,this);continue}else if(d in np){P0(this,w,d,v,b?Jr(v,b+c):c);continue}else if(d==="smoothOrigin"){yr(this,w,"smooth",w.smooth,c);continue}else if(d==="force3D"){w[d]=c;continue}else if(d==="transform"){D0(this,c,t);continue}}else d in a||(d=Ps(d)||d);if(x||(f||f===0)&&(v||v===0)&&!h0.test(c)&&d in a)m=(l+"").substr((v+"").length),f||(f=0),p=Xe(c)||(d in dt.units?dt.units[d]:m),m!==p&&(v=Sr(t,d,l,p)),this._pt=new it(this._pt,x?w:a,d,v,(b?Jr(v,b+f):f)-v,!x&&(p==="px"||d==="zIndex")&&r.autoRound!==!1?p0:hl),this._pt.u=p||0,x&&D!==c?(this._pt.b=l,this._pt.e=D,this._pt.r=u0):m!==p&&p!=="%"&&(this._pt.b=l,this._pt.r=d0);else if(d in a)S0.call(this,t,d,l,b?b+c:c);else if(d in t)this.add(t,d,l||t[d],b?b+c:c,o,i);else if(d!=="parseTransform"){xn(d,c);continue}x||(d in a?T.push(d,0,a[d]):typeof t[d]=="function"?T.push(d,2,t[d]()):T.push(d,1,l||t[d])),n.push(d)}}S&&al(this)},render:function(t,r){if(r.tween._time||!fl())for(var s=r._pt;s;)s.r(t,s.d),s=s._next;else r.styles.revert()},get:rr,aliases:$t,getSetter:function(t,r,s){var o=$t[r];return o&&o.indexOf(",")<0&&(r=o),r in sr&&r!==ut&&(t._gsap.x||rr(t,"x"))?s&&Vu===s?r==="scale"?v0:g0:(Vu=s||{})&&(r==="scale"?b0:_0):t.style&&!_n(t.style[r])?f0:~r.indexOf("-")?m0:kn(t,r)},core:{_removeProperty:wr,_getMatrix:gl}};tt.utils.checkPrefix=Ps;tt.core.getStyleSaver=tp;(function(e,t,r,s){var o=st(e+","+t+","+r,function(i){sr[i]=1});st(t,function(i){dt.units[i]="deg",np[i]=1}),$t[o[13]]=e+","+t,st(s,function(i){var n=i.split(":");$t[n[1]]=o[n[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");st("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){dt.units[e]="px"});tt.registerPlugin(vl);var Vt=tt.registerPlugin(vl)||tt,n5=Vt.core.Tween;var kr=require("react");var lp=typeof document<"u"?kr.useLayoutEffect:kr.useEffect,hp=e=>e&&!Array.isArray(e)&&typeof e=="object",Tn=[],R0={},cp=Vt,rs=(e,t=Tn)=>{let r=R0;hp(e)?(r=e,e=null,t="dependencies"in r?r.dependencies:Tn):hp(t)&&(r=t,t="dependencies"in r?r.dependencies:Tn),e&&typeof e!="function"&&console.warn("First parameter must be a function or config object");let{scope:s,revertOnUpdate:o}=r,i=(0,kr.useRef)(!1),n=(0,kr.useRef)(cp.context(()=>{},s)),a=(0,kr.useRef)(l=>n.current.add(null,l)),h=t&&t.length&&!o;return h&&lp(()=>(i.current=!0,()=>n.current.revert()),Tn),lp(()=>{if(e&&n.current.add(e,s),!h||!i.current)return()=>n.current.revert()},t),{context:n.current,contextSafe:a.current}};rs.register=e=>{cp=e};rs.headless=!0;Vt.registerPlugin(rs);var A0="(prefers-reduced-motion: reduce)";function Pn(){return!window.matchMedia(A0).matches}function dp(e,t){let r=(0,bl.useRef)(t),s=(0,bl.useRef)(!1);r.current=t;let{contextSafe:o}=rs(()=>{let i=e.current;if(i===null||!Pn())return;let n=Array.from(i.children),a=Vt.timeline({defaults:{ease:"power2.out"}});return a.fromTo(i,{autoAlpha:0,y:10,scale:.985,transformOrigin:"50% 36%"},{autoAlpha:1,y:0,scale:1,duration:.22,clearProps:"transform,opacity,visibility"}).fromTo(n,{autoAlpha:.58,y:4},{autoAlpha:1,y:0,duration:.18,stagger:.025,clearProps:"transform,opacity,visibility"},"<0.035"),()=>{a.kill()}},{scope:e});return o(()=>{if(s.current)return;let i=e.current;if(i===null||!Pn()){r.current();return}s.current=!0;let n=Array.from(i.children);Vt.killTweensOf([i,...n]),Vt.timeline({defaults:{ease:"power1.in"},onComplete:()=>{r.current()}}).to(n,{autoAlpha:0,y:-2,duration:.08,stagger:{each:.012,from:"end"}}).to(i,{autoAlpha:0,y:6,scale:.99,transformOrigin:"50% 36%",duration:.12},"<0.025")})}function up(e,t){rs(()=>{let r=e.current;!t||r===null||!Pn()||Vt.fromTo(r,{y:1,scale:.975},{y:0,scale:1,duration:.2,ease:"power2.out",overwrite:"auto",clearProps:"transform"})},{scope:e,dependencies:[t],revertOnUpdate:!0})}function pp(e,t=":scope > *"){rs(()=>{let r=e.current;if(r===null||!Pn())return;let s=r.querySelectorAll(t);Vt.fromTo(s,{autoAlpha:0,y:5},{autoAlpha:1,y:0,duration:.24,stagger:.035,ease:"power2.out",clearProps:"transform,opacity,visibility"})},{scope:e})}var Oe=require("react/jsx-runtime");function Je({title:e,subtitle:t,className:r,onClose:s,children:o}){let i=(0,ss.useId)(),n=(0,ss.useId)(),a=(0,ss.useRef)(null),h=dp(a,s),l=c=>{!(c.target instanceof Element)||c.target.closest("[data-ssh-dialog-close]")===null||(c.preventDefault(),c.stopPropagation(),h())};return(0,Oe.jsx)(Ds.Modal,{open:!0,onClose:h,title:e,closeLabel:"\u5173\u95ED",headless:!0,className:`dsh-ssh-dialog-modal${r===void 0?"":` ${r}-modal`}`,children:(0,Oe.jsx)(tu,{children:(0,Oe.jsx)(ru,{children:(0,Oe.jsxs)("section",{ref:a,className:`dsh-ssh-dialog dsh-ssh-scroll-surface${r===void 0?"":` ${r}`}`,"aria-labelledby":i,"aria-describedby":t===void 0?void 0:n,onClickCapture:l,children:[(0,Oe.jsxs)("header",{children:[(0,Oe.jsxs)("span",{children:[(0,Oe.jsx)("h2",{id:i,children:e}),t&&(0,Oe.jsx)("p",{id:n,children:t})]}),(0,Oe.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:h,"aria-label":"\u5173\u95ED",children:(0,Oe.jsx)(Ds.IconCloseOutline16,{size:16})})]}),o]})})})})}function he({label:e,hint:t,children:r}){return(0,Oe.jsxs)("label",{className:"dsh-ssh-field",children:[(0,Oe.jsx)("span",{children:e}),r,t&&(0,Oe.jsx)("small",{children:t})]})}function is({active:e,onClick:t,children:r}){let s=(0,ss.useRef)(null);return up(s,e),(0,Oe.jsx)("button",{ref:s,type:"button",role:"tab","data-ssh-interactive":"choice",className:e?"is-active":"","aria-selected":e,onClick:t,children:r})}function fp(){let e=(0,ss.useRef)(null);return pp(e),(0,Oe.jsxs)("div",{ref:e,className:"dsh-ssh-empty-state",children:[(0,Oe.jsx)("span",{children:(0,Oe.jsx)(Cr,{})}),(0,Oe.jsx)("h1",{children:"\u8FDE\u63A5\u4F60\u7684\u7B2C\u4E00\u53F0\u8FDC\u7AEF\u4E3B\u673A"}),(0,Oe.jsx)("p",{children:"\u4F7F\u7528\u201C\u4E3B\u673A\u4E0E\u9879\u76EE\u201D\u65C1\u7684\u6DFB\u52A0\u6309\u94AE\u4FDD\u5B58 SSH \u914D\u7F6E\uFF0C\u968F\u540E\u5373\u53EF\u6253\u5F00\u7EC8\u7AEF\u3001\u5EFA\u7ACB\u7AEF\u53E3\u8F6C\u53D1\uFF0C\u5E76\u6309\u4F1A\u8BDD\u6388\u6743\u7ED9 AI\u3002"})]})}function Cr(){return(0,Oe.jsx)("span",{className:"dsh-ssh-server-glyph",children:(0,Oe.jsx)(Ds.IconDataOutline16,{size:17})})}function Pe(e){return e instanceof Error?e.message:String(e)}function mp(e){return e.length<=16?e:`${e.slice(0,8)}\u2026${e.slice(-5)}`}var $e=require("react/jsx-runtime");function Dn({locationName:e,locationKind:t,entries:r,onClose:s,onDelete:o}){let[i,n]=(0,_l.useState)(!1),[a,h]=(0,_l.useState)(),l=r.filter(f=>f.kind==="directory").length,c=async()=>{n(!0),h(void 0);try{await o(),n(!1),s()}catch(f){h(Pe(f)),n(!1)}};return(0,$e.jsxs)(Je,{className:"dsh-ssh-file-delete-dialog",title:`\u5220\u9664 ${r.length} \u9879\uFF1F`,subtitle:`${e} \xB7 \u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500`,onClose:()=>{i||s()},children:[(0,$e.jsxs)("div",{className:"dsh-ssh-file-delete-copy",children:[(0,$e.jsx)("span",{children:(0,$e.jsx)(Rs.IconTrashOutline16,{size:18})}),(0,$e.jsxs)("p",{children:["\u5C06\u76F4\u63A5\u4ECE",t==="local"?"\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8FDC\u7AEF","\u5220\u9664\u6240\u9009\u5185\u5BB9\u3002",l>0?`\u5176\u4E2D ${l} \u4E2A\u76EE\u5F55\u53CA\u5176\u5168\u90E8\u5185\u5BB9\u4F1A\u88AB\u9012\u5F52\u5220\u9664\u3002`:""]})]}),(0,$e.jsxs)("div",{className:"dsh-ssh-file-delete-list",children:[r.slice(0,6).map(f=>(0,$e.jsxs)("div",{children:[f.kind==="directory"?(0,$e.jsx)(Rs.IconFolderClose16,{size:17}):(0,$e.jsx)(Rs.IconDataOutline16,{size:17}),(0,$e.jsxs)("span",{children:[(0,$e.jsx)("strong",{children:f.name}),(0,$e.jsx)("small",{title:f.path,children:f.path})]})]},f.path)),r.length>6&&(0,$e.jsxs)("p",{children:["\u4EE5\u53CA\u5176\u4ED6 ",r.length-6," \u9879"]})]}),a&&(0,$e.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,$e.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,$e.jsx)("span",{}),(0,$e.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:i,onClick:s,children:"\u53D6\u6D88"}),(0,$e.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:i,onClick:()=>{c()},children:i?"\u6B63\u5728\u5220\u9664\u2026":"\u786E\u8BA4\u5220\u9664"})]})]})}var G=require("react/jsx-runtime"),I0=512*1024*1024;function vp({sessionId:e}){let t=(0,xe.useCallback)(i=>Yl(e,i||void 0),[e]),r=(0,xe.useCallback)(i=>Ql(e,i),[e]),s=(0,xe.useCallback)((i,n=!1)=>eh(e,i,n),[e]),o=(0,xe.useCallback)((i,n)=>Zl(e,i,n),[e]);return(0,G.jsx)(yl,{initialPath:"",loadDirectory:t,loadPreview:r,fileUrl:s,deletion:{locationName:"\u672C\u5730\u4F1A\u8BDD",locationKind:"local",remove:o}})}function bp({sessionId:e,profile:t,profiles:r,onProfile:s,onSaved:o}){let i=(0,xe.useCallback)(async(g,u)=>{let d=u?(await uh(e,t.id,g)).cwd:g,m=await Jl(e,t.id,d);return u&&await o(),m},[o,t.id,e]),n=(0,xe.useCallback)(g=>th(e,t.id,g),[t.id,e]),a=(0,xe.useCallback)((g,u=!1)=>rh(e,t.id,g,u),[t.id,e]),h=(0,xe.useCallback)((g,u,d)=>jn(t.id,g,u,d),[t.id]),l=xp(`activity-sftp-${e}-${t.id}`),c=`sftp:${t.id}`,f=(0,xe.useCallback)((g,u)=>Fs({paneId:l,endpointId:c,directory:g,paths:u}),[c,l]),v=(0,G.jsxs)("div",{className:"dsh-ssh-sftp-hostbar",children:[(0,G.jsx)("span",{className:"dsh-ssh-host-monogram",children:t.name.slice(0,1).toUpperCase()}),(0,G.jsxs)("label",{children:[(0,G.jsx)("span",{className:"sr-only",children:"\u9009\u62E9\u8FDC\u7AEF\u4E3B\u673A"}),(0,G.jsx)("select",{value:t.id,onChange:g=>s(g.target.value),children:r.map(g=>(0,G.jsx)("option",{value:g.id,children:g.name},g.id))}),(0,G.jsxs)("small",{children:[t.username,"@",t.host,":",t.port]})]})]});return(0,G.jsx)(yl,{initialPath:t.cwd,header:v,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:t.name},deletion:{locationName:t.name,locationKind:"remote",remove:f}})}function _p({profile:e,initialPath:t="~",onEdit:r,onDelete:s,embedded:o=!1}){let i=(0,xe.useCallback)(v=>sh(e.id,v),[e.id]),n=(0,xe.useCallback)(v=>ih(e.id,v),[e.id]),a=(0,xe.useCallback)((v,g=!1)=>nh(e.id,v,g),[e.id]),h=(0,xe.useCallback)((v,g,u)=>jn(e.id,v,g,u),[e.id]),l=xp(`profile-sftp-${e.id}`),c=`sftp:${e.id}`,f=(0,xe.useCallback)((v,g)=>Fs({paneId:l,endpointId:c,directory:v,paths:g}),[c,l]);return(0,G.jsxs)("div",{className:`dsh-ssh-profile-sftp-pane${o?" is-embedded":""}`,children:[(0,G.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,G.jsxs)("div",{children:[(0,G.jsx)("h1",{children:o?"SFTP":`${e.name} \xB7 SFTP`}),(0,G.jsx)("p",{children:o?t:`${Gt(e)} \xB7 ${t}`})]}),(0,G.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[s&&(0,G.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:s,children:(0,G.jsx)(ke.IconTrashOutline16,{size:16})}),r&&(0,G.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:r,children:[(0,G.jsx)(ke.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,G.jsx)(yl,{workspace:!0,initialPath:t,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:e.name},deletion:{locationName:e.name,locationKind:"remote",remove:f}})]})}function yl({initialPath:e,header:t,workspace:r=!1,loadDirectory:s,loadPreview:o,fileUrl:i,uploadFile:n,operations:a,deletion:h}){let l=(0,xe.useRef)(null),c=(0,xe.useRef)(0),[f,v]=(0,xe.useState)(),[g,u]=(0,xe.useState)(),[d,m]=(0,xe.useState)(e),[p,b]=(0,xe.useState)(!0),[x,y]=(0,xe.useState)(),[w,_]=(0,xe.useState)(),[S,T]=(0,xe.useState)(!1),[D,P]=(0,xe.useState)(),[A,F]=(0,xe.useState)(),[B,$]=(0,xe.useState)(),[z,H]=(0,xe.useState)(),[C,R]=(0,xe.useState)(),L=(0,xe.useCallback)(async(W,ae)=>{b(!0),R(void 0),u(void 0),_(void 0);try{let me=await s(W,ae);v(me),m(me.path)}catch(me){R(Rn(me))}finally{b(!1)}},[s]);(0,xe.useEffect)(()=>{L(e,!1)},[L,e]);let k=W=>{W.preventDefault(),L(d,!0)},U=async(W,ae=f?.path,me=!1)=>{if(n===void 0||ae===void 0||W.length===0)return;let De=W.filter(Te=>Te.size<=I0),se=W.length-De.length;if(De.length===0){R("\u5355\u4E2A\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7 512 MB");return}_(void 0),R(void 0);for(let Te=0;Te<De.length;Te+=1){let ft=De[Te],ar=me&&Te===0;y(ft.name);try{await n(ae,ft,ar)}catch(Ot){!ar&&Ot instanceof lr&&Ot.status===409?_({file:ft,remaining:De.slice(Te+1),directory:ae}):R(Rn(Ot)),y(void 0);return}}y(void 0),await L(ae,!1),se>0&&R(`\u5DF2\u8DF3\u8FC7 ${se} \u4E2A\u8D85\u8FC7 512 MB \u7684\u6587\u4EF6`)},X=n!==void 0&&f!==void 0&&x===void 0&&w===void 0,O=W=>Array.from(W.dataTransfer.types).includes("Files"),te=W=>Array.from(W.dataTransfer.types).includes(Lt),N=W=>{!X||!O(W)||(W.preventDefault(),c.current+=1,T(!0))},I=W=>{if(X&&O(W)){W.preventDefault(),W.dataTransfer.dropEffect="copy";return}if(a===void 0||f===void 0||!te(W))return;let ae=D===void 0?"copy":ti(D,{endpointId:a.endpointId,directory:f.path});ae==="none"||ae==="invalid"||(W.preventDefault(),W.dataTransfer.dropEffect=ae)},J=W=>{O(W)&&(c.current=Math.max(0,c.current-1),c.current===0&&T(!1))},Y=W=>{if(c.current=0,T(!1),X&&O(W)){W.preventDefault();let me=Array.from(W.dataTransfer.files);me.length>0&&U(me);return}if(a===void 0||f===void 0||!te(W))return;W.preventDefault();let ae=vs(W.dataTransfer.getData(Lt));ae!==void 0&&V(ae,f.path)},V=async(W,ae)=>{if(a!==void 0){F(void 0),P(void 0),H(void 0),R(void 0);try{let me=await hn(W,{paneId:a.paneId,endpointId:a.endpointId,directory:ae});me.operation==="move"&&(H("\u5DF2\u79FB\u52A8"),await L(f?.path??ae,!1)),me.operation==="copy"&&H("\u5DF2\u52A0\u5165\u4F20\u8F93\u4EFB\u52A1\uFF0C\u53EF\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u67E5\u770B\u8FDB\u5EA6")}catch(me){R(Rn(me))}}},Q=async()=>{h===void 0||f===void 0||B===void 0||(await h.remove(f.path,[B.path]),await L(f.path,!1))};return(0,G.jsxs)("div",{className:`dsh-ssh-sftp${r?" is-workspace":""}${S?" is-dragging-files":""}`,onDragEnter:N,onDragOver:I,onDragLeave:J,onDrop:Y,children:[t,g?(0,G.jsx)(L0,{entry:g,loadPreview:o,fileUrl:i,onBack:()=>u(void 0)}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("form",{className:`dsh-ssh-sftp-pathbar${n===void 0?"":" has-upload"}`,onSubmit:k,children:[(0,G.jsx)("button",{type:"button","aria-label":"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",title:"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",disabled:f?.parent==null||p,onClick:()=>{f?.parent&&L(f.parent,!0)},children:(0,G.jsx)(ke.IconChevronLeftOutline14,{size:14})}),(0,G.jsx)("input",{"aria-label":"\u5F53\u524D\u8FDC\u7AEF\u76EE\u5F55",value:d,spellCheck:!1,onChange:W=>m(W.target.value)}),(0,G.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",title:"\u5237\u65B0\u76EE\u5F55",disabled:p,onClick:()=>{L(f?.path??d,!1)},children:(0,G.jsx)(ke.IconRefreshOutline16,{size:15})}),n!==void 0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("input",{ref:l,className:"sr-only",type:"file",multiple:!0,tabIndex:-1,onChange:W=>{let ae=Array.from(W.target.files??[]);W.target.value="",ae.length>0&&U(ae)}}),(0,G.jsxs)("button",{type:"button",className:"dsh-ssh-sftp-upload-button",disabled:f===void 0||x!==void 0||w!==void 0,onClick:()=>l.current?.click(),children:[(0,G.jsx)(ke.IconSendOutline14,{size:14}),x===void 0?"\u4E0A\u4F20":"\u4E0A\u4F20\u4E2D"]})]})]}),w!==void 0&&(0,G.jsxs)("div",{className:"dsh-ssh-upload-conflict",role:"alert",children:[(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{children:"\u540C\u540D\u6587\u4EF6\u5DF2\u5B58\u5728"}),(0,G.jsx)("small",{children:w.file.name})]}),(0,G.jsxs)("span",{children:[(0,G.jsx)("button",{type:"button",onClick:()=>{let W=w;_(void 0),U(W.remaining,W.directory)},children:"\u8DF3\u8FC7"}),(0,G.jsx)("button",{type:"button",className:"is-primary",disabled:x!==void 0,onClick:()=>{let W=w;U([W.file,...W.remaining],W.directory,!0)},children:"\u8986\u76D6\u4E0A\u4F20"})]})]}),z&&(0,G.jsxs)("div",{className:"dsh-ssh-sftp-operation-status",role:"status",children:[(0,G.jsx)("span",{children:z}),(0,G.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u63D0\u793A",onClick:()=>H(void 0),children:(0,G.jsx)(ke.IconCloseOutline16,{size:14})})]}),C&&(0,G.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:C}),(0,G.jsxs)("div",{className:"dsh-ssh-sftp-table dsh-ssh-scroll-surface","aria-busy":p,children:[(0,G.jsxs)("div",{className:"dsh-ssh-sftp-columns",children:[(0,G.jsx)("span",{children:"\u540D\u79F0"}),(0,G.jsx)("span",{children:"\u5927\u5C0F"}),(0,G.jsx)("span",{children:"\u4FEE\u6539\u65F6\u95F4"}),(0,G.jsx)("span",{"aria-hidden":"true"})]}),p&&f===void 0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u2026"}):f?.entries.length===0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B64\u76EE\u5F55\u4E3A\u7A7A"}):f?.entries.map(W=>{let ae=ln(W),me=D===void 0||a===void 0?void 0:ti(D,{endpointId:a.endpointId,directory:W.path}),De=ae&&me!=="none"&&me!=="invalid";return(0,G.jsxs)("div",{role:"row",tabIndex:0,"aria-label":`${W.name}${ae?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":"\uFF0C\u6587\u4EF6\uFF0C\u5355\u51FB\u9884\u89C8"}`,"data-ssh-interactive":"row","data-ssh-context-row":!0,draggable:a!==void 0&&(W.kind==="file"||ae),className:`dsh-ssh-sftp-row is-${ae?"directory":W.kind}${A===W.path?" is-drop-target":""}`,onClick:()=>{ae?L(W.path,!0):u(W)},onKeyDown:se=>{se.target===se.currentTarget&&se.key==="Enter"&&(ae?L(W.path,!0):u(W))},onDragStart:se=>{if(a===void 0||f===void 0)return;let Te={paneId:a.paneId,endpointId:a.endpointId,directory:f.path,paths:[W.path]};P(Te),se.dataTransfer.effectAllowed="copyMove",se.dataTransfer.setData(Lt,JSON.stringify(Te))},onDragEnd:()=>{P(void 0),F(void 0)},onDragOver:se=>{let Te=X&&O(se);!ae||!Te&&!te(se)||!Te&&!De||(se.preventDefault(),se.stopPropagation(),se.dataTransfer.dropEffect=Te||me!=="move"?"copy":"move",F(W.path))},onDragLeave:se=>{se.currentTarget.contains(se.relatedTarget)||F(void 0)},onDrop:se=>{if(!ae)return;if(se.preventDefault(),se.stopPropagation(),F(void 0),X&&O(se)){let ft=Array.from(se.dataTransfer.files);ft.length>0&&U(ft,W.path);return}let Te=vs(se.dataTransfer.getData(Lt));Te!==void 0&&V(Te,W.path)},children:[(0,G.jsxs)("span",{children:[ae?(0,G.jsx)(ke.IconFolderClose16,{size:16}):(0,G.jsx)(ke.IconDataOutline16,{size:16}),(0,G.jsx)("strong",{title:W.name,children:W.name})]}),(0,G.jsx)("small",{children:ae?"-":xl(W.size)}),(0,G.jsx)("small",{children:O0(W.modifiedAt)}),h!==void 0&&(0,G.jsx)("button",{type:"button",className:"dsh-ssh-sftp-row-delete dsh-ssh-context-action",draggable:!1,"aria-label":`\u5220\u9664 ${W.name}`,title:`\u5220\u9664 ${W.name}`,onClick:se=>{se.stopPropagation(),$(W)},children:(0,G.jsx)(ke.IconTrashOutline16,{size:14})})]},W.path)})]})]}),S&&(0,G.jsx)("div",{className:"dsh-ssh-sftp-dropzone","aria-hidden":"true",children:(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{children:"\u677E\u5F00\u4EE5\u4E0A\u4F20"}),(0,G.jsxs)("small",{children:["\u4E0A\u4F20\u5230 ",f?.path??d]})]})}),B!==void 0&&h!==void 0&&(0,G.jsx)(Dn,{locationName:h.locationName,locationKind:h.locationKind,entries:[B],onClose:()=>$(void 0),onDelete:Q})]})}function L0({entry:e,loadPreview:t,fileUrl:r,onBack:s}){let[o,i]=(0,xe.useState)(),[n,a]=(0,xe.useState)(),[h,l]=(0,xe.useState)(!1);(0,xe.useEffect)(()=>{let f=!1;return i(void 0),a(void 0),t(e.path).then(v=>{f||i(v)}).catch(v=>{f||a(Rn(v))}),()=>{f=!0}},[e.path,t]);let c=r(e.path);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("section",{className:"dsh-ssh-file-preview",children:[(0,G.jsxs)("header",{children:[(0,G.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u76EE\u5F55",title:"\u8FD4\u56DE\u76EE\u5F55",onClick:s,children:(0,G.jsx)(ke.IconChevronLeftOutline14,{size:14})}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-title",children:[(0,G.jsx)("strong",{title:e.name,children:e.name}),(0,G.jsx)("small",{children:xl(e.size)})]}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,G.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,G.jsx)(ke.IconDownloadOutline16,{size:16})}),(0,G.jsx)("button",{type:"button","aria-label":"\u653E\u5927\u9884\u89C8",title:"\u653E\u5927\u9884\u89C8",onClick:()=>l(!0),children:(0,G.jsx)(ke.IconFullscreenOutline16,{size:16})})]})]}),(0,G.jsx)("div",{className:"dsh-ssh-file-preview-body dsh-ssh-scroll-surface",children:(0,G.jsx)(gp,{entry:e,preview:o,error:n,fileUrl:r,downloadUrl:c})})]}),(0,G.jsx)(ke.Modal,{open:h,onClose:()=>l(!1),title:`\u9884\u89C8 ${e.name}`,closeLabel:"\u5173\u95ED\u9884\u89C8",headless:!0,className:"dsh-ssh-preview-modal",children:(0,G.jsxs)("section",{className:"dsh-ssh-preview-modal-shell",children:[(0,G.jsxs)("header",{children:[(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{title:e.name,children:e.name}),(0,G.jsx)("small",{children:xl(e.size)})]}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,G.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,G.jsx)(ke.IconDownloadOutline16,{size:16})}),(0,G.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u9884\u89C8",title:"\u5173\u95ED\u9884\u89C8",onClick:()=>l(!1),children:(0,G.jsx)(ke.IconCloseOutline16,{size:16})})]})]}),(0,G.jsx)("div",{className:"dsh-ssh-file-preview-body is-modal dsh-ssh-scroll-surface",children:(0,G.jsx)(gp,{entry:e,preview:o,error:n,fileUrl:r,downloadUrl:c})})]})})]})}function gp({entry:e,preview:t,error:r,fileUrl:s,downloadUrl:o}){return r?(0,G.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:r}):t===void 0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u6253\u5F00\u6587\u4EF6\u2026"}):t.kind==="text"&&t.mimeType==="text/markdown"?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("article",{className:"dsh-ssh-markdown-preview",children:(0,G.jsx)(Ho,{remarkPlugins:[on],components:{a:i=>(0,G.jsx)("a",{...i,target:"_blank",rel:"noreferrer"})},children:t.text||""})}),t.truncated&&(0,G.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="text"?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("pre",{children:t.text||""}),t.truncated&&(0,G.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="image"?(0,G.jsx)("img",{src:s(e.path,!0),alt:e.name}):t.kind==="pdf"?(0,G.jsx)("iframe",{src:s(e.path,!0),title:e.name}):(0,G.jsxs)("div",{className:"dsh-ssh-file-binary",children:[(0,G.jsx)(ke.IconDataOutline16,{size:24}),(0,G.jsx)("strong",{children:"\u6B64\u6587\u4EF6\u65E0\u6CD5\u76F4\u63A5\u9884\u89C8"}),(0,G.jsx)("p",{children:t.mimeType}),(0,G.jsxs)("a",{href:o,children:[(0,G.jsx)(ke.IconDownloadOutline16,{size:16}),"\u4E0B\u8F7D\u6587\u4EF6"]})]})}function xl(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],r=e/1024,s=0;for(;r>=1024&&s<t.length-1;)r/=1024,s+=1;return`${r>=10?r.toFixed(0):r.toFixed(1)} ${t[s]}`}function O0(e){return new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(e)}function Rn(e){return e instanceof Error?e.message:String(e)}function xp(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,100)}var As=class{constructor(t){this.endpoints=t}input="";inputSequence=0;inputScheduled=!1;disposed=!1;sendInput(t,r){this.disposed||!t||(this.input+=t,!this.inputScheduled&&(this.inputScheduled=!0,queueMicrotask(()=>{if(this.inputScheduled=!1,this.disposed)return;let s=this.input;if(this.input="",!s)return;let o=this.inputSequence++;this.deliverInput(s,o,r)})))}observe(t){let r=!1,s=0,o,i,n,a=!1,h=()=>{r||(r=!0,o?.close(),i!==void 0&&clearTimeout(i),n!==void 0&&clearTimeout(n))},l=v=>{r||(s=v.cursor,t.output(v),v.closed&&h())},c=async()=>{if(!r)try{let v=await this.endpoints.read(s);l(v),r||(n=window.setTimeout(()=>{c()},document.hidden?500:v.data?16:64))}catch(v){if(r)return;t.error(v),n=window.setTimeout(()=>{c()},500)}},f=()=>{r||n!==void 0||(o?.close(),o=void 0,c())};return typeof EventSource>"u"?(f(),h):(o=new EventSource(this.endpoints.streamUrl),o.onmessage=v=>{try{let g=M0(v.data);a=!0,i!==void 0&&(clearTimeout(i),i=void 0),l(g)}catch(g){t.error(g),f()}},o.onerror=()=>{!a&&o?.readyState===EventSource.CLOSED&&f()},i=window.setTimeout(()=>{a||f()},1500),h)}dispose(){this.disposed=!0,this.input=""}deliverInput(t,r,s,o=0){this.endpoints.send(t,r).catch(i=>{if(!this.disposed){if(o<2&&F0(i)){window.setTimeout(()=>this.deliverInput(t,r,s,o+1),60*(o+1));return}s(i)}})}};function M0(e){let t=JSON.parse(e);if(typeof t.data!="string"||typeof t.cursor!="number"||!Number.isSafeInteger(t.cursor)||t.cursor<0||typeof t.truncated!="boolean"||typeof t.closed!="boolean")throw new Error("SSH terminal stream returned an invalid event");return t}function F0(e){if(typeof e!="object"||e===null||!("status"in e))return!0;let t=Number(e.status);return!Number.isFinite(t)||t>=500}var Sp=Ms(wp(),1),B0={background:"#1c1c1e",foreground:"#f2f2f7",cursor:"#f2f2f7",cursorAccent:"#1c1c1e",selectionBackground:"#8e8e9366",black:"#1c1c1e",red:"#ff453a",green:"#30d158",yellow:"#ffd60a",blue:"#a5a5aa",magenta:"#bf5af2",cyan:"#64d2ff",white:"#e5e5ea",brightBlack:"#8e8e93",brightRed:"#ff6961",brightGreen:"#66d47e",brightYellow:"#ffe45c",brightBlue:"#d1d1d6",brightMagenta:"#da8fff",brightCyan:"#8be0ff",brightWhite:"#ffffff"};function In(e){return new Sp.Terminal({convertEol:!0,cursorBlink:e.readOnly!==!0,cursorInactiveStyle:"outline",disableStdin:e.readOnly===!0,fontFamily:'"SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace',fontSize:e.compact===!0?12:13,fontWeight:"400",fontWeightBold:"600",letterSpacing:0,lineHeight:1.25,scrollback:e.scrollback,theme:B0})}function Ln(e,t,r,s){let o,i=!1,n="",a=()=>{if(i||e.clientWidth===0||e.clientHeight===0)return;r.fit(),t.scrollToBottom();let c=`${t.cols}x${t.rows}`;c!==n&&(n=c,s?.(t.cols,t.rows))},h=()=>{o!==void 0&&cancelAnimationFrame(o),o=requestAnimationFrame(()=>{o=void 0,a()})},l=new ResizeObserver(h);return l.observe(e),document.fonts?.ready.then(h).catch(()=>{}),h(),{fit:a,dispose(){i=!0,o!==void 0&&cancelAnimationFrame(o),l.disconnect()}}}var ce=require("react/jsx-runtime");function Cp(e){let t=String(e.sessionId),[r,s]=(0,Ke.useState)(),[o,i]=(0,Ke.useState)(()=>e.controller.requestedView(t)??"local-directory"),[n,a]=(0,Ke.useState)();(0,Ke.useEffect)(()=>e.controller.subscribe(()=>{let l=e.controller.requestedView(t);l!==void 0&&i(l)}),[e.controller,t]);let h=(0,Ke.useCallback)(async()=>{try{let l=await Gl(t);s(l),l.injection?.permission!=="terminal"&&(e.controller.requestedView(t)==="terminals"&&e.controller.open(t,void 0,"local-directory"),i(c=>c==="terminals"?"local-directory":c)),a(void 0)}catch(l){a(Pe(l))}},[e.controller,t]);return(0,Ke.useEffect)(()=>{let l=!1,c,f=!1,v=async()=>{if(f||(f=!0,await h(),f=!1,l))return;let u=o==="terminals"?2200:3200;c=window.setTimeout(()=>{v()},document.visibilityState==="hidden"?12e3:u)},g=()=>{document.visibilityState!=="visible"||l||(c!==void 0&&window.clearTimeout(c),c=void 0,v())};return document.addEventListener("visibilitychange",g),v(),()=>{l=!0,c!==void 0&&window.clearTimeout(c),document.removeEventListener("visibilitychange",g)}},[h,o]),(0,ce.jsxs)("section",{className:"dsh-ssh-activity-panel","aria-label":"SSH \u6D3B\u52A8",children:[(0,ce.jsxs)("header",{className:"dsh-ssh-activity-header",children:[(0,ce.jsxs)("div",{className:"dsh-ssh-activity-title",children:[(0,ce.jsx)("span",{className:"dsh-ssh-activity-mark",children:(0,ce.jsx)(Cr,{})}),(0,ce.jsxs)("span",{children:[(0,ce.jsx)("strong",{children:"SSH \u6D3B\u52A8"}),(0,ce.jsxs)("small",{children:["\u5F53\u524D\u4F1A\u8BDD \xB7 ",mp(t)]})]})]}),(0,ce.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u5173\u95ED SSH \u6D3B\u52A8",onClick:()=>e.controller.close(t),children:(0,ce.jsx)(ir.IconCloseOutline16,{size:16})})]}),r&&(0,ce.jsxs)("nav",{className:"dsh-ssh-activity-tabs","aria-label":"SSH \u6D3B\u52A8\u89C6\u56FE",children:[(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="local-directory"?"is-active":"","aria-pressed":o==="local-directory",onClick:()=>e.controller.open(t,void 0,"local-directory"),children:[(0,ce.jsx)(ir.IconFolderOpenOutline16,{size:16}),"\u4F1A\u8BDD\u76EE\u5F55"]}),r.profiles.length>0&&(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="remote-directory"?"is-active":"","aria-pressed":o==="remote-directory",onClick:()=>e.controller.open(t,void 0,"remote-directory"),children:[(0,ce.jsx)(Cr,{}),"\u8FDC\u7AEF\u76EE\u5F55"]}),r.injection?.permission==="terminal"&&(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="terminals"?"is-active":"","aria-pressed":o==="terminals",onClick:()=>e.controller.open(t,void 0,"terminals"),children:[(0,ce.jsx)(ir.IconCodeOutline16,{size:16}),"\u7EC8\u7AEF",r.terminals.length>0&&(0,ce.jsx)("em",{children:r.terminals.length})]})]}),(0,ce.jsxs)("div",{className:"dsh-ssh-activity-body",children:[r===void 0?(0,ce.jsx)("p",{className:"dsh-ssh-activity-state",role:"status",children:"\u6B63\u5728\u8BFB\u53D6 SSH \u4F1A\u8BDD\u2026"}):o==="local-directory"?(0,ce.jsx)(vp,{sessionId:t}):o==="remote-directory"?(0,ce.jsx)(N0,{sessionId:t,profiles:r.profiles,selectedProfileId:e.controller.selected(t),onProfile:l=>e.controller.open(t,l,"remote-directory"),onSaved:h}):(0,ce.jsx)(z0,{sessionId:t,terminals:r.terminals,onClosed:h}),n&&(0,ce.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n})]})]})}function N0({sessionId:e,profiles:t,selectedProfileId:r,onProfile:s,onSaved:o}){let i=t.find(n=>n.id===r)??t[0];return i===void 0?(0,ce.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,ce.jsx)(ir.IconFolderOpenOutline16,{size:22}),(0,ce.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u6D4F\u89C8\u7684\u8FDC\u7AEF"}),(0,ce.jsx)("p",{children:"\u8BF7\u5148\u5728 SSH \u9762\u677F\u4E2D\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u8BBF\u95EE\u4E00\u53F0\u4E3B\u673A\u3002"})]}):(0,ce.jsx)(bp,{sessionId:e,profile:i,profiles:t,onProfile:s,onSaved:o},i.id)}function z0({sessionId:e,terminals:t,onClosed:r}){let s=[...t].reverse().find(g=>g.status.kind==="running")??t.at(-1),[o,i]=(0,Ke.useState)(s?.terminalId),[n,a]=(0,Ke.useState)(),[h,l]=(0,Ke.useState)(),c=t.find(g=>g.terminalId===o)??s;if((0,Ke.useEffect)(()=>{(o===void 0||!t.some(g=>g.terminalId===o))&&i(s?.terminalId)},[s?.terminalId,o,t]),c===void 0)return(0,ce.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,ce.jsx)(ir.IconCodeOutline16,{size:22}),(0,ce.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u6253\u5F00\u7684\u7EC8\u7AEF"}),(0,ce.jsx)("p",{children:"AI \u6253\u5F00\u4EA4\u4E92\u7EC8\u7AEF\u540E\uFF0C\u4F1A\u76F4\u63A5\u663E\u793A\u5728\u8FD9\u91CC\u3002"})]});let f=async()=>{if(n===void 0){a(c.terminalId),l(void 0);try{await dh(e,c.terminalId),await r()}catch(g){l(Pe(g))}finally{a(void 0)}}},v=c.status.kind==="running"?"\u7ED3\u675F":"\u79FB\u9664";return(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-workbench",children:[t.length>1&&(0,ce.jsx)("nav",{className:"dsh-ssh-terminal-switcher dsh-ssh-scroll-surface","aria-label":"SSH \u7EC8\u7AEF",children:t.map((g,u)=>{let d=g.name||`\u7EC8\u7AEF ${u+1}`;return(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",title:d,className:g.terminalId===c.terminalId?"is-active":"","aria-pressed":g.terminalId===c.terminalId,onClick:()=>i(g.terminalId),children:[(0,ce.jsx)("span",{className:`dsh-ssh-terminal-state-dot is-${g.status.kind}`}),(0,ce.jsx)("span",{className:"dsh-ssh-terminal-switcher-label",children:d})]},g.terminalId)})}),(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer",children:[(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer-heading",children:[(0,ce.jsxs)("span",{children:[(0,ce.jsx)("strong",{children:c.name}),(0,ce.jsx)("small",{children:c.cwd})]}),(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer-actions",children:[(0,ce.jsx)("span",{className:`dsh-ssh-terminal-state is-${c.status.kind}`,children:c.status.kind==="running"?"\u8FD0\u884C\u4E2D":"\u5DF2\u9000\u51FA"}),(0,ce.jsxs)("button",{type:"button",className:"dsh-ssh-terminal-close",disabled:n!==void 0,"aria-label":`${v}\u7EC8\u7AEF ${c.name}`,title:c.status.kind==="running"?"\u7ED3\u675F\u5E76\u5173\u95ED\u8FD9\u4E2A\u7EC8\u7AEF":"\u4ECE\u6D3B\u52A8\u9762\u677F\u79FB\u9664\u8FD9\u4E2A\u7EC8\u7AEF",onClick:()=>{f()},children:[(0,ce.jsx)(ir.IconCloseOutline16,{size:14}),(0,ce.jsx)("span",{children:n===c.terminalId?"\u5904\u7406\u4E2D":v})]})]})]}),(0,ce.jsx)(H0,{sessionId:e,terminal:c,onError:l},c.terminalId)]}),h&&(0,ce.jsx)("p",{className:"dsh-ssh-terminal-input-error",role:"alert",children:h})]})}function H0({sessionId:e,terminal:t,onError:r}){let s=(0,Ke.useRef)(null),o=(0,Ke.useRef)();return(0,Ke.useEffect)(()=>{let i=s.current;if(i===null)return;let n=In({compact:!0,readOnly:t.status.kind!=="running",scrollback:4e3}),a=new kp.FitAddon;n.loadAddon(a),n.open(i),o.current=n,n.focus();let h=new As({streamUrl:lh(e,t.terminalId),read:v=>ah(e,t.terminalId,v),send:(v,g)=>oh(e,t.terminalId,v,g)}),l=n.onData(v=>h.sendInput(v,g=>r(Pe(g)))),c=h.observe({output:v=>{v.truncated&&n.reset(),v.data&&n.write(v.data),n.scrollToBottom(),r(void 0)},error:v=>r(Pe(v))}),f=Ln(i,n,a,(v,g)=>{ch(e,t.terminalId,v,g).catch(u=>r(Pe(u)))});return()=>{c(),h.dispose(),l.dispose(),f.dispose(),n.dispose(),o.current=void 0}},[t.terminalId,r,e]),(0,Ke.useEffect)(()=>{let i=o.current;i!==void 0&&(i.options.disableStdin=t.status.kind!=="running")},[t.status.kind]),(0,ce.jsx)("div",{className:"dsh-ssh-terminal-screen","aria-label":"\u4EA4\u4E92\u5F0F SSH \u7EC8\u7AEF",children:(0,ce.jsx)("div",{ref:s,className:"dsh-ssh-terminal-viewport"})})}var Er=require("react"),yt=require("react/jsx-runtime");function Tp({className:e,toolbar:t,notice:r,navigation:s,navigationLabel:o,navigationIcon:i,inspector:n,inspectorLabel:a="\u8BE6\u60C5",inspectorIcon:h,children:l}){let[c,f]=(0,Er.useState)(),v=(0,Er.useRef)(null),g=(0,Er.useRef)(null),u=(0,Er.useRef)(null),d=()=>{f(void 0),window.requestAnimationFrame(()=>{let p=u.current;p?.isConnected&&p.focus()})},m={closePanel:d,openPanel:p=>f(p)};return(0,Er.useEffect)(()=>{if(c===void 0)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let b=(c==="navigation"?v.current:g.current)?.querySelector('input:not(:disabled), button:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])');window.requestAnimationFrame(()=>b?.focus());let x=y=>{y.key==="Escape"&&d()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[c]),(0,yt.jsxs)("main",{className:`dsh-ssh-adaptive-workspace${e===void 0?"":` ${e}`}`,"data-panel":c??"none","data-has-inspector":n===void 0?"false":"true",children:[t,r,(0,yt.jsxs)("nav",{className:"dsh-ssh-mobile-actions","aria-label":"\u5DE5\u4F5C\u533A\u9762\u677F",children:[(0,yt.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="navigation","aria-controls":"dsh-ssh-adaptive-navigation","aria-expanded":c==="navigation",onClick:()=>c==="navigation"?d():f("navigation"),children:[i,(0,yt.jsx)("span",{children:o})]}),n!==void 0&&(0,yt.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="inspector","aria-controls":"dsh-ssh-adaptive-inspector","aria-expanded":c==="inspector",onClick:()=>c==="inspector"?d():f("inspector"),children:[h,(0,yt.jsx)("span",{children:a})]})]}),(0,yt.jsxs)("div",{className:"dsh-ssh-adaptive-shell",children:[(0,yt.jsx)("aside",{ref:v,id:"dsh-ssh-adaptive-navigation",className:"dsh-ssh-adaptive-navigation","aria-label":o,children:Ep(s,m)}),(0,yt.jsx)("section",{className:"dsh-ssh-adaptive-content",children:l}),n!==void 0&&(0,yt.jsx)("aside",{ref:g,id:"dsh-ssh-adaptive-inspector",className:"dsh-ssh-adaptive-inspector","aria-label":a,children:Ep(n,m)}),(0,yt.jsx)("button",{type:"button",className:"dsh-ssh-adaptive-backdrop","aria-label":"\u5173\u95ED\u9762\u677F",tabIndex:c===void 0?-1:0,onClick:d})]})]})}function Ep(e,t){return typeof e=="function"?e(t):e}var Pp=`.dsh-ssh-adaptive-workspace {
|
|
38
|
+
`))}function h(g,u,d,m){let p=d.enter("tableCell"),b=d.enter("phrasing"),x=d.containerPhrasing(g,{...m,before:i,after:i});return b(),p(),x}function l(g,u){return Sd(g,{align:u,alignDelimiters:r,padding:s,stringLength:o})}function c(g,u,d){let m=g.children,p=-1,b=[],x=u.enter("table");for(;++p<m.length;)b[p]=f(m[p],u,d);return x(),b}function f(g,u,d){let m=g.children,p=-1,b=[],x=u.enter("tableRow");for(;++p<m.length;)b[p]=h(m[p],g,u,d);return x(),b}function v(g,u,d){let m=Zr.inlineCode(g,u,d);return d.stack.includes("tableCell")&&(m=m.replace(/\|/g,"\\$&")),m}}function fa(){return{exit:{taskListCheckValueChecked:Kd,taskListCheckValueUnchecked:Kd,paragraph:wb}}}function ma(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Sb}}}function Kd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function wb(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let s=this.stack[this.stack.length-1];s.type;let r=s.children[0];if(r&&r.type==="text"){let o=t.children,i=-1,n;for(;++i<o.length;){let a=o[i];if(a.type==="paragraph"){n=a;break}}n===s&&(r.value=r.value.slice(1),r.value.length===0?s.children.shift():s.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,s.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Sb(e,t,s,r){let o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",n="["+(e.checked?"x":" ")+"] ",a=s.createTracker(r);i&&a.move(n);let h=Zr.listItem(e,t,s,{...r,...a.current()});return i&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),h;function l(c){return c+n}}function ga(){return[Go(),Jo(),Qo(),ua(),fa()]}function va(e){return{extensions:[Xo(),Yo(e),Zo(),pa(e),ma()]}}var kb={tokenize:Db,partial:!0},Gd={tokenize:Rb,partial:!0},Xd={tokenize:Ab,partial:!0},Jd={tokenize:Ib,partial:!0},Cb={tokenize:Lb,partial:!0},Yd={name:"wwwAutolink",tokenize:Tb,previous:Zd},Qd={name:"protocolAutolink",tokenize:Pb,previous:eu},ts={name:"emailAutolink",tokenize:Eb,previous:tu},Ht={};function _a(){return{text:Ht}}var Ks=48;for(;Ks<123;)Ht[Ks]=ts,Ks++,Ks===58?Ks=65:Ks===91&&(Ks=97);Ht[43]=ts;Ht[45]=ts;Ht[46]=ts;Ht[95]=ts;Ht[72]=[ts,Qd];Ht[104]=[ts,Qd];Ht[87]=[ts,Yd];Ht[119]=[ts,Yd];function Eb(e,t,s){let r=this,o,i;return n;function n(f){return!ba(f)||!tu.call(r,r.previous)||xa(r.events)?s(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return ba(f)?(e.consume(f),a):f===64?(e.consume(f),h):s(f)}function h(f){return f===46?e.check(Cb,c,l)(f):f===45||f===95||Be(f)?(i=!0,e.consume(f),h):c(f)}function l(f){return e.consume(f),o=!0,h}function c(f){return i&&o&&We(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):s(f)}}function Tb(e,t,s){let r=this;return o;function o(n){return n!==87&&n!==119||!Zd.call(r,r.previous)||xa(r.events)?s(n):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(kb,e.attempt(Gd,e.attempt(Xd,i),s),s)(n))}function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}}function Pb(e,t,s){let r=this,o="",i=!1;return n;function n(f){return(f===72||f===104)&&eu.call(r,r.previous)&&!xa(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(f),e.consume(f),a):s(f)}function a(f){if(We(f)&&o.length<5)return o+=String.fromCodePoint(f),e.consume(f),a;if(f===58){let v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(f),h}return s(f)}function h(f){return f===47?(e.consume(f),i?l:(i=!0,h)):s(f)}function l(f){return f===null||Ns(f)||_e(f)||Nt(f)||zs(f)?s(f):e.attempt(Gd,e.attempt(Xd,c),s)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Db(e,t,s){let r=0;return o;function o(n){return(n===87||n===119)&&r<3?(r++,e.consume(n),o):n===46&&r===3?(e.consume(n),i):s(n)}function i(n){return n===null?s(n):t(n)}}function Rb(e,t,s){let r,o,i;return n;function n(l){return l===46||l===95?e.check(Jd,h,a)(l):l===null||_e(l)||Nt(l)||l!==45&&zs(l)?h(l):(i=!0,e.consume(l),n)}function a(l){return l===95?r=!0:(o=r,r=void 0),e.consume(l),n}function h(l){return o||r||!i?s(l):t(l)}}function Ab(e,t){let s=0,r=0;return o;function o(n){return n===40?(s++,e.consume(n),o):n===41&&r<s?i(n):n===33||n===34||n===38||n===39||n===41||n===42||n===44||n===46||n===58||n===59||n===60||n===63||n===93||n===95||n===126?e.check(Jd,t,i)(n):n===null||_e(n)||Nt(n)?t(n):(e.consume(n),o)}function i(n){return n===41&&r++,e.consume(n),o}}function Ib(e,t,s){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),i):a===93?(e.consume(a),o):a===60||a===null||_e(a)||Nt(a)?t(a):s(a)}function o(a){return a===null||a===40||a===91||_e(a)||Nt(a)?t(a):r(a)}function i(a){return We(a)?n(a):s(a)}function n(a){return a===59?(e.consume(a),r):We(a)?(e.consume(a),n):s(a)}}function Lb(e,t,s){return r;function r(i){return e.consume(i),o}function o(i){return Be(i)?s(i):t(i)}}function Zd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||_e(e)}function eu(e){return!We(e)}function tu(e){return!(e===47||ba(e))}function ba(e){return e===43||e===45||e===46||e===95||Be(e)}function xa(e){let t=e.length,s=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){s=!0;break}if(r._gfmAutolinkLiteralWalkedInto){s=!1;break}}return e.length>0&&!s&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}var Ob={tokenize:$b,partial:!0};function ya(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Nb,continuation:{tokenize:zb},exit:Hb}},text:{91:{name:"gfmFootnoteCall",tokenize:Bb},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Mb,resolveTo:Fb}}}}function Mb(e,t,s){let r=this,o=r.events.length,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),n;for(;o--;){let h=r.events[o][1];if(h.type==="labelImage"){n=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return a;function a(h){if(!n||!n._balanced)return s(h);let l=Ze(r.sliceSerialize({start:n.end,end:r.now()}));return l.codePointAt(0)!==94||!i.includes(l.slice(1))?s(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function Fb(e,t){let s=e.length,r;for(;s--;)if(e[s][1].type==="labelImage"&&e[s][0]==="enter"){r=e[s][1];break}e[s+1][1].type="data",e[s+3][1].type="gfmFootnoteCallLabelMarker";let o={type:"gfmFootnoteCall",start:Object.assign({},e[s+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[s+3][1].end),end:Object.assign({},e[s+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let n={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},n.start),end:Object.assign({},n.end)},h=[e[s+1],e[s+2],["enter",o,t],e[s+3],e[s+4],["enter",i,t],["exit",i,t],["enter",n,t],["enter",a,t],["exit",a,t],["exit",n,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(s,e.length-s+1,...h),e}function Bb(e,t,s){let r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),i=0,n;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),h}function h(f){return f!==94?s(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(f){if(i>999||f===93&&!n||f===null||f===91||_e(f))return s(f);if(f===93){e.exit("chunkString");let v=e.exit("gfmFootnoteCallString");return o.includes(Ze(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):s(f)}return _e(f)||(n=!0),i++,e.consume(f),f===92?c:l}function c(f){return f===91||f===92||f===93?(e.consume(f),i++,l):l(f)}}function Nb(e,t,s){let r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),i,n=0,a;return h;function h(u){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(u){return u===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):s(u)}function c(u){if(n>999||u===93&&!a||u===null||u===91||_e(u))return s(u);if(u===93){e.exit("chunkString");let d=e.exit("gfmFootnoteDefinitionLabelString");return i=Ze(r.sliceSerialize(d)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return _e(u)||(a=!0),n++,e.consume(u),u===92?f:c}function f(u){return u===91||u===92||u===93?(e.consume(u),n++,c):c(u)}function v(u){return u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),o.includes(i)||o.push(i),he(e,g,"gfmFootnoteDefinitionWhitespace")):s(u)}function g(u){return t(u)}}function zb(e,t,s){return e.check(zt,t,e.attempt(Ob,t,s))}function Hb(e){e.exit("gfmFootnoteDefinition")}function $b(e,t,s){let r=this;return he(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){let n=r.events[r.events.length-1];return n&&n[1].type==="gfmFootnoteDefinitionIndent"&&n[2].sliceSerialize(n[1],!0).length===4?t(i):s(i)}}function wa(e){let s=(e||{}).singleTilde,r={name:"strikethrough",tokenize:i,resolveAll:o};return s==null&&(s=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(n,a){let h=-1;for(;++h<n.length;)if(n[h][0]==="enter"&&n[h][1].type==="strikethroughSequenceTemporary"&&n[h][1]._close){let l=h;for(;l--;)if(n[l][0]==="exit"&&n[l][1].type==="strikethroughSequenceTemporary"&&n[l][1]._open&&n[h][1].end.offset-n[h][1].start.offset===n[l][1].end.offset-n[l][1].start.offset){n[h][1].type="strikethroughSequence",n[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},n[l][1].start),end:Object.assign({},n[h][1].end)},f={type:"strikethroughText",start:Object.assign({},n[l][1].end),end:Object.assign({},n[h][1].start)},v=[["enter",c,a],["enter",n[l][1],a],["exit",n[l][1],a],["enter",f,a]],g=a.parser.constructs.insideSpan.null;g&&$e(v,v.length,0,ps(g,n.slice(l+1,h),a)),$e(v,v.length,0,[["exit",f,a],["enter",n[h][1],a],["exit",n[h][1],a],["exit",c,a]]),$e(n,l-1,h-l+3,v),h=l+v.length-2;break}}for(h=-1;++h<n.length;)n[h][1].type==="strikethroughSequenceTemporary"&&(n[h][1].type="data");return n}function i(n,a,h){let l=this.previous,c=this.events,f=0;return v;function v(u){return l===126&&c[c.length-1][1].type!=="characterEscape"?h(u):(n.enter("strikethroughSequenceTemporary"),g(u))}function g(u){let d=es(l);if(u===126)return f>1?h(u):(n.consume(u),f++,g);if(f<2&&!s)return h(u);let m=n.exit("strikethroughSequenceTemporary"),p=es(u);return m._open=!p||p===2&&!!d,m._close=!d||d===2&&!!p,a(u)}}}var nn=class{constructor(){this.map=[]}add(t,s,r){Ub(this,t,s,r)}consume(t){if(this.map.sort(function(i,n){return i[0]-n[0]}),this.map.length===0)return;let s=this.map.length,r=[];for(;s>0;)s-=1,r.push(t.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),t.length=this.map[s][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(let i of o)t.push(i);o=r.pop()}this.map.length=0}};function Ub(e,t,s,r){let o=0;if(!(s===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=s,e.map[o][2].push(...r);return}o+=1}e.map.push([t,s,r])}}function su(e,t){let s=!1,r=[];for(;t<e.length;){let o=e[t];if(s){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(s=!0);t+=1}return r}function Sa(){return{flow:{null:{name:"table",tokenize:Vb,resolveAll:jb}}}}function Vb(e,t,s){let r=this,o=0,i=0,n;return a;function a(T){let A=r.events.length-1;for(;A>-1;){let U=r.events[A][1].type;if(U==="lineEnding"||U==="linePrefix")A--;else break}let F=A>-1?r.events[A][1].type:null,B=F==="tableHead"||F==="tableRow"?_:h;return B===_&&r.parser.lazy[r.now().line]?s(T):B(T)}function h(T){return e.enter("tableHead"),e.enter("tableRow"),l(T)}function l(T){return T===124||(n=!0,i+=1),c(T)}function c(T){return T===null?s(T):ie(T)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),g):s(T):ue(T)?he(e,c,"whitespace")(T):(i+=1,n&&(n=!1,o+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),n=!0,c):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||_e(T)?(e.exit("data"),c(T)):(e.consume(T),T===92?v:f)}function v(T){return T===92||T===124?(e.consume(T),f):f(T)}function g(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?s(T):(e.enter("tableDelimiterRow"),n=!1,ue(T)?he(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):u(T))}function u(T){return T===45||T===58?m(T):T===124?(n=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),d):S(T)}function d(T){return ue(T)?he(e,m,"whitespace")(T):m(T)}function m(T){return T===58?(i+=1,n=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),p):T===45?(i+=1,p(T)):T===null||ie(T)?y(T):S(T)}function p(T){return T===45?(e.enter("tableDelimiterFiller"),b(T)):S(T)}function b(T){return T===45?(e.consume(T),b):T===58?(n=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return ue(T)?he(e,y,"whitespace")(T):y(T)}function y(T){return T===124?u(T):T===null||ie(T)?!n||o!==i?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return s(T)}function _(T){return e.enter("tableRow"),w(T)}function w(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),w):T===null||ie(T)?(e.exit("tableRow"),t(T)):ue(T)?he(e,w,"whitespace")(T):(e.enter("data"),C(T))}function C(T){return T===null||T===124||_e(T)?(e.exit("data"),w(T)):(e.consume(T),T===92?P:C)}function P(T){return T===92||T===124?(e.consume(T),C):C(T)}}function jb(e,t){let s=-1,r=!0,o=0,i=[0,0,0,0],n=[0,0,0,0],a=!1,h=0,l,c,f,v=new nn;for(;++s<e.length;){let g=e[s],u=g[1];g[0]==="enter"?u.type==="tableHead"?(a=!1,h!==0&&(ru(v,t,h,l,c),c=void 0,h=0),l={type:"table",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(s,0,[["enter",l,t]])):u.type==="tableRow"||u.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],n=[0,s+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(s,0,[["enter",c,t]])),o=u.type==="tableDelimiterRow"?2:c?3:1):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")?(r=!1,n[2]===0&&(i[1]!==0&&(n[0]=n[1],f=on(v,t,i,o,void 0,f),i=[0,0,0,0]),n[2]=s)):u.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(n[0]=n[1],f=on(v,t,i,o,void 0,f)),i=n,n=[i[1],s,0,0])):u.type==="tableHead"?(a=!0,h=s):u.type==="tableRow"||u.type==="tableDelimiterRow"?(h=s,i[1]!==0?(n[0]=n[1],f=on(v,t,i,o,s,f)):n[1]!==0&&(f=on(v,t,n,o,s,f)),o=0):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")&&(n[3]=s)}for(h!==0&&ru(v,t,h,l,c),v.consume(t.events),s=-1;++s<t.events.length;){let g=t.events[s];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=su(t.events,s))}return e}function on(e,t,s,r,o,i){let n=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";s[0]!==0&&(i.end=Object.assign({},vr(t.events,s[0])),e.add(s[0],0,[["exit",i,t]]));let h=vr(t.events,s[1]);if(i={type:n,start:Object.assign({},h),end:Object.assign({},h)},e.add(s[1],0,[["enter",i,t]]),s[2]!==0){let l=vr(t.events,s[2]),c=vr(t.events,s[3]),f={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(e.add(s[2],0,[["enter",f,t]]),r!==2){let v=t.events[s[2]],g=t.events[s[3]];if(v[1].end=Object.assign({},g[1].end),v[1].type="chunkText",v[1].contentType="text",s[3]>s[2]+1){let u=s[2]+1,d=s[3]-s[2]-1;e.add(u,d,[])}}e.add(s[3]+1,0,[["exit",f,t]])}return o!==void 0&&(i.end=Object.assign({},vr(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function ru(e,t,s,r,o){let i=[],n=vr(t.events,s);o&&(o.end=Object.assign({},n),i.push(["exit",o,t])),r.end=Object.assign({},n),i.push(["exit",r,t]),e.add(s+1,0,i)}function vr(e,t){let s=e[t],r=s[0]==="enter"?"start":"end";return s[1][r]}var Wb={name:"tasklistCheck",tokenize:qb};function ka(){return{text:{91:Wb}}}function qb(e,t,s){let r=this;return o;function o(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?s(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),i)}function i(h){return _e(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),n):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),n):s(h)}function n(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):s(h)}function a(h){return ie(h)?t(h):ue(h)?e.check({tokenize:Kb},t,s)(h):s(h)}}function Kb(e,t,s){return he(e,r,"whitespace");function r(o){return o===null?s(o):t(o)}}function iu(e){return Ii([_a(),ya(),wa(e),Sa(),ka()])}var Gb={};function an(e){let t=this,s=e||Gb,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),n=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(iu(s)),i.push(ga()),n.push(va(s))}var Ce=require("@deepseek-ai/dsh-client-ui-primitives");var Ft="application/x-dsh-remote-files";function hn(e){return e.kind==="directory"||e.navigable===!0}function ei(e,t){return e.endpointId===t.endpointId&&ln(e.directory)===ln(t.directory)}function ti(e,t,s){if(e.endpointId!==s.endpointId)return!0;let r=ln(s.directory);return!t.some(o=>{let i=ln(o);return r===i||r.startsWith(`${i}/`)})}function si(e,t){return ei(e,t)?"none":ti(e,e.paths,t)?e.endpointId===t.endpointId?"move":"copy":"invalid"}function br(e){try{let t=JSON.parse(e);return typeof t.paneId=="string"&&typeof t.endpointId=="string"&&typeof t.directory=="string"&&Array.isArray(t.paths)&&t.paths.every(s=>typeof s=="string")?{paneId:t.paneId,endpointId:t.endpointId,directory:t.directory,paths:t.paths}:void 0}catch{return}}function ln(e){return e.replaceAll("\\","/").replace(/\/{2,}/g,"/").replace(/\/$/,"")||"/"}async function cn(e,t){let s=si(e,t);if(s==="none")return{operation:s};if(s==="invalid")throw new Error("\u4E0D\u80FD\u628A\u76EE\u5F55\u79FB\u52A8\u5230\u81EA\u8EAB\u6216\u5176\u5B50\u76EE\u5F55");if(s==="move")return await Ul({paneId:t.paneId,endpointId:t.endpointId,sourceDirectory:e.directory,destinationDirectory:t.directory,paths:e.paths}),{operation:s};let r=await Nr({sourceEndpointId:e.endpointId,sourcePaths:e.paths,destinationEndpointId:t.endpointId,destinationDirectory:t.directory,conflictPolicy:"fail"});return{operation:s,job:r}}var Sl=require("react"),Ar=require("@deepseek-ai/dsh-client-ui-primitives");var Me=require("react"),Kt=require("@deepseek-ai/dsh-client-ui-primitives");var $t=require("react"),ri=require("react/jsx-runtime"),Xb=28;function Ca(e,t,s){return Math.min(Math.max(e,t),s)}function _r(){let e=(0,$t.useRef)(null),t=(0,$t.useRef)(void 0),s=(0,$t.useRef)(void 0),r=(0,$t.useCallback)(()=>{t.current=void 0;let n=e.current,a=s.current;if(n===null||a===void 0)return;let h=n.getBoundingClientRect(),l=Ca(a.clientX-h.left,0,h.width),c=Ca(a.clientY-h.top,0,h.height),f=Math.min(l,h.width-l,c,h.height-c),v=Ca(1-f/Xb,0,1),g=Math.atan2(c-h.height/2,l-h.width/2)*(180/Math.PI)+90;n.style.setProperty("--ssh-border-glow-proximity",v.toFixed(3)),n.style.setProperty("--ssh-border-glow-angle",`${g.toFixed(2)}deg`)},[]),o=(0,$t.useCallback)(n=>{s.current={clientX:n.clientX,clientY:n.clientY},t.current===void 0&&(t.current=requestAnimationFrame(r))},[r]),i=(0,$t.useCallback)(()=>{s.current=void 0;let n=e.current;n!==null&&n.style.setProperty("--ssh-border-glow-proximity","0")},[]);return(0,$t.useEffect)(()=>()=>{t.current!==void 0&&cancelAnimationFrame(t.current)},[]),{ref:e,onPointerMove:o,onPointerLeave:i}}function nu({children:e,className:t}){let s=_r();return(0,ri.jsxs)("div",{ref:s.ref,className:`dsh-ssh-border-glow${t===void 0?"":` ${t}`}`,onPointerMove:s.onPointerMove,onPointerLeave:s.onPointerLeave,children:[(0,ri.jsx)("span",{className:"dsh-ssh-border-glow-edge","aria-hidden":"true"}),(0,ri.jsx)("div",{className:"dsh-ssh-border-glow-inner",children:e})]})}var Ea=require("react/jsx-runtime");function Jb(e,t){let s=e.trim().replace(/^#/,"");if(/^[\da-f]{3}$/i.test(s)){let[r="0",o="0",i="0"]=s;return`rgba(${parseInt(r+r,16)}, ${parseInt(o+o,16)}, ${parseInt(i+i,16)}, ${t})`}return/^[\da-f]{6}$/i.test(s)?`rgba(${parseInt(s.slice(0,2),16)}, ${parseInt(s.slice(2,4),16)}, ${parseInt(s.slice(4,6),16)}, ${t})`:`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`}function ou({children:e,className:t,glareColor:s="#ffffff",glareOpacity:r=.28,glareAngle:o=-30,glareSize:i=300,transitionDuration:n=800}){let a={"--dsh-ssh-glare-angle":`${o}deg`,"--dsh-ssh-glare-color":Jb(s,r),"--dsh-ssh-glare-duration":`${n}ms`,"--dsh-ssh-glare-size":`${i}px`};return(0,Ea.jsx)("div",{className:`dsh-ssh-glare-hover${t===void 0?"":` ${t}`}`,style:a,children:(0,Ea.jsx)("div",{className:"dsh-ssh-glare-hover-inner",children:e})})}var _l=require("react");function ss(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mu(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ft={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},hi={duration:.5,overwrite:!1,delay:0},ja,Xe,Ae,Rt=1e8,Te=1/Rt,Oa=Math.PI*2,Yb=Oa/4,Qb=0,gu=Math.sqrt,Zb=Math.cos,e_=Math.sin,qe=function(t){return typeof t=="string"},Ne=function(t){return typeof t=="function"},is=function(t){return typeof t=="number"},xn=function(t){return typeof t>"u"},jt=function(t){return typeof t=="object"},pt=function(t){return t!==!1},Wa=function(){return typeof window<"u"},dn=function(t){return Ne(t)||qe(t)},vu=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},st=Array.isArray,t_=/random\([^)]+\)/g,s_=/,\s*/g,au=/(?:-?\.?\d|\.)+/gi,qa=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Ys=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ta=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ka=/[+-]=-?[.\d]+/,r_=/[^,'"\[\]\s]+/gi,i_=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Le,Ut,Ma,Ga,xt={},mn={},bu,_u=function(t){return(mn=yr(t,xt))&&rt},yn=function(t,s){return console.warn("Invalid property",t,"set to",s,"Missing plugin? gsap.registerPlugin()")},ci=function(t,s){return!s&&console.warn(t)},xu=function(t,s){return t&&(xt[t]=s)&&mn&&(mn[t]=s)||xt},di=function(){return 0},n_={suppressEvents:!0,isStart:!0,kill:!1},un={suppressEvents:!0,kill:!1},o_={suppressEvents:!0},Xa={},bs=[],Fa={},yu,dt={},Pa={},lu=30,pn=[],Ja="",Ya=function(t){var s=t[0],r,o;if(jt(s)||Ne(s)||(t=[t]),!(r=(s._gsap||{}).harness)){for(o=pn.length;o--&&!pn[o].targetTest(s););r=pn[o]}for(o=t.length;o--;)t[o]&&(t[o]._gsap||(t[o]._gsap=new tl(t[o],r)))||t.splice(o,1);return t},_s=function(t){return t._gsap||Ya(At(t))[0]._gsap},Qa=function(t,s,r){return(r=t[s])&&Ne(r)?t[s]():xn(r)&&t.getAttribute&&t.getAttribute(s)||r},nt=function(t,s){return(t=t.split(",")).forEach(s)||t},ze=function(t){return Math.round(t*1e5)/1e5||0},Ie=function(t){return Math.round(t*1e7)/1e7||0},Qs=function(t,s){var r=s.charAt(0),o=parseFloat(s.substr(2));return t=parseFloat(t),r==="+"?t+o:r==="-"?t-o:r==="*"?t*o:t/o},a_=function(t,s){for(var r=s.length,o=0;t.indexOf(s[o])<0&&++o<r;);return o<r},gn=function(){var t=bs.length,s=bs.slice(0),r,o;for(Fa={},bs.length=0,r=0;r<t;r++)o=s[r],o&&o._lazy&&(o.render(o._lazy[0],o._lazy[1],!0)._lazy=0)},Za=function(t){return!!(t._initted||t._startAt||t.add)},wu=function(t,s,r,o){bs.length&&!Xe&&gn(),t.render(s,r,o||!!(Xe&&s<0&&Za(t))),bs.length&&!Xe&&gn()},Su=function(t){var s=parseFloat(t);return(s||s===0)&&(t+"").match(r_).length<2?s:qe(t)?t.trim():t},ku=function(t){return t},yt=function(t,s){for(var r in s)r in t||(t[r]=s[r]);return t},l_=function(t){return function(s,r){for(var o in r)o in s||o==="duration"&&t||o==="ease"||(s[o]=r[o])}},yr=function(t,s){for(var r in s)t[r]=s[r];return t},hu=function e(t,s){for(var r in s)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(t[r]=jt(s[r])?e(t[r]||(t[r]={}),s[r]):s[r]);return t},vn=function(t,s){var r={},o;for(o in t)o in s||(r[o]=t[o]);return r},oi=function(t){var s=t.parent||Le,r=t.keyframes?l_(st(t.keyframes)):yt;if(pt(t.inherit))for(;s;)r(t,s.vars.defaults),s=s.parent||s._dp;return t},h_=function(t,s){for(var r=t.length,o=r===s.length;o&&r--&&t[r]===s[r];);return r<0},Cu=function(t,s,r,o,i){r===void 0&&(r="_first"),o===void 0&&(o="_last");var n=t[o],a;if(i)for(a=s[i];n&&n[i]>a;)n=n._prev;return n?(s._next=n._next,n._next=s):(s._next=t[r],t[r]=s),s._next?s._next._prev=s:t[o]=s,s._prev=n,s.parent=s._dp=t,s},wn=function(t,s,r,o){r===void 0&&(r="_first"),o===void 0&&(o="_last");var i=s._prev,n=s._next;i?i._next=n:t[r]===s&&(t[r]=n),n?n._prev=i:t[o]===s&&(t[o]=i),s._next=s._prev=s.parent=null},xs=function(t,s){t.parent&&(!s||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Gs=function(t,s){if(t&&(!s||s._end>t._dur||s._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t},c_=function(t){for(var s=t.parent;s&&s.parent;)s._dirty=1,s.totalDuration(),s=s.parent;return t},Ba=function(t,s,r,o){return t._startAt&&(Xe?t._startAt.revert(un):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(s,!0,o))},d_=function e(t){return!t||t._ts&&e(t.parent)},cu=function(t){return t._repeat?wr(t._tTime,t=t.duration()+t._rDelay)*t:0},wr=function(t,s){var r=Math.floor(t=Ie(t/s));return t&&r===t?r-1:r},bn=function(t,s){return(t-s._start)*s._ts+(s._ts>=0?0:s._dirty?s.totalDuration():s._tDur)},Sn=function(t){return t._end=Ie(t._start+(t._tDur/Math.abs(t._ts||t._rts||Te)||0))},kn=function(t,s){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=Ie(r._time-(t._ts>0?s/t._ts:((t._dirty?t.totalDuration():t._tDur)-s)/-t._ts)),Sn(t),r._dirty||Gs(r,t)),t},Eu=function(t,s){var r;if((s._time||!s._dur&&s._initted||s._start<t._time&&(s._dur||!s.add))&&(r=bn(t.rawTime(),s),(!s._dur||fi(0,s.totalDuration(),r)-s._tTime>Te)&&s.render(r,!0)),Gs(t,s)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;t._zTime=-Te}},Vt=function(t,s,r,o){return s.parent&&xs(s),s._start=Ie((is(r)?r:r||t!==Le?Dt(t,r,s):t._time)+s._delay),s._end=Ie(s._start+(s.totalDuration()/Math.abs(s.timeScale())||0)),Cu(t,s,"_first","_last",t._sort?"_start":0),Na(s)||(t._recent=s),o||Eu(t,s),t._ts<0&&kn(t,t._tTime),t},Tu=function(t,s){return(xt.ScrollTrigger||yn("scrollTrigger",s))&&xt.ScrollTrigger.create(s,t)},Pu=function(t,s,r,o,i){if(il(t,s,i),!t._initted)return 1;if(!r&&t._pt&&!Xe&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&yu!==ut.frame)return bs.push(t),t._lazy=[i,o],1},u_=function e(t){var s=t.parent;return s&&s._ts&&s._initted&&!s._lock&&(s.rawTime()<0||e(s))},Na=function(t){var s=t.data;return s==="isFromStart"||s==="isStart"},p_=function(t,s,r,o){var i=t.ratio,n=s<0||!s&&(!t._start&&u_(t)&&!(!t._initted&&Na(t))||(t._ts<0||t._dp._ts<0)&&!Na(t))?0:1,a=t._rDelay,h=0,l,c,f;if(a&&t._repeat&&(h=fi(0,t._tDur,s),c=wr(h,a),t._yoyo&&c&1&&(n=1-n),c!==wr(t._tTime,a)&&(i=1-n,t.vars.repeatRefresh&&t._initted&&t.invalidate())),n!==i||Xe||o||t._zTime===Te||!s&&t._zTime){if(!t._initted&&Pu(t,s,o,r,h))return;for(f=t._zTime,t._zTime=s||(r?Te:0),r||(r=s&&!f),t.ratio=n,t._from&&(n=1-n),t._time=0,t._tTime=h,l=t._pt;l;)l.r(n,l.d),l=l._next;s<0&&Ba(t,s,r,!0),t._onUpdate&&!r&&_t(t,"onUpdate"),h&&t._repeat&&!r&&t.parent&&_t(t,"onRepeat"),(s>=t._tDur||s<0)&&t.ratio===n&&(n&&xs(t,1),!r&&!Xe&&(_t(t,n?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=s)},f_=function(t,s,r){var o;if(r>s)for(o=t._first;o&&o._start<=r;){if(o.data==="isPause"&&o._start>s)return o;o=o._next}else for(o=t._last;o&&o._start>=r;){if(o.data==="isPause"&&o._start<s)return o;o=o._prev}},Sr=function(t,s,r,o){var i=t._repeat,n=Ie(s)||0,a=t._tTime/t._tDur;return a&&!o&&(t._time*=n/t._dur),t._dur=n,t._tDur=i?i<0?1e10:Ie(n*(i+1)+t._rDelay*i):n,a>0&&!o&&kn(t,t._tTime=t._tDur*a),t.parent&&Sn(t),r||Gs(t.parent,t),t},du=function(t){return t instanceof tt?Gs(t):Sr(t,t._dur)},m_={_start:0,endTime:di,totalDuration:di},Dt=function e(t,s,r){var o=t.labels,i=t._recent||m_,n=t.duration()>=Rt?i.endTime(!1):t._dur,a,h,l;return qe(s)&&(isNaN(s)||s in o)?(h=s.charAt(0),l=s.substr(-1)==="%",a=s.indexOf("="),h==="<"||h===">"?(a>=0&&(s=s.replace(/=/,"")),(h==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(s.substr(1))||0)*(l?(a<0?i:r).totalDuration()/100:1)):a<0?(s in o||(o[s]=n),o[s]):(h=parseFloat(s.charAt(a-1)+s.substr(a+1)),l&&r&&(h=h/100*(st(r)?r[0]:r).totalDuration()),a>1?e(t,s.substr(0,a-1),r)+h:n+h)):s==null?n:+s},ai=function(t,s,r){var o=is(s[1]),i=(o?2:1)+(t<2?0:1),n=s[i],a,h;if(o&&(n.duration=s[1]),n.parent=r,t){for(a=n,h=r;h&&!("immediateRender"in a);)a=h.vars.defaults||{},h=pt(h.vars.inherit)&&h.parent;n.immediateRender=pt(a.immediateRender),t<2?n.runBackwards=1:n.startAt=s[i-1]}return new Ue(s[0],n,s[i+1])},ys=function(t,s){return t||t===0?s(t):s},fi=function(t,s,r){return r<t?t:r>s?s:r},Je=function(t,s){return!qe(t)||!(s=i_.exec(t))?"":s[1]},g_=function(t,s,r){return ys(r,function(o){return fi(t,s,o)})},za=[].slice,Du=function(t,s){return t&&jt(t)&&"length"in t&&(!s&&!t.length||t.length-1 in t&&jt(t[0]))&&!t.nodeType&&t!==Ut},v_=function(t,s,r){return r===void 0&&(r=[]),t.forEach(function(o){var i;return qe(o)&&!s||Du(o,1)?(i=r).push.apply(i,At(o)):r.push(o)})||r},At=function(t,s,r){return Ae&&!s&&Ae.selector?Ae.selector(t):qe(t)&&!r&&(Ma||!kr())?za.call((s||Ga).querySelectorAll(t),0):st(t)?v_(t,r):Du(t)?za.call(t,0):t?[t]:[]},Ha=function(t){return t=At(t)[0]||ci("Invalid scope")||{},function(s){var r=t.current||t.nativeElement||t;return At(s,r.querySelectorAll?r:r===t?ci("Invalid scope")||Ga.createElement("div"):t)}},Ru=function(t){return t.sort(function(){return .5-Math.random()})},Au=function(t){if(Ne(t))return t;var s=jt(t)?t:{each:t},r=Xs(s.ease),o=s.from||0,i=parseFloat(s.base)||0,n={},a=o>0&&o<1,h=isNaN(o)||a,l=s.axis,c=o,f=o;return qe(o)?c=f={center:.5,edges:.5,end:1}[o]||0:!a&&h&&(c=o[0],f=o[1]),function(v,g,u){var d=(u||s).length,m=n[d],p,b,x,y,S,_,w,C,P;if(!m){if(P=s.grid==="auto"?0:(s.grid||[1,Rt])[1],!P){for(w=-Rt;w<(w=u[P++].getBoundingClientRect().left)&&P<d;);P<d&&P--}for(m=n[d]=[],p=h?Math.min(P,d)*c-.5:o%P,b=P===Rt?0:h?d*f/P-.5:o/P|0,w=0,C=Rt,_=0;_<d;_++)x=_%P-p,y=b-(_/P|0),m[_]=S=l?Math.abs(l==="y"?y:x):gu(x*x+y*y),S>w&&(w=S),S<C&&(C=S);o==="random"&&Ru(m),m.max=w-C,m.min=C,m.v=d=(parseFloat(s.amount)||parseFloat(s.each)*(P>d?d-1:l?l==="y"?d/P:P:Math.max(P,d/P))||0)*(o==="edges"?-1:1),m.b=d<0?i-d:i,m.u=Je(s.amount||s.each)||0,r=r&&d<0?R_(r):r}return d=(m[v]-m.min)/m.max||0,Ie(m.b+(r?r(d):d)*m.v)+m.u}},$a=function(t){var s=Math.pow(10,((t+"").split(".")[1]||"").length);return function(r){var o=Ie(Math.round(parseFloat(r)/t)*t*s);return(o-o%1)/s+(is(r)?0:Je(r))}},Iu=function(t,s){var r=st(t),o,i;return!r&&jt(t)&&(o=r=t.radius||Rt,t.values?(t=At(t.values),(i=!is(t[0]))&&(o*=o)):t=$a(t.increment)),ys(s,r?Ne(t)?function(n){return i=t(n),Math.abs(i-n)<=o?i:n}:function(n){for(var a=parseFloat(i?n.x:n),h=parseFloat(i?n.y:0),l=Rt,c=0,f=t.length,v,g;f--;)i?(v=t[f].x-a,g=t[f].y-h,v=v*v+g*g):v=Math.abs(t[f]-a),v<l&&(l=v,c=f);return c=!o||l<=o?t[c]:n,i||c===n||is(n)?c:c+Je(n)}:$a(t))},Lu=function(t,s,r,o){return ys(st(t)?!s:r===!0?!!(r=0):!o,function(){return st(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(o=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(s-t+r*.99))/r)*r*o)/o})},b_=function(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return function(o){return s.reduce(function(i,n){return n(i)},o)}},__=function(t,s){return function(r){return t(parseFloat(r))+(s||Je(r))}},x_=function(t,s,r){return Mu(t,s,0,1,r)},Ou=function(t,s,r){return ys(r,function(o){return t[~~s(o)]})},y_=function e(t,s,r){var o=s-t;return st(t)?Ou(t,e(0,t.length),s):ys(r,function(i){return(o+(i-t)%o)%o+t})},w_=function e(t,s,r){var o=s-t,i=o*2;return st(t)?Ou(t,e(0,t.length-1),s):ys(r,function(n){return n=(i+(n-t)%i)%i||0,t+(n>o?i-n:n)})},Cr=function(t){return t.replace(t_,function(s){var r=s.indexOf("[")+1,o=s.substring(r||7,r?s.indexOf("]"):s.length-1).split(s_);return Lu(r?o:+o[0],r?0:+o[1],+o[2]||1e-5)})},Mu=function(t,s,r,o,i){var n=s-t,a=o-r;return ys(i,function(h){return r+((h-t)/n*a||0)})},S_=function e(t,s,r,o){var i=isNaN(t+s)?0:function(g){return(1-g)*t+g*s};if(!i){var n=qe(t),a={},h,l,c,f,v;if(r===!0&&(o=1)&&(r=null),n)t={p:t},s={p:s};else if(st(t)&&!st(s)){for(c=[],f=t.length,v=f-2,l=1;l<f;l++)c.push(e(t[l-1],t[l]));f--,i=function(u){u*=f;var d=Math.min(v,~~u);return c[d](u-d)},r=s}else o||(t=yr(st(t)?[]:{},t));if(!c){for(h in s)sl.call(a,t,h,"get",s[h]);i=function(u){return al(u,a)||(n?t.p:t)}}}return ys(r,i)},uu=function(t,s,r){var o=t.labels,i=Rt,n,a,h;for(n in o)a=o[n]-s,a<0==!!r&&a&&i>(a=Math.abs(a))&&(h=n,i=a);return h},_t=function(t,s,r){var o=t.vars,i=o[s],n=Ae,a=t._ctx,h,l,c;if(i)return h=o[s+"Params"],l=o.callbackScope||t,r&&bs.length&&gn(),a&&(Ae=a),c=h?i.apply(l,h):i.call(l),Ae=n,c},ii=function(t){return xs(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Xe),t.progress()<1&&_t(t,"onInterrupt"),t},xr,Fu=[],Bu=function(t){if(t)if(t=!t.name&&t.default||t,Wa()||t.headless){var s=t.name,r=Ne(t),o=s&&!r&&t.init?function(){this._props=[]}:t,i={init:di,render:al,add:sl,kill:H_,modifier:z_,rawVars:0},n={targetTest:0,get:0,getSetter:Cn,aliases:{},register:0};if(kr(),t!==o){if(dt[s])return;yt(o,yt(vn(t,i),n)),yr(o.prototype,yr(i,vn(t,n))),dt[o.prop=s]=o,t.targetTest&&(pn.push(o),Xa[s]=1),s=(s==="css"?"CSS":s.charAt(0).toUpperCase()+s.substr(1))+"Plugin"}xu(s,o),t.register&&t.register(rt,o,ot)}else Fu.push(t)},Ee=255,ni={aqua:[0,Ee,Ee],lime:[0,Ee,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ee],navy:[0,0,128],white:[Ee,Ee,Ee],olive:[128,128,0],yellow:[Ee,Ee,0],orange:[Ee,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ee,0,0],pink:[Ee,192,203],cyan:[0,Ee,Ee],transparent:[Ee,Ee,Ee,0]},Da=function(t,s,r){return t+=t<0?1:t>1?-1:0,(t*6<1?s+(r-s)*t*6:t<.5?r:t*3<2?s+(r-s)*(2/3-t)*6:s)*Ee+.5|0},Nu=function(t,s,r){var o=t?is(t)?[t>>16,t>>8&Ee,t&Ee]:0:ni.black,i,n,a,h,l,c,f,v,g,u;if(!o){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),ni[t])o=ni[t];else if(t.charAt(0)==="#"){if(t.length<6&&(i=t.charAt(1),n=t.charAt(2),a=t.charAt(3),t="#"+i+i+n+n+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return o=parseInt(t.substr(1,6),16),[o>>16,o>>8&Ee,o&Ee,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),o=[t>>16,t>>8&Ee,t&Ee]}else if(t.substr(0,3)==="hsl"){if(o=u=t.match(au),!s)h=+o[0]%360/360,l=+o[1]/100,c=+o[2]/100,n=c<=.5?c*(l+1):c+l-c*l,i=c*2-n,o.length>3&&(o[3]*=1),o[0]=Da(h+1/3,i,n),o[1]=Da(h,i,n),o[2]=Da(h-1/3,i,n);else if(~t.indexOf("="))return o=t.match(qa),r&&o.length<4&&(o[3]=1),o}else o=t.match(au)||ni.transparent;o=o.map(Number)}return s&&!u&&(i=o[0]/Ee,n=o[1]/Ee,a=o[2]/Ee,f=Math.max(i,n,a),v=Math.min(i,n,a),c=(f+v)/2,f===v?h=l=0:(g=f-v,l=c>.5?g/(2-f-v):g/(f+v),h=f===i?(n-a)/g+(n<a?6:0):f===n?(a-i)/g+2:(i-n)/g+4,h*=60),o[0]=~~(h+.5),o[1]=~~(l*100+.5),o[2]=~~(c*100+.5)),r&&o.length<4&&(o[3]=1),o},zu=function(t){var s=[],r=[],o=-1;return t.split(rs).forEach(function(i){var n=i.match(Ys)||[];s.push.apply(s,n),r.push(o+=n.length+1)}),s.c=r,s},pu=function(t,s,r){var o="",i=(t+o).match(rs),n=s?"hsla(":"rgba(",a=0,h,l,c,f;if(!i)return t;if(i=i.map(function(v){return(v=Nu(v,s,1))&&n+(s?v[0]+","+v[1]+"%,"+v[2]+"%,"+v[3]:v.join(","))+")"}),r&&(c=zu(t),h=r.c,h.join(o)!==c.c.join(o)))for(l=t.replace(rs,"1").split(Ys),f=l.length-1;a<f;a++)o+=l[a]+(~h.indexOf(a)?i.shift()||n+"0,0,0,0)":(c.length?c:i.length?i:r).shift());if(!l)for(l=t.split(rs),f=l.length-1;a<f;a++)o+=l[a]+i[a];return o+l[f]},rs=(function(){var e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in ni)e+="|"+t+"\\b";return new RegExp(e+")","gi")})(),k_=/hsl[a]?\(/,el=function(t){var s=t.join(" "),r;if(rs.lastIndex=0,rs.test(s))return r=k_.test(s),t[1]=pu(t[1],r),t[0]=pu(t[0],r,zu(t[1])),!0},ui,ut=(function(){var e=Date.now,t=500,s=33,r=e(),o=r,i=1e3/240,n=i,a=[],h,l,c,f,v,g,u=function d(m){var p=e()-o,b=m===!0,x,y,S,_;if((p>t||p<0)&&(r+=p-s),o+=p,S=o-r,x=S-n,(x>0||b)&&(_=++f.frame,v=S-f.time*1e3,f.time=S=S/1e3,n+=x+(x>=i?4:i-x),y=1),b||(h=l(d)),y)for(g=0;g<a.length;g++)a[g](S,v,_,m)};return f={time:0,frame:0,tick:function(){u(!0)},deltaRatio:function(m){return v/(1e3/(m||60))},wake:function(){bu&&(!Ma&&Wa()&&(Ut=Ma=window,Ga=Ut.document||{},xt.gsap=rt,(Ut.gsapVersions||(Ut.gsapVersions=[])).push(rt.version),_u(mn||Ut.GreenSockGlobals||!Ut.gsap&&Ut||{}),Fu.forEach(Bu)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&f.sleep(),l=c||function(m){return setTimeout(m,n-f.time*1e3+1|0)},ui=1,u(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(h),ui=0,l=di},lagSmoothing:function(m,p){t=m||1/0,s=Math.min(p||33,t)},fps:function(m){i=1e3/(m||240),n=f.time*1e3+i},add:function(m,p,b){var x=p?function(y,S,_,w){m(y,S,_,w),f.remove(x)}:m;return f.remove(m),a[b?"unshift":"push"](x),kr(),x},remove:function(m,p){~(p=a.indexOf(m))&&a.splice(p,1)&&g>=p&&g--},_listeners:a},f})(),kr=function(){return!ui&&ut.wake()},we={},C_=/^[\d.\-M][\d.\-,\s]/,E_=/["']/g,T_=function(t){for(var s={},r=t.substr(1,t.length-3).split(":"),o=r[0],i=1,n=r.length,a,h,l;i<n;i++)h=r[i],a=i!==n-1?h.lastIndexOf(","):h.length,l=h.substr(0,a),s[o]=isNaN(l)?l.replace(E_,"").trim():+l,o=h.substr(a+1).trim();return s},P_=function(t){var s=t.indexOf("(")+1,r=t.indexOf(")"),o=t.indexOf("(",s);return t.substring(s,~o&&o<r?t.indexOf(")",r+1):r)},D_=function(t){var s=(t+"").split("("),r=we[s[0]];return r&&s.length>1&&r.config?r.config.apply(null,~t.indexOf("{")?[T_(s[1])]:P_(t).split(",").map(Su)):we._CE&&C_.test(t)?we._CE("",t):r},R_=function(t){return function(s){return 1-t(1-s)}},Xs=function(t,s){return t&&(Ne(t)?t:we[t]||D_(t))||s},Zs=function(t,s,r,o){r===void 0&&(r=function(h){return 1-s(1-h)}),o===void 0&&(o=function(h){return h<.5?s(h*2)/2:1-s((1-h)*2)/2});var i={easeIn:s,easeOut:r,easeInOut:o},n;return nt(t,function(a){we[a]=xt[a]=i,we[n=a.toLowerCase()]=r;for(var h in i)we[n+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=we[a+"."+h]=i[h]}),i},Hu=function(t){return function(s){return s<.5?(1-t(1-s*2))/2:.5+t((s-.5)*2)/2}},Ra=function e(t,s,r){var o=s>=1?s:1,i=(r||(t?.3:.45))/(s<1?s:1),n=i/Oa*(Math.asin(1/o)||0),a=function(c){return c===1?1:o*Math.pow(2,-10*c)*e_((c-n)*i)+1},h=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:Hu(a);return i=Oa/i,h.config=function(l,c){return e(t,l,c)},h},Aa=function e(t,s){s===void 0&&(s=1.70158);var r=function(n){return n?--n*n*((s+1)*n+s)+1:0},o=t==="out"?r:t==="in"?function(i){return 1-r(1-i)}:Hu(r);return o.config=function(i){return e(t,i)},o};nt("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var s=t<5?t+1:t;Zs(e+",Power"+(s-1),t?function(r){return Math.pow(r,s)}:function(r){return r},function(r){return 1-Math.pow(1-r,s)},function(r){return r<.5?Math.pow(r*2,s)/2:1-Math.pow((1-r)*2,s)/2})});we.Linear.easeNone=we.none=we.Linear.easeIn;Zs("Elastic",Ra("in"),Ra("out"),Ra());(function(e,t){var s=1/t,r=2*s,o=2.5*s,i=function(a){return a<s?e*a*a:a<r?e*Math.pow(a-1.5/t,2)+.75:a<o?e*(a-=2.25/t)*a+.9375:e*Math.pow(a-2.625/t,2)+.984375};Zs("Bounce",function(n){return 1-i(1-n)},i)})(7.5625,2.75);Zs("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)});Zs("Circ",function(e){return-(gu(1-e*e)-1)});Zs("Sine",function(e){return e===1?1:-Zb(e*Yb)+1});Zs("Back",Aa("in"),Aa("out"),Aa());we.SteppedEase=we.steps=xt.SteppedEase={config:function(t,s){t===void 0&&(t=1);var r=1/t,o=t+(s?0:1),i=s?1:0,n=1-Te;return function(a){return((o*fi(0,n,a)|0)+i)*r}}};hi.ease=we["quad.out"];nt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return Ja+=e+","+e+"Params,"});var tl=function(t,s){this.id=Qb++,t._gsap=this,this.target=t,this.harness=s,this.get=s?s.get:Qa,this.set=s?s.getSetter:Cn},pi=(function(){function e(s){this.vars=s,this._delay=+s.delay||0,(this._repeat=s.repeat===1/0?-2:s.repeat||0)&&(this._rDelay=s.repeatDelay||0,this._yoyo=!!s.yoyo||!!s.yoyoEase),this._ts=1,Sr(this,+s.duration,1,1),this.data=s.data,Ae&&(this._ctx=Ae,Ae.data.push(this)),ui||ut.wake()}var t=e.prototype;return t.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},t.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},t.totalDuration=function(r){return arguments.length?(this._dirty=0,Sr(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(r,o){if(kr(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(kn(this,r),!i._dp||i.parent||Eu(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Vt(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!o||this._initted&&Math.abs(this._zTime)===Te||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),wu(this,r,o)),this},t.time=function(r,o){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+cu(this))%(this._dur+this._rDelay)||(r?this._dur:0),o):this._time},t.totalProgress=function(r,o){return arguments.length?this.totalTime(this.totalDuration()*r,o):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(r,o){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+cu(this),o):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(r,o){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*i,o):this._repeat?wr(this._tTime,i)+1:1},t.timeScale=function(r,o){if(!arguments.length)return this._rts===-Te?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?bn(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Te?0:this._rts,this.totalTime(fi(-Math.abs(this._delay),this.totalDuration(),i),o!==!1),Sn(this),c_(this)},t.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(kr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Te&&(this._tTime-=Te)))),this):this._ps},t.startTime=function(r){if(arguments.length){this._start=Ie(r);var o=this.parent||this._dp;return o&&(o._sort||!this.parent)&&Vt(o,this,this._start-this._delay),this}return this._start},t.endTime=function(r){return this._start+(pt(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(r){var o=this.parent||this._dp;return o?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?bn(o.rawTime(r),this):this._tTime:this._tTime},t.revert=function(r){r===void 0&&(r=o_);var o=Xe;return Xe=r,Za(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Xe=o,this},t.globalTime=function(r){for(var o=this,i=arguments.length?r:o.rawTime();o;)i=o._start+i/(Math.abs(o._ts)||1),o=o._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},t.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,du(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(r){if(arguments.length){var o=this._time;return this._rDelay=r,du(this),o?this.time(o):this}return this._rDelay},t.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},t.seek=function(r,o){return this.totalTime(Dt(this,r),pt(o))},t.restart=function(r,o){return this.play().totalTime(r?-this._delay:0,pt(o)),this._dur||(this._zTime=-Te),this},t.play=function(r,o){return r!=null&&this.seek(r,o),this.reversed(!1).paused(!1)},t.reverse=function(r,o){return r!=null&&this.seek(r||this.totalDuration(),o),this.reversed(!0).paused(!1)},t.pause=function(r,o){return r!=null&&this.seek(r,o),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-Te:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Te,this},t.isActive=function(){var r=this.parent||this._dp,o=this._start,i;return!!(!r||this._ts&&this._initted&&r.isActive()&&(i=r.rawTime(!0))>=o&&i<this.endTime(!0)-Te)},t.eventCallback=function(r,o,i){var n=this.vars;return arguments.length>1?(o?(n[r]=o,i&&(n[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=o)):delete n[r],this):n[r]},t.then=function(r){var o=this,i=o._prom;return new Promise(function(n){var a=Ne(r)?r:ku,h=function(){var c=o.then;o.then=null,i&&i(),Ne(a)&&(a=a(o))&&(a.then||a===o)&&(o.then=c),n(a),o.then=c};o._initted&&o.totalProgress()===1&&o._ts>=0||!o._tTime&&o._ts<0?h():o._prom=h})},t.kill=function(){ii(this)},e})();yt(pi.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Te,_prom:0,_ps:!1,_rts:1});var tt=(function(e){mu(t,e);function t(r,o){var i;return r===void 0&&(r={}),i=e.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=pt(r.sortChildren),Le&&Vt(r.parent||Le,ss(i),o),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&Tu(ss(i),r.scrollTrigger),i}var s=t.prototype;return s.to=function(o,i,n){return ai(0,arguments,this),this},s.from=function(o,i,n){return ai(1,arguments,this),this},s.fromTo=function(o,i,n,a){return ai(2,arguments,this),this},s.set=function(o,i,n){return i.duration=0,i.parent=this,oi(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Ue(o,i,Dt(this,n),1),this},s.call=function(o,i,n){return Vt(this,Ue.delayedCall(0,o,i),n)},s.staggerTo=function(o,i,n,a,h,l,c){return n.duration=i,n.stagger=n.stagger||a,n.onComplete=l,n.onCompleteParams=c,n.parent=this,new Ue(o,n,Dt(this,h)),this},s.staggerFrom=function(o,i,n,a,h,l,c){return n.runBackwards=1,oi(n).immediateRender=pt(n.immediateRender),this.staggerTo(o,i,n,a,h,l,c)},s.staggerFromTo=function(o,i,n,a,h,l,c,f){return a.startAt=n,oi(a).immediateRender=pt(a.immediateRender),this.staggerTo(o,i,a,h,l,c,f)},s.render=function(o,i,n){var a=this._time,h=this._dirty?this.totalDuration():this._tDur,l=this._dur,c=o<=0?0:Ie(o),f=this._zTime<0!=o<0&&(this._initted||!l),v,g,u,d,m,p,b,x,y,S,_,w;if(this!==Le&&c>h&&o>=0&&(c=h),c!==this._tTime||n||f){if(a!==this._time&&l&&(c+=this._time-a,o+=this._time-a),v=c,y=this._start,x=this._ts,p=!x,f&&(l||(a=this._zTime),(o||!i)&&(this._zTime=o)),this._repeat){if(_=this._yoyo,m=l+this._rDelay,this._repeat<-1&&o<0)return this.totalTime(m*100+o,i,n);if(v=Ie(c%m),c===h?(d=this._repeat,v=l):(S=Ie(c/m),d=~~S,d&&d===S&&(v=l,d--),v>l&&(v=l)),S=wr(this._tTime,m),!a&&this._tTime&&S!==d&&this._tTime-S*m-this._dur<=0&&(S=d),_&&d&1&&(v=l-v,w=1),d!==S&&!this._lock){var C=_&&S&1,P=C===(_&&d&1);if(d<S&&(C=!C),a=C?0:c%l?l:c,this._lock=1,this.render(a||(w?0:Ie(d*m)),i,!l)._lock=0,this._tTime=c,!i&&this.parent&&_t(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1,S=d),a&&a!==this._time||p!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,h=this._tDur,P&&(this._lock=2,a=C?l:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!p)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=f_(this,Ie(a),Ie(v)),b&&(c-=v-(v=b._start))),this._tTime=c,this._time=v,this._act=!!x,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=o,a=0),!a&&c&&l&&!i&&!S&&(_t(this,"onStart"),this._tTime!==c))return this;if(v>=a&&o>=0)for(g=this._first;g;){if(u=g._next,(g._act||v>=g._start)&&g._ts&&b!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(v-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(v-g._start)*g._ts,i,n),v!==this._time||!this._ts&&!p){b=0,u&&(c+=this._zTime=-Te);break}}g=u}else{g=this._last;for(var T=o<0?o:v;g;){if(u=g._prev,(g._act||T<=g._end)&&g._ts&&b!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(T-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(T-g._start)*g._ts,i,n||Xe&&Za(g)),v!==this._time||!this._ts&&!p){b=0,u&&(c+=this._zTime=T?-Te:Te);break}}g=u}}if(b&&!i&&(this.pause(),b.render(v>=a?0:-Te)._zTime=v>=a?1:-1,this._ts))return this._start=y,Sn(this),this.render(o,i,n);this._onUpdate&&!i&&_t(this,"onUpdate",!0),(c===h&&this._tTime>=this.totalDuration()||!c&&a)&&(y===this._start||Math.abs(x)!==Math.abs(this._ts))&&(this._lock||((o||!l)&&(c===h&&this._ts>0||!c&&this._ts<0)&&xs(this,1),!i&&!(o<0&&!a)&&(c||a||!h)&&(_t(this,c===h&&o>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<h&&this.timeScale()>0)&&this._prom())))}return this},s.add=function(o,i){var n=this;if(is(i)||(i=Dt(this,i,o)),!(o instanceof pi)){if(st(o))return o.forEach(function(a){return n.add(a,i)}),this;if(qe(o))return this.addLabel(o,i);if(Ne(o))o=Ue.delayedCall(0,o);else return this}return this!==o?Vt(this,o,i):this},s.getChildren=function(o,i,n,a){o===void 0&&(o=!0),i===void 0&&(i=!0),n===void 0&&(n=!0),a===void 0&&(a=-Rt);for(var h=[],l=this._first;l;)l._start>=a&&(l instanceof Ue?i&&h.push(l):(n&&h.push(l),o&&h.push.apply(h,l.getChildren(!0,i,n)))),l=l._next;return h},s.getById=function(o){for(var i=this.getChildren(1,1,1),n=i.length;n--;)if(i[n].vars.id===o)return i[n]},s.remove=function(o){return qe(o)?this.removeLabel(o):Ne(o)?this.killTweensOf(o):(o.parent===this&&wn(this,o),o===this._recent&&(this._recent=this._last),Gs(this))},s.totalTime=function(o,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ie(ut.time-(this._ts>0?o/this._ts:(this.totalDuration()-o)/-this._ts))),e.prototype.totalTime.call(this,o,i),this._forcing=0,this):this._tTime},s.addLabel=function(o,i){return this.labels[o]=Dt(this,i),this},s.removeLabel=function(o){return delete this.labels[o],this},s.addPause=function(o,i,n){var a=Ue.delayedCall(0,i||di,n);return a.data="isPause",this._hasPause=1,Vt(this,a,Dt(this,o))},s.removePause=function(o){var i=this._first;for(o=Dt(this,o);i;)i._start===o&&i.data==="isPause"&&xs(i),i=i._next},s.killTweensOf=function(o,i,n){for(var a=this.getTweensOf(o,n),h=a.length;h--;)vs!==a[h]&&a[h].kill(o,i);return this},s.getTweensOf=function(o,i){for(var n=[],a=At(o),h=this._first,l=is(i),c;h;)h instanceof Ue?a_(h._targets,a)&&(l?(!vs||h._initted&&h._ts)&&h.globalTime(0)<=i&&h.globalTime(h.totalDuration())>i:!i||h.isActive())&&n.push(h):(c=h.getTweensOf(a,i)).length&&n.push.apply(n,c),h=h._next;return n},s.tweenTo=function(o,i){i=i||{};var n=this,a=Dt(n,o),h=i,l=h.startAt,c=h.onStart,f=h.onStartParams,v=h.immediateRender,g,u=Ue.to(n,yt({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale())||Te,onStart:function(){if(n.pause(),!g){var m=i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale());u._dur!==m&&Sr(u,m,0,1).render(u._time,!0,!0),g=1}c&&c.apply(u,f||[])}},i));return v?u.render(0):u},s.tweenFromTo=function(o,i,n){return this.tweenTo(i,yt({startAt:{time:Dt(this,o)}},n))},s.recent=function(){return this._recent},s.nextLabel=function(o){return o===void 0&&(o=this._time),uu(this,Dt(this,o))},s.previousLabel=function(o){return o===void 0&&(o=this._time),uu(this,Dt(this,o),1)},s.currentLabel=function(o){return arguments.length?this.seek(o,!0):this.previousLabel(this._time+Te)},s.shiftChildren=function(o,i,n){n===void 0&&(n=0);var a=this._first,h=this.labels,l;for(o=Ie(o);a;)a._start>=n&&(a._start+=o,a._end+=o),a=a._next;if(i)for(l in h)h[l]>=n&&(h[l]+=o);return Gs(this)},s.invalidate=function(o){var i=this._first;for(this._lock=0;i;)i.invalidate(o),i=i._next;return e.prototype.invalidate.call(this,o)},s.clear=function(o){o===void 0&&(o=!0);for(var i=this._first,n;i;)n=i._next,this.remove(i),i=n;return this._dp&&(this._time=this._tTime=this._pTime=0),o&&(this.labels={}),Gs(this)},s.totalDuration=function(o){var i=0,n=this,a=n._last,h=Rt,l,c,f;if(arguments.length)return n.timeScale((n._repeat<0?n.duration():n.totalDuration())/(n.reversed()?-o:o));if(n._dirty){for(f=n.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),c=a._start,c>h&&n._sort&&a._ts&&!n._lock?(n._lock=1,Vt(n,a,c-a._delay,1)._lock=0):h=c,c<0&&a._ts&&(i-=c,(!f&&!n._dp||f&&f.smoothChildTiming)&&(n._start+=Ie(c/n._ts),n._time-=c,n._tTime-=c),n.shiftChildren(-c,!1,-1/0),h=0),a._end>i&&a._ts&&(i=a._end),a=l;Sr(n,n===Le&&n._time>i?n._time:i,1,1),n._dirty=0}return n._tDur},t.updateRoot=function(o){if(Le._ts&&(wu(Le,bn(o,Le)),yu=ut.frame),ut.frame>=lu){lu+=ft.autoSleep||120;var i=Le._first;if((!i||!i._ts)&&ft.autoSleep&&ut._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||ut.sleep()}}},t})(pi);yt(tt.prototype,{_lock:0,_hasPause:0,_forcing:0});var A_=function(t,s,r,o,i,n,a){var h=new ot(this._pt,t,s,0,1,ol,null,i),l=0,c=0,f,v,g,u,d,m,p,b;for(h.b=r,h.e=o,r+="",o+="",(p=~o.indexOf("random("))&&(o=Cr(o)),n&&(b=[r,o],n(b,t,s),r=b[0],o=b[1]),v=r.match(Ta)||[];f=Ta.exec(o);)u=f[0],d=o.substring(l,f.index),g?g=(g+1)%5:d.substr(-5)==="rgba("&&(g=1),u!==v[c++]&&(m=parseFloat(v[c-1])||0,h._pt={_next:h._pt,p:d||c===1?d:",",s:m,c:u.charAt(1)==="="?Qs(m,u)-m:parseFloat(u)-m,m:g&&g<4?Math.round:0},l=Ta.lastIndex);return h.c=l<o.length?o.substring(l,o.length):"",h.fp=a,(Ka.test(o)||p)&&(h.e=0),this._pt=h,h},sl=function(t,s,r,o,i,n,a,h,l,c){Ne(o)&&(o=o(i||0,t,n));var f=t[s],v=r!=="get"?r:Ne(f)?l?t[s.indexOf("set")||!Ne(t["get"+s.substr(3)])?s:"get"+s.substr(3)](l):t[s]():f,g=Ne(f)?l?F_:Vu:nl,u;if(qe(o)&&(~o.indexOf("random(")&&(o=Cr(o)),o.charAt(1)==="="&&(u=Qs(v,o)+(Je(v)||0),(u||u===0)&&(o=u))),!c||v!==o||Ua)return!isNaN(v*o)&&o!==""?(u=new ot(this._pt,t,s,+v||0,o-(v||0),typeof f=="boolean"?N_:ju,0,g),l&&(u.fp=l),a&&u.modifier(a,this,t),this._pt=u):(!f&&!(s in t)&&yn(s,o),A_.call(this,t,s,v,o,g,h||ft.stringFilter,l))},I_=function(t,s,r,o,i){if(Ne(t)&&(t=li(t,i,s,r,o)),!jt(t)||t.style&&t.nodeType||st(t)||vu(t))return qe(t)?li(t,i,s,r,o):t;var n={},a;for(a in t)n[a]=li(t[a],i,s,r,o);return n},rl=function(t,s,r,o,i,n){var a,h,l,c;if(dt[t]&&(a=new dt[t]).init(i,a.rawVars?s[t]:I_(s[t],o,i,n,r),r,o,n)!==!1&&(r._pt=h=new ot(r._pt,i,t,0,1,a.render,a,0,a.priority),r!==xr))for(l=r._ptLookup[r._targets.indexOf(i)],c=a._props.length;c--;)l[a._props[c]]=h;return a},vs,Ua,il=function e(t,s,r){var o=t.vars,i=o.ease,n=o.startAt,a=o.immediateRender,h=o.lazy,l=o.onUpdate,c=o.runBackwards,f=o.yoyoEase,v=o.keyframes,g=o.autoRevert,u=t._dur,d=t._startAt,m=t._targets,p=t.parent,b=p&&p.data==="nested"?p.vars.targets:m,x=t._overwrite==="auto"&&!ja,y=t.timeline,S=o.easeReverse||f,_,w,C,P,T,A,F,B,U,N,H,E,R;if(y&&(!v||!i)&&(i="none"),t._ease=Xs(i,hi.ease),t._rEase=S&&(Xs(S)||t._ease),t._from=!y&&!!o.runBackwards,t._from&&(t.ratio=1),!y||v&&!o.stagger){if(B=m[0]?_s(m[0]).harness:0,E=B&&o[B.prop],_=vn(o,Xa),d&&(d._zTime<0&&d.progress(1),s<0&&c&&a&&!g?d.render(-1,!0):d.revert(c&&u?un:n_),d._lazy=0),n){if(xs(t._startAt=Ue.set(m,yt({data:"isStart",overwrite:!1,parent:p,immediateRender:!0,lazy:!d&&pt(h),startAt:null,delay:0,onUpdate:l&&function(){return _t(t,"onUpdate")},stagger:0},n))),t._startAt._dp=0,t._startAt._sat=t,s<0&&(Xe||!a&&!g)&&t._startAt.revert(un),a&&u&&s<=0&&r<=0){s&&(t._zTime=s);return}}else if(c&&u&&!d){if(s&&(a=!1),C=yt({overwrite:!1,data:"isFromStart",lazy:a&&!d&&pt(h),immediateRender:a,stagger:0,parent:p},_),E&&(C[B.prop]=E),xs(t._startAt=Ue.set(m,C)),t._startAt._dp=0,t._startAt._sat=t,s<0&&(Xe?t._startAt.revert(un):t._startAt.render(-1,!0)),t._zTime=s,!a)e(t._startAt,Te,Te);else if(!s)return}for(t._pt=t._ptCache=0,h=u&&pt(h)||h&&!u,w=0;w<m.length;w++){if(T=m[w],F=T._gsap||Ya(m)[w]._gsap,t._ptLookup[w]=N={},Fa[F.id]&&bs.length&&gn(),H=b===m?w:b.indexOf(T),B&&(U=new B).init(T,E||_,t,H,b)!==!1&&(t._pt=P=new ot(t._pt,T,U.name,0,1,U.render,U,0,U.priority),U._props.forEach(function(L){N[L]=P}),U.priority&&(A=1)),!B||E)for(C in _)dt[C]&&(U=rl(C,_,t,H,T,b))?U.priority&&(A=1):N[C]=P=sl.call(t,T,C,"get",_[C],H,b,0,o.stringFilter);t._op&&t._op[w]&&t.kill(T,t._op[w]),x&&t._pt&&(vs=t,Le.killTweensOf(T,N,t.globalTime(s)),R=!t.parent,vs=0),t._pt&&h&&(Fa[F.id]=1)}A&&ll(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!R,v&&s<=0&&y.render(Rt,!0,!0)},L_=function(t,s,r,o,i,n,a,h){var l=(t._pt&&t._ptCache||(t._ptCache={}))[s],c,f,v,g;if(!l)for(l=t._ptCache[s]=[],v=t._ptLookup,g=t._targets.length;g--;){if(c=v[g][s],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==s&&c.fp!==s;)c=c._next;if(!c)return Ua=1,t.vars[s]="+=0",il(t,a),Ua=0,h?ci(s+" not eligible for reset. Try splitting into individual properties"):1;l.push(c)}for(g=l.length;g--;)f=l[g],c=f._pt||f,c.s=(o||o===0)&&!i?o:c.s+(o||0)+n*c.c,c.c=r-c.s,f.e&&(f.e=ze(r)+Je(f.e)),f.b&&(f.b=c.s+Je(f.b))},O_=function(t,s){var r=t[0]?_s(t[0]).harness:0,o=r&&r.aliases,i,n,a,h;if(!o)return s;i=yr({},s);for(n in o)if(n in i)for(h=o[n].split(","),a=h.length;a--;)i[h[a]]=i[n];return i},M_=function(t,s,r,o){var i=s.ease||o||"power1.inOut",n,a;if(st(s))a=r[t]||(r[t]=[]),s.forEach(function(h,l){return a.push({t:l/(s.length-1)*100,v:h,e:i})});else for(n in s)a=r[n]||(r[n]=[]),n==="ease"||a.push({t:parseFloat(t),v:s[n],e:i})},li=function(t,s,r,o,i){return Ne(t)?t.call(s,r,o,i):qe(t)&&~t.indexOf("random(")?Cr(t):t},$u=Ja+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",Uu={};nt($u+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return Uu[e]=1});var Ue=(function(e){mu(t,e);function t(r,o,i,n){var a;typeof o=="number"&&(i.duration=o,o=i,i=null),a=e.call(this,n?o:oi(o))||this;var h=a.vars,l=h.duration,c=h.delay,f=h.immediateRender,v=h.stagger,g=h.overwrite,u=h.keyframes,d=h.defaults,m=h.scrollTrigger,p=o.parent||Le,b=(st(r)||vu(r)?is(r[0]):"length"in o)?[r]:At(r),x,y,S,_,w,C,P,T;if(a._targets=b.length?Ya(b):ci("GSAP target "+r+" not found. https://gsap.com",!ft.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=g,u||v||dn(l)||dn(c)){o=a.vars;var A=o.easeReverse||o.yoyoEase;if(x=a.timeline=new tt({data:"nested",defaults:d||{},targets:p&&p.data==="nested"?p.vars.targets:b}),x.kill(),x.parent=x._dp=ss(a),x._start=0,v||dn(l)||dn(c)){if(_=b.length,P=v&&Au(v),jt(v))for(w in v)~$u.indexOf(w)&&(T||(T={}),T[w]=v[w]);for(y=0;y<_;y++)S=vn(o,Uu),S.stagger=0,A&&(S.easeReverse=A),T&&yr(S,T),C=b[y],S.duration=+li(l,ss(a),y,C,b),S.delay=(+li(c,ss(a),y,C,b)||0)-a._delay,!v&&_===1&&S.delay&&(a._delay=c=S.delay,a._start+=c,S.delay=0),x.to(C,S,P?P(y,C,b):0),x._ease=we.none;x.duration()?l=c=0:a.timeline=0}else if(u){oi(yt(x.vars.defaults,{ease:"none"})),x._ease=Xs(u.ease||o.ease||"none");var F=0,B,U,N;if(st(u))u.forEach(function(H){return x.to(b,H,">")}),x.duration();else{S={};for(w in u)w==="ease"||w==="easeEach"||M_(w,u[w],S,u.easeEach);for(w in S)for(B=S[w].sort(function(H,E){return H.t-E.t}),F=0,y=0;y<B.length;y++)U=B[y],N={ease:U.e,duration:(U.t-(y?B[y-1].t:0))/100*l},N[w]=U.v,x.to(b,N,F),F+=N.duration;x.duration()<l&&x.to({},{duration:l-x.duration()})}}l||a.duration(l=x.duration())}else a.timeline=0;return g===!0&&!ja&&(vs=ss(a),Le.killTweensOf(b),vs=0),Vt(p,ss(a),i),o.reversed&&a.reverse(),o.paused&&a.paused(!0),(f||!l&&!u&&a._start===Ie(p._time)&&pt(f)&&d_(ss(a))&&p.data!=="nested")&&(a._tTime=-Te,a.render(Math.max(0,-c)||0)),m&&Tu(ss(a),m),a}var s=t.prototype;return s.render=function(o,i,n){var a=this._time,h=this._tDur,l=this._dur,c=o<0,f=o>h-Te&&!c?h:o<Te?0:o,v,g,u,d,m,p,b,x;if(!l)p_(this,o,i,n);else if(f!==this._tTime||!o||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(v=f,x=this.timeline,this._repeat){if(d=l+this._rDelay,this._repeat<-1&&c)return this.totalTime(d*100+o,i,n);if(v=Ie(f%d),f===h?(u=this._repeat,v=l):(m=Ie(f/d),u=~~m,u&&u===m?(v=l,u--):v>l&&(v=l)),p=this._yoyo&&u&1,p&&(v=l-v),m=wr(this._tTime,d),v===a&&!n&&this._initted&&u===m)return this._tTime=f,this;u!==m&&this.vars.repeatRefresh&&!p&&!this._lock&&v!==d&&this._initted&&(this._lock=n=1,this.render(Ie(d*u),!0).invalidate()._lock=0)}if(!this._initted){if(Pu(this,c?o:v,n,i,f))return this._tTime=0,this;if(a!==this._time&&!(n&&this.vars.repeatRefresh&&u!==m))return this;if(l!==this._dur)return this.render(o,i,n)}if(this._rEase){var y=v<a;if(y!==this._inv){var S=y?a:l-a;this._inv=y,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=a,this._invRecip=S?(y?-1:1)/S:0,this._invScale=y?-this.ratio:1-this.ratio,this._invEase=y?this._rEase:this._ease}this.ratio=b=this._invRatio+this._invScale*this._invEase((v-this._invTime)*this._invRecip)}else this.ratio=b=this._ease(v/l);if(this._from&&(this.ratio=b=1-b),this._tTime=f,this._time=v,!this._act&&this._ts&&(this._act=1,this._lazy=0),!a&&f&&!i&&!m&&(_t(this,"onStart"),this._tTime!==f))return this;for(g=this._pt;g;)g.r(b,g.d),g=g._next;x&&x.render(o<0?o:x._dur*x._ease(v/this._dur),i,n)||this._startAt&&(this._zTime=o),this._onUpdate&&!i&&(c&&Ba(this,o,i,n),_t(this,"onUpdate")),this._repeat&&u!==m&&this.vars.onRepeat&&!i&&this.parent&&_t(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(c&&!this._onUpdate&&Ba(this,o,!0,!0),(o||!l)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&xs(this,1),!i&&!(c&&!a)&&(f||a||p)&&(_t(this,f===h?"onComplete":"onReverseComplete",!0),this._prom&&!(f<h&&this.timeScale()>0)&&this._prom()))}return this},s.targets=function(){return this._targets},s.invalidate=function(o){return(!o||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(o),e.prototype.invalidate.call(this,o)},s.resetTo=function(o,i,n,a,h){ui||ut.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||il(this,l),c=this._ease(l/this._dur),L_(this,o,i,n,a,c,l,h)?this.resetTo(o,i,n,a,1):(kn(this,0),this.parent||Cu(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},s.kill=function(o,i){if(i===void 0&&(i="all"),!o&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?ii(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Xe),this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(o,i,vs&&vs.vars.overwrite!==!0)._first||ii(this),this.parent&&n!==this.timeline.totalDuration()&&Sr(this,this._dur*this.timeline._tDur/n,0,1),this}var a=this._targets,h=o?At(o):a,l=this._ptLookup,c=this._pt,f,v,g,u,d,m,p;if((!i||i==="all")&&h_(a,h))return i==="all"&&(this._pt=0),ii(this);for(f=this._op=this._op||[],i!=="all"&&(qe(i)&&(d={},nt(i,function(b){return d[b]=1}),i=d),i=O_(a,i)),p=a.length;p--;)if(~h.indexOf(a[p])){v=l[p],i==="all"?(f[p]=i,u=v,g={}):(g=f[p]=f[p]||{},u=i);for(d in u)m=v&&v[d],m&&((!("kill"in m.d)||m.d.kill(d)===!0)&&wn(this,m,"_pt"),delete v[d]),g!=="all"&&(g[d]=1)}return this._initted&&!this._pt&&c&&ii(this),this},t.to=function(o,i){return new t(o,i,arguments[2])},t.from=function(o,i){return ai(1,arguments)},t.delayedCall=function(o,i,n,a){return new t(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:o,onComplete:i,onReverseComplete:i,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:a})},t.fromTo=function(o,i,n){return ai(2,arguments)},t.set=function(o,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new t(o,i)},t.killTweensOf=function(o,i,n){return Le.killTweensOf(o,i,n)},t})(pi);yt(Ue.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});nt("staggerTo,staggerFrom,staggerFromTo",function(e){Ue[e]=function(){var t=new tt,s=za.call(arguments,0);return s.splice(e==="staggerFromTo"?5:4,0,0),t[e].apply(t,s)}});var nl=function(t,s,r){return t[s]=r},Vu=function(t,s,r){return t[s](r)},F_=function(t,s,r,o){return t[s](o.fp,r)},B_=function(t,s,r){return t.setAttribute(s,r)},Cn=function(t,s){return Ne(t[s])?Vu:xn(t[s])&&t.setAttribute?B_:nl},ju=function(t,s){return s.set(s.t,s.p,Math.round((s.s+s.c*t)*1e6)/1e6,s)},N_=function(t,s){return s.set(s.t,s.p,!!(s.s+s.c*t),s)},ol=function(t,s){var r=s._pt,o="";if(!t&&s.b)o=s.b;else if(t===1&&s.e)o=s.e;else{for(;r;)o=r.p+(r.m?r.m(r.s+r.c*t):Math.round((r.s+r.c*t)*1e4)/1e4)+o,r=r._next;o+=s.c}s.set(s.t,s.p,o,s)},al=function(t,s){for(var r=s._pt;r;)r.r(t,r.d),r=r._next},z_=function(t,s,r,o){for(var i=this._pt,n;i;)n=i._next,i.p===o&&i.modifier(t,s,r),i=n},H_=function(t){for(var s=this._pt,r,o;s;)o=s._next,s.p===t&&!s.op||s.op===t?wn(this,s,"_pt"):s.dep||(r=1),s=o;return!r},$_=function(t,s,r,o){o.mSet(t,s,o.m.call(o.tween,r,o.mt),o)},ll=function(t){for(var s=t._pt,r,o,i,n;s;){for(r=s._next,o=i;o&&o.pr>s.pr;)o=o._next;(s._prev=o?o._prev:n)?s._prev._next=s:i=s,(s._next=o)?o._prev=s:n=s,s=r}t._pt=i},ot=(function(){function e(s,r,o,i,n,a,h,l,c){this.t=r,this.s=i,this.c=n,this.p=o,this.r=a||ju,this.d=h||this,this.set=l||nl,this.pr=c||0,this._next=s,s&&(s._prev=this)}var t=e.prototype;return t.modifier=function(r,o,i){this.mSet=this.mSet||this.set,this.set=$_,this.m=r,this.mt=i,this.tween=o},e})();nt(Ja+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(e){return Xa[e]=1});xt.TweenMax=xt.TweenLite=Ue;xt.TimelineLite=xt.TimelineMax=tt;Le=new tt({sortChildren:!1,defaults:hi,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ft.stringFilter=el;var Js=[],fn={},U_=[],fu=0,V_=0,Ia=function(t){return(fn[t]||U_).map(function(s){return s()})},Va=function(){var t=Date.now(),s=[];t-fu>2&&(Ia("matchMediaInit"),Js.forEach(function(r){var o=r.queries,i=r.conditions,n,a,h,l;for(a in o)n=Ut.matchMedia(o[a]).matches,n&&(h=1),n!==i[a]&&(i[a]=n,l=1);l&&(r.revert(),h&&s.push(r))}),Ia("matchMediaRevert"),s.forEach(function(r){return r.onMatch(r,function(o){return r.add(null,o)})}),fu=t,Ia("matchMedia"))},Wu=(function(){function e(s,r){this.selector=r&&Ha(r),this.data=[],this._r=[],this.isReverted=!1,this.id=V_++,s&&this.add(s)}var t=e.prototype;return t.add=function(r,o,i){Ne(r)&&(i=o,o=r,r=Ne);var n=this,a=function(){var l=Ae,c=n.selector,f;return l&&l!==n&&l.data.push(n),i&&(n.selector=Ha(i)),Ae=n,f=o.apply(n,arguments),Ne(f)&&n._r.push(f),Ae=l,n.selector=c,n.isReverted=!1,f};return n.last=a,r===Ne?a(n,function(h){return n.add(null,h)}):r?n[r]=a:a},t.ignore=function(r){var o=Ae;Ae=null,r(this),Ae=o},t.getTweens=function(){var r=[];return this.data.forEach(function(o){return o instanceof e?r.push.apply(r,o.getTweens()):o instanceof Ue&&!(o.parent&&o.parent.data==="nested")&&r.push(o)}),r},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(r,o){var i=this;if(r?(function(){for(var a=i.getTweens(),h=i.data.length,l;h--;)l=i.data[h],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(c){return a.splice(a.indexOf(c),1)}));for(a.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,f){return f.g-c.g||-1/0}).forEach(function(c){return c.t.revert(r)}),h=i.data.length;h--;)l=i.data[h],l instanceof tt?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Ue)&&l.revert&&l.revert(r);i._r.forEach(function(c){return c(r,i)}),i.isReverted=!0})():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),o)for(var n=Js.length;n--;)Js[n].id===this.id&&Js.splice(n,1)},t.revert=function(r){this.kill(r||{})},e})(),j_=(function(){function e(s){this.contexts=[],this.scope=s,Ae&&Ae.data.push(this)}var t=e.prototype;return t.add=function(r,o,i){jt(r)||(r={matches:r});var n=new Wu(0,i||this.scope),a=n.conditions={},h,l,c;Ae&&!n.selector&&(n.selector=Ae.selector),this.contexts.push(n),o=n.add("onMatch",o),n.queries=r;for(l in r)l==="all"?c=1:(h=Ut.matchMedia(r[l]),h&&(Js.indexOf(n)<0&&Js.push(n),(a[l]=h.matches)&&(c=1),h.addListener?h.addListener(Va):h.addEventListener("change",Va)));return c&&o(n,function(f){return n.add(null,f)}),this},t.revert=function(r){this.kill(r||{})},t.kill=function(r){this.contexts.forEach(function(o){return o.kill(r,!0)})},e})(),_n={registerPlugin:function(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];s.forEach(function(o){return Bu(o)})},timeline:function(t){return new tt(t)},getTweensOf:function(t,s){return Le.getTweensOf(t,s)},getProperty:function(t,s,r,o){qe(t)&&(t=At(t)[0]);var i=_s(t||{}).get,n=r?ku:Su;return r==="native"&&(r=""),t&&(s?n((dt[s]&&dt[s].get||i)(t,s,r,o)):function(a,h,l){return n((dt[a]&&dt[a].get||i)(t,a,h,l))})},quickSetter:function(t,s,r){if(t=At(t),t.length>1){var o=t.map(function(c){return rt.quickSetter(c,s,r)}),i=o.length;return function(c){for(var f=i;f--;)o[f](c)}}t=t[0]||{};var n=dt[s],a=_s(t),h=a.harness&&(a.harness.aliases||{})[s]||s,l=n?function(c){var f=new n;xr._pt=0,f.init(t,r?c+r:c,xr,0,[t]),f.render(1,f),xr._pt&&al(1,xr)}:a.set(t,h);return n?l:function(c){return l(t,h,r?c+r:c,a,1)}},quickTo:function(t,s,r){var o,i=rt.to(t,yt((o={},o[s]="+=0.1",o.paused=!0,o.stagger=0,o),r||{})),n=function(h,l,c){return i.resetTo(s,h,l,c)};return n.tween=i,n},isTweening:function(t){return Le.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Xs(t.ease,hi.ease)),hu(hi,t||{})},config:function(t){return hu(ft,t||{})},registerEffect:function(t){var s=t.name,r=t.effect,o=t.plugins,i=t.defaults,n=t.extendTimeline;(o||"").split(",").forEach(function(a){return a&&!dt[a]&&!xt[a]&&ci(s+" effect requires "+a+" plugin.")}),Pa[s]=function(a,h,l){return r(At(a),yt(h||{},i),l)},n&&(tt.prototype[s]=function(a,h,l){return this.add(Pa[s](a,jt(h)?h:(l=h)&&{},this),l)})},registerEase:function(t,s){we[t]=Xs(s)},parseEase:function(t,s){return arguments.length?Xs(t,s):we},getById:function(t){return Le.getById(t)},exportRoot:function(t,s){t===void 0&&(t={});var r=new tt(t),o,i;for(r.smoothChildTiming=pt(t.smoothChildTiming),Le.remove(r),r._dp=0,r._time=r._tTime=Le._time,o=Le._first;o;)i=o._next,(s||!(!o._dur&&o instanceof Ue&&o.vars.onComplete===o._targets[0]))&&Vt(r,o,o._start-o._delay),o=i;return Vt(Le,r,0),r},context:function(t,s){return t?new Wu(t,s):Ae},matchMedia:function(t){return new j_(t)},matchMediaRefresh:function(){return Js.forEach(function(t){var s=t.conditions,r,o;for(o in s)s[o]&&(s[o]=!1,r=1);r&&t.revert()})||Va()},addEventListener:function(t,s){var r=fn[t]||(fn[t]=[]);~r.indexOf(s)||r.push(s)},removeEventListener:function(t,s){var r=fn[t],o=r&&r.indexOf(s);o>=0&&r.splice(o,1)},utils:{wrap:y_,wrapYoyo:w_,distribute:Au,random:Lu,snap:Iu,normalize:x_,getUnit:Je,clamp:g_,splitColor:Nu,toArray:At,selector:Ha,mapRange:Mu,pipe:b_,unitize:__,interpolate:S_,shuffle:Ru},install:_u,effects:Pa,ticker:ut,updateRoot:tt.updateRoot,plugins:dt,globalTimeline:Le,core:{PropTween:ot,globals:xu,Tween:Ue,Timeline:tt,Animation:pi,getCache:_s,_removeLinkedListItem:wn,reverting:function(){return Xe},context:function(t){return t&&Ae&&(Ae.data.push(t),t._ctx=Ae),Ae},suppressOverwrites:function(t){return ja=t}}};nt("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return _n[e]=Ue[e]});ut.add(tt.updateRoot);xr=_n.to({},{duration:0});var W_=function(t,s){for(var r=t._pt;r&&r.p!==s&&r.op!==s&&r.fp!==s;)r=r._next;return r},q_=function(t,s){var r=t._targets,o,i,n;for(o in s)for(i=r.length;i--;)n=t._ptLookup[i][o],n&&(n=n.d)&&(n._pt&&(n=W_(n,o)),n&&n.modifier&&n.modifier(s[o],t,r[i],o))},La=function(t,s){return{name:t,headless:1,rawVars:1,init:function(o,i,n){n._onInit=function(a){var h,l;if(qe(i)&&(h={},nt(i,function(c){return h[c]=1}),i=h),s){h={};for(l in i)h[l]=s(i[l]);i=h}q_(a,i)}}}},rt=_n.registerPlugin({name:"attr",init:function(t,s,r,o,i){var n,a,h;this.tween=r;for(n in s)h=t.getAttribute(n)||"",a=this.add(t,"setAttribute",(h||0)+"",s[n],o,i,0,0,n),a.op=n,a.b=h,this._props.push(n)},render:function(t,s){for(var r=s._pt;r;)Xe?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",headless:1,init:function(t,s){for(var r=s.length;r--;)this.add(t,r,t[r]||0,s[r],0,0,0,0,0,1)}},La("roundProps",$a),La("modifiers"),La("snap",Iu))||_n;Ue.version=tt.version=rt.version="3.15.0";bu=1;Wa()&&kr();var K_=we.Power0,G_=we.Power1,X_=we.Power2,J_=we.Power3,Y_=we.Power4,Q_=we.Linear,Z_=we.Quad,e0=we.Cubic,t0=we.Quart,s0=we.Quint,r0=we.Strong,i0=we.Elastic,n0=we.Back,o0=we.SteppedEase,a0=we.Bounce,l0=we.Sine,h0=we.Expo,c0=we.Circ;var qu,ws,Tr,fl,rr,d0,Ku,ml,u0=function(){return typeof window<"u"},os={},sr=180/Math.PI,Pr=Math.PI/180,Er=Math.atan2,Gu=1e8,gl=/([A-Z])/g,p0=/(left|right|width|margin|padding|x)/i,f0=/[\s,\(]\S/,Wt={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},cl=function(t,s){return s.set(s.t,s.p,Math.round((s.s+s.c*t)*1e4)/1e4+s.u,s)},m0=function(t,s){return s.set(s.t,s.p,t===1?s.e:Math.round((s.s+s.c*t)*1e4)/1e4+s.u,s)},g0=function(t,s){return s.set(s.t,s.p,t?Math.round((s.s+s.c*t)*1e4)/1e4+s.u:s.b,s)},v0=function(t,s){return s.set(s.t,s.p,t===1?s.e:t?Math.round((s.s+s.c*t)*1e4)/1e4+s.u:s.b,s)},b0=function(t,s){var r=s.s+s.c*t;s.set(s.t,s.p,~~(r+(r<0?-.5:.5))+s.u,s)},sp=function(t,s){return s.set(s.t,s.p,t?s.e:s.b,s)},rp=function(t,s){return s.set(s.t,s.p,t!==1?s.b:s.e,s)},_0=function(t,s,r){return t.style[s]=r},x0=function(t,s,r){return t.style.setProperty(s,r)},y0=function(t,s,r){return t._gsap[s]=r},w0=function(t,s,r){return t._gsap.scaleX=t._gsap.scaleY=r},S0=function(t,s,r,o,i){var n=t._gsap;n.scaleX=n.scaleY=r,n.renderTransform(i,n)},k0=function(t,s,r,o,i){var n=t._gsap;n[s]=r,n.renderTransform(i,n)},Oe="transform",mt=Oe+"Origin",C0=function e(t,s){var r=this,o=this.target,i=o.style,n=o._gsap;if(t in os&&i){if(this.tfm=this.tfm||{},t!=="transform")t=Wt[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return r.tfm[a]=ns(o,a)}):this.tfm[t]=n.x?n[t]:ns(o,t),t===mt&&(this.tfm.zOrigin=n.zOrigin);else return Wt.transform.split(",").forEach(function(a){return e.call(r,a,s)});if(this.props.indexOf(Oe)>=0)return;n.svg&&(this.svgo=o.getAttribute("data-svg-origin"),this.props.push(mt,s,"")),t=Oe}(i||s)&&this.props.push(t,s,i[t])},ip=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},E0=function(){var t=this.props,s=this.target,r=s.style,o=s._gsap,i,n;for(i=0;i<t.length;i+=3)t[i+1]?t[i+1]===2?s[t[i]](t[i+2]):s[t[i]]=t[i+2]:t[i+2]?r[t[i]]=t[i+2]:r.removeProperty(t[i].substr(0,2)==="--"?t[i]:t[i].replace(gl,"-$1").toLowerCase());if(this.tfm){for(n in this.tfm)o[n]=this.tfm[n];o.svg&&(o.renderTransform(),s.setAttribute("data-svg-origin",this.svgo||"")),i=ml(),(!i||!i.isStart)&&!r[Oe]&&(ip(r),o.zOrigin&&r[mt]&&(r[mt]+=" "+o.zOrigin+"px",o.zOrigin=0,o.renderTransform()),o.uncache=1)}},np=function(t,s){var r={target:t,props:[],revert:E0,save:C0};return t._gsap||rt.core.getCache(t),s&&t.style&&t.nodeType&&s.split(",").forEach(function(o){return r.save(o)}),r},op,dl=function(t,s){var r=ws.createElementNS?ws.createElementNS((s||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):ws.createElement(t);return r&&r.style?r:ws.createElement(t)},wt=function e(t,s,r){var o=getComputedStyle(t);return o[s]||o.getPropertyValue(s.replace(gl,"-$1").toLowerCase())||o.getPropertyValue(s)||!r&&e(t,Dr(s)||s,1)||""},Xu="O,Moz,ms,Ms,Webkit".split(","),Dr=function(t,s,r){var o=s||rr,i=o.style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(Xu[n]+t in i););return n<0?null:(n===3?"ms":n>=0?Xu[n]:"")+t},ul=function(){u0()&&window.document&&(qu=window,ws=qu.document,Tr=ws.documentElement,rr=dl("div")||{style:{}},d0=dl("div"),Oe=Dr(Oe),mt=Oe+"Origin",rr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",op=!!Dr("perspective"),ml=rt.core.reverting,fl=1)},Ju=function(t){var s=t.ownerSVGElement,r=dl("svg",s&&s.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),o=t.cloneNode(!0),i;o.style.display="block",r.appendChild(o),Tr.appendChild(r);try{i=o.getBBox()}catch{}return r.removeChild(o),Tr.removeChild(r),i},Yu=function(t,s){for(var r=s.length;r--;)if(t.hasAttribute(s[r]))return t.getAttribute(s[r])},ap=function(t){var s,r;try{s=t.getBBox()}catch{s=Ju(t),r=1}return s&&(s.width||s.height)||r||(s=Ju(t)),s&&!s.width&&!s.x&&!s.y?{x:+Yu(t,["x","cx","x1"])||0,y:+Yu(t,["y","cy","y1"])||0,width:0,height:0}:s},lp=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ap(t))},ks=function(t,s){if(s){var r=t.style,o;s in os&&s!==mt&&(s=Oe),r.removeProperty?(o=s.substr(0,2),(o==="ms"||s.substr(0,6)==="webkit")&&(s="-"+s),r.removeProperty(o==="--"?s:s.replace(gl,"-$1").toLowerCase())):r.removeAttribute(s)}},Ss=function(t,s,r,o,i,n){var a=new ot(t._pt,s,r,0,1,n?rp:sp);return t._pt=a,a.b=o,a.e=i,t._props.push(r),a},Qu={deg:1,rad:1,turn:1},T0={grid:1,flex:1},Cs=function e(t,s,r,o){var i=parseFloat(r)||0,n=(r+"").trim().substr((i+"").length)||"px",a=rr.style,h=p0.test(s),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),f=100,v=o==="px",g=o==="%",u,d,m,p;if(o===n||!i||Qu[o]||Qu[n])return i;if(n!=="px"&&!v&&(i=e(t,s,r,"px")),p=t.getCTM&&lp(t),(g||n==="%")&&(os[s]||~s.indexOf("adius")))return u=p?t.getBBox()[h?"width":"height"]:t[c],ze(g?i/u*f:i/100*u);if(a[h?"width":"height"]=f+(v?n:o),d=o!=="rem"&&~s.indexOf("adius")||o==="em"&&t.appendChild&&!l?t:t.parentNode,p&&(d=(t.ownerSVGElement||{}).parentNode),(!d||d===ws||!d.appendChild)&&(d=ws.body),m=d._gsap,m&&g&&m.width&&h&&m.time===ut.time&&!m.uncache)return ze(i/m.width*f);if(g&&(s==="height"||s==="width")){var b=t.style[s];t.style[s]=f+o,u=t[c],b?t.style[s]=b:ks(t,s)}else(g||n==="%")&&!T0[wt(d,"display")]&&(a.position=wt(t,"position")),d===t&&(a.position="static"),d.appendChild(rr),u=rr[c],d.removeChild(rr),a.position="absolute";return h&&g&&(m=_s(d),m.time=ut.time,m.width=d[c]),ze(v?u*i/f:u&&i?f/u*i:0)},ns=function(t,s,r,o){var i;return fl||ul(),s in Wt&&s!=="transform"&&(s=Wt[s],~s.indexOf(",")&&(s=s.split(",")[0])),os[s]&&s!=="transform"?(i=vi(t,o),i=s!=="transformOrigin"?i[s]:i.svg?i.origin:Tn(wt(t,mt))+" "+i.zOrigin+"px"):(i=t.style[s],(!i||i==="auto"||o||~(i+"").indexOf("calc("))&&(i=En[s]&&En[s](t,s,r)||wt(t,s)||Qa(t,s)||(s==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?Cs(t,s,i,r)+r:i},P0=function(t,s,r,o){if(!r||r==="none"){var i=Dr(s,t,1),n=i&&wt(t,i,1);n&&n!==r?(s=i,r=n):s==="borderColor"&&(r=wt(t,"borderTopColor"))}var a=new ot(this._pt,t.style,s,0,1,ol),h=0,l=0,c,f,v,g,u,d,m,p,b,x,y,S;if(a.b=r,a.e=o,r+="",o+="",o.substring(0,6)==="var(--"&&(o=wt(t,o.substring(4,o.indexOf(")")))),o==="auto"&&(d=t.style[s],t.style[s]=o,o=wt(t,s)||o,d?t.style[s]=d:ks(t,s)),c=[r,o],el(c),r=c[0],o=c[1],v=r.match(Ys)||[],S=o.match(Ys)||[],S.length){for(;f=Ys.exec(o);)m=f[0],b=o.substring(h,f.index),u?u=(u+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(u=1),m!==(d=v[l++]||"")&&(g=parseFloat(d)||0,y=d.substr((g+"").length),m.charAt(1)==="="&&(m=Qs(g,m)+y),p=parseFloat(m),x=m.substr((p+"").length),h=Ys.lastIndex-x.length,x||(x=x||ft.units[s]||y,h===o.length&&(o+=x,a.e+=x)),y!==x&&(g=Cs(t,s,d,x)||0),a._pt={_next:a._pt,p:b||l===1?b:",",s:g,c:p-g,m:u&&u<4||s==="zIndex"?Math.round:0});a.c=h<o.length?o.substring(h,o.length):""}else a.r=s==="display"&&o==="none"?rp:sp;return Ka.test(o)&&(a.e=0),this._pt=a,a},Zu={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},D0=function(t){var s=t.split(" "),r=s[0],o=s[1]||"50%";return(r==="top"||r==="bottom"||o==="left"||o==="right")&&(t=r,r=o,o=t),s[0]=Zu[r]||r,s[1]=Zu[o]||o,s.join(" ")},R0=function(t,s){if(s.tween&&s.tween._time===s.tween._dur){var r=s.t,o=r.style,i=s.u,n=r._gsap,a,h,l;if(i==="all"||i===!0)o.cssText="",h=1;else for(i=i.split(","),l=i.length;--l>-1;)a=i[l],os[a]&&(h=1,a=a==="transformOrigin"?mt:Oe),ks(r,a);h&&(ks(r,Oe),n&&(n.svg&&r.removeAttribute("transform"),o.scale=o.rotate=o.translate="none",vi(r,1),n.uncache=1,ip(o)))}},En={clearProps:function(t,s,r,o,i){if(i.data!=="isFromStart"){var n=t._pt=new ot(t._pt,s,r,0,0,R0);return n.u=o,n.pr=-10,n.tween=i,t._props.push(r),1}}},gi=[1,0,0,1,0,0],hp={},cp=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},ep=function(t){var s=wt(t,Oe);return cp(s)?gi:s.substr(7).match(qa).map(ze)},vl=function(t,s){var r=t._gsap||_s(t),o=t.style,i=ep(t),n,a,h,l;return r.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,i=[h.a,h.b,h.c,h.d,h.e,h.f],i.join(",")==="1,0,0,1,0,0"?gi:i):(i===gi&&!t.offsetParent&&t!==Tr&&!r.svg&&(h=o.display,o.display="block",n=t.parentNode,(!n||!t.offsetParent&&!t.getBoundingClientRect().width)&&(l=1,a=t.nextElementSibling,Tr.appendChild(t)),i=ep(t),h?o.display=h:ks(t,"display"),l&&(a?n.insertBefore(t,a):n?n.appendChild(t):Tr.removeChild(t))),s&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},pl=function(t,s,r,o,i,n){var a=t._gsap,h=i||vl(t,!0),l=a.xOrigin||0,c=a.yOrigin||0,f=a.xOffset||0,v=a.yOffset||0,g=h[0],u=h[1],d=h[2],m=h[3],p=h[4],b=h[5],x=s.split(" "),y=parseFloat(x[0])||0,S=parseFloat(x[1])||0,_,w,C,P;r?h!==gi&&(w=g*m-u*d)&&(C=y*(m/w)+S*(-d/w)+(d*b-m*p)/w,P=y*(-u/w)+S*(g/w)-(g*b-u*p)/w,y=C,S=P):(_=ap(t),y=_.x+(~x[0].indexOf("%")?y/100*_.width:y),S=_.y+(~(x[1]||x[0]).indexOf("%")?S/100*_.height:S)),o||o!==!1&&a.smooth?(p=y-l,b=S-c,a.xOffset=f+(p*g+b*d)-p,a.yOffset=v+(p*u+b*m)-b):a.xOffset=a.yOffset=0,a.xOrigin=y,a.yOrigin=S,a.smooth=!!o,a.origin=s,a.originIsAbsolute=!!r,t.style[mt]="0px 0px",n&&(Ss(n,a,"xOrigin",l,y),Ss(n,a,"yOrigin",c,S),Ss(n,a,"xOffset",f,a.xOffset),Ss(n,a,"yOffset",v,a.yOffset)),t.setAttribute("data-svg-origin",y+" "+S)},vi=function(t,s){var r=t._gsap||new tl(t);if("x"in r&&!s&&!r.uncache)return r;var o=t.style,i=r.scaleX<0,n="px",a="deg",h=getComputedStyle(t),l=wt(t,mt)||"0",c,f,v,g,u,d,m,p,b,x,y,S,_,w,C,P,T,A,F,B,U,N,H,E,R,L,k,$,X,O,se,z;return c=f=v=d=m=p=b=x=y=0,g=u=1,r.svg=!!(t.getCTM&&lp(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(o[Oe]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[Oe]!=="none"?h[Oe]:"")),o.scale=o.rotate=o.translate="none"),w=vl(t,r.svg),r.svg&&(r.uncache?(R=t.getBBox(),l=r.xOrigin-R.x+"px "+(r.yOrigin-R.y)+"px",E=""):E=!s&&t.getAttribute("data-svg-origin"),pl(t,E||l,!!E||r.originIsAbsolute,r.smooth!==!1,w)),S=r.xOrigin||0,_=r.yOrigin||0,w!==gi&&(A=w[0],F=w[1],B=w[2],U=w[3],c=N=w[4],f=H=w[5],w.length===6?(g=Math.sqrt(A*A+F*F),u=Math.sqrt(U*U+B*B),d=A||F?Er(F,A)*sr:0,b=B||U?Er(B,U)*sr+d:0,b&&(u*=Math.abs(Math.cos(b*Pr))),r.svg&&(c-=S-(S*A+_*B),f-=_-(S*F+_*U))):(z=w[6],O=w[7],k=w[8],$=w[9],X=w[10],se=w[11],c=w[12],f=w[13],v=w[14],C=Er(z,X),m=C*sr,C&&(P=Math.cos(-C),T=Math.sin(-C),E=N*P+k*T,R=H*P+$*T,L=z*P+X*T,k=N*-T+k*P,$=H*-T+$*P,X=z*-T+X*P,se=O*-T+se*P,N=E,H=R,z=L),C=Er(-B,X),p=C*sr,C&&(P=Math.cos(-C),T=Math.sin(-C),E=A*P-k*T,R=F*P-$*T,L=B*P-X*T,se=U*T+se*P,A=E,F=R,B=L),C=Er(F,A),d=C*sr,C&&(P=Math.cos(C),T=Math.sin(C),E=A*P+F*T,R=N*P+H*T,F=F*P-A*T,H=H*P-N*T,A=E,N=R),m&&Math.abs(m)+Math.abs(d)>359.9&&(m=d=0,p=180-p),g=ze(Math.sqrt(A*A+F*F+B*B)),u=ze(Math.sqrt(H*H+z*z)),C=Er(N,H),b=Math.abs(C)>2e-4?C*sr:0,y=se?1/(se<0?-se:se):0),r.svg&&(E=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!cp(wt(t,Oe)),E&&t.setAttribute("transform",E))),Math.abs(b)>90&&Math.abs(b)<270&&(i?(g*=-1,b+=d<=0?180:-180,d+=d<=0?180:-180):(u*=-1,b+=b<=0?180:-180)),s=s||r.uncache,r.x=c-((r.xPercent=c&&(!s&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+n,r.y=f-((r.yPercent=f&&(!s&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-f)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+n,r.z=v+n,r.scaleX=ze(g),r.scaleY=ze(u),r.rotation=ze(d)+a,r.rotationX=ze(m)+a,r.rotationY=ze(p)+a,r.skewX=b+a,r.skewY=x+a,r.transformPerspective=y+n,(r.zOrigin=parseFloat(l.split(" ")[2])||!s&&r.zOrigin||0)&&(o[mt]=Tn(l)),r.xOffset=r.yOffset=0,r.force3D=ft.force3D,r.renderTransform=r.svg?I0:op?dp:A0,r.uncache=0,r},Tn=function(t){return(t=t.split(" "))[0]+" "+t[1]},hl=function(t,s,r){var o=Je(s);return ze(parseFloat(s)+parseFloat(Cs(t,"x",r+"px",o)))+o},A0=function(t,s){s.z="0px",s.rotationY=s.rotationX="0deg",s.force3D=0,dp(t,s)},er="0deg",mi="0px",tr=") ",dp=function(t,s){var r=s||this,o=r.xPercent,i=r.yPercent,n=r.x,a=r.y,h=r.z,l=r.rotation,c=r.rotationY,f=r.rotationX,v=r.skewX,g=r.skewY,u=r.scaleX,d=r.scaleY,m=r.transformPerspective,p=r.force3D,b=r.target,x=r.zOrigin,y="",S=p==="auto"&&t&&t!==1||p===!0;if(x&&(f!==er||c!==er)){var _=parseFloat(c)*Pr,w=Math.sin(_),C=Math.cos(_),P;_=parseFloat(f)*Pr,P=Math.cos(_),n=hl(b,n,w*P*-x),a=hl(b,a,-Math.sin(_)*-x),h=hl(b,h,C*P*-x+x)}m!==mi&&(y+="perspective("+m+tr),(o||i)&&(y+="translate("+o+"%, "+i+"%) "),(S||n!==mi||a!==mi||h!==mi)&&(y+=h!==mi||S?"translate3d("+n+", "+a+", "+h+") ":"translate("+n+", "+a+tr),l!==er&&(y+="rotate("+l+tr),c!==er&&(y+="rotateY("+c+tr),f!==er&&(y+="rotateX("+f+tr),(v!==er||g!==er)&&(y+="skew("+v+", "+g+tr),(u!==1||d!==1)&&(y+="scale("+u+", "+d+tr),b.style[Oe]=y||"translate(0, 0)"},I0=function(t,s){var r=s||this,o=r.xPercent,i=r.yPercent,n=r.x,a=r.y,h=r.rotation,l=r.skewX,c=r.skewY,f=r.scaleX,v=r.scaleY,g=r.target,u=r.xOrigin,d=r.yOrigin,m=r.xOffset,p=r.yOffset,b=r.forceCSS,x=parseFloat(n),y=parseFloat(a),S,_,w,C,P;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=Pr,l*=Pr,S=Math.cos(h)*f,_=Math.sin(h)*f,w=Math.sin(h-l)*-v,C=Math.cos(h-l)*v,l&&(c*=Pr,P=Math.tan(l-c),P=Math.sqrt(1+P*P),w*=P,C*=P,c&&(P=Math.tan(c),P=Math.sqrt(1+P*P),S*=P,_*=P)),S=ze(S),_=ze(_),w=ze(w),C=ze(C)):(S=f,C=v,_=w=0),(x&&!~(n+"").indexOf("px")||y&&!~(a+"").indexOf("px"))&&(x=Cs(g,"x",n,"px"),y=Cs(g,"y",a,"px")),(u||d||m||p)&&(x=ze(x+u-(u*S+d*w)+m),y=ze(y+d-(u*_+d*C)+p)),(o||i)&&(P=g.getBBox(),x=ze(x+o/100*P.width),y=ze(y+i/100*P.height)),P="matrix("+S+","+_+","+w+","+C+","+x+","+y+")",g.setAttribute("transform",P),b&&(g.style[Oe]=P)},L0=function(t,s,r,o,i){var n=360,a=qe(i),h=parseFloat(i)*(a&&~i.indexOf("rad")?sr:1),l=h-o,c=o+l+"deg",f,v;return a&&(f=i.split("_")[1],f==="short"&&(l%=n,l!==l%(n/2)&&(l+=l<0?n:-n)),f==="cw"&&l<0?l=(l+n*Gu)%n-~~(l/n)*n:f==="ccw"&&l>0&&(l=(l-n*Gu)%n-~~(l/n)*n)),t._pt=v=new ot(t._pt,s,r,o,l,m0),v.e=c,v.u="deg",t._props.push(r),v},tp=function(t,s){for(var r in s)t[r]=s[r];return t},O0=function(t,s,r){var o=tp({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",n=r.style,a,h,l,c,f,v,g,u;o.svg?(l=r.getAttribute("transform"),r.setAttribute("transform",""),n[Oe]=s,a=vi(r,1),ks(r,Oe),r.setAttribute("transform",l)):(l=getComputedStyle(r)[Oe],n[Oe]=s,a=vi(r,1),n[Oe]=l);for(h in os)l=o[h],c=a[h],l!==c&&i.indexOf(h)<0&&(g=Je(l),u=Je(c),f=g!==u?Cs(r,h,l,u):parseFloat(l),v=parseFloat(c),t._pt=new ot(t._pt,a,h,f,v-f,cl),t._pt.u=u||0,t._props.push(h));tp(a,o)};nt("padding,margin,Width,Radius",function(e,t){var s="Top",r="Right",o="Bottom",i="Left",n=(t<3?[s,r,o,i]:[s+i,s+r,o+r,o+i]).map(function(a){return t<2?e+a:"border"+a+e});En[t>1?"border"+e:e]=function(a,h,l,c,f){var v,g;if(arguments.length<4)return v=n.map(function(u){return ns(a,u,l)}),g=v.join(" "),g.split(v[0]).length===5?v[0]:g;v=(c+"").split(" "),g={},n.forEach(function(u,d){return g[u]=v[d]=v[d]||v[(d-1)/2|0]}),a.init(h,g,f)}});var bl={name:"css",register:ul,targetTest:function(t){return t.style&&t.nodeType},init:function(t,s,r,o,i){var n=this._props,a=t.style,h=r.vars.startAt,l,c,f,v,g,u,d,m,p,b,x,y,S,_,w,C,P;fl||ul(),this.styles=this.styles||np(t),C=this.styles.props,this.tween=r;for(d in s)if(d!=="autoRound"&&(c=s[d],!(dt[d]&&rl(d,s,r,o,t,i)))){if(g=typeof c,u=En[d],g==="function"&&(c=c.call(r,o,t,i),g=typeof c),g==="string"&&~c.indexOf("random(")&&(c=Cr(c)),u)u(this,t,d,c,r)&&(w=1);else if(d.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(d)+"").trim(),c+="",rs.lastIndex=0,rs.test(l)||(m=Je(l),p=Je(c),p?m!==p&&(l=Cs(t,d,l,p)+p):m&&(c+=m)),this.add(a,"setProperty",l,c,o,i,0,0,d),n.push(d),C.push(d,0,a[d]);else if(g!=="undefined"){if(h&&d in h?(l=typeof h[d]=="function"?h[d].call(r,o,t,i):h[d],qe(l)&&~l.indexOf("random(")&&(l=Cr(l)),Je(l+"")||l==="auto"||(l+=ft.units[d]||Je(ns(t,d))||""),(l+"").charAt(1)==="="&&(l=ns(t,d))):l=ns(t,d),v=parseFloat(l),b=g==="string"&&c.charAt(1)==="="&&c.substr(0,2),b&&(c=c.substr(2)),f=parseFloat(c),d in Wt&&(d==="autoAlpha"&&(v===1&&ns(t,"visibility")==="hidden"&&f&&(v=0),C.push("visibility",0,a.visibility),Ss(this,a,"visibility",v?"inherit":"hidden",f?"inherit":"hidden",!f)),d!=="scale"&&d!=="transform"&&(d=Wt[d],~d.indexOf(",")&&(d=d.split(",")[0]))),x=d in os,x){if(this.styles.save(d),P=c,g==="string"&&c.substring(0,6)==="var(--"){if(c=wt(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var T=t.style.perspective;t.style.perspective=c,c=wt(t,"perspective"),T?t.style.perspective=T:ks(t,"perspective")}f=parseFloat(c)}if(y||(S=t._gsap,S.renderTransform&&!s.parseTransform||vi(t,s.parseTransform),_=s.smoothOrigin!==!1&&S.smooth,y=this._pt=new ot(this._pt,a,Oe,0,1,S.renderTransform,S,0,-1),y.dep=1),d==="scale")this._pt=new ot(this._pt,S,"scaleY",S.scaleY,(b?Qs(S.scaleY,b+f):f)-S.scaleY||0,cl),this._pt.u=0,n.push("scaleY",d),d+="X";else if(d==="transformOrigin"){C.push(mt,0,a[mt]),c=D0(c),S.svg?pl(t,c,0,_,0,this):(p=parseFloat(c.split(" ")[2])||0,p!==S.zOrigin&&Ss(this,S,"zOrigin",S.zOrigin,p),Ss(this,a,d,Tn(l),Tn(c)));continue}else if(d==="svgOrigin"){pl(t,c,1,_,0,this);continue}else if(d in hp){L0(this,S,d,v,b?Qs(v,b+c):c);continue}else if(d==="smoothOrigin"){Ss(this,S,"smooth",S.smooth,c);continue}else if(d==="force3D"){S[d]=c;continue}else if(d==="transform"){O0(this,c,t);continue}}else d in a||(d=Dr(d)||d);if(x||(f||f===0)&&(v||v===0)&&!f0.test(c)&&d in a)m=(l+"").substr((v+"").length),f||(f=0),p=Je(c)||(d in ft.units?ft.units[d]:m),m!==p&&(v=Cs(t,d,l,p)),this._pt=new ot(this._pt,x?S:a,d,v,(b?Qs(v,b+f):f)-v,!x&&(p==="px"||d==="zIndex")&&s.autoRound!==!1?b0:cl),this._pt.u=p||0,x&&P!==c?(this._pt.b=l,this._pt.e=P,this._pt.r=v0):m!==p&&p!=="%"&&(this._pt.b=l,this._pt.r=g0);else if(d in a)P0.call(this,t,d,l,b?b+c:c);else if(d in t)this.add(t,d,l||t[d],b?b+c:c,o,i);else if(d!=="parseTransform"){yn(d,c);continue}x||(d in a?C.push(d,0,a[d]):typeof t[d]=="function"?C.push(d,2,t[d]()):C.push(d,1,l||t[d])),n.push(d)}}w&&ll(this)},render:function(t,s){if(s.tween._time||!ml())for(var r=s._pt;r;)r.r(t,r.d),r=r._next;else s.styles.revert()},get:ns,aliases:Wt,getSetter:function(t,s,r){var o=Wt[s];return o&&o.indexOf(",")<0&&(s=o),s in os&&s!==mt&&(t._gsap.x||ns(t,"x"))?r&&Ku===r?s==="scale"?w0:y0:(Ku=r||{})&&(s==="scale"?S0:k0):t.style&&!xn(t.style[s])?_0:~s.indexOf("-")?x0:Cn(t,s)},core:{_removeProperty:ks,_getMatrix:vl}};rt.utils.checkPrefix=Dr;rt.core.getStyleSaver=np;(function(e,t,s,r){var o=nt(e+","+t+","+s,function(i){os[i]=1});nt(t,function(i){ft.units[i]="deg",hp[i]=1}),Wt[o[13]]=e+","+t,nt(r,function(i){var n=i.split(":");Wt[n[1]]=o[n[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");nt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){ft.units[e]="px"});rt.registerPlugin(bl);var qt=rt.registerPlugin(bl)||rt,c5=qt.core.Tween;var Es=require("react");var up=typeof document<"u"?Es.useLayoutEffect:Es.useEffect,pp=e=>e&&!Array.isArray(e)&&typeof e=="object",Pn=[],M0={},fp=qt,ir=(e,t=Pn)=>{let s=M0;pp(e)?(s=e,e=null,t="dependencies"in s?s.dependencies:Pn):pp(t)&&(s=t,t="dependencies"in s?s.dependencies:Pn),e&&typeof e!="function"&&console.warn("First parameter must be a function or config object");let{scope:r,revertOnUpdate:o}=s,i=(0,Es.useRef)(!1),n=(0,Es.useRef)(fp.context(()=>{},r)),a=(0,Es.useRef)(l=>n.current.add(null,l)),h=t&&t.length&&!o;return h&&up(()=>(i.current=!0,()=>n.current.revert()),Pn),up(()=>{if(e&&n.current.add(e,r),!h||!i.current)return()=>n.current.revert()},t),{context:n.current,contextSafe:a.current}};ir.register=e=>{fp=e};ir.headless=!0;qt.registerPlugin(ir);var F0="(prefers-reduced-motion: reduce)";function Dn(){return!window.matchMedia(F0).matches}function mp(e,t){let s=(0,_l.useRef)(t),r=(0,_l.useRef)(!1);s.current=t;let{contextSafe:o}=ir(()=>{let i=e.current;if(i===null||!Dn())return;let n=Array.from(i.children),a=qt.timeline({defaults:{ease:"power2.out"}});return a.fromTo(i,{autoAlpha:0,y:10,scale:.985,transformOrigin:"50% 36%"},{autoAlpha:1,y:0,scale:1,duration:.22,clearProps:"transform,opacity,visibility"}).fromTo(n,{autoAlpha:.58,y:4},{autoAlpha:1,y:0,duration:.18,stagger:.025,clearProps:"transform,opacity,visibility"},"<0.035"),()=>{a.kill()}},{scope:e});return o(()=>{if(r.current)return;let i=e.current;if(i===null||!Dn()){s.current();return}r.current=!0;let n=Array.from(i.children);qt.killTweensOf([i,...n]),qt.timeline({defaults:{ease:"power1.in"},onComplete:()=>{s.current()}}).to(n,{autoAlpha:0,y:-2,duration:.08,stagger:{each:.012,from:"end"}}).to(i,{autoAlpha:0,y:6,scale:.99,transformOrigin:"50% 36%",duration:.12},"<0.025")})}function gp(e,t){ir(()=>{let s=e.current;!t||s===null||!Dn()||qt.fromTo(s,{y:1,scale:.975},{y:0,scale:1,duration:.2,ease:"power2.out",overwrite:"auto",clearProps:"transform"})},{scope:e,dependencies:[t],revertOnUpdate:!0})}function vp(e,t=":scope > *"){ir(()=>{let s=e.current;if(s===null||!Dn())return;let r=s.querySelectorAll(t);qt.fromTo(r,{autoAlpha:0,y:5},{autoAlpha:1,y:0,duration:.24,stagger:.035,ease:"power2.out",clearProps:"transform,opacity,visibility"})},{scope:e})}var Se=require("react/jsx-runtime");function Ye({title:e,subtitle:t,className:s,onClose:r,children:o}){let i=(0,Me.useId)(),n=(0,Me.useId)(),a=(0,Me.useRef)(null),h=mp(a,r),l=c=>{!(c.target instanceof Element)||c.target.closest("[data-ssh-dialog-close]")===null||(c.preventDefault(),c.stopPropagation(),h())};return(0,Se.jsx)(Kt.Modal,{open:!0,onClose:h,title:e,closeLabel:"\u5173\u95ED",headless:!0,className:`dsh-ssh-dialog-modal${s===void 0?"":` ${s}-modal`}`,children:(0,Se.jsx)(nu,{children:(0,Se.jsx)(ou,{children:(0,Se.jsxs)("section",{ref:a,className:`dsh-ssh-dialog dsh-ssh-scroll-surface${s===void 0?"":` ${s}`}`,"aria-labelledby":i,"aria-describedby":t===void 0?void 0:n,onClickCapture:l,children:[(0,Se.jsxs)("header",{children:[(0,Se.jsxs)("span",{children:[(0,Se.jsx)("h2",{id:i,children:e}),t&&(0,Se.jsx)("p",{id:n,children:t})]}),(0,Se.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:h,"aria-label":"\u5173\u95ED",children:(0,Se.jsx)(Kt.IconCloseOutline16,{size:16})})]}),o]})})})})}function le({label:e,hint:t,children:s}){return(0,Se.jsxs)("label",{className:"dsh-ssh-field",children:[(0,Se.jsx)("span",{children:e}),s,t&&(0,Se.jsx)("small",{children:t})]})}function Rr({value:e,options:t,placeholder:s,maxLength:r,multiple:o=!1,ariaLabel:i,onChange:n}){let a=(0,Me.useId)(),h=(0,Me.useRef)(null),l=(0,Me.useRef)(null),c=(0,Me.useRef)(!1),f=(0,Me.useMemo)(()=>yl(t).sort((w,C)=>w.localeCompare(C,void 0,{numeric:!0,sensitivity:"base"})),[t]),[v,g]=(0,Me.useState)(!1),[u,d]=(0,Me.useState)(""),[m,p]=(0,Me.useState)(0),b=(0,Me.useMemo)(()=>o?bp(e):e.trim()?[e.trim()]:[],[o,e]),x=(0,Me.useMemo)(()=>{let w=u.trim().toLocaleLowerCase();return f.filter(C=>(!o||!b.some(P=>xl(P,C)))&&(w.length===0||C.toLocaleLowerCase().includes(w)))},[u,o,f,b]);(0,Me.useEffect)(()=>{if(!v)return;let w=C=>{C.target instanceof Node&&!h.current?.contains(C.target)&&g(!1)};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[v]),(0,Me.useEffect)(()=>{p(w=>Math.min(w,Math.max(0,x.length-1)))},[x.length]);let y=w=>{if(!o)n(w);else{let C=bp(e),P=u.trim().length>0&&C.length>0;n(yl([...P?C.slice(0,-1):C,w]).join(", "))}d(""),g(!1),document.activeElement!==l.current&&(c.current=!0,l.current?.focus())},S=w=>{if(w.key==="ArrowDown"||w.key==="ArrowUp"){if(w.preventDefault(),!v){g(!0),p(0);return}let C=w.key==="ArrowDown"?1:-1;p(P=>(P+C+x.length)%Math.max(1,x.length))}else w.key==="Enter"&&v&&x[m]!==void 0?(w.preventDefault(),y(x[m])):w.key==="Escape"&&v&&(w.preventDefault(),g(!1))},_=w=>{n(w),d(o?w.split(/[,,]/u).at(-1)?.trim()??"":w),p(0),g(!0)};return(0,Se.jsxs)("div",{ref:h,className:`dsh-ssh-suggestion-input${v?" is-open":""}`,children:[(0,Se.jsx)("input",{ref:l,role:"combobox","aria-label":i,"aria-autocomplete":"list","aria-expanded":v,"aria-controls":a,"aria-activedescendant":v&&x[m]!==void 0?`${a}-${m}`:void 0,value:e,maxLength:r,placeholder:s,onChange:w=>_(w.target.value),onFocus:()=>{if(c.current){c.current=!1;return}d(o?"":e),f.length>0&&g(!0)},onKeyDown:S}),(0,Se.jsx)("button",{type:"button",className:"dsh-ssh-suggestion-toggle","aria-label":`${v?"\u6536\u8D77":"\u5C55\u5F00"}${i}\u5DF2\u6709\u9009\u9879`,"aria-expanded":v,onClick:()=>{if(v){g(!1);return}d(""),p(0),g(!0),l.current?.focus()},children:(0,Se.jsx)(Kt.IconChevronDownOutline14,{size:14})}),v&&(0,Se.jsx)("div",{id:a,className:"dsh-ssh-suggestion-menu dsh-ssh-scroll-surface",role:"listbox","aria-label":`${i}\u5DF2\u6709\u9009\u9879`,children:x.length===0?(0,Se.jsx)("p",{children:f.length===0?"\u6682\u65E0\u5DF2\u6709\u9009\u9879\uFF0C\u53EF\u76F4\u63A5\u8F93\u5165":"\u6CA1\u6709\u5339\u914D\u9879\uFF0C\u53EF\u76F4\u63A5\u8F93\u5165\u65B0\u5185\u5BB9"}):x.map((w,C)=>(0,Se.jsxs)("button",{id:`${a}-${C}`,type:"button",role:"option","aria-selected":!o&&xl(e,w),className:C===m?"is-active":"",onPointerMove:()=>p(C),onClick:()=>y(w),children:[(0,Se.jsx)("span",{children:w}),!o&&xl(e,w)&&(0,Se.jsx)(Kt.IconCheckOutline14,{size:14})]},w))})]})}function wl(e){let[t,s]=(0,Me.useState)(!1);return(0,Se.jsxs)("div",{className:"dsh-ssh-password-input",children:[(0,Se.jsx)("input",{...e,type:t?"text":"password"}),(0,Se.jsx)("button",{type:"button","aria-label":t?"\u9690\u85CF\u5BC6\u7801":"\u663E\u793A\u5BC6\u7801","aria-pressed":t,onClick:()=>s(r=>!r),children:t?"\u9690\u85CF":"\u663E\u793A"})]})}function nr({active:e,onClick:t,children:s}){let r=(0,Me.useRef)(null);return gp(r,e),(0,Se.jsx)("button",{ref:r,type:"button",role:"tab","data-ssh-interactive":"choice",className:e?"is-active":"","aria-selected":e,onClick:t,children:s})}function _p(){let e=(0,Me.useRef)(null);return vp(e),(0,Se.jsxs)("div",{ref:e,className:"dsh-ssh-empty-state",children:[(0,Se.jsx)("span",{children:(0,Se.jsx)(Ts,{})}),(0,Se.jsx)("h1",{children:"\u8FDE\u63A5\u4F60\u7684\u7B2C\u4E00\u53F0\u8FDC\u7AEF\u4E3B\u673A"}),(0,Se.jsx)("p",{children:"\u4F7F\u7528\u201C\u4E3B\u673A\u4E0E\u9879\u76EE\u201D\u65C1\u7684\u6DFB\u52A0\u6309\u94AE\u4FDD\u5B58 SSH \u914D\u7F6E\uFF0C\u968F\u540E\u5373\u53EF\u6253\u5F00\u7EC8\u7AEF\u3001\u5EFA\u7ACB\u7AEF\u53E3\u8F6C\u53D1\uFF0C\u5E76\u6309\u4F1A\u8BDD\u6388\u6743\u7ED9 AI\u3002"})]})}function Ts(){return(0,Se.jsx)("span",{className:"dsh-ssh-server-glyph",children:(0,Se.jsx)(Kt.IconDataOutline16,{size:17})})}function De(e){return e instanceof Error?e.message:String(e)}function xp(e){return e.length<=16?e:`${e.slice(0,8)}\u2026${e.slice(-5)}`}function bp(e){return yl(e.split(/[,,]/u))}function xl(e,t){return e.trim().localeCompare(t.trim(),void 0,{sensitivity:"accent"})===0}function yl(e){let t=new Map;for(let s of e){let r=s.trim();r.length>0&&!t.has(r.toLocaleLowerCase())&&t.set(r.toLocaleLowerCase(),r)}return[...t.values()]}var Ve=require("react/jsx-runtime");function Rn({locationName:e,locationKind:t,entries:s,onClose:r,onDelete:o}){let[i,n]=(0,Sl.useState)(!1),[a,h]=(0,Sl.useState)(),l=s.filter(f=>f.kind==="directory").length,c=async()=>{n(!0),h(void 0);try{await o(),n(!1),r()}catch(f){h(De(f)),n(!1)}};return(0,Ve.jsxs)(Ye,{className:"dsh-ssh-file-delete-dialog",title:`\u5220\u9664 ${s.length} \u9879\uFF1F`,subtitle:`${e} \xB7 \u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500`,onClose:()=>{i||r()},children:[(0,Ve.jsxs)("div",{className:"dsh-ssh-file-delete-copy",children:[(0,Ve.jsx)("span",{children:(0,Ve.jsx)(Ar.IconTrashOutline16,{size:18})}),(0,Ve.jsxs)("p",{children:["\u5C06\u76F4\u63A5\u4ECE",t==="local"?"\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8FDC\u7AEF","\u5220\u9664\u6240\u9009\u5185\u5BB9\u3002",l>0?`\u5176\u4E2D ${l} \u4E2A\u76EE\u5F55\u53CA\u5176\u5168\u90E8\u5185\u5BB9\u4F1A\u88AB\u9012\u5F52\u5220\u9664\u3002`:""]})]}),(0,Ve.jsxs)("div",{className:"dsh-ssh-file-delete-list",children:[s.slice(0,6).map(f=>(0,Ve.jsxs)("div",{children:[f.kind==="directory"?(0,Ve.jsx)(Ar.IconFolderClose16,{size:17}):(0,Ve.jsx)(Ar.IconDataOutline16,{size:17}),(0,Ve.jsxs)("span",{children:[(0,Ve.jsx)("strong",{children:f.name}),(0,Ve.jsx)("small",{title:f.path,children:f.path})]})]},f.path)),s.length>6&&(0,Ve.jsxs)("p",{children:["\u4EE5\u53CA\u5176\u4ED6 ",s.length-6," \u9879"]})]}),a&&(0,Ve.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,Ve.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,Ve.jsx)("span",{}),(0,Ve.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:i,onClick:r,children:"\u53D6\u6D88"}),(0,Ve.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:i,onClick:()=>{c()},children:i?"\u6B63\u5728\u5220\u9664\u2026":"\u786E\u8BA4\u5220\u9664"})]})]})}var G=require("react/jsx-runtime"),B0=512*1024*1024;function wp({sessionId:e}){let t=(0,xe.useCallback)(i=>th(e,i||void 0),[e]),s=(0,xe.useCallback)(i=>sh(e,i),[e]),r=(0,xe.useCallback)((i,n=!1)=>ih(e,i,n),[e]),o=(0,xe.useCallback)((i,n)=>rh(e,i,n),[e]);return(0,G.jsx)(Cl,{initialPath:"",loadDirectory:t,loadPreview:s,fileUrl:r,deletion:{locationName:"\u672C\u5730\u4F1A\u8BDD",locationKind:"local",remove:o}})}function Sp({sessionId:e,profile:t,profiles:s,onProfile:r,onSaved:o}){let i=(0,xe.useCallback)(async(g,u)=>{let d=u?(await gh(e,t.id,g)).cwd:g,m=await eh(e,t.id,d);return u&&await o(),m},[o,t.id,e]),n=(0,xe.useCallback)(g=>nh(e,t.id,g),[t.id,e]),a=(0,xe.useCallback)((g,u=!1)=>oh(e,t.id,g,u),[t.id,e]),h=(0,xe.useCallback)((g,u,d)=>Wn(t.id,g,u,d),[t.id]),l=Cp(`activity-sftp-${e}-${t.id}`),c=`sftp:${t.id}`,f=(0,xe.useCallback)((g,u)=>Br({paneId:l,endpointId:c,directory:g,paths:u}),[c,l]),v=(0,G.jsxs)("div",{className:"dsh-ssh-sftp-hostbar",children:[(0,G.jsx)("span",{className:"dsh-ssh-host-monogram",children:t.name.slice(0,1).toUpperCase()}),(0,G.jsxs)("label",{children:[(0,G.jsx)("span",{className:"sr-only",children:"\u9009\u62E9\u8FDC\u7AEF\u4E3B\u673A"}),(0,G.jsx)("select",{value:t.id,onChange:g=>r(g.target.value),children:s.map(g=>(0,G.jsx)("option",{value:g.id,children:g.name},g.id))}),(0,G.jsxs)("small",{children:[t.username,"@",t.host,":",t.port]})]})]});return(0,G.jsx)(Cl,{initialPath:t.cwd,header:v,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:t.name},deletion:{locationName:t.name,locationKind:"remote",remove:f}})}function kp({profile:e,initialPath:t="~",onEdit:s,onDelete:r,embedded:o=!1}){let i=(0,xe.useCallback)(v=>ah(e.id,v),[e.id]),n=(0,xe.useCallback)(v=>lh(e.id,v),[e.id]),a=(0,xe.useCallback)((v,g=!1)=>hh(e.id,v,g),[e.id]),h=(0,xe.useCallback)((v,g,u)=>Wn(e.id,v,g,u),[e.id]),l=Cp(`profile-sftp-${e.id}`),c=`sftp:${e.id}`,f=(0,xe.useCallback)((v,g)=>Br({paneId:l,endpointId:c,directory:v,paths:g}),[c,l]);return(0,G.jsxs)("div",{className:`dsh-ssh-profile-sftp-pane${o?" is-embedded":""}`,children:[(0,G.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,G.jsxs)("div",{children:[(0,G.jsx)("h1",{children:o?"SFTP":`${e.name} \xB7 SFTP`}),(0,G.jsx)("p",{children:o?t:`${Yt(e)} \xB7 ${t}`})]}),(0,G.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[r&&(0,G.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:r,children:(0,G.jsx)(Ce.IconTrashOutline16,{size:16})}),s&&(0,G.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,children:[(0,G.jsx)(Ce.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,G.jsx)(Cl,{workspace:!0,initialPath:t,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:e.name},deletion:{locationName:e.name,locationKind:"remote",remove:f}})]})}function Cl({initialPath:e,header:t,workspace:s=!1,loadDirectory:r,loadPreview:o,fileUrl:i,uploadFile:n,operations:a,deletion:h}){let l=(0,xe.useRef)(null),c=(0,xe.useRef)(0),[f,v]=(0,xe.useState)(),[g,u]=(0,xe.useState)(),[d,m]=(0,xe.useState)(e),[p,b]=(0,xe.useState)(!0),[x,y]=(0,xe.useState)(),[S,_]=(0,xe.useState)(),[w,C]=(0,xe.useState)(!1),[P,T]=(0,xe.useState)(),[A,F]=(0,xe.useState)(),[B,U]=(0,xe.useState)(),[N,H]=(0,xe.useState)(),[E,R]=(0,xe.useState)(),L=(0,xe.useCallback)(async(W,ae)=>{b(!0),R(void 0),u(void 0),_(void 0);try{let me=await r(W,ae);v(me),m(me.path)}catch(me){R(An(me))}finally{b(!1)}},[r]);(0,xe.useEffect)(()=>{L(e,!1)},[L,e]);let k=W=>{W.preventDefault(),L(d,!0)},$=async(W,ae=f?.path,me=!1)=>{if(n===void 0||ae===void 0||W.length===0)return;let Re=W.filter(Pe=>Pe.size<=B0),re=W.length-Re.length;if(Re.length===0){R("\u5355\u4E2A\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7 512 MB");return}_(void 0),R(void 0);for(let Pe=0;Pe<Re.length;Pe+=1){let gt=Re[Pe],hs=me&&Pe===0;y(gt.name);try{await n(ae,gt,hs)}catch(Bt){!hs&&Bt instanceof cs&&Bt.status===409?_({file:gt,remaining:Re.slice(Pe+1),directory:ae}):R(An(Bt)),y(void 0);return}}y(void 0),await L(ae,!1),re>0&&R(`\u5DF2\u8DF3\u8FC7 ${re} \u4E2A\u8D85\u8FC7 512 MB \u7684\u6587\u4EF6`)},X=n!==void 0&&f!==void 0&&x===void 0&&S===void 0,O=W=>Array.from(W.dataTransfer.types).includes("Files"),se=W=>Array.from(W.dataTransfer.types).includes(Ft),z=W=>{!X||!O(W)||(W.preventDefault(),c.current+=1,C(!0))},I=W=>{if(X&&O(W)){W.preventDefault(),W.dataTransfer.dropEffect="copy";return}if(a===void 0||f===void 0||!se(W))return;let ae=P===void 0?"copy":si(P,{endpointId:a.endpointId,directory:f.path});ae==="none"||ae==="invalid"||(W.preventDefault(),W.dataTransfer.dropEffect=ae)},J=W=>{O(W)&&(c.current=Math.max(0,c.current-1),c.current===0&&C(!1))},Y=W=>{if(c.current=0,C(!1),X&&O(W)){W.preventDefault();let me=Array.from(W.dataTransfer.files);me.length>0&&$(me);return}if(a===void 0||f===void 0||!se(W))return;W.preventDefault();let ae=br(W.dataTransfer.getData(Ft));ae!==void 0&&V(ae,f.path)},V=async(W,ae)=>{if(a!==void 0){F(void 0),T(void 0),H(void 0),R(void 0);try{let me=await cn(W,{paneId:a.paneId,endpointId:a.endpointId,directory:ae});me.operation==="move"&&(H("\u5DF2\u79FB\u52A8"),await L(f?.path??ae,!1)),me.operation==="copy"&&H("\u5DF2\u52A0\u5165\u4F20\u8F93\u4EFB\u52A1\uFF0C\u53EF\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u67E5\u770B\u8FDB\u5EA6")}catch(me){R(An(me))}}},Q=async()=>{h===void 0||f===void 0||B===void 0||(await h.remove(f.path,[B.path]),await L(f.path,!1))};return(0,G.jsxs)("div",{className:`dsh-ssh-sftp${s?" is-workspace":""}${w?" is-dragging-files":""}`,onDragEnter:z,onDragOver:I,onDragLeave:J,onDrop:Y,children:[t,g?(0,G.jsx)(N0,{entry:g,loadPreview:o,fileUrl:i,onBack:()=>u(void 0)}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("form",{className:`dsh-ssh-sftp-pathbar${n===void 0?"":" has-upload"}`,onSubmit:k,children:[(0,G.jsx)("button",{type:"button","aria-label":"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",title:"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",disabled:f?.parent==null||p,onClick:()=>{f?.parent&&L(f.parent,!0)},children:(0,G.jsx)(Ce.IconChevronLeftOutline14,{size:14})}),(0,G.jsx)("input",{"aria-label":"\u5F53\u524D\u8FDC\u7AEF\u76EE\u5F55",value:d,spellCheck:!1,onChange:W=>m(W.target.value)}),(0,G.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",title:"\u5237\u65B0\u76EE\u5F55",disabled:p,onClick:()=>{L(f?.path??d,!1)},children:(0,G.jsx)(Ce.IconRefreshOutline16,{size:15})}),n!==void 0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("input",{ref:l,className:"sr-only",type:"file",multiple:!0,tabIndex:-1,onChange:W=>{let ae=Array.from(W.target.files??[]);W.target.value="",ae.length>0&&$(ae)}}),(0,G.jsxs)("button",{type:"button",className:"dsh-ssh-sftp-upload-button",disabled:f===void 0||x!==void 0||S!==void 0,onClick:()=>l.current?.click(),children:[(0,G.jsx)(Ce.IconSendOutline14,{size:14}),x===void 0?"\u4E0A\u4F20":"\u4E0A\u4F20\u4E2D"]})]})]}),S!==void 0&&(0,G.jsxs)("div",{className:"dsh-ssh-upload-conflict",role:"alert",children:[(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{children:"\u540C\u540D\u6587\u4EF6\u5DF2\u5B58\u5728"}),(0,G.jsx)("small",{children:S.file.name})]}),(0,G.jsxs)("span",{children:[(0,G.jsx)("button",{type:"button",onClick:()=>{let W=S;_(void 0),$(W.remaining,W.directory)},children:"\u8DF3\u8FC7"}),(0,G.jsx)("button",{type:"button",className:"is-primary",disabled:x!==void 0,onClick:()=>{let W=S;$([W.file,...W.remaining],W.directory,!0)},children:"\u8986\u76D6\u4E0A\u4F20"})]})]}),N&&(0,G.jsxs)("div",{className:"dsh-ssh-sftp-operation-status",role:"status",children:[(0,G.jsx)("span",{children:N}),(0,G.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u63D0\u793A",onClick:()=>H(void 0),children:(0,G.jsx)(Ce.IconCloseOutline16,{size:14})})]}),E&&(0,G.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:E}),(0,G.jsxs)("div",{className:"dsh-ssh-sftp-table dsh-ssh-scroll-surface","aria-busy":p,children:[(0,G.jsxs)("div",{className:"dsh-ssh-sftp-columns",children:[(0,G.jsx)("span",{children:"\u540D\u79F0"}),(0,G.jsx)("span",{children:"\u5927\u5C0F"}),(0,G.jsx)("span",{children:"\u4FEE\u6539\u65F6\u95F4"}),(0,G.jsx)("span",{"aria-hidden":"true"})]}),p&&f===void 0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u2026"}):f?.entries.length===0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B64\u76EE\u5F55\u4E3A\u7A7A"}):f?.entries.map(W=>{let ae=hn(W),me=P===void 0||a===void 0?void 0:si(P,{endpointId:a.endpointId,directory:W.path}),Re=ae&&me!=="none"&&me!=="invalid";return(0,G.jsxs)("div",{role:"row",tabIndex:0,"aria-label":`${W.name}${ae?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":"\uFF0C\u6587\u4EF6\uFF0C\u5355\u51FB\u9884\u89C8"}`,"data-ssh-interactive":"row","data-ssh-context-row":!0,draggable:a!==void 0&&(W.kind==="file"||ae),className:`dsh-ssh-sftp-row is-${ae?"directory":W.kind}${A===W.path?" is-drop-target":""}`,onClick:()=>{ae?L(W.path,!0):u(W)},onKeyDown:re=>{re.target===re.currentTarget&&re.key==="Enter"&&(ae?L(W.path,!0):u(W))},onDragStart:re=>{if(a===void 0||f===void 0)return;let Pe={paneId:a.paneId,endpointId:a.endpointId,directory:f.path,paths:[W.path]};T(Pe),re.dataTransfer.effectAllowed="copyMove",re.dataTransfer.setData(Ft,JSON.stringify(Pe))},onDragEnd:()=>{T(void 0),F(void 0)},onDragOver:re=>{let Pe=X&&O(re);!ae||!Pe&&!se(re)||!Pe&&!Re||(re.preventDefault(),re.stopPropagation(),re.dataTransfer.dropEffect=Pe||me!=="move"?"copy":"move",F(W.path))},onDragLeave:re=>{re.currentTarget.contains(re.relatedTarget)||F(void 0)},onDrop:re=>{if(!ae)return;if(re.preventDefault(),re.stopPropagation(),F(void 0),X&&O(re)){let gt=Array.from(re.dataTransfer.files);gt.length>0&&$(gt,W.path);return}let Pe=br(re.dataTransfer.getData(Ft));Pe!==void 0&&V(Pe,W.path)},children:[(0,G.jsxs)("span",{children:[ae?(0,G.jsx)(Ce.IconFolderClose16,{size:16}):(0,G.jsx)(Ce.IconDataOutline16,{size:16}),(0,G.jsx)("strong",{title:W.name,children:W.name})]}),(0,G.jsx)("small",{children:ae?"-":kl(W.size)}),(0,G.jsx)("small",{children:z0(W.modifiedAt)}),h!==void 0&&(0,G.jsx)("button",{type:"button",className:"dsh-ssh-sftp-row-delete dsh-ssh-context-action",draggable:!1,"aria-label":`\u5220\u9664 ${W.name}`,title:`\u5220\u9664 ${W.name}`,onClick:re=>{re.stopPropagation(),U(W)},children:(0,G.jsx)(Ce.IconTrashOutline16,{size:14})})]},W.path)})]})]}),w&&(0,G.jsx)("div",{className:"dsh-ssh-sftp-dropzone","aria-hidden":"true",children:(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{children:"\u677E\u5F00\u4EE5\u4E0A\u4F20"}),(0,G.jsxs)("small",{children:["\u4E0A\u4F20\u5230 ",f?.path??d]})]})}),B!==void 0&&h!==void 0&&(0,G.jsx)(Rn,{locationName:h.locationName,locationKind:h.locationKind,entries:[B],onClose:()=>U(void 0),onDelete:Q})]})}function N0({entry:e,loadPreview:t,fileUrl:s,onBack:r}){let[o,i]=(0,xe.useState)(),[n,a]=(0,xe.useState)(),[h,l]=(0,xe.useState)(!1);(0,xe.useEffect)(()=>{let f=!1;return i(void 0),a(void 0),t(e.path).then(v=>{f||i(v)}).catch(v=>{f||a(An(v))}),()=>{f=!0}},[e.path,t]);let c=s(e.path);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("section",{className:"dsh-ssh-file-preview",children:[(0,G.jsxs)("header",{children:[(0,G.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u76EE\u5F55",title:"\u8FD4\u56DE\u76EE\u5F55",onClick:r,children:(0,G.jsx)(Ce.IconChevronLeftOutline14,{size:14})}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-title",children:[(0,G.jsx)("strong",{title:e.name,children:e.name}),(0,G.jsx)("small",{children:kl(e.size)})]}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,G.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,G.jsx)(Ce.IconDownloadOutline16,{size:16})}),(0,G.jsx)("button",{type:"button","aria-label":"\u653E\u5927\u9884\u89C8",title:"\u653E\u5927\u9884\u89C8",onClick:()=>l(!0),children:(0,G.jsx)(Ce.IconFullscreenOutline16,{size:16})})]})]}),(0,G.jsx)("div",{className:"dsh-ssh-file-preview-body dsh-ssh-scroll-surface",children:(0,G.jsx)(yp,{entry:e,preview:o,error:n,fileUrl:s,downloadUrl:c})})]}),(0,G.jsx)(Ce.Modal,{open:h,onClose:()=>l(!1),title:`\u9884\u89C8 ${e.name}`,closeLabel:"\u5173\u95ED\u9884\u89C8",headless:!0,className:"dsh-ssh-preview-modal",children:(0,G.jsxs)("section",{className:"dsh-ssh-preview-modal-shell",children:[(0,G.jsxs)("header",{children:[(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{title:e.name,children:e.name}),(0,G.jsx)("small",{children:kl(e.size)})]}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,G.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,G.jsx)(Ce.IconDownloadOutline16,{size:16})}),(0,G.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u9884\u89C8",title:"\u5173\u95ED\u9884\u89C8",onClick:()=>l(!1),children:(0,G.jsx)(Ce.IconCloseOutline16,{size:16})})]})]}),(0,G.jsx)("div",{className:"dsh-ssh-file-preview-body is-modal dsh-ssh-scroll-surface",children:(0,G.jsx)(yp,{entry:e,preview:o,error:n,fileUrl:s,downloadUrl:c})})]})})]})}function yp({entry:e,preview:t,error:s,fileUrl:r,downloadUrl:o}){return s?(0,G.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:s}):t===void 0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u6253\u5F00\u6587\u4EF6\u2026"}):t.kind==="text"&&t.mimeType==="text/markdown"?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("article",{className:"dsh-ssh-markdown-preview",children:(0,G.jsx)($o,{remarkPlugins:[an],components:{a:i=>(0,G.jsx)("a",{...i,target:"_blank",rel:"noreferrer"})},children:t.text||""})}),t.truncated&&(0,G.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="text"?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("pre",{children:t.text||""}),t.truncated&&(0,G.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="image"?(0,G.jsx)("img",{src:r(e.path,!0),alt:e.name}):t.kind==="pdf"?(0,G.jsx)("iframe",{src:r(e.path,!0),title:e.name}):(0,G.jsxs)("div",{className:"dsh-ssh-file-binary",children:[(0,G.jsx)(Ce.IconDataOutline16,{size:24}),(0,G.jsx)("strong",{children:"\u6B64\u6587\u4EF6\u65E0\u6CD5\u76F4\u63A5\u9884\u89C8"}),(0,G.jsx)("p",{children:t.mimeType}),(0,G.jsxs)("a",{href:o,children:[(0,G.jsx)(Ce.IconDownloadOutline16,{size:16}),"\u4E0B\u8F7D\u6587\u4EF6"]})]})}function kl(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],s=e/1024,r=0;for(;s>=1024&&r<t.length-1;)s/=1024,r+=1;return`${s>=10?s.toFixed(0):s.toFixed(1)} ${t[r]}`}function z0(e){return new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(e)}function An(e){return e instanceof Error?e.message:String(e)}function Cp(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,100)}var Ir=class{constructor(t){this.endpoints=t}input="";inputSequence=0;inputScheduled=!1;disposed=!1;sendInput(t,s){this.disposed||!t||(this.input+=t,!this.inputScheduled&&(this.inputScheduled=!0,queueMicrotask(()=>{if(this.inputScheduled=!1,this.disposed)return;let r=this.input;if(this.input="",!r)return;let o=this.inputSequence++;this.deliverInput(r,o,s)})))}observe(t){let s=!1,r=0,o,i,n,a=!1,h=()=>{s||(s=!0,o?.close(),i!==void 0&&clearTimeout(i),n!==void 0&&clearTimeout(n))},l=v=>{s||(r=v.cursor,t.output(v),v.closed&&h())},c=async()=>{if(!s)try{let v=await this.endpoints.read(r);l(v),s||(n=window.setTimeout(()=>{c()},document.hidden?500:v.data?16:64))}catch(v){if(s)return;t.error(v),n=window.setTimeout(()=>{c()},500)}},f=()=>{s||n!==void 0||(o?.close(),o=void 0,c())};return typeof EventSource>"u"?(f(),h):(o=new EventSource(this.endpoints.streamUrl),o.onmessage=v=>{try{let g=H0(v.data);a=!0,i!==void 0&&(clearTimeout(i),i=void 0),l(g)}catch(g){t.error(g),f()}},o.onerror=()=>{!a&&o?.readyState===EventSource.CLOSED&&f()},i=window.setTimeout(()=>{a||f()},1500),h)}dispose(){this.disposed=!0,this.input=""}deliverInput(t,s,r,o=0){this.endpoints.send(t,s).catch(i=>{if(!this.disposed){if(o<2&&$0(i)){window.setTimeout(()=>this.deliverInput(t,s,r,o+1),60*(o+1));return}r(i)}})}};function H0(e){let t=JSON.parse(e);if(typeof t.data!="string"||typeof t.cursor!="number"||!Number.isSafeInteger(t.cursor)||t.cursor<0||typeof t.truncated!="boolean"||typeof t.closed!="boolean")throw new Error("SSH terminal stream returned an invalid event");return t}function $0(e){if(typeof e!="object"||e===null||!("status"in e))return!0;let t=Number(e.status);return!Number.isFinite(t)||t>=500}var Pp=Fr(Tp(),1),U0={background:"#1c1c1e",foreground:"#f2f2f7",cursor:"#f2f2f7",cursorAccent:"#1c1c1e",selectionBackground:"#8e8e9366",black:"#1c1c1e",red:"#ff453a",green:"#30d158",yellow:"#ffd60a",blue:"#a5a5aa",magenta:"#bf5af2",cyan:"#64d2ff",white:"#e5e5ea",brightBlack:"#8e8e93",brightRed:"#ff6961",brightGreen:"#66d47e",brightYellow:"#ffe45c",brightBlue:"#d1d1d6",brightMagenta:"#da8fff",brightCyan:"#8be0ff",brightWhite:"#ffffff"};function Ln(e){return new Pp.Terminal({convertEol:!0,cursorBlink:e.readOnly!==!0,cursorInactiveStyle:"outline",disableStdin:e.readOnly===!0,fontFamily:'"SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace',fontSize:e.compact===!0?12:13,fontWeight:"400",fontWeightBold:"600",letterSpacing:0,lineHeight:1.25,scrollback:e.scrollback,theme:U0})}function On(e,t,s,r){let o,i=!1,n="",a=()=>{if(i||e.clientWidth===0||e.clientHeight===0)return;s.fit(),t.scrollToBottom();let c=`${t.cols}x${t.rows}`;c!==n&&(n=c,r?.(t.cols,t.rows))},h=()=>{o!==void 0&&cancelAnimationFrame(o),o=requestAnimationFrame(()=>{o=void 0,a()})},l=new ResizeObserver(h);return l.observe(e),document.fonts?.ready.then(h).catch(()=>{}),h(),{fit:a,dispose(){i=!0,o!==void 0&&cancelAnimationFrame(o),l.disconnect()}}}var ce=require("react/jsx-runtime");function Rp(e){let t=String(e.sessionId),[s,r]=(0,Ge.useState)(),[o,i]=(0,Ge.useState)(()=>e.controller.requestedView(t)??"local-directory"),[n,a]=(0,Ge.useState)();(0,Ge.useEffect)(()=>e.controller.subscribe(()=>{let l=e.controller.requestedView(t);l!==void 0&&i(l)}),[e.controller,t]);let h=(0,Ge.useCallback)(async()=>{try{let l=await Ql(t);r(l),l.injection?.permission!=="terminal"&&(e.controller.requestedView(t)==="terminals"&&e.controller.open(t,void 0,"local-directory"),i(c=>c==="terminals"?"local-directory":c)),a(void 0)}catch(l){a(De(l))}},[e.controller,t]);return(0,Ge.useEffect)(()=>{let l=!1,c,f=!1,v=async()=>{if(f||(f=!0,await h(),f=!1,l))return;let u=o==="terminals"?2200:3200;c=window.setTimeout(()=>{v()},document.visibilityState==="hidden"?12e3:u)},g=()=>{document.visibilityState!=="visible"||l||(c!==void 0&&window.clearTimeout(c),c=void 0,v())};return document.addEventListener("visibilitychange",g),v(),()=>{l=!0,c!==void 0&&window.clearTimeout(c),document.removeEventListener("visibilitychange",g)}},[h,o]),(0,ce.jsxs)("section",{className:"dsh-ssh-activity-panel","aria-label":"SSH \u6D3B\u52A8",children:[(0,ce.jsxs)("header",{className:"dsh-ssh-activity-header",children:[(0,ce.jsxs)("div",{className:"dsh-ssh-activity-title",children:[(0,ce.jsx)("span",{className:"dsh-ssh-activity-mark",children:(0,ce.jsx)(Ts,{})}),(0,ce.jsxs)("span",{children:[(0,ce.jsx)("strong",{children:"SSH \u6D3B\u52A8"}),(0,ce.jsxs)("small",{children:["\u5F53\u524D\u4F1A\u8BDD \xB7 ",xp(t)]})]})]}),(0,ce.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u5173\u95ED SSH \u6D3B\u52A8",onClick:()=>e.controller.close(t),children:(0,ce.jsx)(as.IconCloseOutline16,{size:16})})]}),s&&(0,ce.jsxs)("nav",{className:"dsh-ssh-activity-tabs","aria-label":"SSH \u6D3B\u52A8\u89C6\u56FE",children:[(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="local-directory"?"is-active":"","aria-pressed":o==="local-directory",onClick:()=>e.controller.open(t,void 0,"local-directory"),children:[(0,ce.jsx)(as.IconFolderOpenOutline16,{size:16}),"\u4F1A\u8BDD\u76EE\u5F55"]}),s.profiles.length>0&&(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="remote-directory"?"is-active":"","aria-pressed":o==="remote-directory",onClick:()=>e.controller.open(t,void 0,"remote-directory"),children:[(0,ce.jsx)(Ts,{}),"\u8FDC\u7AEF\u76EE\u5F55"]}),s.injection?.permission==="terminal"&&(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="terminals"?"is-active":"","aria-pressed":o==="terminals",onClick:()=>e.controller.open(t,void 0,"terminals"),children:[(0,ce.jsx)(as.IconCodeOutline16,{size:16}),"\u7EC8\u7AEF",s.terminals.length>0&&(0,ce.jsx)("em",{children:s.terminals.length})]})]}),(0,ce.jsxs)("div",{className:"dsh-ssh-activity-body",children:[s===void 0?(0,ce.jsx)("p",{className:"dsh-ssh-activity-state",role:"status",children:"\u6B63\u5728\u8BFB\u53D6 SSH \u4F1A\u8BDD\u2026"}):o==="local-directory"?(0,ce.jsx)(wp,{sessionId:t}):o==="remote-directory"?(0,ce.jsx)(V0,{sessionId:t,profiles:s.profiles,selectedProfileId:e.controller.selected(t),onProfile:l=>e.controller.open(t,l,"remote-directory"),onSaved:h}):(0,ce.jsx)(j0,{sessionId:t,terminals:s.terminals,onClosed:h}),n&&(0,ce.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n})]})]})}function V0({sessionId:e,profiles:t,selectedProfileId:s,onProfile:r,onSaved:o}){let i=t.find(n=>n.id===s)??t[0];return i===void 0?(0,ce.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,ce.jsx)(as.IconFolderOpenOutline16,{size:22}),(0,ce.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u6D4F\u89C8\u7684\u8FDC\u7AEF"}),(0,ce.jsx)("p",{children:"\u8BF7\u5148\u5728 SSH \u9762\u677F\u4E2D\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u8BBF\u95EE\u4E00\u53F0\u4E3B\u673A\u3002"})]}):(0,ce.jsx)(Sp,{sessionId:e,profile:i,profiles:t,onProfile:r,onSaved:o},i.id)}function j0({sessionId:e,terminals:t,onClosed:s}){let r=[...t].reverse().find(g=>g.status.kind==="running")??t.at(-1),[o,i]=(0,Ge.useState)(r?.terminalId),[n,a]=(0,Ge.useState)(),[h,l]=(0,Ge.useState)(),c=t.find(g=>g.terminalId===o)??r;if((0,Ge.useEffect)(()=>{(o===void 0||!t.some(g=>g.terminalId===o))&&i(r?.terminalId)},[r?.terminalId,o,t]),c===void 0)return(0,ce.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,ce.jsx)(as.IconCodeOutline16,{size:22}),(0,ce.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u6253\u5F00\u7684\u7EC8\u7AEF"}),(0,ce.jsx)("p",{children:"AI \u6253\u5F00\u4EA4\u4E92\u7EC8\u7AEF\u540E\uFF0C\u4F1A\u76F4\u63A5\u663E\u793A\u5728\u8FD9\u91CC\u3002"})]});let f=async()=>{if(n===void 0){a(c.terminalId),l(void 0);try{await mh(e,c.terminalId),await s()}catch(g){l(De(g))}finally{a(void 0)}}},v=c.status.kind==="running"?"\u7ED3\u675F":"\u79FB\u9664";return(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-workbench",children:[t.length>1&&(0,ce.jsx)("nav",{className:"dsh-ssh-terminal-switcher dsh-ssh-scroll-surface","aria-label":"SSH \u7EC8\u7AEF",children:t.map((g,u)=>{let d=g.name||`\u7EC8\u7AEF ${u+1}`;return(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",title:d,className:g.terminalId===c.terminalId?"is-active":"","aria-pressed":g.terminalId===c.terminalId,onClick:()=>i(g.terminalId),children:[(0,ce.jsx)("span",{className:`dsh-ssh-terminal-state-dot is-${g.status.kind}`}),(0,ce.jsx)("span",{className:"dsh-ssh-terminal-switcher-label",children:d})]},g.terminalId)})}),(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer",children:[(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer-heading",children:[(0,ce.jsxs)("span",{children:[(0,ce.jsx)("strong",{children:c.name}),(0,ce.jsx)("small",{children:c.cwd})]}),(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer-actions",children:[(0,ce.jsx)("span",{className:`dsh-ssh-terminal-state is-${c.status.kind}`,children:c.status.kind==="running"?"\u8FD0\u884C\u4E2D":"\u5DF2\u9000\u51FA"}),(0,ce.jsxs)("button",{type:"button",className:"dsh-ssh-terminal-close",disabled:n!==void 0,"aria-label":`${v}\u7EC8\u7AEF ${c.name}`,title:c.status.kind==="running"?"\u7ED3\u675F\u5E76\u5173\u95ED\u8FD9\u4E2A\u7EC8\u7AEF":"\u4ECE\u6D3B\u52A8\u9762\u677F\u79FB\u9664\u8FD9\u4E2A\u7EC8\u7AEF",onClick:()=>{f()},children:[(0,ce.jsx)(as.IconCloseOutline16,{size:14}),(0,ce.jsx)("span",{children:n===c.terminalId?"\u5904\u7406\u4E2D":v})]})]})]}),(0,ce.jsx)(W0,{sessionId:e,terminal:c,onError:l},c.terminalId)]}),h&&(0,ce.jsx)("p",{className:"dsh-ssh-terminal-input-error",role:"alert",children:h})]})}function W0({sessionId:e,terminal:t,onError:s}){let r=(0,Ge.useRef)(null),o=(0,Ge.useRef)();return(0,Ge.useEffect)(()=>{let i=r.current;if(i===null)return;let n=Ln({compact:!0,readOnly:t.status.kind!=="running",scrollback:4e3}),a=new Dp.FitAddon;n.loadAddon(a),n.open(i),o.current=n,n.focus();let h=new Ir({streamUrl:uh(e,t.terminalId),read:v=>dh(e,t.terminalId,v),send:(v,g)=>ch(e,t.terminalId,v,g)}),l=n.onData(v=>h.sendInput(v,g=>s(De(g)))),c=h.observe({output:v=>{v.truncated&&n.reset(),v.data&&n.write(v.data),n.scrollToBottom(),s(void 0)},error:v=>s(De(v))}),f=On(i,n,a,(v,g)=>{fh(e,t.terminalId,v,g).catch(u=>s(De(u)))});return()=>{c(),h.dispose(),l.dispose(),f.dispose(),n.dispose(),o.current=void 0}},[t.terminalId,s,e]),(0,Ge.useEffect)(()=>{let i=o.current;i!==void 0&&(i.options.disableStdin=t.status.kind!=="running")},[t.status.kind]),(0,ce.jsx)("div",{className:"dsh-ssh-terminal-screen","aria-label":"\u4EA4\u4E92\u5F0F SSH \u7EC8\u7AEF",children:(0,ce.jsx)("div",{ref:r,className:"dsh-ssh-terminal-viewport"})})}var Ps=require("react"),St=require("react/jsx-runtime");function Ip({className:e,toolbar:t,notice:s,navigation:r,navigationLabel:o,navigationIcon:i,inspector:n,inspectorLabel:a="\u8BE6\u60C5",inspectorIcon:h,children:l}){let[c,f]=(0,Ps.useState)(),v=(0,Ps.useRef)(null),g=(0,Ps.useRef)(null),u=(0,Ps.useRef)(null),d=()=>{f(void 0),window.requestAnimationFrame(()=>{let p=u.current;p?.isConnected&&p.focus()})},m={closePanel:d,openPanel:p=>f(p)};return(0,Ps.useEffect)(()=>{if(c===void 0)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let b=(c==="navigation"?v.current:g.current)?.querySelector('input:not(:disabled), button:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])');window.requestAnimationFrame(()=>b?.focus());let x=y=>{y.key==="Escape"&&d()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[c]),(0,St.jsxs)("main",{className:`dsh-ssh-adaptive-workspace${e===void 0?"":` ${e}`}`,"data-panel":c??"none","data-has-inspector":n===void 0?"false":"true",children:[t,s,(0,St.jsxs)("nav",{className:"dsh-ssh-mobile-actions","aria-label":"\u5DE5\u4F5C\u533A\u9762\u677F",children:[(0,St.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="navigation","aria-controls":"dsh-ssh-adaptive-navigation","aria-expanded":c==="navigation",onClick:()=>c==="navigation"?d():f("navigation"),children:[i,(0,St.jsx)("span",{children:o})]}),n!==void 0&&(0,St.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="inspector","aria-controls":"dsh-ssh-adaptive-inspector","aria-expanded":c==="inspector",onClick:()=>c==="inspector"?d():f("inspector"),children:[h,(0,St.jsx)("span",{children:a})]})]}),(0,St.jsxs)("div",{className:"dsh-ssh-adaptive-shell",children:[(0,St.jsx)("aside",{ref:v,id:"dsh-ssh-adaptive-navigation",className:"dsh-ssh-adaptive-navigation","aria-label":o,children:Ap(r,m)}),(0,St.jsx)("section",{className:"dsh-ssh-adaptive-content",children:l}),n!==void 0&&(0,St.jsx)("aside",{ref:g,id:"dsh-ssh-adaptive-inspector",className:"dsh-ssh-adaptive-inspector","aria-label":a,children:Ap(n,m)}),(0,St.jsx)("button",{type:"button",className:"dsh-ssh-adaptive-backdrop","aria-label":"\u5173\u95ED\u9762\u677F",tabIndex:c===void 0?-1:0,onClick:d})]})]})}function Ap(e,t){return typeof e=="function"?e(t):e}var Lp=`.dsh-ssh-adaptive-workspace {
|
|
39
39
|
container: dsh-ssh-workspace/inline-size;
|
|
40
40
|
position: relative;
|
|
41
41
|
display: flex;
|
|
@@ -195,7 +195,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
195
195
|
backdrop-filter: none;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
`;var
|
|
198
|
+
`;var Op=`.dsh-ssh-border-glow {
|
|
199
199
|
--ssh-border-glow-proximity: 0;
|
|
200
200
|
--ssh-border-glow-angle: 0deg;
|
|
201
201
|
position: relative;
|
|
@@ -309,7 +309,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
309
309
|
display: none;
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
|
-
`;var
|
|
312
|
+
`;var Mp=`.dsh-ssh-glare-hover {
|
|
313
313
|
position: relative;
|
|
314
314
|
display: grid;
|
|
315
315
|
width: 100%;
|
|
@@ -370,7 +370,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
370
370
|
display: none;
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
`;var
|
|
373
|
+
`;var Fp=`/*
|
|
374
374
|
* Shared interaction contract for the whole plugin.
|
|
375
375
|
* Components declare intent only; this file owns neutral hover, selection,
|
|
376
376
|
* edge reflection and reduced-motion behavior so host-theme colors cannot
|
|
@@ -566,7 +566,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
566
566
|
}
|
|
567
567
|
.dsh-ssh-context-action { transition: none; }
|
|
568
568
|
}
|
|
569
|
-
`;var
|
|
569
|
+
`;var Tl="@lemoncat7/dsh-plugin-ui/workspace-activate";function Pl(e){window.dispatchEvent(new CustomEvent(Tl,{detail:{pluginId:e}}))}function Bp(e,t){let s=r=>{r.detail?.pluginId!==e&&t()};return window.addEventListener(Tl,s),()=>window.removeEventListener(Tl,s)}var ye=require("@deepseek-ai/dsh-client-ui-primitives"),df=Fr(Vn(),1);var Np=`/**
|
|
570
570
|
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
571
571
|
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
572
572
|
* https://github.com/chjj/term.js
|
|
@@ -784,7 +784,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
784
784
|
z-index: 2;
|
|
785
785
|
position: relative;
|
|
786
786
|
}
|
|
787
|
-
`;var
|
|
787
|
+
`;var zp=`.sr-only {
|
|
788
788
|
position: absolute;
|
|
789
789
|
width: 1px;
|
|
790
790
|
height: 1px;
|
|
@@ -2560,6 +2560,104 @@ body[data-ds-dark-theme] :is(
|
|
|
2560
2560
|
line-height: 1.4;
|
|
2561
2561
|
font-weight: 400;
|
|
2562
2562
|
}
|
|
2563
|
+
.dsh-ssh-suggestion-input,
|
|
2564
|
+
.dsh-ssh-password-input {
|
|
2565
|
+
position: relative;
|
|
2566
|
+
min-width: 0;
|
|
2567
|
+
font-weight: 400;
|
|
2568
|
+
}
|
|
2569
|
+
.dsh-ssh-suggestion-input > input {
|
|
2570
|
+
padding-right: 38px;
|
|
2571
|
+
}
|
|
2572
|
+
.dsh-ssh-suggestion-toggle,
|
|
2573
|
+
.dsh-ssh-password-input > button {
|
|
2574
|
+
appearance: none;
|
|
2575
|
+
position: absolute;
|
|
2576
|
+
top: 4px;
|
|
2577
|
+
right: 4px;
|
|
2578
|
+
display: grid;
|
|
2579
|
+
height: 30px;
|
|
2580
|
+
place-items: center;
|
|
2581
|
+
border: 0;
|
|
2582
|
+
border-radius: 6px;
|
|
2583
|
+
color: var(--ssh-text-subtle);
|
|
2584
|
+
background: transparent;
|
|
2585
|
+
cursor: pointer;
|
|
2586
|
+
transition: color 140ms ease, background 140ms ease;
|
|
2587
|
+
}
|
|
2588
|
+
.dsh-ssh-suggestion-toggle {
|
|
2589
|
+
width: 30px;
|
|
2590
|
+
}
|
|
2591
|
+
.dsh-ssh-suggestion-toggle:hover,
|
|
2592
|
+
.dsh-ssh-password-input > button:hover {
|
|
2593
|
+
color: var(--ssh-text);
|
|
2594
|
+
background: var(--ssh-hover);
|
|
2595
|
+
}
|
|
2596
|
+
.dsh-ssh-suggestion-input.is-open .dsh-ssh-suggestion-toggle > svg {
|
|
2597
|
+
transform: rotate(180deg);
|
|
2598
|
+
}
|
|
2599
|
+
.dsh-ssh-suggestion-menu {
|
|
2600
|
+
position: absolute;
|
|
2601
|
+
z-index: 40;
|
|
2602
|
+
top: calc(100% + 6px);
|
|
2603
|
+
right: 0;
|
|
2604
|
+
left: 0;
|
|
2605
|
+
display: grid;
|
|
2606
|
+
max-height: 176px;
|
|
2607
|
+
gap: 2px;
|
|
2608
|
+
padding: 5px;
|
|
2609
|
+
overflow: auto;
|
|
2610
|
+
border: 1px solid color-mix(in srgb, var(--ssh-border) 76%, var(--ssh-text) 24%);
|
|
2611
|
+
border-radius: 10px;
|
|
2612
|
+
background: var(--ssh-modal-surface-raised);
|
|
2613
|
+
box-shadow: var(--ssh-shadow-md);
|
|
2614
|
+
}
|
|
2615
|
+
.dsh-ssh-suggestion-menu > button {
|
|
2616
|
+
appearance: none;
|
|
2617
|
+
display: flex;
|
|
2618
|
+
min-height: 34px;
|
|
2619
|
+
align-items: center;
|
|
2620
|
+
justify-content: space-between;
|
|
2621
|
+
gap: 8px;
|
|
2622
|
+
padding: 0 9px;
|
|
2623
|
+
border: 0;
|
|
2624
|
+
border-radius: 7px;
|
|
2625
|
+
color: var(--ssh-text-muted);
|
|
2626
|
+
background: transparent;
|
|
2627
|
+
font: 500 12px/1.35 var(--ssh-font-sans);
|
|
2628
|
+
text-align: left;
|
|
2629
|
+
cursor: pointer;
|
|
2630
|
+
}
|
|
2631
|
+
.dsh-ssh-suggestion-menu > button:is(:hover, .is-active) {
|
|
2632
|
+
color: var(--ssh-text);
|
|
2633
|
+
background: var(--ssh-hover);
|
|
2634
|
+
}
|
|
2635
|
+
.dsh-ssh-suggestion-menu > button > span {
|
|
2636
|
+
min-width: 0;
|
|
2637
|
+
overflow: hidden;
|
|
2638
|
+
text-overflow: ellipsis;
|
|
2639
|
+
white-space: nowrap;
|
|
2640
|
+
}
|
|
2641
|
+
.dsh-ssh-suggestion-menu > button > svg {
|
|
2642
|
+
flex: none;
|
|
2643
|
+
color: var(--ssh-accent-strong);
|
|
2644
|
+
}
|
|
2645
|
+
.dsh-ssh-suggestion-menu > p {
|
|
2646
|
+
margin: 0;
|
|
2647
|
+
padding: 9px;
|
|
2648
|
+
color: var(--ssh-text-subtle);
|
|
2649
|
+
font-size: var(--ssh-type-caption);
|
|
2650
|
+
font-weight: 400;
|
|
2651
|
+
line-height: 1.4;
|
|
2652
|
+
}
|
|
2653
|
+
.dsh-ssh-password-input > input {
|
|
2654
|
+
padding-right: 54px;
|
|
2655
|
+
}
|
|
2656
|
+
.dsh-ssh-password-input > button {
|
|
2657
|
+
min-width: 44px;
|
|
2658
|
+
padding: 0 8px;
|
|
2659
|
+
font: 600 var(--ssh-type-caption)/1 var(--ssh-font-sans);
|
|
2660
|
+
}
|
|
2563
2661
|
.dsh-ssh-form-divider {
|
|
2564
2662
|
display: flex;
|
|
2565
2663
|
align-items: center;
|
|
@@ -4275,7 +4373,7 @@ body[data-ds-dark-theme] :is(
|
|
|
4275
4373
|
color: var(--ssh-on-accent);
|
|
4276
4374
|
background: var(--ssh-accent-strong);
|
|
4277
4375
|
}
|
|
4278
|
-
`;var
|
|
4376
|
+
`;var Hp=`.dsh-ssh-workspace {
|
|
4279
4377
|
--ssh-adaptive-navigation-width: 304px;
|
|
4280
4378
|
}
|
|
4281
4379
|
|
|
@@ -4341,15 +4439,38 @@ body[data-ds-dark-theme] :is(
|
|
|
4341
4439
|
}
|
|
4342
4440
|
|
|
4343
4441
|
.dsh-ssh-tree-group > h3 {
|
|
4344
|
-
display: flex;
|
|
4345
4442
|
height: 26px;
|
|
4346
|
-
align-items: center;
|
|
4347
|
-
justify-content: space-between;
|
|
4348
4443
|
margin: 0;
|
|
4444
|
+
padding: 0;
|
|
4445
|
+
}
|
|
4446
|
+
|
|
4447
|
+
.dsh-ssh-tree-group > h3 > button {
|
|
4448
|
+
appearance: none;
|
|
4449
|
+
display: grid;
|
|
4450
|
+
width: 100%;
|
|
4451
|
+
height: 26px;
|
|
4452
|
+
grid-template-columns: 14px minmax(0, 1fr) auto;
|
|
4453
|
+
align-items: center;
|
|
4454
|
+
gap: 5px;
|
|
4349
4455
|
padding: 0 8px;
|
|
4456
|
+
border: 0;
|
|
4457
|
+
border-radius: 7px;
|
|
4350
4458
|
color: var(--ssh-text-subtle);
|
|
4459
|
+
background: transparent;
|
|
4351
4460
|
font-size: var(--ssh-type-caption);
|
|
4352
4461
|
font-weight: 600;
|
|
4462
|
+
text-align: left;
|
|
4463
|
+
cursor: pointer;
|
|
4464
|
+
transition: color 140ms ease, background 140ms ease;
|
|
4465
|
+
}
|
|
4466
|
+
|
|
4467
|
+
.dsh-ssh-tree-group > h3 > button:hover {
|
|
4468
|
+
color: var(--ssh-text-muted);
|
|
4469
|
+
background: color-mix(in srgb, var(--ssh-text) 4%, transparent);
|
|
4470
|
+
}
|
|
4471
|
+
|
|
4472
|
+
.dsh-ssh-tree-group > h3 > button > svg {
|
|
4473
|
+
transition: transform 140ms ease;
|
|
4353
4474
|
}
|
|
4354
4475
|
|
|
4355
4476
|
.dsh-ssh-tree-group > h3 small {
|
|
@@ -5161,7 +5282,7 @@ body[data-ds-dark-theme] :is(
|
|
|
5161
5282
|
background: var(--ssh-panel);
|
|
5162
5283
|
}
|
|
5163
5284
|
}
|
|
5164
|
-
`;var
|
|
5285
|
+
`;var $p=`.dsh-ssh-host-workbench {
|
|
5165
5286
|
display: flex;
|
|
5166
5287
|
width: 100%;
|
|
5167
5288
|
height: 100%;
|
|
@@ -5426,7 +5547,7 @@ body[data-ds-dark-theme] :is(
|
|
|
5426
5547
|
background: var(--ssh-surface-raised);
|
|
5427
5548
|
}
|
|
5428
5549
|
}
|
|
5429
|
-
`;var Bp=require("react");function Np(e){(0,Bp.useEffect)(()=>{let t=e.current,r=t?.parentElement;if(t==null||r===null||r===void 0)return;let s=r,o=!1,i,n=()=>{let a=t.parentElement;for(;a!==null&&a!==document.body;){let h=a.previousElementSibling;if(h instanceof HTMLElement){let l=getComputedStyle(h),c=Number.parseFloat(l.flexGrow);if(l.display==="flex"&&l.flexDirection==="column"&&c>0)return h.insertBefore(t,h.firstChild),t.dataset.dshSshAnchored="true",o=!0,!0}a=a.parentElement}return!1};return n()||(i=new MutationObserver(()=>{n()&&i?.disconnect()}),i.observe(document.body,{childList:!0,subtree:!0})),()=>{i?.disconnect(),delete t.dataset.dshSshAnchored,o&&s.isConnected&&s.append(t)}},[e])}var pt=require("react"),wt=require("@deepseek-ai/dsh-client-ui-primitives");var nr=require("react"),ns=require("@deepseek-ai/dsh-client-ui-primitives"),ge=require("react/jsx-runtime");function zp({profile:e,project:t,workspaces:r,currentWorkspaceId:s,recentWorkspaceId:o,returnFocus:i,onClose:n,onCreate:a}){let h=r.some(x=>String(x.workspaceId)===s)?s:r.some(x=>String(x.workspaceId)===o)?o:r[0]===void 0?void 0:String(r[0].workspaceId),[l,c]=(0,nr.useState)(h),[f,v]=(0,nr.useState)(!1),[g,u]=(0,nr.useState)(),d=(0,nr.useRef)(null),m=(0,nr.useRef)(null);(0,nr.useEffect)(()=>((d.current??m.current)?.focus(),()=>{i.isConnected&&i.focus()}),[i]);let p=()=>{f||n()},b=async x=>{if(x.preventDefault(),l!==void 0){v(!0),u(void 0);try{await a(t,l)}catch(y){u(J0(y)),v(!1)}}};return(0,ge.jsx)(ns.Modal,{open:!0,onClose:p,title:"\u9009\u62E9\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4",closeLabel:"\u5173\u95ED",headless:!0,className:"dsh-ssh-session-create-modal",children:(0,ge.jsxs)("section",{className:"dsh-ssh-session-create-shell",onKeyDown:X0,children:[(0,ge.jsxs)("header",{children:[(0,ge.jsxs)("span",{children:[(0,ge.jsx)("h2",{children:"\u65B0\u5EFA\u8FDC\u7AEF\u4F1A\u8BDD"}),(0,ge.jsx)("p",{children:"\u9009\u62E9\u8FD9\u4E2A\u4F1A\u8BDD\u5728 DSH \u4E2D\u5F52\u5C5E\u7684\u672C\u5730\u9879\u76EE"})]}),(0,ge.jsx)("button",{ref:m,type:"button",className:"dsh-ssh-icon-button",disabled:f,onClick:p,"aria-label":"\u5173\u95ED",children:(0,ge.jsx)(ns.IconCloseOutline16,{size:16})})]}),(0,ge.jsxs)("form",{onSubmit:x=>{b(x)},children:[(0,ge.jsxs)("dl",{className:"dsh-ssh-session-create-target",children:[(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u4E3B\u673A"}),(0,ge.jsxs)("dd",{children:[e.name,(0,ge.jsxs)("small",{children:[e.username,"@",e.host,":",e.port]})]})]}),(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u5DE5\u4F5C\u76EE\u5F55"}),(0,ge.jsxs)("dd",{children:[t.name,(0,ge.jsx)("small",{title:t.path,children:t.path})]})]})]}),(0,ge.jsxs)("fieldset",{className:"dsh-ssh-workspace-picker",children:[(0,ge.jsx)("legend",{children:"\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4"}),(0,ge.jsx)("p",{children:"\u4F1A\u8BDD\u8BB0\u5F55\u4FDD\u5B58\u5728\u6240\u9009 DSH \u9879\u76EE\u4E2D\uFF0CSSH \u547D\u4EE4\u4E0E\u7EC8\u7AEF\u56FA\u5B9A\u4F7F\u7528\u4E0A\u9762\u7684\u8FDC\u7AEF\u76EE\u5F55\u3002"}),r.length===0?(0,ge.jsxs)("div",{className:"dsh-ssh-workspace-picker-empty",children:[(0,ge.jsx)(ns.IconFolderClose16,{size:18}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u7684 DSH \u9879\u76EE"}),(0,ge.jsx)("small",{children:"\u8BF7\u5148\u5173\u95ED\u6B64\u7A97\u53E3\uFF0C\u5728 DSH \u5DE6\u4FA7\u7A7A\u95F4\u4E2D\u65B0\u5EFA\u6216\u6DFB\u52A0\u9879\u76EE\u3002"})]})]}):(0,ge.jsx)("div",{className:"dsh-ssh-workspace-options dsh-ssh-scroll-surface",role:"radiogroup","aria-label":"\u9009\u62E9 DSH \u9879\u76EE",children:r.map(x=>{let y=String(x.workspaceId),w=y===s?"\u5F53\u524D\u9879\u76EE":y===o?"\u6700\u8FD1\u4F7F\u7528":void 0;return(0,ge.jsxs)("label",{className:"dsh-ssh-workspace-option",children:[(0,ge.jsx)("input",{ref:y===h?d:void 0,className:"sr-only",type:"radio",name:"dsh-ssh-session-workspace",value:y,checked:l===y,disabled:f,onChange:()=>c(y)}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("span",{className:"dsh-ssh-workspace-option-icon",children:(0,ge.jsx)(ns.IconFolderClose16,{size:16})}),(0,ge.jsxs)("span",{className:"dsh-ssh-workspace-option-copy",children:[(0,ge.jsx)("strong",{children:x.title}),(0,ge.jsx)("small",{title:x.path,children:x.path})]}),w&&(0,ge.jsx)("em",{children:w}),(0,ge.jsx)("i",{"aria-hidden":"true"})]})]},y)})})]}),g&&(0,ge.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:g}),(0,ge.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,ge.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:f,onClick:p,children:"\u53D6\u6D88"}),(0,ge.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:f||l===void 0,children:f?"\u6B63\u5728\u65B0\u5EFA\u2026":"\u65B0\u5EFA\u5E76\u6253\u5F00"})]})]})]})})}function X0(e){if(e.key!=="Tab")return;let t=Array.from(e.currentTarget.querySelectorAll('button:not(:disabled), input:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])')).filter(o=>o.getClientRects().length>0),r=t[0],s=t[t.length-1];r===void 0||s===void 0||(e.shiftKey&&document.activeElement===r?(e.preventDefault(),s.focus()):!e.shiftKey&&document.activeElement===s&&(e.preventDefault(),r.focus()))}function J0(e){return e instanceof Error?e.message:String(e)}var re=require("react/jsx-runtime");function Hp(e){let t=bs(),[r,s]=(0,pt.useState)(""),[o,i]=(0,pt.useState)(()=>new Set),[n,a]=(0,pt.useState)({}),[h,l]=(0,pt.useState)(),[c,f]=(0,pt.useState)(),[v,g]=(0,pt.useState)(),[u,d]=(0,pt.useState)(),m=r.trim().toLocaleLowerCase(),p=(0,pt.useMemo)(()=>Z0(e.profiles.filter(w=>ex(w).includes(m))),[m,e.profiles]),b=async w=>{l(w);try{let _=await jl(w);a(S=>({...S,[w]:_})),d(void 0)}catch(_){d(Cl(_))}finally{l(_=>_===w?void 0:_)}},x=w=>{i(new Set([w])),n[w]===void 0&&b(w),e.onSelect({profileId:w,path:"~"})},y=w=>{let _=e.access?.profileIds??[],S=_.includes(w);e.onProfiles(S?_.filter(T=>T!==w):[..._,w]),S&&e.onDirectory(w,void 0)};return(0,re.jsxs)("aside",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-remote-tree dsh-ssh-border-surface",children:[(0,re.jsxs)("header",{className:"dsh-ssh-tree-header",children:[(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:"\u4E3B\u673A\u4E0E\u9879\u76EE"}),(0,re.jsxs)("small",{children:[e.profiles.length," \u53F0\u4E3B\u673A"]})]}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:e.onNewProfile,"aria-label":"\u65B0\u5EFA\u8FDE\u63A5",title:"\u65B0\u5EFA\u8FDE\u63A5",children:(0,re.jsx)(wt.IconPlusOutline16,{size:16})})]}),(0,re.jsxs)("label",{className:"dsh-ssh-search",children:[(0,re.jsx)("span",{className:"sr-only",children:"\u641C\u7D22\u4E3B\u673A"}),(0,re.jsx)("input",{value:r,onChange:w=>s(w.target.value),placeholder:"\u641C\u7D22\u4E3B\u673A\u3001\u5206\u7EC4\u3001\u6807\u7B7E\u2026"})]}),(0,re.jsxs)("div",{className:"dsh-ssh-tree-scroll dsh-ssh-scroll-surface",children:[p.map(w=>(0,re.jsxs)("section",{className:"dsh-ssh-tree-group",children:[(0,re.jsxs)("h3",{children:[(0,re.jsx)("span",{children:w.name}),(0,re.jsx)("small",{children:w.profiles.length})]}),w.profiles.map(_=>{let S=o.has(_.id),T=e.access?.profileIds.includes(_.id)===!0,D=n[_.id]??[],P=e.selected?.profileId===_.id&&e.selected.projectId===void 0;return(0,re.jsxs)("div",{className:"dsh-ssh-tree-host","data-open":S,children:[(0,re.jsxs)("div",{"data-ssh-interactive":"row","data-ssh-context-row":!0,className:`dsh-ssh-tree-host-row${T?" is-authorized":""}${P?" is-active":""}`,children:[(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-tree-host-main","aria-pressed":P,"aria-expanded":S,title:`\u9009\u62E9\u5E76\u5C55\u5F00 ${_.name}`,onClick:()=>x(_.id),children:[(0,re.jsx)("span",{className:"dsh-ssh-host-monogram",children:_.name.slice(0,1).toUpperCase()}),(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:_.name}),(0,re.jsxs)("small",{children:[_.username,"@",_.host]})]})]}),(0,re.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-tree-mount dsh-ssh-context-action${T?" is-mounted":""}`,"aria-label":`${T?"\u5378\u8F7D":"\u6302\u8F7D"} ${_.name}`,"aria-pressed":T,title:e.access===null?"\u6253\u5F00\u4E00\u4E2A DSH \u4F1A\u8BDD\u540E\u624D\u80FD\u6302\u8F7D\u4E3B\u673A":T?"\u4ECE\u5F53\u524D\u4F1A\u8BDD\u5378\u8F7D":"\u6302\u8F7D\u5230\u5F53\u524D\u4F1A\u8BDD",disabled:e.access===null||e.accessLoading||e.accessSaving,onClick:()=>y(_.id),children:T?"\u5378\u8F7D":"\u6302\u8F7D"}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-tree-add","aria-label":`\u4E3A ${_.name} \u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55`,title:"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55",onClick:()=>f({profile:_}),children:(0,re.jsx)(wt.IconPlusOutline16,{size:14})})]}),S&&(0,re.jsx)("div",{className:"dsh-ssh-tree-branches",children:h===_.id&&n[_.id]===void 0?(0,re.jsx)("p",{className:"dsh-ssh-tree-state",children:"\u6B63\u5728\u8BFB\u53D6\u56FA\u5B9A\u76EE\u5F55\u2026"}):D.length===0?(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-tree-empty",onClick:()=>f({profile:_}),children:[(0,re.jsx)(wt.IconPlusOutline16,{size:13}),"\u6DFB\u52A0\u9879\u76EE\u76EE\u5F55"]}):D.map(A=>{let F=e.selected?.projectId===A.id,B=e.access?.workingProjectIds[_.id]===A.id;return(0,re.jsx)("div",{className:"dsh-ssh-tree-project",children:(0,re.jsxs)("div",{"data-ssh-interactive":"row",className:`dsh-ssh-tree-project-row${F?" is-active":""}${B?" is-bound":""}`,children:[(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-tree-project-main","aria-pressed":e.access===null?void 0:B,title:e.access===null?"\u5F53\u524D\u6CA1\u6709\u53EF\u56FA\u5B9A\u76EE\u5F55\u7684 DSH \u4F1A\u8BDD":T?B?"\u53D6\u6D88\u5F53\u524D\u4F1A\u8BDD\u7684\u56FA\u5B9A\u76EE\u5F55":"\u56FA\u5B9A\u4E3A\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8BF7\u5148\u6302\u8F7D\u8BE5\u4E3B\u673A",onClick:()=>{T&&!e.accessLoading&&!e.accessSaving&&(e.onDirectory(_.id,B?void 0:A.path,B?void 0:A.id),e.onSelect(B?{profileId:_.id,path:"~"}:{profileId:_.id,path:A.path,projectId:A.id}))},children:[(0,re.jsx)("span",{children:B?(0,re.jsx)(wt.IconFolderOpenOutline16,{size:15}):(0,re.jsx)(wt.IconFolderClose16,{size:15})}),(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:A.name}),(0,re.jsx)("small",{children:A.path}),B&&(0,re.jsx)("em",{children:"\u5F53\u524D\u4F1A\u8BDD\u5DF2\u56FA\u5B9A\u8BE5\u8DEF\u5F84"})]})]}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-new","aria-label":`\u5728 ${A.name} \u65B0\u5EFA\u4F1A\u8BDD`,title:"\u65B0\u5EFA\u4F1A\u8BDD",onClick:$=>{d(void 0),g({profile:_,project:A,returnFocus:$.currentTarget})},children:(0,re.jsx)(wt.IconPlusOutline16,{size:13})}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-edit","aria-label":`\u7F16\u8F91 ${A.name}`,title:"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",onClick:()=>f({profile:_,project:A}),children:(0,re.jsx)(wt.IconEditOutline16,{size:13})})]})},A.id)})})]},_.id)})]},w.name)),p.length===0&&(0,re.jsx)("p",{className:"dsh-ssh-tree-no-results",children:e.profiles.length===0?"\u8FD8\u6CA1\u6709 SSH \u4E3B\u673A":"\u6CA1\u6709\u5339\u914D\u7684\u4E3B\u673A"})]}),(0,re.jsx)(Y0,{access:e.access,loading:e.accessLoading,saving:e.accessSaving,error:e.accessError??u,onPermission:e.onPermission,onApproval:e.onApproval}),c!==void 0&&(0,re.jsx)(Q0,{profile:c.profile,project:c.project,onClose:()=>f(void 0),onSaved:async()=>{let w=c.profile.id;f(void 0),await b(w)}}),v!==void 0&&(0,re.jsx)(zp,{...v,workspaces:e.workspaces,currentWorkspaceId:e.currentWorkspaceId,recentWorkspaceId:e.recentWorkspaceId,onClose:()=>g(void 0),onCreate:e.onCreateSession})]})}function Y0({access:e,loading:t,saving:r,error:s,onPermission:o,onApproval:i}){return(0,re.jsxs)("footer",{className:"dsh-ssh-access-footer",children:[(0,re.jsxs)("div",{className:"dsh-ssh-access-heading",children:[(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:"\u5F53\u524D\u4F1A\u8BDD\u6743\u9650"}),(0,re.jsxs)("small",{children:[e?.profileIds.length??0," \u53F0\u4E3B\u673A\u53EF\u7528"]})]}),(0,re.jsx)("em",{children:t?"\u8BFB\u53D6\u4E2D":r?"\u4FDD\u5B58\u4E2D":"\u5DF2\u540C\u6B65"})]}),(0,re.jsxs)("div",{className:"dsh-ssh-access-segments","aria-label":"SSH \u6743\u9650",children:[(0,re.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="exec"?"is-active":"","aria-pressed":e?.permission==="exec",disabled:e===null,onClick:()=>o("exec"),children:"\u4EC5\u547D\u4EE4"}),(0,re.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="terminal"?"is-active":"","aria-pressed":e?.permission==="terminal",disabled:e===null,onClick:()=>o("terminal"),children:"\u7EC8\u7AEF\u63A7\u5236"})]}),(0,re.jsxs)("label",{className:"dsh-ssh-access-approval",children:[(0,re.jsxs)("span",{children:[(0,re.jsx)("strong",{children:"\u6267\u884C\u524D\u786E\u8BA4"}),(0,re.jsx)("small",{children:e?.requireCommandApproval===!1?"\u5173\u95ED\u540E\u6309\u5F53\u524D\u4F1A\u8BDD\u6743\u9650\u76F4\u63A5\u6267\u884C":"\u9700 DSH \u4F7F\u7528 Ask\uFF1BFull Access \u4F1A\u76F4\u63A5\u62D2\u7EDD"})]}),(0,re.jsx)("input",{type:"checkbox",checked:e?.requireCommandApproval??!0,disabled:e===null,onChange:n=>i(n.target.checked)}),(0,re.jsx)("i",{"aria-hidden":"true"})]}),s&&(0,re.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:s})]})}function Q0({profile:e,project:t,onClose:r,onSaved:s}){let[o,i]=(0,pt.useState)(t?.name??""),[n,a]=(0,pt.useState)(t?.path??""),[h,l]=(0,pt.useState)(!1),[c,f]=(0,pt.useState)(),v=async u=>{u.preventDefault(),l(!0),f(void 0);try{t===void 0?await Wl(e.id,{name:o,path:n}):await ql(e.id,t.id,{name:o,path:n}),await s()}catch(d){f(Cl(d)),l(!1)}},g=async()=>{if(!(t===void 0||!window.confirm(`\u5220\u9664\u56FA\u5B9A\u76EE\u5F55\u201C${t.name}\u201D\uFF1F\u76F8\u5173 DSH \u4F1A\u8BDD\u4E0D\u4F1A\u5220\u9664\u3002`))){l(!0),f(void 0);try{await Kl(e.id,t.id),await s()}catch(u){f(Cl(u)),l(!1)}}};return(0,re.jsx)(Je,{className:"dsh-ssh-project-dialog",title:t===void 0?"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55":"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",subtitle:`${e.name} \xB7 \u7EC8\u7AEF\u4E0E SFTP \u7684\u9ED8\u8BA4\u8FDC\u7AEF\u8DEF\u5F84`,onClose:r,children:(0,re.jsxs)("form",{className:"dsh-ssh-form",onSubmit:u=>{v(u)},children:[(0,re.jsxs)("label",{className:"dsh-ssh-field",children:[(0,re.jsx)("span",{children:"\u540D\u79F0"}),(0,re.jsx)("input",{required:!0,maxLength:80,value:o,placeholder:"\u7F51\u7AD9\u9879\u76EE",onChange:u=>i(u.target.value)})]}),(0,re.jsxs)("label",{className:"dsh-ssh-field",children:[(0,re.jsx)("span",{children:"\u8FDC\u7AEF\u8DEF\u5F84"}),(0,re.jsx)("input",{required:!0,maxLength:4096,value:n,spellCheck:!1,placeholder:"/var/www/example",onChange:u=>a(u.target.value)}),(0,re.jsx)("small",{children:"\u4FDD\u5B58\u524D\u4F1A\u5728\u53F3\u4FA7 SFTP \u4E2D\u9A8C\u8BC1\u8DEF\u5F84\u662F\u5426\u53EF\u8BBF\u95EE\u3002"})]}),c&&(0,re.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:c}),(0,re.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[t!==void 0&&(0,re.jsxs)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:h,onClick:()=>{g()},children:[(0,re.jsx)(wt.IconTrashOutline16,{size:15}),"\u5220\u9664"]}),(0,re.jsx)("span",{className:"dsh-ssh-dialog-spacer"}),(0,re.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h,onClick:r,children:"\u53D6\u6D88"}),(0,re.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h,children:h?"\u4FDD\u5B58\u4E2D\u2026":"\u4FDD\u5B58\u76EE\u5F55"})]})]})})}function Z0(e){let t=new Map;for(let r of e){let s=r.group?.trim()||"\u672A\u5206\u7EC4",o=t.get(s);o===void 0?t.set(s,[r]):o.push(r)}return[...t].map(([r,s])=>({name:r,profiles:s}))}function ex(e){return`${e.name} ${e.group??""} ${e.host} ${e.username} ${e.tags.join(" ")}`.toLocaleLowerCase()}function Cl(e){return e instanceof Error?e.message:String(e)}var nt=require("react");var El=new Set;function On(e){for(let t of El)t(e)}function Up(e){return El.add(e),()=>El.delete(e)}function Vp(e){let[t,r]=(0,nt.useState)(null),[s,o]=(0,nt.useState)(e!==void 0),[i,n]=(0,nt.useState)(!1),[a,h]=(0,nt.useState)(),l=(0,nt.useRef)(null),c=(0,nt.useRef)(e),f=(0,nt.useRef)(Promise.resolve()),v=(0,nt.useRef)(0);c.current=e,(0,nt.useEffect)(()=>{let d=!1;return l.current=null,r(null),h(void 0),o(e!==void 0),e===void 0?()=>{d=!0}:(wi(e).then(m=>{if(d)return;let p=m??vi(e);l.current=p,r(p),On(p)}).catch(m=>{d||h($p(m))}).finally(()=>{d||o(!1)}),()=>{d=!0})},[e]);let g=(0,nt.useCallback)(async d=>{l.current=d,r(d),On(d),h(void 0),v.current+=1,n(!0);let m=f.current.catch(()=>{}).then(()=>Si(d));f.current=m;try{let p=await m;return c.current===p.sessionId&&l.current===d&&(l.current=p,r(p),On(p)),p}catch(p){throw c.current===d.sessionId&&h($p(p)),p}finally{v.current=Math.max(0,v.current-1),c.current===d.sessionId&&v.current===0&&n(!1)}},[]),u=(0,nt.useCallback)(d=>{let m=c.current;if(m===void 0)return;let p=l.current??vi(m);g({...p,...d,sessionId:m}).catch(()=>{})},[g]);return{value:t,loading:s,saving:i,error:a,setProfiles:d=>u({profileIds:d}),setDirectory:(d,m,p)=>{let b=c.current;if(b===void 0)return;let x=l.current??vi(b),y={...x.workingDirectories},w={...x.workingProjectIds};m===void 0?delete y[d]:y[d]=m,p===void 0?delete w[d]:w[d]=p,u({workingDirectories:y,workingProjectIds:w})},setPermission:d=>u({permission:d}),setRequireCommandApproval:d=>u({requireCommandApproval:d}),setFileEndpoints:d=>u({fileEndpointIds:d}),setFilePermission:d=>u({filePermission:d}),setRequireFileApproval:d=>u({requireFileApproval:d}),replace:g}}function vi(e){return{sessionId:e,profileIds:[],permission:"exec",requireCommandApproval:!0,fileEndpointIds:[],filePermission:"browse",requireFileApproval:!0,workingDirectories:{},workingProjectIds:{},updatedAt:0}}function $p(e){return e instanceof Error?e.message:String(e)}var os=require("react"),Fn=require("react/jsx-runtime"),Mn=38,bi=28,_i=66,tx=320,rx=280,sx=7;function jp(e,t,r){return Math.min(r,Math.max(t,e))}function ix(e){if(typeof window>"u")return Mn;try{let t=Number.parseFloat(window.localStorage.getItem(e)??"");return Number.isFinite(t)?jp(t,bi,_i):Mn}catch{return Mn}}function Tl(e,t){try{window.localStorage.setItem(e,t.toFixed(2))}catch{}}function nx(e){if(e<=0)return{min:bi,max:_i};let t=rx/e*100,r=(e-tx-sx)/e*100,s=Math.max(bi,t),o=Math.max(s,Math.min(_i,r));return{min:s,max:o}}function Wp({primary:e,secondary:t,storageKey:r,label:s}){let[o,i]=(0,os.useState)(()=>ix(r)),n=(0,os.useRef)(null),a=(0,os.useRef)(null),h=(0,os.useRef)(o),l=(0,os.useRef)(),c=p=>{let b=n.current;if(b===null)return p;let x=nx(b.getBoundingClientRect().width),y=jp(p,x.min,x.max);return b.style.setProperty("--ssh-sftp-width",`${y}%`),a.current?.setAttribute("aria-valuenow",String(Math.round(y))),h.current=y,y},f=p=>{if(l.current===void 0)return;let b=a.current;l.current=void 0,p!==void 0&&b?.hasPointerCapture(p)&&b.releasePointerCapture(p),n.current?.classList.remove("is-resizing");let x=h.current;i(x),Tl(r,x)},v=p=>{p.button===0&&(l.current=p.pointerId,h.current=o,p.currentTarget.setPointerCapture(p.pointerId),n.current?.classList.add("is-resizing"),p.preventDefault())},g=p=>{if(l.current!==p.pointerId)return;let b=n.current?.getBoundingClientRect();b===void 0||b.width===0||(c((b.right-p.clientX)/b.width*100),p.preventDefault())},u=p=>{let b=p.shiftKey?5:2,x;if(p.key==="ArrowLeft"&&(x=o+b),p.key==="ArrowRight"&&(x=o-b),p.key==="Home"&&(x=bi),p.key==="End"&&(x=_i),x===void 0)return;let y=c(x);i(y),Tl(r,y),p.preventDefault()},d=()=>{let p=c(Mn);i(p),Tl(r,p)},m={"--ssh-sftp-width":`${o}%`};return(0,Fn.jsxs)("div",{ref:n,className:"dsh-ssh-workbench-split",style:m,children:[e,(0,Fn.jsx)("div",{ref:a,className:"dsh-ssh-workbench-resizer",role:"separator","aria-label":s,"aria-orientation":"vertical","aria-valuemin":bi,"aria-valuemax":_i,"aria-valuenow":Math.round(o),tabIndex:0,title:"\u62D6\u52A8\u8C03\u6574\u5BBD\u5EA6\uFF0C\u53CC\u51FB\u6062\u590D\u9ED8\u8BA4",onDoubleClick:d,onKeyDown:u,onPointerDown:v,onPointerMove:g,onPointerUp:p=>f(p.pointerId),onPointerCancel:p=>f(p.pointerId),onLostPointerCapture:()=>f()}),t]})}var or=require("react"),St=require("@deepseek-ai/dsh-client-ui-primitives");var K=require("react/jsx-runtime");function qp({profile:e,dependents:t,onClose:r,onDeleted:s}){let[o,i]=(0,or.useState)(!1),[n,a]=(0,or.useState)(),h=async()=>{if(!(o||t.length>0)){i(!0),a(void 0);try{await oe(`/profiles/${encodeURIComponent(e.id)}`,{method:"DELETE"}),s()}catch(l){a(Pe(l))}finally{i(!1)}}};return(0,K.jsx)(Je,{title:`\u5220\u9664 ${e.name}`,subtitle:Gt(e),onClose:r,children:(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile",children:[(0,K.jsx)("span",{className:"dsh-ssh-delete-profile-mark",children:(0,K.jsx)(St.IconTrashOutline16,{size:19})}),(0,K.jsxs)("div",{children:[(0,K.jsx)("strong",{children:"\u8FD9\u4E2A\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u914D\u7F6E\u3001\u8BE5\u4E3B\u673A\u7684\u72EC\u7ACB\u51ED\u636E\u548C\u5173\u8054\u7AEF\u53E3\u8F6C\u53D1\u4F1A\u4E00\u5E76\u5220\u9664\uFF1B\u5B83\u4E5F\u4F1A\u4ECE\u6240\u6709\u4F1A\u8BDD\u6388\u6743\u4E2D\u79FB\u9664\u3002\u5BC6\u94A5\u5E93\u4E2D\u7684\u5171\u4EAB\u51ED\u636E\u4E0D\u4F1A\u5220\u9664\u3002"})]}),t.length>0&&(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile-block",role:"alert",children:[(0,K.jsx)("strong",{children:"\u6682\u65F6\u4E0D\u80FD\u5220\u9664"}),(0,K.jsxs)("p",{children:["\u4EE5\u4E0B\u8FDE\u63A5\u4ECD\u5C06\u5B83\u4F5C\u4E3A SSH \u8DF3\u677F\uFF1A",t.map(l=>l.name).join("\u3001"),"\u3002\u8BF7\u5148\u4FEE\u6539\u8FD9\u4E9B\u8FDE\u63A5\u7684\u8DF3\u677F\u94FE\u3002"]})]}),n&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:o,onClick:r,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o||t.length>0,onClick:()=>{h()},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u4E3B\u673A"})]})]})})}function Kp({profile:e,profiles:t,vaultEntries:r,proxyEntries:s,onClose:o,onSaved:i}){let[n,a]=(0,or.useState)(()=>({name:e?.name??"",group:e?.group??"",host:e?.host??"",port:String(e?.port??22),username:e?.username??"",authType:e?.authType??"password",credentialId:e?.credentialId??"",proxyType:e?.proxy.type??"none",proxyEntryId:e?.proxy.type==="saved"?e.proxy.proxyId:"",proxyHost:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.host:"",proxyPort:e?.proxy.type==="http"||e?.proxy.type==="socks5"?String(e.proxy.port):"1080",proxyUsername:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.username??"":"",jumpProfileIds:e?.proxy.type==="jump"?e.proxy.profileIds:[],tags:e?.tags.join(", ")??"",password:"",privateKey:"",passphrase:"",proxyPassword:"",hostFingerprint:e?.hostFingerprint??""})),[h,l]=(0,or.useState)(!1),[c,f]=(0,or.useState)(!1),[v,g]=(0,or.useState)(),[u,d]=(0,or.useState)(),[m,p]=(0,or.useState)(),b=S=>({value:n[S],onChange:T=>{a(D=>({...D,[S]:T.target.value})),g(void 0),d(void 0)}}),x=r.find(S=>S.id===n.credentialId),y=(S=n.hostFingerprint)=>{let T=n.proxyType==="none"?{type:"none"}:n.proxyType==="saved"?{type:"saved",proxyId:n.proxyEntryId}:n.proxyType==="jump"?{type:"jump",profileIds:n.jumpProfileIds}:{type:n.proxyType,host:n.proxyHost,port:Number(n.proxyPort),...n.proxyUsername.trim()?{username:n.proxyUsername.trim()}:{}};return{profile:{name:n.name,...n.group.trim()?{group:n.group.trim()}:{},host:n.host,port:Number(n.port),username:x?.username??n.username,authType:x?.authType??n.authType,...n.credentialId?{credentialId:n.credentialId}:{},...S?{hostFingerprint:S}:{},proxy:T,keepAliveIntervalMs:e?.keepAliveIntervalMs??15e3,connectTimeoutMs:e?.connectTimeoutMs??15e3,terminalType:e?.terminalType??"xterm-256color",tags:n.tags.split(",").map(D=>D.trim()).filter(Boolean)},secrets:{password:n.password,privateKey:n.privateKey,passphrase:n.passphrase,proxyPassword:n.proxyPassword}}},w=async S=>{f(!0),p(void 0),g(void 0),d(void 0);try{await oe("/profiles/test-draft",{method:"POST",body:JSON.stringify({...y(S),...e===void 0?{}:{profileId:e.id}})}),S!==void 0&&a(T=>({...T,hostFingerprint:S})),g("success")}catch(T){T instanceof lr&&T.body?.code==="HOST_KEY_REQUIRED"&&typeof T.body.fingerprint=="string"?d(T.body.fingerprint):p(Pe(T))}finally{f(!1)}},_=async S=>{S.preventDefault(),l(!0),p(void 0);try{await oe(e===void 0?"/profiles":`/profiles/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(y())}),i()}catch(T){p(Pe(T))}finally{l(!1)}};return(0,K.jsx)(Je,{title:e===void 0?"\u65B0\u5EFA SSH \u8FDE\u63A5":`\u7F16\u8F91 ${e.name}`,subtitle:"\u51ED\u636E\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:o,children:(0,K.jsxs)("form",{className:"dsh-ssh-form",onSubmit:S=>{_(S)},children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u4FE1\u606F"}),(0,K.jsx)("small",{children:"\u4E3B\u673A\u5730\u5740\u4E0E\u663E\u793A\u65B9\u5F0F"})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(he,{label:"\u540D\u79F0",children:(0,K.jsx)("input",{required:!0,maxLength:80,placeholder:"\u5F00\u53D1\u670D\u52A1\u5668",...b("name")})}),(0,K.jsx)(he,{label:"\u5206\u7EC4",children:(0,K.jsx)("input",{maxLength:64,placeholder:"\u4F8B\u5982\uFF1A\u751F\u4EA7\u73AF\u5883",...b("group")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(he,{label:"\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,placeholder:"server.example.com",spellCheck:!1,...b("host")})}),(0,K.jsx)(he,{label:"\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",...b("port")})})]}),(0,K.jsx)(he,{label:"\u6807\u7B7E",hint:"\u591A\u4E2A\u6807\u7B7E\u4F7F\u7528\u82F1\u6587\u9017\u53F7\u5206\u9694\u3002",children:(0,K.jsx)("input",{placeholder:"production, linux",...b("tags")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,K.jsx)("small",{children:"\u9009\u62E9\u5171\u4EAB\u51ED\u636E\u6216\u5355\u72EC\u4FDD\u5B58"})]}),(0,K.jsx)(he,{label:"\u51ED\u636E\u6765\u6E90",hint:"\u53EF\u4F7F\u7528\u6B64\u8FDE\u63A5\u81EA\u5DF1\u7684\u51ED\u636E\uFF0C\u6216\u5F15\u7528\u5BC6\u94A5\u5E93\u4E2D\u7684\u5E38\u7528\u8D26\u53F7\u3002",children:(0,K.jsxs)("select",{...b("credentialId"),children:[(0,K.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u72EC\u7ACB\u4FDD\u5B58"}),r.map(S=>(0,K.jsxs)("option",{value:S.id,children:[S.name," \xB7 ",S.username]},S.id))]})}),x?(0,K.jsxs)("div",{className:"dsh-ssh-credential-reference",children:[(0,K.jsx)("span",{children:(0,K.jsx)(St.IconUserOutline16,{size:16})}),(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:x.name}),(0,K.jsxs)("small",{children:[x.username," \xB7 ",x.authType==="password"?"\u5BC6\u7801":"\u79C1\u94A5"]})]}),(0,K.jsx)("em",{children:x.credential.configured?"\u5DF2\u5C31\u7EEA":"\u7F3A\u5C11\u51ED\u636E"})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(he,{label:"\u7528\u6237\u540D",children:(0,K.jsx)("input",{required:!0,autoComplete:"username",...b("username")})}),(0,K.jsx)(he,{label:"\u8BA4\u8BC1\u65B9\u5F0F",children:(0,K.jsxs)("select",{...b("authType"),children:[(0,K.jsx)("option",{value:"password",children:"\u5BC6\u7801"}),(0,K.jsx)("option",{value:"private-key",children:"\u79C1\u94A5"}),(0,K.jsx)("option",{value:"agent",children:"SSH Agent"})]})})]}),n.authType==="password"&&(0,K.jsx)(he,{label:"\u5BC6\u7801",hint:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,K.jsx)("input",{required:e===void 0,type:"password",autoComplete:"new-password",placeholder:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":"",...b("password")})}),n.authType==="private-key"&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(he,{label:"\u79C1\u94A5",hint:e?.credential.source==="profile"&&e.credential.fields.includes("privateKey")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u7C98\u8D34 OpenSSH/PEM \u79C1\u94A5",children:(0,K.jsx)("textarea",{required:e===void 0,rows:5,spellCheck:!1,...b("privateKey")})}),(0,K.jsx)(he,{label:"\u79C1\u94A5\u53E3\u4EE4",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",...b("passphrase")})})]})]})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u8DEF\u5F84"}),(0,K.jsx)("small",{children:"\u76F4\u8FDE\u3001\u4EE3\u7406\u6216\u8DF3\u677F\u94FE"})]}),(0,K.jsx)(he,{label:"\u8FDE\u63A5\u65B9\u5F0F",children:(0,K.jsxs)("select",{...b("proxyType"),children:[(0,K.jsx)("option",{value:"none",children:"\u76F4\u8FDE"}),(0,K.jsx)("option",{value:"saved",children:"\u5E38\u7528\u4EE3\u7406"}),(0,K.jsx)("option",{value:"http",children:"\u81EA\u5B9A\u4E49 HTTP CONNECT"}),(0,K.jsx)("option",{value:"socks5",children:"\u81EA\u5B9A\u4E49 SOCKS5"}),(0,K.jsx)("option",{value:"jump",children:"SSH \u8DF3\u677F"})]})}),n.proxyType==="saved"&&(0,K.jsx)(he,{label:"\u5E38\u7528\u4EE3\u7406",hint:s.length===0?"\u8BF7\u5148\u5728\u4EE3\u7406\u5E93\u4E2D\u6DFB\u52A0 HTTP \u6216 SOCKS5 \u4EE3\u7406\u3002":"\u591A\u53F0\u4E3B\u673A\u53EF\u5F15\u7528\u540C\u4E00\u6761\u4EE3\u7406\u914D\u7F6E\u3002",children:(0,K.jsxs)("select",{required:!0,...b("proxyEntryId"),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u4EE3\u7406"}),s.map(S=>(0,K.jsxs)("option",{value:S.id,children:[S.name," \xB7 ",S.proxyType==="http"?"HTTP":"SOCKS5"," \xB7 ",S.host,":",S.port]},S.id))]})}),(n.proxyType==="http"||n.proxyType==="socks5")&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(he,{label:"\u4EE3\u7406\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,spellCheck:!1,...b("proxyHost")})}),(0,K.jsx)(he,{label:"\u4EE3\u7406\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",...b("proxyPort")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(he,{label:"\u4EE3\u7406\u7528\u6237\u540D",children:(0,K.jsx)("input",{autoComplete:"username",...b("proxyUsername")})}),(0,K.jsx)(he,{label:"\u4EE3\u7406\u5BC6\u7801",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",...b("proxyPassword")})})]})]}),n.proxyType==="jump"&&(0,K.jsx)(ox,{profiles:t.filter(S=>S.id!==e?.id),value:n.jumpProfileIds,onChange:S=>a(T=>({...T,jumpProfileIds:S}))})]}),u&&(0,K.jsxs)("div",{className:"dsh-ssh-test-result is-warning",role:"alert",children:[(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:"\u9996\u6B21\u8FDE\u63A5\uFF0C\u8BF7\u6838\u5BF9\u4E3B\u673A\u6307\u7EB9"}),(0,K.jsx)("code",{children:u})]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-small-primary",disabled:c,onClick:()=>{w(u)},children:"\u786E\u8BA4\u5E76\u91CD\u8BD5"})]}),v==="success"&&(0,K.jsxs)("p",{className:"dsh-ssh-test-result is-success",role:"status",children:[(0,K.jsx)(St.IconCheckOutline14,{size:14}),"\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F"]}),m&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:m}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button dsh-ssh-test-button",disabled:h||c,onClick:S=>{S.currentTarget.form?.reportValidity()&&w()},children:c?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h||c,onClick:o,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h||c,children:h?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})})}function ox({profiles:e,value:t,onChange:r}){let s=()=>{let n=e.find(a=>!t.includes(a.id));n!==void 0&&t.length<8&&r([...t,n.id])},o=(n,a)=>r(t.map((h,l)=>l===n?a:h)),i=(n,a)=>{let h=n+a;if(h<0||h>=t.length)return;let l=[...t];[l[n],l[h]]=[l[h],l[n]],r(l)};return(0,K.jsxs)("fieldset",{className:"dsh-ssh-jump-chain",children:[(0,K.jsx)("legend",{children:"\u8DF3\u677F\u94FE"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u4F1A\u6309\u4ECE\u4E0A\u5230\u4E0B\u7684\u987A\u5E8F\u9010\u7EA7\u5EFA\u7ACB\u3002"}),(0,K.jsx)("div",{children:t.map((n,a)=>(0,K.jsxs)("div",{className:"dsh-ssh-jump-row",children:[(0,K.jsx)("em",{children:a+1}),(0,K.jsxs)("select",{required:!0,value:n,onChange:h=>o(a,h.target.value),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u5DF2\u6709\u8FDE\u63A5"}),e.filter(h=>h.id===n||!t.includes(h.id)).map(h=>(0,K.jsxs)("option",{value:h.id,children:[h.name," \xB7 ",h.host]},h.id))]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===0,"aria-label":"\u4E0A\u79FB\u8DF3\u677F",onClick:()=>i(a,-1),children:(0,K.jsx)(St.IconChevronUpOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===t.length-1,"aria-label":"\u4E0B\u79FB\u8DF3\u677F",onClick:()=>i(a,1),children:(0,K.jsx)(St.IconChevronDownOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":"\u79FB\u9664\u8DF3\u677F",onClick:()=>r(t.filter((h,l)=>l!==a)),children:(0,K.jsx)(St.IconTrashOutline16,{size:15})})]},`${n}-${a}`))}),t.length===0&&(0,K.jsx)("p",{className:"dsh-ssh-jump-empty",children:"\u81F3\u5C11\u6DFB\u52A0\u4E00\u53F0\u8DF3\u677F\u4E3B\u673A\u3002"}),(0,K.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:t.length>=8||e.every(n=>t.includes(n.id)),onClick:s,children:[(0,K.jsx)(St.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u8DF3\u677F"]})]})}var be=require("react"),At=require("@deepseek-ai/dsh-client-ui-primitives");var jt=require("react"),Rt=require("@deepseek-ai/dsh-client-ui-primitives");var j=require("react/jsx-runtime");function Gp({profiles:e,vaultEntries:t,proxyEntries:r,onClose:s,onChanged:o}){let[i,n]=(0,jt.useState)(),[a,h]=(0,jt.useState)(),[l,c]=(0,jt.useState)(),f=i!==void 0||a!==void 0,v=m=>{h(void 0),n(m),c(void 0)},g=()=>{h(void 0),n("new"),c(void 0)},u=m=>{n(void 0),h(m),c(void 0)},d=async m=>{c(void 0);try{await oe(`/ftp-profiles/${encodeURIComponent(m.id)}`,{method:"DELETE"}),h(void 0),o()}catch(p){c(Pe(p))}};return(0,j.jsx)(Je,{className:"dsh-ssh-ftp-manager-dialog",title:"\u6587\u4EF6\u8FDE\u63A5",subtitle:"\u7BA1\u7406 FTP \u4E0E FTPS\uFF1BSFTP \u76F4\u63A5\u590D\u7528\u5DF2\u6709 SSH \u4E3B\u673A",onClose:s,children:(0,j.jsxs)("div",{className:`dsh-ssh-ftp-manager${f?" has-detail":""}`,children:[(0,j.jsxs)("aside",{className:"dsh-ssh-ftp-manager-list",children:[(0,j.jsxs)("header",{children:[(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:"FTP / FTPS"}),(0,j.jsxs)("small",{children:[e.length," \u4E2A\u8FDE\u63A5"]})]}),(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:g,children:[(0,j.jsx)(Rt.IconPlusOutline16,{size:15}),"\u65B0\u5EFA"]})]}),e.length===0?(0,j.jsxs)("div",{className:"dsh-ssh-ftp-list-empty",children:[(0,j.jsx)("span",{children:(0,j.jsx)(Rt.IconDataOutline16,{size:20})}),(0,j.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u72EC\u7ACB\u6587\u4EF6\u8FDE\u63A5"}),(0,j.jsx)("p",{children:"SFTP \u4F1A\u663E\u793A\u5728\u6587\u4EF6\u7A97\u683C\u7684\u8FDE\u63A5\u5217\u8868\u4E2D\uFF1B\u8FD9\u91CC\u53EA\u7BA1\u7406 FTP \u4E0E FTPS\u3002"}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:g,children:"\u65B0\u5EFA FTPS \u8FDE\u63A5"})]}):(0,j.jsx)("div",{className:"dsh-ssh-ftp-profile-list",role:"list",children:e.map(m=>{let p=i!=="new"&&i?.id===m.id||a?.id===m.id;return(0,j.jsxs)("article",{role:"listitem","data-ssh-interactive":"choice","aria-selected":p,className:p?"is-active":"",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-profile-main",onClick:()=>v(m),children:[(0,j.jsx)("span",{className:`dsh-ssh-protocol-badge is-${m.protocol}`,children:hx(m.protocol)}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{title:m.name,children:m.name}),(0,j.jsxs)("small",{title:`${m.username}@${m.host}:${m.port}`,children:[m.username,"@",m.host,":",m.port]})]}),(0,j.jsx)("i",{className:m.credential.configured?"is-ready":"is-missing",children:m.credential.configured?"\u53EF\u7528":"\u7F3A\u5C11\u5BC6\u7801"})]}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664 ${m.name}`,onClick:()=>u(m),children:(0,j.jsx)(Rt.IconTrashOutline16,{size:15})})]},m.id)})})]}),(0,j.jsx)("main",{className:"dsh-ssh-ftp-manager-detail",children:a!==void 0?(0,j.jsx)(ax,{profile:a,error:l,onBack:()=>h(void 0),onDelete:()=>d(a)}):i!==void 0?(0,j.jsx)(lx,{value:i==="new"?void 0:i,vaultEntries:t,proxyEntries:r,onBack:()=>n(void 0),onSaved:()=>{n(void 0),o()}},i==="new"?"new":i.id):(0,j.jsxs)("div",{className:"dsh-ssh-ftp-manager-overview",children:[(0,j.jsx)("span",{children:(0,j.jsx)(Rt.IconDataOutline16,{size:22})}),(0,j.jsx)("h3",{children:"\u9009\u62E9\u4E00\u4E2A\u8FDE\u63A5\u8FDB\u884C\u7F16\u8F91"}),(0,j.jsx)("p",{children:"\u6587\u4EF6\u7A97\u683C\u4F1A\u628A\u8FD9\u91CC\u4FDD\u5B58\u7684 FTP\u3001FTPS \u4E0E SSH \u4E3B\u673A\u63D0\u4F9B\u7684 SFTP \u6C47\u603B\u6210\u8FDE\u63A5\u5217\u8868\u3002"}),(0,j.jsxs)("dl",{children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"FTPS"}),(0,j.jsx)("dd",{children:"\u52A0\u5BC6\u63A7\u5236\u4E0E\u6587\u4EF6\u6570\u636E\uFF0C\u9ED8\u8BA4\u4E25\u683C\u6821\u9A8C\u8BC1\u4E66"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"FTP"}),(0,j.jsx)("dd",{children:"\u517C\u5BB9\u65E7\u670D\u52A1\u5668\uFF0C\u4F46\u8D26\u53F7\u548C\u6587\u4EF6\u5185\u5BB9\u4E0D\u52A0\u5BC6"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"SFTP"}),(0,j.jsx)("dd",{children:"\u7531 SSH \u4E3B\u673A\u7BA1\u7406\uFF0C\u4E0D\u5728\u8FD9\u91CC\u91CD\u590D\u914D\u7F6E"})]})]})]})})]})})}function ax({profile:e,error:t,onBack:r,onDelete:s}){let[o,i]=(0,jt.useState)(!1);return(0,j.jsxs)("div",{className:"dsh-ssh-ftp-delete-panel",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:r,children:[(0,j.jsx)(Rt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,j.jsx)("span",{className:"dsh-ssh-ftp-delete-mark",children:(0,j.jsx)(Rt.IconWarningOutline16,{size:20})}),(0,j.jsxs)("h3",{children:["\u5220\u9664\u201C",e.name,"\u201D\uFF1F"]}),(0,j.jsx)("p",{children:"\u5C06\u79FB\u9664\u8BE5 FTP/FTPS \u8FDE\u63A5\u53CA\u5176\u72EC\u7ACB\u4FDD\u5B58\u7684\u5BC6\u7801\uFF0C\u4E0D\u4F1A\u5220\u9664\u8FDC\u7AEF\u670D\u52A1\u5668\u4E0A\u7684\u4EFB\u4F55\u6587\u4EF6\u3002"}),(0,j.jsxs)("code",{children:[e.username,"@",e.host,":",e.port]}),t&&(0,j.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t}),(0,j.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:r,disabled:o,children:"\u53D6\u6D88"}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o,onClick:()=>{i(!0),s().finally(()=>i(!1))},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u8FDE\u63A5"})]})]})}function lx({value:e,vaultEntries:t,proxyEntries:r,onBack:s,onSaved:o}){let i=t.filter(y=>y.authType==="password"),[n,a]=(0,jt.useState)({name:e?.name??"",group:e?.group??"",protocol:e?.protocol??"ftps-explicit",host:e?.host??"",port:String(e?.port??21),username:e?.username??"",credentialId:e?.credentialId??"",password:"",proxyId:e?.proxy.type==="saved"?e.proxy.proxyId:"",initialPath:e?.initialPath??"/",connectTimeoutMs:String(e?.connectTimeoutMs??15e3),tlsServerName:e?.tlsServerName??""}),[h,l]=(0,jt.useState)(!1),[c,f]=(0,jt.useState)(!1),[v,g]=(0,jt.useState)(),[u,d]=(0,jt.useState)(),m=()=>({profile:{name:n.name,...n.group.trim()?{group:n.group.trim()}:{},protocol:n.protocol,host:n.host,port:Number(n.port),username:n.username,...n.credentialId?{credentialId:n.credentialId}:{},proxy:n.proxyId?{type:"saved",proxyId:n.proxyId}:{type:"none"},initialPath:n.initialPath,connectTimeoutMs:Number(n.connectTimeoutMs),...n.tlsServerName.trim()?{tlsServerName:n.tlsServerName.trim()}:{}},secrets:{password:n.password}}),p=async y=>{y.preventDefault(),l(!0),d(void 0),g(void 0);try{await oe(e===void 0?"/ftp-profiles":`/ftp-profiles/${encodeURIComponent(e.id)}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(m())}),o()}catch(w){d(Pe(w))}finally{l(!1)}},b=async()=>{f(!0),d(void 0),g(void 0);try{await oe("/ftp-profiles/test-draft",{method:"POST",body:JSON.stringify({...m(),...e===void 0?{}:{profileId:e.id}})}),g("\u8FDE\u63A5\u6210\u529F\uFF0C\u521D\u59CB\u76EE\u5F55\u53EF\u8BFB\u53D6")}catch(y){d(Pe(y))}finally{f(!1)}},x=y=>a(w=>({...w,protocol:y,port:w.port==="21"||w.port==="990"?String(y==="ftps-implicit"?990:21):w.port}));return(0,j.jsxs)("form",{className:"dsh-ssh-ftp-editor-form",onSubmit:y=>{p(y)},children:[(0,j.jsxs)("header",{className:"dsh-ssh-ftp-editor-heading",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:s,children:[(0,j.jsx)(Rt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:e===void 0?"\u65B0\u5EFA\u6587\u4EF6\u8FDE\u63A5":e.name}),(0,j.jsx)("small",{children:e===void 0?"\u586B\u5199\u670D\u52A1\u5668\u548C\u8BA4\u8BC1\u4FE1\u606F":"\u4FEE\u6539\u540E\u53EF\u5148\u6D4B\u8BD5\u518D\u4FDD\u5B58"})]})]}),(0,j.jsxs)("div",{className:"dsh-ssh-ftp-editor-scroll",children:[(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8FDE\u63A5\u7C7B\u578B"}),(0,j.jsx)("small",{children:"\u4F18\u5148\u4F7F\u7528 FTPS\uFF1B\u4EC5\u5728\u670D\u52A1\u5668\u4E0D\u652F\u6301 TLS \u65F6\u9009\u62E9 FTP"})]}),(0,j.jsx)("div",{className:"dsh-ssh-ftp-protocol-options",role:"radiogroup","aria-label":"\u8FDE\u63A5\u534F\u8BAE",children:[["ftps-explicit","FTPS","\u663E\u5F0F TLS \xB7 \u63A8\u8350"],["ftps-implicit","FTPS-I","\u9690\u5F0F TLS"],["ftp","FTP","\u672A\u52A0\u5BC6"]].map(y=>(0,j.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":n.protocol===y[0],className:n.protocol===y[0]?"is-active":"",onClick:()=>x(y[0]),children:[(0,j.jsx)("span",{className:`dsh-ssh-protocol-badge is-${y[0]}`,children:y[1]}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:y[1]}),(0,j.jsx)("small",{children:y[2]})]})]},y[0]))}),n.protocol==="ftp"&&(0,j.jsx)("p",{className:"dsh-ssh-form-warning",children:"\u666E\u901A FTP \u7684\u8D26\u53F7\u3001\u5BC6\u7801\u548C\u6587\u4EF6\u5185\u5BB9\u5747\u4E0D\u52A0\u5BC6\u3002"})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u670D\u52A1\u5668"}),(0,j.jsx)("small",{children:"\u540D\u79F0\u7528\u4E8E\u8FDE\u63A5\u5217\u8868\uFF0C\u5206\u7EC4\u7528\u4E8E\u533A\u5206\u73AF\u5883\u6216\u7528\u9014"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(he,{label:"\u8FDE\u63A5\u540D\u79F0",children:(0,j.jsx)("input",{autoFocus:e===void 0,required:!0,maxLength:80,value:n.name,onChange:y=>a({...n,name:y.target.value})})}),(0,j.jsx)(he,{label:"\u5206\u7EC4\uFF08\u53EF\u9009\uFF09",children:(0,j.jsx)("input",{maxLength:64,value:n.group,onChange:y=>a({...n,group:y.target.value})})})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,j.jsx)(he,{label:"\u670D\u52A1\u5668\u5730\u5740",children:(0,j.jsx)("input",{required:!0,maxLength:253,spellCheck:!1,value:n.host,onChange:y=>a({...n,host:y.target.value})})}),(0,j.jsx)(he,{label:"\u7AEF\u53E3",children:(0,j.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:n.port,onChange:y=>a({...n,port:y.target.value})})})]})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,j.jsx)("small",{children:"\u5BC6\u7801\u53EA\u5199\u5165 DSH \u51ED\u636E\u670D\u52A1\uFF0C\u4E0D\u4F1A\u5728\u754C\u9762\u56DE\u663E"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(he,{label:"\u7528\u6237\u540D",children:(0,j.jsx)("input",{required:!0,maxLength:128,autoComplete:"username",value:n.username,onChange:y=>a({...n,username:y.target.value})})}),(0,j.jsx)(he,{label:"\u51ED\u636E\u6765\u6E90",children:(0,j.jsxs)("select",{value:n.credentialId,onChange:y=>a({...n,credentialId:y.target.value}),children:[(0,j.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u5355\u72EC\u4FDD\u5B58\u5BC6\u7801"}),i.map(y=>(0,j.jsxs)("option",{value:y.id,children:[y.name," \xB7 ",y.username]},y.id))]})})]}),!n.credentialId&&(0,j.jsx)(he,{label:"\u5BC6\u7801",hint:e?.credential.configured&&e.credential.source==="profile"?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",children:(0,j.jsx)("input",{required:e===void 0||e.credential.source!=="profile"||!e.credential.configured,type:"password",autoComplete:"new-password",value:n.password,onChange:y=>a({...n,password:y.target.value})})})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8DEF\u5F84\u4E0E\u7F51\u7EDC"}),(0,j.jsx)("small",{children:"\u4EE3\u7406\u590D\u7528 SSH \u63D2\u4EF6\u7684\u4EE3\u7406\u5E93\uFF0C\u63A7\u5236\u548C\u6570\u636E\u8FDE\u63A5\u4F7F\u7528\u540C\u4E00\u8DEF\u5F84"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(he,{label:"\u521D\u59CB\u76EE\u5F55",children:(0,j.jsx)("input",{required:!0,maxLength:4096,spellCheck:!1,value:n.initialPath,onChange:y=>a({...n,initialPath:y.target.value})})}),(0,j.jsx)(he,{label:"\u8FDE\u63A5\u4EE3\u7406",children:(0,j.jsxs)("select",{value:n.proxyId,onChange:y=>a({...n,proxyId:y.target.value}),children:[(0,j.jsx)("option",{value:"",children:"\u76F4\u8FDE"}),r.map(y=>(0,j.jsxs)("option",{value:y.id,children:[y.name," \xB7 ",y.proxyType.toUpperCase()]},y.id))]})})]}),(0,j.jsxs)("details",{className:"dsh-ssh-form-advanced",children:[(0,j.jsx)("summary",{children:"\u9AD8\u7EA7\u8FDE\u63A5\u8BBE\u7F6E"}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(he,{label:"\u8FDE\u63A5\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09",children:(0,j.jsx)("input",{required:!0,type:"number",min:"1000",max:"120000",step:"1000",value:n.connectTimeoutMs,onChange:y=>a({...n,connectTimeoutMs:y.target.value})})}),(0,j.jsx)(he,{label:"TLS \u670D\u52A1\u5668\u540D\u79F0",hint:"\u8BC1\u4E66\u540D\u79F0\u4E0E\u4E3B\u673A\u4E0D\u540C\u65F6\u586B\u5199",children:(0,j.jsx)("input",{maxLength:253,spellCheck:!1,value:n.tlsServerName,onChange:y=>a({...n,tlsServerName:y.target.value})})})]})]})]}),v&&(0,j.jsx)("p",{className:"dsh-ssh-inline-success",role:"status",children:v}),u&&(0,j.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:u})]}),(0,j.jsxs)("footer",{className:"dsh-ssh-ftp-editor-actions",children:[(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>{b()},disabled:c||h,children:c?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,j.jsx)("span",{}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,disabled:h||c,children:"\u53D6\u6D88"}),(0,j.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:h||c,children:h?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})}function hx(e){return e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}function Xp(e,t,r){let s=r==="asc"?1:-1;return e.map((o,i)=>({entry:o,index:i})).sort((o,i)=>{let n=o.entry.kind==="directory"||o.entry.navigable===!0,a=i.entry.kind==="directory"||i.entry.navigable===!0;if(n!==a)return n?-1:1;let h=cx(o.entry,i.entry,t);if(h!==0)return h*s;let l=o.entry.name.localeCompare(i.entry.name,void 0,{numeric:!0,sensitivity:"base"});return l!==0?l:o.index-i.index}).map(o=>o.entry)}function cx(e,t,r){return r==="name"?e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:"base"}):e[r]-t[r]}var M=require("react/jsx-runtime"),Qp="dsh-ssh:file-transfer:tabs:v2",Pl=38,dx=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"});function Zp({ftpProfiles:e,vaultEntries:t,proxyEntries:r,access:s,onProfilesChanged:o}){let[i,n]=(0,be.useState)([]),[a,h]=(0,be.useState)([]),[l,c]=(0,be.useState)(()=>Sx()),[f,v]=(0,be.useState)(()=>l[0]?.id??"transfer-1"),[g,u]=(0,be.useState)(!1),[d,m]=(0,be.useState)(!1),[p,b]=(0,be.useState)(),[x,y]=(0,be.useState)(),[w,_]=(0,be.useState)(),[S,T]=(0,be.useState)({}),D=(0,be.useRef)(new Map),P=(0,be.useCallback)(async()=>{try{let R=await Ml();n(R),c(L=>kx(L,R))}catch(R){_(Pe(R))}},[]);(0,be.useEffect)(()=>{P()},[P,e]),(0,be.useEffect)(()=>{try{localStorage.setItem(Qp,JSON.stringify(l))}catch{}},[l]),(0,be.useEffect)(()=>{let R=D.current,L=a.filter(k=>Jp(k.state)&&R.has(k.id)&&!Jp(R.get(k.id)));D.current=new Map(a.map(k=>[k.id,k.state])),L.length!==0&&T(k=>{let U={...k};for(let X of L){let O=Bn(X.request.destinationEndpointId,X.request.destinationDirectory);U[O]=(U[O]??0)+1}return U})},[a]),(0,be.useEffect)(()=>{let R=!1,L,k=async()=>{if(document.visibilityState==="hidden"){L=window.setTimeout(()=>{k()},1800);return}try{let U=await zl();R||h(U)}catch{}R||(L=window.setTimeout(()=>{k()},800))};return k(),()=>{R=!0,L!==void 0&&clearTimeout(L)}},[]);let A=l.find(R=>R.id===f)??l[0],F=R=>c(L=>L.map(k=>k.id===A?.id?R(k):k)),B=()=>{let R=`transfer-${Date.now().toString(36)}`,L=Rl(R,l.length+1);c(k=>[...k,L]),v(R)},$=R=>{if(l.length===1)return;let L=l.findIndex(U=>U.id===R),k=l.filter(U=>U.id!==R);c(k),f===R&&v(k[Math.max(0,L-1)].id)},z=R=>F(L=>({...L,panes:Array.from({length:R},(k,U)=>L.panes[U]??Nn(`${L.id}-pane-${U}`))})),H=async(R,L,k,U,X)=>{let O={endpointId:R,directory:L},te={endpointId:U,directory:X};if(!(Zs(O,te)||!ei(O,k,te)))try{_(void 0);let N=await Bs({sourceEndpointId:R,sourcePaths:k,destinationEndpointId:U,destinationDirectory:X,conflictPolicy:"fail"});h(I=>[N,...I.filter(J=>J.id!==N.id)])}catch(N){_(Pe(N))}},C=async(R,L,k)=>{try{_(void 0);let U=await hn(R,{paneId:L.id,endpointId:L.endpointId,directory:k});U.job!==void 0&&h(X=>[U.job,...X.filter(O=>O.id!==U.job.id)]),U.operation==="move"&&T(X=>{let O={...X};for(let te of[Bn(R.endpointId,R.directory),Bn(L.endpointId,k)])O[te]=(O[te]??0)+1;return O})}catch(U){_(Pe(U))}};return(0,M.jsxs)("div",{className:"dsh-ssh-transfer-workspace",children:[(0,M.jsxs)("header",{className:"dsh-ssh-transfer-header",children:[(0,M.jsxs)("div",{children:[(0,M.jsx)("h1",{children:"\u6587\u4EF6\u4F20\u8F93"}),(0,M.jsx)("p",{children:"FTP\u3001FTPS \u4E0E SFTP \u4E4B\u95F4\u76F4\u63A5\u6D41\u5F0F\u4E92\u4F20"})]}),(0,M.jsxs)("div",{className:"dsh-ssh-transfer-actions",children:[(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>m(!0),children:["\u4F1A\u8BDD\u8BBF\u95EE \xB7 ",s.value?.fileEndpointIds.length??0]}),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>u(!0),children:"FTP \u7BA1\u7406"})]})]}),w&&(0,M.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,M.jsx)("span",{children:w}),(0,M.jsx)("button",{type:"button",onClick:()=>_(void 0),"aria-label":"\u5173\u95ED",children:(0,M.jsx)(At.IconCloseOutline16,{size:16})})]}),(0,M.jsxs)("div",{className:"dsh-ssh-transfer-tabbar",role:"tablist","aria-label":"\u6587\u4EF6\u4F20\u8F93\u4EFB\u52A1\u9875",children:[(0,M.jsxs)("div",{className:"dsh-ssh-transfer-tabs",children:[l.map(R=>(0,M.jsxs)("span",{"data-ssh-interactive":"choice",className:`dsh-ssh-transfer-tab${R.id===A?.id?" is-active":""}`,children:[(0,M.jsx)("button",{type:"button",role:"tab","aria-selected":R.id===A?.id,onClick:()=>v(R.id),children:R.name}),l.length>1&&(0,M.jsx)("button",{type:"button",className:"is-close","aria-label":`\u5173\u95ED ${R.name}`,onClick:()=>$(R.id),children:(0,M.jsx)(At.IconCloseOutline16,{size:13})})]},R.id)),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"is-add","aria-label":"\u65B0\u5EFA\u4F20\u8F93\u4EFB\u52A1\u9875",onClick:B,children:(0,M.jsx)(At.IconPlusOutline16,{size:15})})]}),(0,M.jsx)("div",{className:"dsh-ssh-pane-layout","aria-label":"\u7A97\u683C\u6570\u91CF",children:[2,3,4].map(R=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":A?.panes.length===R,className:A?.panes.length===R?"is-active":"",onClick:()=>z(R),children:[R," \u680F"]},R))})]}),i.length===0?(0,M.jsxs)("div",{className:"dsh-ssh-transfer-empty",children:[(0,M.jsx)(At.IconDataOutline16,{size:24}),(0,M.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u6587\u4EF6\u8FDE\u63A5"}),(0,M.jsx)("p",{children:"\u65B0\u5EFA FTP/FTPS \u8FDE\u63A5\uFF0C\u6216\u5148\u6DFB\u52A0\u4E00\u53F0 SSH \u4E3B\u673A\u4F7F\u7528 SFTP\u3002"}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>u(!0),children:"\u65B0\u5EFA FTP \u8FDE\u63A5"})]}):A&&(0,M.jsx)("div",{className:`dsh-ssh-transfer-panes has-${A.panes.length}`,children:A.panes.map((R,L)=>{let k=A.panes[(L+1)%A.panes.length];return(0,M.jsx)(ux,{pane:R,endpoints:i,dragSource:x,refreshRevision:S[Bn(R.endpointId,R.path)]??0,...k===void 0?{}:{destination:k},onManageConnections:()=>u(!0),onDragSourceChange:y,onChange:U=>F(X=>({...X,panes:X.panes.map(O=>O.id===R.id?{...O,...U}:O)})),onTransfer:(U,X)=>{H(R.endpointId,R.path,U,X.endpointId,X.path)},onExternalDrop:(U,X)=>{C(U,R,X)}},R.id)})}),(0,M.jsx)(gx,{jobs:a,endpoints:i,onCancel:async R=>{try{await Hl(R),h(L=>L.map(k=>k.id===R?{...k,state:"cancelled"}:k))}catch(L){_(Pe(L))}},onConflict:b}),g&&(0,M.jsx)(Gp,{profiles:e,vaultEntries:t,proxyEntries:r,onClose:()=>u(!1),onChanged:()=>{o(),P()}}),d&&(0,M.jsx)(bx,{endpoints:i,access:s,onClose:()=>m(!1)}),p&&(0,M.jsx)(vx,{job:p,onClose:()=>b(void 0),onRetry:async R=>{try{let L=await Bs({...p.request,conflictPolicy:R});h(k=>[L,...k]),b(void 0)}catch(L){_(Pe(L))}}})]})}function ux({pane:e,endpoints:t,destination:r,dragSource:s,refreshRevision:o,onChange:i,onTransfer:n,onExternalDrop:a,onDragSourceChange:h,onManageConnections:l}){let[c,f]=(0,be.useState)(),[v,g]=(0,be.useState)([]),[u,d]=(0,be.useState)(e.path),[m,p]=(0,be.useState)(!1),[b,x]=(0,be.useState)(0),[y,w]=(0,be.useState)({key:"name",direction:"asc"}),[_,S]=(0,be.useState)(!1),[T,D]=(0,be.useState)(),[P,A]=(0,be.useState)(),[F,B]=(0,be.useState)(),$=(0,be.useRef)(null),z=(0,be.useRef)(0),H=t.find(V=>V.id===e.endpointId),C=(0,be.useMemo)(()=>Xp(c?.entries??[],y.key,y.direction),[c?.entries,y]),R=C.length>200,L=R?Math.max(0,Math.floor(b/Pl)-8):0,k=(0,be.useMemo)(()=>R?C.slice(L,Math.min(C.length,L+56)):C,[C,L,R]),U=(0,be.useCallback)(async(V=e.path)=>{if(H===void 0)return;let Q=++z.current;p(!0),B(void 0);try{let W=await Fl(e.id,H.id,V);if(Q!==z.current)return;f(W),d(W.path),g([]),x(0),$.current&&($.current.scrollTop=0),i({endpointId:H.id,path:W.path})}catch(W){Q===z.current&&B(Pe(W))}finally{Q===z.current&&p(!1)}},[H?.id,e.path]);(0,be.useEffect)(()=>{H!==void 0&&U(e.path)},[H?.id,o]),(0,be.useEffect)(()=>{s===void 0&&(S(!1),D(void 0))},[s]);let X=V=>{V.preventDefault(),U(u)},O=V=>{w(Q=>Q.key===V?{key:V,direction:Q.direction==="asc"?"desc":"asc"}:{key:V,direction:"asc"}),x(0),$.current&&($.current.scrollTop=0)},te=V=>{z.current+=1,i({endpointId:V.id,path:V.initialPath}),d(V.initialPath),f(void 0),B(void 0)},N=()=>{z.current+=1,i({endpointId:"",path:"/"}),f(void 0),g([]),B(void 0),p(!1)},I=(V,Q)=>g(W=>Q?W.includes(V.path)?W.filter(ae=>ae!==V.path):[...W,V.path]:[V.path]),J=async()=>{if(!(P===void 0||c===void 0||H===void 0))try{await Fs({paneId:e.id,endpointId:H.id,directory:c.path,paths:P.map(V=>V.path)}),g([])}finally{await U(c.path)}},Y=V=>{V.preventDefault(),S(!1);let Q=vs(V.dataTransfer.getData(Lt));h(void 0),!(Q===void 0||Q.paneId===e.id||Zs(Q,{endpointId:e.endpointId,directory:e.path}))&&a(Q,e.path)};return H===void 0?(0,M.jsxs)("section",{className:"dsh-ssh-file-pane is-connections",children:[(0,M.jsxs)("header",{children:[(0,M.jsxs)("span",{className:"dsh-ssh-pane-heading",children:[(0,M.jsx)("strong",{children:"\u8FDE\u63A5\u5217\u8868"}),(0,M.jsx)("small",{children:"\u5355\u51FB\u8FDE\u63A5\u540E\u6D4F\u89C8\u8FDC\u7AEF\u6587\u4EF6"})]}),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-pane-manage-button",onClick:l,children:"FTP \u7BA1\u7406"})]}),(0,M.jsx)("div",{className:"dsh-ssh-endpoint-list",children:t.map(V=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"row",className:"dsh-ssh-endpoint-row",onClick:()=>te(V),children:[(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${V.protocol}`,children:Al(V.protocol)}),(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{title:V.name,children:V.name}),(0,M.jsx)("small",{title:V.address,children:V.address})]}),(0,M.jsxs)("span",{children:[(0,M.jsx)("i",{className:`dsh-ssh-protocol-dot is-${V.protocol}`,"aria-hidden":"true"}),V.group??(V.kind==="sftp"?"SSH \u4E3B\u673A":"\u6587\u4EF6\u8FDE\u63A5")]})]},V.id))}),(0,M.jsxs)("footer",{children:[(0,M.jsxs)("span",{children:[t.length," \u4E2A\u53EF\u7528\u8FDE\u63A5"]}),(0,M.jsx)("small",{children:"SFTP \u590D\u7528 SSH \u4E3B\u673A\u914D\u7F6E"})]})]}):(0,M.jsxs)("section",{className:`dsh-ssh-file-pane${_?" is-drop-target":""}`,onDragOver:V=>{V.dataTransfer.types.includes(Lt)&&Ex(s,e)?(V.preventDefault(),V.dataTransfer.dropEffect=s?.endpointId===e.endpointId?"move":"copy",D(void 0),S(!0)):_&&S(!1)},onDragLeave:V=>{V.currentTarget.contains(V.relatedTarget)||(S(!1),D(void 0))},onDrop:Y,children:[(0,M.jsxs)("header",{children:[(0,M.jsx)("button",{type:"button",className:"dsh-ssh-pane-back","aria-label":"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868",onClick:N,children:(0,M.jsx)(At.IconChevronLeftOutline14,{size:14})}),(0,M.jsxs)("span",{className:"dsh-ssh-pane-endpoint",children:[(0,M.jsx)("strong",{children:H.name}),(0,M.jsx)("small",{title:H.address,children:H.address})]}),(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${H.protocol}`,children:Al(H.protocol)})]}),(0,M.jsxs)("form",{className:"dsh-ssh-file-pathbar",onSubmit:X,children:[(0,M.jsx)("button",{type:"button","aria-label":"\u4E0A\u4E00\u7EA7\u76EE\u5F55",disabled:c?.parent===null||m,onClick:()=>{c?.parent&&U(c.parent)},children:(0,M.jsx)(Ax,{})}),(0,M.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",disabled:m,onClick:()=>{U()},children:(0,M.jsx)(Ix,{})}),(0,M.jsx)("input",{"aria-label":"\u8FDC\u7AEF\u8DEF\u5F84",value:u,onChange:V=>d(V.target.value)}),(0,M.jsx)("button",{type:"submit",disabled:m,children:"\u524D\u5F80"})]}),(0,M.jsxs)("div",{className:"dsh-ssh-file-table",role:"grid","aria-busy":m,children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-table-head",role:"row",children:[(0,M.jsx)(Dl,{label:"\u540D\u79F0",sortKey:"name",current:y,onSort:O}),(0,M.jsx)(Dl,{label:"\u5927\u5C0F",sortKey:"size",current:y,onSort:O}),(0,M.jsx)(Dl,{label:"\u4FEE\u6539\u65F6\u95F4",sortKey:"modifiedAt",current:y,onSort:O}),(0,M.jsx)("span",{role:"columnheader","aria-label":"\u64CD\u4F5C"})]}),(0,M.jsx)("div",{ref:$,className:"dsh-ssh-file-table-body",onScroll:V=>{R&&x(V.currentTarget.scrollTop)},children:m&&!c?(0,M.jsx)("div",{className:"dsh-ssh-file-loading",children:"\u6B63\u5728\u8BFB\u53D6\u76EE\u5F55\u2026"}):F?(0,M.jsxs)("div",{className:"dsh-ssh-file-error",children:[(0,M.jsx)("span",{children:F}),(0,M.jsx)("button",{type:"button",onClick:()=>{U()},children:"\u91CD\u8BD5"})]}):C.length===0?(0,M.jsx)("div",{className:"dsh-ssh-table-empty",children:"\u8FD9\u4E2A\u76EE\u5F55\u662F\u7A7A\u7684\u3002"}):(0,M.jsx)("div",{className:R?"dsh-ssh-file-virtual-list":void 0,style:R?{height:`${C.length*Pl}px`}:void 0,children:k.map((V,Q)=>(0,M.jsx)(mx,{entry:V,paneId:e.id,endpointId:H.id,sourceDirectory:c?.path??e.path,dragSource:s,dropTarget:T===V.path,selected:v.includes(V.path),selectedPaths:v,...R?{style:{position:"absolute",insetInline:0,transform:`translateY(${(L+Q)*Pl}px)`}}:{},onDelete:()=>A([V]),onDirectoryTarget:W=>{S(!1),D(W)},onDropIntoDirectory:(W,ae)=>{D(void 0),h(void 0),a(W,ae)},onDragSourceChange:h,onSelect:W=>I(V,W),onOpen:()=>{U(V.path)}},V.path))})})]}),(0,M.jsxs)("footer",{children:[(0,M.jsx)("span",{children:v.length>0?`\u5DF2\u9009\u62E9 ${v.length} \u9879`:`${c?.entries.length??0} \u9879`}),(0,M.jsx)("span",{className:"dsh-ssh-file-pane-actions",children:(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-to-button",disabled:v.length===0||r===void 0||!r.endpointId||m,onClick:()=>{r?.endpointId&&n(v,r)},children:["\u4F20\u9001\u5230\u4E0B\u4E00\u680F ",(0,M.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]}),_&&(0,M.jsxs)("div",{className:"dsh-ssh-file-drop-overlay",children:[(0,M.jsx)("strong",{children:s?.endpointId===e.endpointId?"\u79FB\u52A8\u5230\u6B64\u76EE\u5F55":"\u590D\u5236\u5230\u6B64\u76EE\u5F55"}),(0,M.jsx)("span",{children:c?.path??e.path})]}),P!==void 0&&(0,M.jsx)(Dn,{locationName:H.name,locationKind:"remote",entries:P,onClose:()=>A(void 0),onDelete:J})]})}function Dl({label:e,sortKey:t,current:r,onSort:s}){let o=r.key===t;return(0,M.jsx)("span",{role:"columnheader","aria-sort":o?r.direction==="asc"?"ascending":"descending":"none",children:(0,M.jsxs)("button",{type:"button",onClick:()=>s(t),children:[e,(0,M.jsx)(px,{active:o,direction:r.direction})]})})}function px({active:e,direction:t}){return(0,M.jsx)("svg",{className:e?"is-active":"",viewBox:"0 0 12 12","aria-hidden":"true",children:(0,M.jsx)("path",{d:"m3.5 5 2.5 2.5L8.5 5",transform:t==="desc"?void 0:"rotate(180 6 6)"})})}function fx(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M8 2v7m0 0 2.6-2.6M8 9 5.4 6.4M3 11.5v1.25h10V11.5"})})}function mx({entry:e,paneId:t,endpointId:r,sourceDirectory:s,dragSource:o,dropTarget:i,selected:n,selectedPaths:a,style:h,onSelect:l,onOpen:c,onDelete:f,onDirectoryTarget:v,onDropIntoDirectory:g,onDragSourceChange:u}){let d=ln(e),m=d&&(o===void 0||ei(o,o.paths,{endpointId:r,directory:e.path})),p=b=>{if(!d)return;b.preventDefault(),b.stopPropagation(),v(void 0);let x=vs(b.dataTransfer.getData(Lt));x!==void 0&&ei(x,x.paths,{endpointId:r,directory:e.path})&&g(x,e.path)};return(0,M.jsxs)("div",{role:"row","data-ssh-interactive":"row","data-ssh-context-row":!0,tabIndex:0,"aria-selected":n,"aria-label":`${e.name}${d?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":""}`,draggable:e.kind==="file"||d,className:`dsh-ssh-file-row is-${d?"directory":e.kind}${n?" is-selected":""}${i?" is-drop-target":""}`,style:h,onClick:b=>{d&&!b.ctrlKey&&!b.metaKey&&!b.shiftKey?c():l(b.ctrlKey||b.metaKey)},onKeyDown:b=>{b.target===b.currentTarget&&(b.key==="Enter"&&d&&c(),b.key===" "&&(b.preventDefault(),l(b.ctrlKey||b.metaKey)))},onDragStart:b=>{let x=n?a:[e.path],y={paneId:t,endpointId:r,directory:s,paths:x};u(y),b.dataTransfer.effectAllowed="copyMove",b.dataTransfer.setData(Lt,JSON.stringify(y))},onDragEnd:()=>u(void 0),onDragOver:b=>{b.dataTransfer.types.includes(Lt)&&m&&(b.preventDefault(),b.stopPropagation(),b.dataTransfer.dropEffect=o?.endpointId===r?"move":"copy",v(e.path))},onDragLeave:b=>{i&&!b.currentTarget.contains(b.relatedTarget)&&v(void 0)},onDrop:p,children:[(0,M.jsxs)("span",{children:[(0,M.jsx)(Lx,{directory:d}),(0,M.jsx)("i",{title:e.name,children:e.name})]}),(0,M.jsx)("span",{children:d?"\u2014":tf(e.size)}),(0,M.jsx)("span",{children:e.modifiedAt>0?new Date(e.modifiedAt).toLocaleString():"\u2014"}),(0,M.jsxs)("span",{className:"dsh-ssh-file-row-actions dsh-ssh-context-action",children:[(e.kind==="file"||e.kind==="directory")&&(0,M.jsx)("a",{className:"dsh-ssh-file-row-download",href:Bl(r,e.path),download:e.kind==="directory"?`${e.name}.tar`:e.name,draggable:!1,"aria-label":`\u4E0B\u8F7D ${e.name} \u5230\u672C\u5730`,title:e.kind==="directory"?`\u5C06 ${e.name} \u6253\u5305\u4E0B\u8F7D\u5230\u672C\u5730`:`\u4E0B\u8F7D ${e.name} \u5230\u672C\u5730`,onClick:b=>b.stopPropagation(),children:(0,M.jsx)(fx,{})}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-file-row-delete",draggable:!1,"aria-label":`\u5220\u9664 ${e.name}`,title:`\u5220\u9664 ${e.name}`,onClick:b=>{b.stopPropagation(),f()},children:(0,M.jsx)(At.IconTrashOutline16,{size:14})})]})]})}function gx({jobs:e,endpoints:t,onCancel:r,onConflict:s}){let[o,i]=(0,be.useState)(!0),n=e.filter(a=>a.state==="queued"||a.state==="scanning"||a.state==="transferring");return(0,M.jsxs)("section",{className:`dsh-ssh-transfer-queue${o?" is-open":""}`,children:[(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-queue-heading","aria-expanded":o,onClick:()=>i(a=>!a),children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u4F20\u8F93\u4EFB\u52A1"}),(0,M.jsx)("small",{children:n.length>0?`${n.length} \u4E2A\u8FDB\u884C\u4E2D`:e.length>0?"\u6700\u8FD1\u4EFB\u52A1":"\u6682\u65E0\u4EFB\u52A1"})]}),(0,M.jsx)("span",{children:o?"\u6536\u8D77":"\u5C55\u5F00"})]}),o&&(0,M.jsx)("div",{className:"dsh-ssh-transfer-job-list",children:e.length===0?(0,M.jsx)("p",{children:"\u4ECE\u4E00\u4E2A\u7A97\u683C\u62D6\u5230\u53E6\u4E00\u4E2A\u7A97\u683C\uFF0C\u6216\u9009\u4E2D\u6587\u4EF6\u540E\u70B9\u51FB\u201C\u4F20\u9001\u5230\u4E0B\u4E00\u680F\u201D\u3002"}):e.slice(0,12).map(a=>{let h=a.totalBytes>0?Math.min(100,a.transferredBytes/a.totalBytes*100):a.state==="completed"?100:0;return(0,M.jsxs)("article",{children:[(0,M.jsx)("span",{className:`dsh-ssh-transfer-state is-${a.state}`,"aria-hidden":"true"}),(0,M.jsxs)("span",{className:"dsh-ssh-transfer-job-copy",children:[(0,M.jsxs)("strong",{children:[ef(a.request.sourcePaths)," ",(0,M.jsx)("i",{children:"\u2192"})," ",Cx(t,a.request.destinationEndpointId)]}),(0,M.jsx)("small",{children:a.error??Tx(a,h)}),(0,M.jsx)("span",{className:"dsh-ssh-transfer-job-time",children:Px(a)}),(0,M.jsx)("span",{className:"dsh-ssh-transfer-progress",children:(0,M.jsx)("i",{style:{transform:`scaleX(${h/100})`}})})]}),a.state==="queued"||a.state==="scanning"||a.state==="transferring"?(0,M.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u53D6\u6D88\u4F20\u8F93",onClick:()=>{r(a.id)},children:(0,M.jsx)(At.IconCloseOutline16,{size:15})}):a.state==="failed"&&a.error?.includes("destination already contains")?(0,M.jsx)("button",{type:"button",className:"dsh-ssh-job-resolve",onClick:()=>s(a),children:"\u5904\u7406"}):null]},a.id)})})]})}function vx({job:e,onClose:t,onRetry:r}){let[s,o]=(0,be.useState)("rename"),[i,n]=(0,be.useState)(!1);return(0,M.jsxs)(Je,{className:"dsh-ssh-transfer-conflict-dialog",title:"\u76EE\u6807\u4E2D\u5B58\u5728\u540C\u540D\u6587\u4EF6",subtitle:"\u4E3A\u672C\u6279\u4F20\u8F93\u9009\u62E9\u5904\u7406\u65B9\u5F0F",onClose:t,children:[(0,M.jsxs)("div",{className:"dsh-ssh-transfer-conflict-copy",children:[(0,M.jsx)("strong",{children:ef(e.request.sourcePaths)}),(0,M.jsx)("span",{children:e.request.destinationDirectory})]}),(0,M.jsx)("div",{className:"dsh-ssh-conflict-options",children:[["rename","\u81EA\u52A8\u91CD\u547D\u540D","\u4FDD\u7559\u4E24\u4EFD\u6587\u4EF6\uFF0C\u5728\u540D\u79F0\u540E\u6DFB\u52A0\u5E8F\u53F7"],["skip","\u8DF3\u8FC7\u540C\u540D\u6587\u4EF6","\u7EE7\u7EED\u4F20\u8F93\u5176\u4ED6\u5185\u5BB9"],["overwrite","\u8986\u76D6\u76EE\u6807\u6587\u4EF6","\u4F7F\u7528\u6765\u6E90\u5185\u5BB9\u66FF\u6362\u76EE\u6807\u5185\u5BB9"]].map(a=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":s===a[0],className:s===a[0]?"is-active":"",onClick:()=>o(a[0]),children:[(0,M.jsx)("i",{"aria-hidden":"true"}),(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:a[1]}),(0,M.jsx)("small",{children:a[2]})]})]},a[0]))}),(0,M.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,M.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:i,onClick:()=>{n(!0),r(s).finally(()=>n(!1))},children:i?"\u6B63\u5728\u91CD\u65B0\u52A0\u5165\u961F\u5217\u2026":"\u7EE7\u7EED\u4F20\u8F93"})]})]})}function bx({endpoints:e,access:t,onClose:r}){let s=t.value,o=e.filter(n=>s?.fileEndpointIds.includes(n.id)).length,i=n=>t.setFileEndpoints(s?.fileEndpointIds.includes(n)?s.fileEndpointIds.filter(a=>a!==n):[...s?.fileEndpointIds??[],n]);return(0,M.jsxs)(Je,{className:"dsh-ssh-file-access-dialog",title:"\u4F1A\u8BDD\u8BBF\u95EE",subtitle:"\u5355\u72EC\u7BA1\u7406\u5F53\u524D\u4F1A\u8BDD\u53EF\u4F7F\u7528\u7684\u8FDC\u7AEF\u6587\u4EF6\u8FDE\u63A5",onClose:r,children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-access-body dsh-ssh-scroll-surface",children:[t.error&&(0,M.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t.error}),(0,M.jsxs)("section",{className:"dsh-ssh-file-access-section","aria-labelledby":"dsh-ssh-file-access-connections",children:[(0,M.jsxs)("header",{children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{id:"dsh-ssh-file-access-connections",children:"\u6587\u4EF6\u8FDE\u63A5"}),(0,M.jsx)("small",{children:"\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u6D4F\u89C8\u6307\u5B9A\u7684 FTP\u3001FTPS \u6216 SFTP"})]}),(0,M.jsxs)("i",{children:[o.toString().padStart(2,"0")," / ",e.length.toString().padStart(2,"0")]})]}),(0,M.jsx)("div",{className:"dsh-ssh-file-access-list",children:t.loading?(0,M.jsx)(xx,{}):e.length===0?(0,M.jsxs)("div",{className:"dsh-ssh-file-access-empty",children:[(0,M.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u7528\u8FDE\u63A5"}),(0,M.jsx)("small",{children:"\u8BF7\u5148\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u6DFB\u52A0 FTP\uFF0C\u6216\u5728\u4E3B\u673A\u9762\u677F\u4E2D\u6DFB\u52A0 SSH \u4E3B\u673A\u3002"})]}):e.map(n=>(0,M.jsx)(_x,{endpoint:n,enabled:s?.fileEndpointIds.includes(n.id)??!1,onToggle:()=>i(n.id)},n.id))})]}),(0,M.jsxs)("section",{className:"dsh-ssh-file-access-section is-options","aria-labelledby":"dsh-ssh-file-access-policy",children:[(0,M.jsx)("header",{children:(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{id:"dsh-ssh-file-access-policy",children:"\u8BBF\u95EE\u7B56\u7565"}),(0,M.jsx)("small",{children:"\u6587\u4EF6\u6743\u9650\u4E0E SSH \u547D\u4EE4\u3001\u7EC8\u7AEF\u6743\u9650\u76F8\u4E92\u72EC\u7ACB"})]})}),(0,M.jsxs)("div",{className:"dsh-ssh-file-access-options",children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650"}),(0,M.jsx)("small",{children:"\u6D4F\u89C8\u6A21\u5F0F\u4E0D\u4F1A\u5411 AI \u66B4\u9732\u8DE8\u7AEF\u4F20\u8F93\u5DE5\u5177"})]}),(0,M.jsx)(yx,{value:s?.filePermission??"browse",onChange:t.setFilePermission})]}),(0,M.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u4F20\u8F93\u524D\u786E\u8BA4"}),(0,M.jsx)("small",{children:"AI \u53D1\u8D77\u4F20\u8F93\u65F6\u8BF7\u6C42 DSH \u6388\u6743"})]}),(0,M.jsx)(wx,{checked:s?.requireFileApproval??!0,onChange:t.setRequireFileApproval})]})]})]})]}),(0,M.jsxs)("footer",{className:"dsh-ssh-file-access-footer",children:[(0,M.jsxs)("span",{className:t.saving?"is-saving":"is-saved",children:[(0,M.jsx)("i",{"aria-hidden":"true"}),t.saving?"\u6B63\u5728\u4FDD\u5B58\u66F4\u6539":`${o>0?`\u5DF2\u6388\u6743 ${o} \u4E2A\u8FDE\u63A5`:"\u672A\u6388\u6743\u8FDE\u63A5"} \xB7 \u81EA\u52A8\u4FDD\u5B58`]}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button","data-ssh-dialog-close":!0,disabled:t.saving,onClick:r,children:t.saving?"\u4FDD\u5B58\u4E2D\u2026":"\u5B8C\u6210"})]})]})}function _x({endpoint:e,enabled:t,onToggle:r}){return(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-file-access-endpoint${t?" is-mounted":""}`,"aria-pressed":t,onClick:r,children:[(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${e.protocol}`,children:Al(e.protocol)}),(0,M.jsxs)("span",{className:"dsh-ssh-file-access-endpoint-copy",children:[(0,M.jsx)("strong",{title:e.name,children:e.name}),(0,M.jsx)("small",{title:e.address,children:e.address})]}),(0,M.jsxs)("span",{className:"dsh-ssh-file-access-state",children:[(0,M.jsx)("i",{"aria-hidden":"true",children:(0,M.jsx)("b",{})}),(0,M.jsx)("em",{children:t?"\u5DF2\u6388\u6743":"\u672A\u6388\u6743"})]})]})}function xx(){return(0,M.jsx)("div",{className:"dsh-ssh-file-access-skeleton","aria-label":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u6743\u9650",children:[0,1,2].map(e=>(0,M.jsxs)("span",{style:{"--ssh-skeleton-index":e},children:[(0,M.jsx)("i",{}),(0,M.jsxs)("b",{children:[(0,M.jsx)("i",{}),(0,M.jsx)("i",{})]}),(0,M.jsx)("em",{})]},e))})}function yx({value:e,onChange:t}){return(0,M.jsx)("div",{className:"dsh-ssh-file-permission-picker",role:"radiogroup","aria-label":"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650",children:[["browse","\u4EC5\u6D4F\u89C8"],["transfer","\u5141\u8BB8\u4F20\u8F93"]].map(([r,s])=>(0,M.jsx)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":e===r,className:e===r?"is-active":"",onClick:()=>t(r),children:s},r))})}function wx({checked:e,onChange:t}){return(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"switch","aria-checked":e,className:`dsh-ssh-file-approval-switch${e?" is-active":""}`,onClick:()=>t(!e),children:[(0,M.jsx)("i",{"aria-hidden":"true",children:(0,M.jsx)("b",{})}),(0,M.jsx)("span",{children:e?"\u9700\u8981\u786E\u8BA4":"\u76F4\u63A5\u6267\u884C"})]})}function Sx(){try{let e=JSON.parse(localStorage.getItem(Qp)??"[]");if(!Array.isArray(e))return[Rl("transfer-1",1)];let t=e.slice(0,8).flatMap(r=>{if(typeof r!="object"||r===null)return[];let s=r;if(typeof s.id!="string"||!/^[a-zA-Z0-9_-]{1,100}$/.test(s.id)||typeof s.name!="string"||!Array.isArray(s.panes))return[];let o=s.panes.slice(0,4).flatMap(i=>{if(typeof i!="object"||i===null)return[];let n=i;return typeof n.id=="string"&&/^[a-zA-Z0-9_-]{1,100}$/.test(n.id)&&typeof n.endpointId=="string"&&typeof n.path=="string"?[{id:n.id,endpointId:"",path:"/"}]:[]});return o.length>=2?[{id:s.id,name:s.name.slice(0,40),panes:o}]:[]});if(t.length>0)return t}catch{}return[Rl("transfer-1",1)]}function Rl(e,t){return{id:e,name:`\u4EFB\u52A1 ${t}`,panes:[Nn(`${e}-a`),Nn(`${e}-b`)]}}function Nn(e){return{id:e,endpointId:"",path:"/"}}function kx(e,t){return e.map(r=>({...r,panes:r.panes.map(s=>!s.endpointId||t.some(o=>o.id===s.endpointId)?s:Nn(s.id))}))}function Cx(e,t){return e.find(r=>r.id===t)?.name??t}function ef(e){let t=e[0]?.replaceAll("\\","/").split("/").filter(Boolean).at(-1)??"\u6587\u4EF6";return e.length>1?`${t} \u7B49 ${e.length} \u9879`:t}function Al(e){return e==="sftp"?"SFTP":e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}function Bn(e,t){return JSON.stringify([e,t.replaceAll("\\","/").replace(/\/+$/,"")||"/"])}function Ex(e,t){return e===void 0||e.paneId!==t.id&&!Zs(e,{endpointId:t.endpointId,directory:t.path})}function Jp(e){return e==="completed"||e==="failed"||e==="cancelled"}function tf(e){return e<1024?`${e} B`:e<1024**2?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024**2).toFixed(1)} MB`:`${(e/1024**3).toFixed(2)} GB`}function Tx(e,t){if(e.state==="queued")return"\u7B49\u5F85\u4F20\u8F93";if(e.state==="scanning")return"\u6B63\u5728\u626B\u63CF\u76EE\u5F55";if(e.state==="transferring"){let r=Math.max(1,(Date.now()-(e.startedAt??Date.now()))/1e3),s=e.transferredBytes/r,o=s>0?Math.max(0,(e.totalBytes-e.transferredBytes)/s):0;return`${t.toFixed(0)}% \xB7 ${tf(s)}/s${o>1?` \xB7 \u7EA6 ${Rx(o)}`:""}`}return e.state==="completed"?`\u5DF2\u5B8C\u6210 ${e.completedFiles} \u4E2A\u6587\u4EF6${e.skippedFiles?`\uFF0C\u8DF3\u8FC7 ${e.skippedFiles}`:""}`:e.state==="cancelled"?"\u5DF2\u53D6\u6D88":"\u4F20\u8F93\u5931\u8D25"}function Px(e){if(e.startedAt===void 0)return`\u521B\u5EFA\u4E8E ${Yp(e.createdAt)}`;let t=e.completedAt??Date.now(),r=Dx(Math.max(0,t-e.startedAt));return e.completedAt===void 0?`\u5DF2\u6267\u884C ${r}`:`\u8017\u65F6 ${r} \xB7 \u5B8C\u6210\u4E8E ${Yp(e.completedAt)}`}function Yp(e){return dx.format(e)}function Dx(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t} \u79D2`;let r=Math.floor(t/60);return r<60?`${r} \u5206 ${String(t%60).padStart(2,"0")} \u79D2`:`${Math.floor(r/60)} \u5C0F\u65F6 ${String(r%60).padStart(2,"0")} \u5206`}function Rx(e){if(e<60)return`${Math.ceil(e)} \u79D2`;let t=Math.ceil(e/60);return t<60?`${t} \u5206\u949F`:`${Math.floor(t/60)} \u5C0F\u65F6 ${t%60} \u5206\u949F`}function Ax(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M8 12V4m0 0L4.8 7.2M8 4l3.2 3.2"})})}function Ix(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M12.2 5.2A5 5 0 1 0 13 9M12.2 5.2V2.5m0 2.7H9.5"})})}function Lx({directory:e}){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:e?(0,M.jsx)("path",{d:"M2 4.3h4l1.2 1.4H14v6.8H2z"}):(0,M.jsx)("path",{d:"M3.2 2h6l3.6 3.6V14H3.2zm6 0v3.6h3.6"})})}var rf=`.dsh-ssh-transfer-workspace {
|
|
5550
|
+
`;var Up=require("react");function Vp(e){(0,Up.useEffect)(()=>{let t=e.current,s=t?.parentElement;if(t==null||s===null||s===void 0)return;let r=s,o=!1,i,n=()=>{let a=t.parentElement;for(;a!==null&&a!==document.body;){let h=a.previousElementSibling;if(h instanceof HTMLElement){let l=getComputedStyle(h),c=Number.parseFloat(l.flexGrow);if(l.display==="flex"&&l.flexDirection==="column"&&c>0)return h.insertBefore(t,h.firstChild),t.dataset.dshSshAnchored="true",o=!0,!0}a=a.parentElement}return!1};return n()||(i=new MutationObserver(()=>{n()&&i?.disconnect()}),i.observe(document.body,{childList:!0,subtree:!0})),()=>{i?.disconnect(),delete t.dataset.dshSshAnchored,o&&r.isConnected&&r.append(t)}},[e])}var at=require("react"),Qe=require("@deepseek-ai/dsh-client-ui-primitives");var ls=require("react"),or=require("@deepseek-ai/dsh-client-ui-primitives"),ge=require("react/jsx-runtime");function jp({profile:e,project:t,workspaces:s,currentWorkspaceId:r,recentWorkspaceId:o,returnFocus:i,onClose:n,onCreate:a}){let h=s.some(x=>String(x.workspaceId)===r)?r:s.some(x=>String(x.workspaceId)===o)?o:s[0]===void 0?void 0:String(s[0].workspaceId),[l,c]=(0,ls.useState)(h),[f,v]=(0,ls.useState)(!1),[g,u]=(0,ls.useState)(),d=(0,ls.useRef)(null),m=(0,ls.useRef)(null);(0,ls.useEffect)(()=>((d.current??m.current)?.focus(),()=>{i.isConnected&&i.focus()}),[i]);let p=()=>{f||n()},b=async x=>{if(x.preventDefault(),l!==void 0){v(!0),u(void 0);try{await a(t,l)}catch(y){u(tx(y)),v(!1)}}};return(0,ge.jsx)(or.Modal,{open:!0,onClose:p,title:"\u9009\u62E9\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4",closeLabel:"\u5173\u95ED",headless:!0,className:"dsh-ssh-session-create-modal",children:(0,ge.jsxs)("section",{className:"dsh-ssh-session-create-shell",onKeyDown:ex,children:[(0,ge.jsxs)("header",{children:[(0,ge.jsxs)("span",{children:[(0,ge.jsx)("h2",{children:"\u65B0\u5EFA\u8FDC\u7AEF\u4F1A\u8BDD"}),(0,ge.jsx)("p",{children:"\u9009\u62E9\u8FD9\u4E2A\u4F1A\u8BDD\u5728 DSH \u4E2D\u5F52\u5C5E\u7684\u672C\u5730\u9879\u76EE"})]}),(0,ge.jsx)("button",{ref:m,type:"button",className:"dsh-ssh-icon-button",disabled:f,onClick:p,"aria-label":"\u5173\u95ED",children:(0,ge.jsx)(or.IconCloseOutline16,{size:16})})]}),(0,ge.jsxs)("form",{onSubmit:x=>{b(x)},children:[(0,ge.jsxs)("dl",{className:"dsh-ssh-session-create-target",children:[(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u4E3B\u673A"}),(0,ge.jsxs)("dd",{children:[e.name,(0,ge.jsxs)("small",{children:[e.username,"@",e.host,":",e.port]})]})]}),(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u5DE5\u4F5C\u76EE\u5F55"}),(0,ge.jsxs)("dd",{children:[t.name,(0,ge.jsx)("small",{title:t.path,children:t.path})]})]})]}),(0,ge.jsxs)("fieldset",{className:"dsh-ssh-workspace-picker",children:[(0,ge.jsx)("legend",{children:"\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4"}),(0,ge.jsx)("p",{children:"\u4F1A\u8BDD\u8BB0\u5F55\u4FDD\u5B58\u5728\u6240\u9009 DSH \u9879\u76EE\u4E2D\uFF0CSSH \u547D\u4EE4\u4E0E\u7EC8\u7AEF\u56FA\u5B9A\u4F7F\u7528\u4E0A\u9762\u7684\u8FDC\u7AEF\u76EE\u5F55\u3002"}),s.length===0?(0,ge.jsxs)("div",{className:"dsh-ssh-workspace-picker-empty",children:[(0,ge.jsx)(or.IconFolderClose16,{size:18}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u7684 DSH \u9879\u76EE"}),(0,ge.jsx)("small",{children:"\u8BF7\u5148\u5173\u95ED\u6B64\u7A97\u53E3\uFF0C\u5728 DSH \u5DE6\u4FA7\u7A7A\u95F4\u4E2D\u65B0\u5EFA\u6216\u6DFB\u52A0\u9879\u76EE\u3002"})]})]}):(0,ge.jsx)("div",{className:"dsh-ssh-workspace-options dsh-ssh-scroll-surface",role:"radiogroup","aria-label":"\u9009\u62E9 DSH \u9879\u76EE",children:s.map(x=>{let y=String(x.workspaceId),S=y===r?"\u5F53\u524D\u9879\u76EE":y===o?"\u6700\u8FD1\u4F7F\u7528":void 0;return(0,ge.jsxs)("label",{className:"dsh-ssh-workspace-option",children:[(0,ge.jsx)("input",{ref:y===h?d:void 0,className:"sr-only",type:"radio",name:"dsh-ssh-session-workspace",value:y,checked:l===y,disabled:f,onChange:()=>c(y)}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("span",{className:"dsh-ssh-workspace-option-icon",children:(0,ge.jsx)(or.IconFolderClose16,{size:16})}),(0,ge.jsxs)("span",{className:"dsh-ssh-workspace-option-copy",children:[(0,ge.jsx)("strong",{children:x.title}),(0,ge.jsx)("small",{title:x.path,children:x.path})]}),S&&(0,ge.jsx)("em",{children:S}),(0,ge.jsx)("i",{"aria-hidden":"true"})]})]},y)})})]}),g&&(0,ge.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:g}),(0,ge.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,ge.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:f,onClick:p,children:"\u53D6\u6D88"}),(0,ge.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:f||l===void 0,children:f?"\u6B63\u5728\u65B0\u5EFA\u2026":"\u65B0\u5EFA\u5E76\u6253\u5F00"})]})]})]})})}function ex(e){if(e.key!=="Tab")return;let t=Array.from(e.currentTarget.querySelectorAll('button:not(:disabled), input:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])')).filter(o=>o.getClientRects().length>0),s=t[0],r=t[t.length-1];s===void 0||r===void 0||(e.shiftKey&&document.activeElement===s?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),s.focus()))}function tx(e){return e instanceof Error?e.message:String(e)}var te=require("react/jsx-runtime");function Wp(e){let t=_r(),[s,r]=(0,at.useState)(""),[o,i]=(0,at.useState)(()=>new Set),[n,a]=(0,at.useState)(()=>new Set),[h,l]=(0,at.useState)({}),[c,f]=(0,at.useState)(),[v,g]=(0,at.useState)(),[u,d]=(0,at.useState)(),[m,p]=(0,at.useState)(),b=s.trim().toLocaleLowerCase(),x=(0,at.useMemo)(()=>ix(e.profiles.filter(C=>nx(C).includes(b))),[b,e.profiles]),y=async C=>{f(C);try{let P=await Gl(C);l(T=>({...T,[C]:P})),p(void 0)}catch(P){p(Dl(P))}finally{f(P=>P===C?void 0:P)}},S=C=>{a(new Set([C])),h[C]===void 0&&y(C),e.onSelect({profileId:C,path:"~"})},_=C=>{let P=e.access?.profileIds??[],T=P.includes(C);e.onProfiles(T?P.filter(A=>A!==C):[...P,C]),T&&e.onDirectory(C,void 0)},w=C=>i(P=>{let T=new Set(P);return T.has(C)?T.delete(C):T.add(C),T});return(0,te.jsxs)("aside",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-remote-tree dsh-ssh-border-surface",children:[(0,te.jsxs)("header",{className:"dsh-ssh-tree-header",children:[(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:"\u4E3B\u673A\u4E0E\u9879\u76EE"}),(0,te.jsxs)("small",{children:[e.profiles.length," \u53F0\u4E3B\u673A"]})]}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:e.onNewProfile,"aria-label":"\u65B0\u5EFA\u8FDE\u63A5",title:"\u65B0\u5EFA\u8FDE\u63A5",children:(0,te.jsx)(Qe.IconPlusOutline16,{size:16})})]}),(0,te.jsxs)("label",{className:"dsh-ssh-search",children:[(0,te.jsx)("span",{className:"sr-only",children:"\u641C\u7D22\u4E3B\u673A"}),(0,te.jsx)("input",{value:s,onChange:C=>r(C.target.value),placeholder:"\u641C\u7D22\u4E3B\u673A\u3001\u5206\u7EC4\u3001\u6807\u7B7E\u2026"})]}),(0,te.jsxs)("div",{className:"dsh-ssh-tree-scroll dsh-ssh-scroll-surface",children:[x.map(C=>{let P=o.has(C.name);return(0,te.jsxs)("section",{className:"dsh-ssh-tree-group","data-collapsed":P,children:[(0,te.jsx)("h3",{children:(0,te.jsxs)("button",{type:"button","aria-expanded":!P,onClick:()=>w(C.name),children:[P?(0,te.jsx)(Qe.IconChevronRightOutline14,{size:14}):(0,te.jsx)(Qe.IconChevronDownOutline14,{size:14}),(0,te.jsx)("span",{children:C.name}),(0,te.jsx)("small",{children:C.profiles.length})]})}),!P&&C.profiles.map(T=>{let A=n.has(T.id),F=e.access?.profileIds.includes(T.id)===!0,B=h[T.id]??[],U=e.selected?.profileId===T.id&&e.selected.projectId===void 0;return(0,te.jsxs)("div",{className:"dsh-ssh-tree-host","data-open":A,children:[(0,te.jsxs)("div",{"data-ssh-interactive":"row","data-ssh-context-row":!0,className:`dsh-ssh-tree-host-row${F?" is-authorized":""}${U?" is-active":""}`,children:[(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-tree-host-main","aria-pressed":U,"aria-expanded":A,title:`\u9009\u62E9\u5E76\u5C55\u5F00 ${T.name}`,onClick:()=>S(T.id),children:[(0,te.jsx)("span",{className:"dsh-ssh-host-monogram",children:T.name.slice(0,1).toUpperCase()}),(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:T.name}),(0,te.jsxs)("small",{children:[T.username,"@",T.host]})]})]}),(0,te.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-tree-mount dsh-ssh-context-action${F?" is-mounted":""}`,"aria-label":`${F?"\u5378\u8F7D":"\u6302\u8F7D"} ${T.name}`,"aria-pressed":F,title:e.access===null?"\u6253\u5F00\u4E00\u4E2A DSH \u4F1A\u8BDD\u540E\u624D\u80FD\u6302\u8F7D\u4E3B\u673A":F?"\u4ECE\u5F53\u524D\u4F1A\u8BDD\u5378\u8F7D":"\u6302\u8F7D\u5230\u5F53\u524D\u4F1A\u8BDD",disabled:e.access===null||e.accessLoading||e.accessSaving,onClick:()=>_(T.id),children:F?"\u5378\u8F7D":"\u6302\u8F7D"}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-tree-add","aria-label":`\u4E3A ${T.name} \u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55`,title:"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55",onClick:()=>g({profile:T}),children:(0,te.jsx)(Qe.IconPlusOutline16,{size:14})})]}),A&&(0,te.jsx)("div",{className:"dsh-ssh-tree-branches",children:c===T.id&&h[T.id]===void 0?(0,te.jsx)("p",{className:"dsh-ssh-tree-state",children:"\u6B63\u5728\u8BFB\u53D6\u56FA\u5B9A\u76EE\u5F55\u2026"}):B.length===0?(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-tree-empty",onClick:()=>g({profile:T}),children:[(0,te.jsx)(Qe.IconPlusOutline16,{size:13}),"\u6DFB\u52A0\u9879\u76EE\u76EE\u5F55"]}):B.map(N=>{let H=e.selected?.projectId===N.id,E=e.access?.workingProjectIds[T.id]===N.id;return(0,te.jsx)("div",{className:"dsh-ssh-tree-project",children:(0,te.jsxs)("div",{"data-ssh-interactive":"row",className:`dsh-ssh-tree-project-row${H?" is-active":""}${E?" is-bound":""}`,children:[(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-tree-project-main","aria-pressed":e.access===null?void 0:E,title:e.access===null?"\u5F53\u524D\u6CA1\u6709\u53EF\u56FA\u5B9A\u76EE\u5F55\u7684 DSH \u4F1A\u8BDD":F?E?"\u53D6\u6D88\u5F53\u524D\u4F1A\u8BDD\u7684\u56FA\u5B9A\u76EE\u5F55":"\u56FA\u5B9A\u4E3A\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8BF7\u5148\u6302\u8F7D\u8BE5\u4E3B\u673A",onClick:()=>{F&&!e.accessLoading&&!e.accessSaving&&(e.onDirectory(T.id,E?void 0:N.path,E?void 0:N.id),e.onSelect(E?{profileId:T.id,path:"~"}:{profileId:T.id,path:N.path,projectId:N.id}))},children:[(0,te.jsx)("span",{children:E?(0,te.jsx)(Qe.IconFolderOpenOutline16,{size:15}):(0,te.jsx)(Qe.IconFolderClose16,{size:15})}),(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:N.name}),(0,te.jsx)("small",{children:N.path}),E&&(0,te.jsx)("em",{children:"\u5F53\u524D\u4F1A\u8BDD\u5DF2\u56FA\u5B9A\u8BE5\u8DEF\u5F84"})]})]}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-new","aria-label":`\u5728 ${N.name} \u65B0\u5EFA\u4F1A\u8BDD`,title:"\u65B0\u5EFA\u4F1A\u8BDD",onClick:R=>{p(void 0),d({profile:T,project:N,returnFocus:R.currentTarget})},children:(0,te.jsx)(Qe.IconPlusOutline16,{size:13})}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-edit","aria-label":`\u7F16\u8F91 ${N.name}`,title:"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",onClick:()=>g({profile:T,project:N}),children:(0,te.jsx)(Qe.IconEditOutline16,{size:13})})]})},N.id)})})]},T.id)})]},C.name)}),x.length===0&&(0,te.jsx)("p",{className:"dsh-ssh-tree-no-results",children:e.profiles.length===0?"\u8FD8\u6CA1\u6709 SSH \u4E3B\u673A":"\u6CA1\u6709\u5339\u914D\u7684\u4E3B\u673A"})]}),(0,te.jsx)(sx,{access:e.access,loading:e.accessLoading,saving:e.accessSaving,error:e.accessError??m,onPermission:e.onPermission,onApproval:e.onApproval}),v!==void 0&&(0,te.jsx)(rx,{profile:v.profile,project:v.project,onClose:()=>g(void 0),onSaved:async()=>{let C=v.profile.id;g(void 0),await y(C)}}),u!==void 0&&(0,te.jsx)(jp,{...u,workspaces:e.workspaces,currentWorkspaceId:e.currentWorkspaceId,recentWorkspaceId:e.recentWorkspaceId,onClose:()=>d(void 0),onCreate:e.onCreateSession})]})}function sx({access:e,loading:t,saving:s,error:r,onPermission:o,onApproval:i}){return(0,te.jsxs)("footer",{className:"dsh-ssh-access-footer",children:[(0,te.jsxs)("div",{className:"dsh-ssh-access-heading",children:[(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:"\u5F53\u524D\u4F1A\u8BDD\u6743\u9650"}),(0,te.jsxs)("small",{children:[e?.profileIds.length??0," \u53F0\u4E3B\u673A\u53EF\u7528"]})]}),(0,te.jsx)("em",{children:t?"\u8BFB\u53D6\u4E2D":s?"\u4FDD\u5B58\u4E2D":"\u5DF2\u540C\u6B65"})]}),(0,te.jsxs)("div",{className:"dsh-ssh-access-segments","aria-label":"SSH \u6743\u9650",children:[(0,te.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="exec"?"is-active":"","aria-pressed":e?.permission==="exec",disabled:e===null,onClick:()=>o("exec"),children:"\u4EC5\u547D\u4EE4"}),(0,te.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="terminal"?"is-active":"","aria-pressed":e?.permission==="terminal",disabled:e===null,onClick:()=>o("terminal"),children:"\u7EC8\u7AEF\u63A7\u5236"})]}),(0,te.jsxs)("label",{className:"dsh-ssh-access-approval",children:[(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:"\u6267\u884C\u524D\u786E\u8BA4"}),(0,te.jsx)("small",{children:e?.requireCommandApproval===!1?"\u5173\u95ED\u540E\u6309\u5F53\u524D\u4F1A\u8BDD\u6743\u9650\u76F4\u63A5\u6267\u884C":"\u9700 DSH \u4F7F\u7528 Ask\uFF1BFull Access \u4F1A\u76F4\u63A5\u62D2\u7EDD"})]}),(0,te.jsx)("input",{type:"checkbox",checked:e?.requireCommandApproval??!0,disabled:e===null,onChange:n=>i(n.target.checked)}),(0,te.jsx)("i",{"aria-hidden":"true"})]}),r&&(0,te.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:r})]})}function rx({profile:e,project:t,onClose:s,onSaved:r}){let[o,i]=(0,at.useState)(t?.name??""),[n,a]=(0,at.useState)(t?.path??""),[h,l]=(0,at.useState)(!1),[c,f]=(0,at.useState)(),v=async u=>{u.preventDefault(),l(!0),f(void 0);try{t===void 0?await Xl(e.id,{name:o,path:n}):await Jl(e.id,t.id,{name:o,path:n}),await r()}catch(d){f(Dl(d)),l(!1)}},g=async()=>{if(!(t===void 0||!window.confirm(`\u5220\u9664\u56FA\u5B9A\u76EE\u5F55\u201C${t.name}\u201D\uFF1F\u76F8\u5173 DSH \u4F1A\u8BDD\u4E0D\u4F1A\u5220\u9664\u3002`))){l(!0),f(void 0);try{await Yl(e.id,t.id),await r()}catch(u){f(Dl(u)),l(!1)}}};return(0,te.jsx)(Ye,{className:"dsh-ssh-project-dialog",title:t===void 0?"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55":"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",subtitle:`${e.name} \xB7 \u7EC8\u7AEF\u4E0E SFTP \u7684\u9ED8\u8BA4\u8FDC\u7AEF\u8DEF\u5F84`,onClose:s,children:(0,te.jsxs)("form",{className:"dsh-ssh-form",onSubmit:u=>{v(u)},children:[(0,te.jsxs)("label",{className:"dsh-ssh-field",children:[(0,te.jsx)("span",{children:"\u540D\u79F0"}),(0,te.jsx)("input",{required:!0,maxLength:80,value:o,placeholder:"\u7F51\u7AD9\u9879\u76EE",onChange:u=>i(u.target.value)})]}),(0,te.jsxs)("label",{className:"dsh-ssh-field",children:[(0,te.jsx)("span",{children:"\u8FDC\u7AEF\u8DEF\u5F84"}),(0,te.jsx)("input",{required:!0,maxLength:4096,value:n,spellCheck:!1,placeholder:"/var/www/example",onChange:u=>a(u.target.value)}),(0,te.jsx)("small",{children:"\u4FDD\u5B58\u524D\u4F1A\u5728\u53F3\u4FA7 SFTP \u4E2D\u9A8C\u8BC1\u8DEF\u5F84\u662F\u5426\u53EF\u8BBF\u95EE\u3002"})]}),c&&(0,te.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:c}),(0,te.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[t!==void 0&&(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:h,onClick:()=>{g()},children:[(0,te.jsx)(Qe.IconTrashOutline16,{size:15}),"\u5220\u9664"]}),(0,te.jsx)("span",{className:"dsh-ssh-dialog-spacer"}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h,onClick:s,children:"\u53D6\u6D88"}),(0,te.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h,children:h?"\u4FDD\u5B58\u4E2D\u2026":"\u4FDD\u5B58\u76EE\u5F55"})]})]})})}function ix(e){let t=new Map;for(let s of e){let r=s.group?.trim()||"\u672A\u5206\u7EC4",o=t.get(r);o===void 0?t.set(r,[s]):o.push(s)}return[...t].map(([s,r])=>({name:s,profiles:r}))}function nx(e){return`${e.name} ${e.group??""} ${e.host} ${e.username} ${e.tags.join(" ")}`.toLocaleLowerCase()}function Dl(e){return e instanceof Error?e.message:String(e)}var lt=require("react");var Rl=new Set;function Mn(e){for(let t of Rl)t(e)}function qp(e){return Rl.add(e),()=>Rl.delete(e)}function Gp(e){let[t,s]=(0,lt.useState)(null),[r,o]=(0,lt.useState)(e!==void 0),[i,n]=(0,lt.useState)(!1),[a,h]=(0,lt.useState)(),l=(0,lt.useRef)(null),c=(0,lt.useRef)(e),f=(0,lt.useRef)(Promise.resolve()),v=(0,lt.useRef)(0);c.current=e,(0,lt.useEffect)(()=>{let d=!1;return l.current=null,s(null),h(void 0),o(e!==void 0),e===void 0?()=>{d=!0}:(Si(e).then(m=>{if(d)return;let p=m??bi(e);l.current=p,s(p),Mn(p)}).catch(m=>{d||h(Kp(m))}).finally(()=>{d||o(!1)}),()=>{d=!0})},[e]);let g=(0,lt.useCallback)(async d=>{l.current=d,s(d),Mn(d),h(void 0),v.current+=1,n(!0);let m=f.current.catch(()=>{}).then(()=>ki(d));f.current=m;try{let p=await m;return c.current===p.sessionId&&l.current===d&&(l.current=p,s(p),Mn(p)),p}catch(p){throw c.current===d.sessionId&&h(Kp(p)),p}finally{v.current=Math.max(0,v.current-1),c.current===d.sessionId&&v.current===0&&n(!1)}},[]),u=(0,lt.useCallback)(d=>{let m=c.current;if(m===void 0)return;let p=l.current??bi(m);g({...p,...d,sessionId:m}).catch(()=>{})},[g]);return{value:t,loading:r,saving:i,error:a,setProfiles:d=>u({profileIds:d}),setDirectory:(d,m,p)=>{let b=c.current;if(b===void 0)return;let x=l.current??bi(b),y={...x.workingDirectories},S={...x.workingProjectIds};m===void 0?delete y[d]:y[d]=m,p===void 0?delete S[d]:S[d]=p,u({workingDirectories:y,workingProjectIds:S})},setPermission:d=>u({permission:d}),setRequireCommandApproval:d=>u({requireCommandApproval:d}),setFileEndpoints:d=>u({fileEndpointIds:d}),setFilePermission:d=>u({filePermission:d}),setRequireFileApproval:d=>u({requireFileApproval:d}),replace:g}}function bi(e){return{sessionId:e,profileIds:[],permission:"exec",requireCommandApproval:!0,fileEndpointIds:[],filePermission:"browse",requireFileApproval:!0,workingDirectories:{},workingProjectIds:{},updatedAt:0}}function Kp(e){return e instanceof Error?e.message:String(e)}var ar=require("react"),Bn=require("react/jsx-runtime"),Fn=38,_i=28,xi=66,ox=320,ax=280,lx=7;function Xp(e,t,s){return Math.min(s,Math.max(t,e))}function hx(e){if(typeof window>"u")return Fn;try{let t=Number.parseFloat(window.localStorage.getItem(e)??"");return Number.isFinite(t)?Xp(t,_i,xi):Fn}catch{return Fn}}function Al(e,t){try{window.localStorage.setItem(e,t.toFixed(2))}catch{}}function cx(e){if(e<=0)return{min:_i,max:xi};let t=ax/e*100,s=(e-ox-lx)/e*100,r=Math.max(_i,t),o=Math.max(r,Math.min(xi,s));return{min:r,max:o}}function Jp({primary:e,secondary:t,storageKey:s,label:r}){let[o,i]=(0,ar.useState)(()=>hx(s)),n=(0,ar.useRef)(null),a=(0,ar.useRef)(null),h=(0,ar.useRef)(o),l=(0,ar.useRef)(),c=p=>{let b=n.current;if(b===null)return p;let x=cx(b.getBoundingClientRect().width),y=Xp(p,x.min,x.max);return b.style.setProperty("--ssh-sftp-width",`${y}%`),a.current?.setAttribute("aria-valuenow",String(Math.round(y))),h.current=y,y},f=p=>{if(l.current===void 0)return;let b=a.current;l.current=void 0,p!==void 0&&b?.hasPointerCapture(p)&&b.releasePointerCapture(p),n.current?.classList.remove("is-resizing");let x=h.current;i(x),Al(s,x)},v=p=>{p.button===0&&(l.current=p.pointerId,h.current=o,p.currentTarget.setPointerCapture(p.pointerId),n.current?.classList.add("is-resizing"),p.preventDefault())},g=p=>{if(l.current!==p.pointerId)return;let b=n.current?.getBoundingClientRect();b===void 0||b.width===0||(c((b.right-p.clientX)/b.width*100),p.preventDefault())},u=p=>{let b=p.shiftKey?5:2,x;if(p.key==="ArrowLeft"&&(x=o+b),p.key==="ArrowRight"&&(x=o-b),p.key==="Home"&&(x=_i),p.key==="End"&&(x=xi),x===void 0)return;let y=c(x);i(y),Al(s,y),p.preventDefault()},d=()=>{let p=c(Fn);i(p),Al(s,p)},m={"--ssh-sftp-width":`${o}%`};return(0,Bn.jsxs)("div",{ref:n,className:"dsh-ssh-workbench-split",style:m,children:[e,(0,Bn.jsx)("div",{ref:a,className:"dsh-ssh-workbench-resizer",role:"separator","aria-label":r,"aria-orientation":"vertical","aria-valuemin":_i,"aria-valuemax":xi,"aria-valuenow":Math.round(o),tabIndex:0,title:"\u62D6\u52A8\u8C03\u6574\u5BBD\u5EA6\uFF0C\u53CC\u51FB\u6062\u590D\u9ED8\u8BA4",onDoubleClick:d,onKeyDown:u,onPointerDown:v,onPointerMove:g,onPointerUp:p=>f(p.pointerId),onPointerCancel:p=>f(p.pointerId),onLostPointerCapture:()=>f()}),t]})}var It=require("react"),kt=require("@deepseek-ai/dsh-client-ui-primitives");var K=require("react/jsx-runtime");function Yp({profile:e,dependents:t,onClose:s,onDeleted:r}){let[o,i]=(0,It.useState)(!1),[n,a]=(0,It.useState)(),h=async()=>{if(!(o||t.length>0)){i(!0),a(void 0);try{await oe(`/profiles/${encodeURIComponent(e.id)}`,{method:"DELETE"}),r()}catch(l){a(De(l))}finally{i(!1)}}};return(0,K.jsx)(Ye,{title:`\u5220\u9664 ${e.name}`,subtitle:Yt(e),onClose:s,children:(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile",children:[(0,K.jsx)("span",{className:"dsh-ssh-delete-profile-mark",children:(0,K.jsx)(kt.IconTrashOutline16,{size:19})}),(0,K.jsxs)("div",{children:[(0,K.jsx)("strong",{children:"\u8FD9\u4E2A\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u914D\u7F6E\u3001\u8BE5\u4E3B\u673A\u7684\u72EC\u7ACB\u51ED\u636E\u548C\u5173\u8054\u7AEF\u53E3\u8F6C\u53D1\u4F1A\u4E00\u5E76\u5220\u9664\uFF1B\u5B83\u4E5F\u4F1A\u4ECE\u6240\u6709\u4F1A\u8BDD\u6388\u6743\u4E2D\u79FB\u9664\u3002\u5BC6\u94A5\u5E93\u4E2D\u7684\u5171\u4EAB\u51ED\u636E\u4E0D\u4F1A\u5220\u9664\u3002"})]}),t.length>0&&(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile-block",role:"alert",children:[(0,K.jsx)("strong",{children:"\u6682\u65F6\u4E0D\u80FD\u5220\u9664"}),(0,K.jsxs)("p",{children:["\u4EE5\u4E0B\u8FDE\u63A5\u4ECD\u5C06\u5B83\u4F5C\u4E3A SSH \u8DF3\u677F\uFF1A",t.map(l=>l.name).join("\u3001"),"\u3002\u8BF7\u5148\u4FEE\u6539\u8FD9\u4E9B\u8FDE\u63A5\u7684\u8DF3\u677F\u94FE\u3002"]})]}),n&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:o,onClick:s,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o||t.length>0,onClick:()=>{h()},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u4E3B\u673A"})]})]})})}function Qp({profile:e,profiles:t,vaultEntries:s,proxyEntries:r,onClose:o,onSaved:i}){let[n,a]=(0,It.useState)(()=>({name:e?.name??"",group:e?.group??"",host:e?.host??"",port:String(e?.port??22),username:e?.username??"",authType:e?.authType??"password",credentialId:e?.credentialId??"",proxyType:e?.proxy.type??"none",proxyEntryId:e?.proxy.type==="saved"?e.proxy.proxyId:"",proxyHost:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.host:"",proxyPort:e?.proxy.type==="http"||e?.proxy.type==="socks5"?String(e.proxy.port):"1080",proxyUsername:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.username??"":"",jumpProfileIds:e?.proxy.type==="jump"?e.proxy.profileIds:[],tags:e?.tags.join(", ")??"",password:"",privateKey:"",passphrase:"",proxyPassword:"",hostFingerprint:e?.hostFingerprint??""})),[h,l]=(0,It.useState)(!1),[c,f]=(0,It.useState)(!1),[v,g]=(0,It.useState)(),[u,d]=(0,It.useState)(),[m,p]=(0,It.useState)(),b=P=>({value:n[P],onChange:T=>{a(A=>({...A,[P]:T.target.value})),g(void 0),d(void 0)}}),x=s.find(P=>P.id===n.credentialId),y=(0,It.useMemo)(()=>t.flatMap(P=>P.group===void 0?[]:[P.group]),[t]),S=(0,It.useMemo)(()=>t.flatMap(P=>P.tags),[t]),_=(P=n.hostFingerprint)=>{let T=n.proxyType==="none"?{type:"none"}:n.proxyType==="saved"?{type:"saved",proxyId:n.proxyEntryId}:n.proxyType==="jump"?{type:"jump",profileIds:n.jumpProfileIds}:{type:n.proxyType,host:n.proxyHost,port:Number(n.proxyPort),...n.proxyUsername.trim()?{username:n.proxyUsername.trim()}:{}};return{profile:{name:n.name,...n.group.trim()?{group:n.group.trim()}:{},host:n.host,port:Number(n.port),username:x?.username??n.username,authType:x?.authType??n.authType,...n.credentialId?{credentialId:n.credentialId}:{},...P?{hostFingerprint:P}:{},proxy:T,keepAliveIntervalMs:e?.keepAliveIntervalMs??15e3,connectTimeoutMs:e?.connectTimeoutMs??15e3,terminalType:e?.terminalType??"xterm-256color",tags:n.tags.split(",").map(A=>A.trim()).filter(Boolean)},secrets:{password:n.password,privateKey:n.privateKey,passphrase:n.passphrase,proxyPassword:n.proxyPassword}}},w=async P=>{f(!0),p(void 0),g(void 0),d(void 0);try{await oe("/profiles/test-draft",{method:"POST",body:JSON.stringify({..._(P),...e===void 0?{}:{profileId:e.id}})}),P!==void 0&&a(T=>({...T,hostFingerprint:P})),g("success")}catch(T){T instanceof cs&&T.body?.code==="HOST_KEY_REQUIRED"&&typeof T.body.fingerprint=="string"?d(T.body.fingerprint):p(De(T))}finally{f(!1)}},C=async P=>{P.preventDefault(),l(!0),p(void 0);try{await oe(e===void 0?"/profiles":`/profiles/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(_())}),i()}catch(T){p(De(T))}finally{l(!1)}};return(0,K.jsx)(Ye,{title:e===void 0?"\u65B0\u5EFA SSH \u8FDE\u63A5":`\u7F16\u8F91 ${e.name}`,subtitle:"\u51ED\u636E\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:o,children:(0,K.jsxs)("form",{className:"dsh-ssh-form",onSubmit:P=>{C(P)},children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u4FE1\u606F"}),(0,K.jsx)("small",{children:"\u4E3B\u673A\u5730\u5740\u4E0E\u663E\u793A\u65B9\u5F0F"})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(le,{label:"\u540D\u79F0",children:(0,K.jsx)("input",{required:!0,maxLength:80,placeholder:"\u5F00\u53D1\u670D\u52A1\u5668",...b("name")})}),(0,K.jsx)(le,{label:"\u5206\u7EC4",children:(0,K.jsx)(Rr,{ariaLabel:"\u4E3B\u673A\u5206\u7EC4",maxLength:64,options:y,placeholder:"\u9009\u62E9\u5DF2\u6709\u5206\u7EC4\u6216\u8F93\u5165\u65B0\u5206\u7EC4",value:n.group,onChange:P=>a(T=>({...T,group:P}))})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(le,{label:"\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,placeholder:"server.example.com",spellCheck:!1,...b("host")})}),(0,K.jsx)(le,{label:"\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",...b("port")})})]}),(0,K.jsx)(le,{label:"\u6807\u7B7E",hint:"\u53EF\u9009\u62E9\u5DF2\u6709\u6807\u7B7E\u6216\u76F4\u63A5\u8F93\u5165\uFF1B\u591A\u4E2A\u6807\u7B7E\u4F7F\u7528\u9017\u53F7\u5206\u9694\u3002",children:(0,K.jsx)(Rr,{ariaLabel:"\u4E3B\u673A\u6807\u7B7E",multiple:!0,options:S,placeholder:"\u9009\u62E9\u6216\u8F93\u5165\u6807\u7B7E",value:n.tags,onChange:P=>a(T=>({...T,tags:P}))})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,K.jsx)("small",{children:"\u9009\u62E9\u5171\u4EAB\u51ED\u636E\u6216\u5355\u72EC\u4FDD\u5B58"})]}),(0,K.jsx)(le,{label:"\u51ED\u636E\u6765\u6E90",hint:"\u53EF\u4F7F\u7528\u6B64\u8FDE\u63A5\u81EA\u5DF1\u7684\u51ED\u636E\uFF0C\u6216\u5F15\u7528\u5BC6\u94A5\u5E93\u4E2D\u7684\u5E38\u7528\u8D26\u53F7\u3002",children:(0,K.jsxs)("select",{...b("credentialId"),children:[(0,K.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u72EC\u7ACB\u4FDD\u5B58"}),s.map(P=>(0,K.jsxs)("option",{value:P.id,children:[P.name," \xB7 ",P.username]},P.id))]})}),x?(0,K.jsxs)("div",{className:"dsh-ssh-credential-reference",children:[(0,K.jsx)("span",{children:(0,K.jsx)(kt.IconUserOutline16,{size:16})}),(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:x.name}),(0,K.jsxs)("small",{children:[x.username," \xB7 ",x.authType==="password"?"\u5BC6\u7801":"\u79C1\u94A5"]})]}),(0,K.jsx)("em",{children:x.credential.configured?"\u5DF2\u5C31\u7EEA":"\u7F3A\u5C11\u51ED\u636E"})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(le,{label:"\u7528\u6237\u540D",children:(0,K.jsx)("input",{required:!0,autoComplete:"username",...b("username")})}),(0,K.jsx)(le,{label:"\u8BA4\u8BC1\u65B9\u5F0F",children:(0,K.jsxs)("select",{...b("authType"),children:[(0,K.jsx)("option",{value:"password",children:"\u5BC6\u7801"}),(0,K.jsx)("option",{value:"private-key",children:"\u79C1\u94A5"}),(0,K.jsx)("option",{value:"agent",children:"SSH Agent"})]})})]}),n.authType==="password"&&(0,K.jsx)(le,{label:"\u5BC6\u7801",hint:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,K.jsx)("input",{required:e===void 0,type:"password",autoComplete:"new-password",placeholder:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":"",...b("password")})}),n.authType==="private-key"&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(le,{label:"\u79C1\u94A5",hint:e?.credential.source==="profile"&&e.credential.fields.includes("privateKey")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u7C98\u8D34 OpenSSH/PEM \u79C1\u94A5",children:(0,K.jsx)("textarea",{required:e===void 0,rows:5,spellCheck:!1,...b("privateKey")})}),(0,K.jsx)(le,{label:"\u79C1\u94A5\u53E3\u4EE4",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",...b("passphrase")})})]})]})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u8DEF\u5F84"}),(0,K.jsx)("small",{children:"\u76F4\u8FDE\u3001\u4EE3\u7406\u6216\u8DF3\u677F\u94FE"})]}),(0,K.jsx)(le,{label:"\u8FDE\u63A5\u65B9\u5F0F",children:(0,K.jsxs)("select",{...b("proxyType"),children:[(0,K.jsx)("option",{value:"none",children:"\u76F4\u8FDE"}),(0,K.jsx)("option",{value:"saved",children:"\u5E38\u7528\u4EE3\u7406"}),(0,K.jsx)("option",{value:"http",children:"\u81EA\u5B9A\u4E49 HTTP CONNECT"}),(0,K.jsx)("option",{value:"socks5",children:"\u81EA\u5B9A\u4E49 SOCKS5"}),(0,K.jsx)("option",{value:"jump",children:"SSH \u8DF3\u677F"})]})}),n.proxyType==="saved"&&(0,K.jsx)(le,{label:"\u5E38\u7528\u4EE3\u7406",hint:r.length===0?"\u8BF7\u5148\u5728\u4EE3\u7406\u5E93\u4E2D\u6DFB\u52A0 HTTP \u6216 SOCKS5 \u4EE3\u7406\u3002":"\u591A\u53F0\u4E3B\u673A\u53EF\u5F15\u7528\u540C\u4E00\u6761\u4EE3\u7406\u914D\u7F6E\u3002",children:(0,K.jsxs)("select",{required:!0,...b("proxyEntryId"),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u4EE3\u7406"}),r.map(P=>(0,K.jsxs)("option",{value:P.id,children:[P.name," \xB7 ",P.proxyType==="http"?"HTTP":"SOCKS5"," \xB7 ",P.host,":",P.port]},P.id))]})}),(n.proxyType==="http"||n.proxyType==="socks5")&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(le,{label:"\u4EE3\u7406\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,spellCheck:!1,...b("proxyHost")})}),(0,K.jsx)(le,{label:"\u4EE3\u7406\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",...b("proxyPort")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(le,{label:"\u4EE3\u7406\u7528\u6237\u540D",children:(0,K.jsx)("input",{autoComplete:"username",...b("proxyUsername")})}),(0,K.jsx)(le,{label:"\u4EE3\u7406\u5BC6\u7801",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",...b("proxyPassword")})})]})]}),n.proxyType==="jump"&&(0,K.jsx)(dx,{profiles:t.filter(P=>P.id!==e?.id),value:n.jumpProfileIds,onChange:P=>a(T=>({...T,jumpProfileIds:P}))})]}),u&&(0,K.jsxs)("div",{className:"dsh-ssh-test-result is-warning",role:"alert",children:[(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:"\u9996\u6B21\u8FDE\u63A5\uFF0C\u8BF7\u6838\u5BF9\u4E3B\u673A\u6307\u7EB9"}),(0,K.jsx)("code",{children:u})]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-small-primary",disabled:c,onClick:()=>{w(u)},children:"\u786E\u8BA4\u5E76\u91CD\u8BD5"})]}),v==="success"&&(0,K.jsxs)("p",{className:"dsh-ssh-test-result is-success",role:"status",children:[(0,K.jsx)(kt.IconCheckOutline14,{size:14}),"\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F"]}),m&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:m}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button dsh-ssh-test-button",disabled:h||c,onClick:P=>{P.currentTarget.form?.reportValidity()&&w()},children:c?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h||c,onClick:o,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h||c,children:h?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})})}function dx({profiles:e,value:t,onChange:s}){let r=()=>{let n=e.find(a=>!t.includes(a.id));n!==void 0&&t.length<8&&s([...t,n.id])},o=(n,a)=>s(t.map((h,l)=>l===n?a:h)),i=(n,a)=>{let h=n+a;if(h<0||h>=t.length)return;let l=[...t];[l[n],l[h]]=[l[h],l[n]],s(l)};return(0,K.jsxs)("fieldset",{className:"dsh-ssh-jump-chain",children:[(0,K.jsx)("legend",{children:"\u8DF3\u677F\u94FE"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u4F1A\u6309\u4ECE\u4E0A\u5230\u4E0B\u7684\u987A\u5E8F\u9010\u7EA7\u5EFA\u7ACB\u3002"}),(0,K.jsx)("div",{children:t.map((n,a)=>(0,K.jsxs)("div",{className:"dsh-ssh-jump-row",children:[(0,K.jsx)("em",{children:a+1}),(0,K.jsxs)("select",{required:!0,value:n,onChange:h=>o(a,h.target.value),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u5DF2\u6709\u8FDE\u63A5"}),e.filter(h=>h.id===n||!t.includes(h.id)).map(h=>(0,K.jsxs)("option",{value:h.id,children:[h.name," \xB7 ",h.host]},h.id))]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===0,"aria-label":"\u4E0A\u79FB\u8DF3\u677F",onClick:()=>i(a,-1),children:(0,K.jsx)(kt.IconChevronUpOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===t.length-1,"aria-label":"\u4E0B\u79FB\u8DF3\u677F",onClick:()=>i(a,1),children:(0,K.jsx)(kt.IconChevronDownOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":"\u79FB\u9664\u8DF3\u677F",onClick:()=>s(t.filter((h,l)=>l!==a)),children:(0,K.jsx)(kt.IconTrashOutline16,{size:15})})]},`${n}-${a}`))}),t.length===0&&(0,K.jsx)("p",{className:"dsh-ssh-jump-empty",children:"\u81F3\u5C11\u6DFB\u52A0\u4E00\u53F0\u8DF3\u677F\u4E3B\u673A\u3002"}),(0,K.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:t.length>=8||e.every(n=>t.includes(n.id)),onClick:r,children:[(0,K.jsx)(kt.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u8DF3\u677F"]})]})}var be=require("react"),Ot=require("@deepseek-ai/dsh-client-ui-primitives");var Ct=require("react"),Lt=require("@deepseek-ai/dsh-client-ui-primitives");var j=require("react/jsx-runtime");function Zp({profiles:e,vaultEntries:t,proxyEntries:s,onClose:r,onChanged:o}){let[i,n]=(0,Ct.useState)(),[a,h]=(0,Ct.useState)(),[l,c]=(0,Ct.useState)(),f=i!==void 0||a!==void 0,v=m=>{h(void 0),n(m),c(void 0)},g=()=>{h(void 0),n("new"),c(void 0)},u=m=>{n(void 0),h(m),c(void 0)},d=async m=>{c(void 0);try{await oe(`/ftp-profiles/${encodeURIComponent(m.id)}`,{method:"DELETE"}),h(void 0),o()}catch(p){c(De(p))}};return(0,j.jsx)(Ye,{className:"dsh-ssh-ftp-manager-dialog",title:"\u6587\u4EF6\u8FDE\u63A5",subtitle:"\u7BA1\u7406 FTP \u4E0E FTPS\uFF1BSFTP \u76F4\u63A5\u590D\u7528\u5DF2\u6709 SSH \u4E3B\u673A",onClose:r,children:(0,j.jsxs)("div",{className:`dsh-ssh-ftp-manager${f?" has-detail":""}`,children:[(0,j.jsxs)("aside",{className:"dsh-ssh-ftp-manager-list",children:[(0,j.jsxs)("header",{children:[(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:"FTP / FTPS"}),(0,j.jsxs)("small",{children:[e.length," \u4E2A\u8FDE\u63A5"]})]}),(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:g,children:[(0,j.jsx)(Lt.IconPlusOutline16,{size:15}),"\u65B0\u5EFA"]})]}),e.length===0?(0,j.jsxs)("div",{className:"dsh-ssh-ftp-list-empty",children:[(0,j.jsx)("span",{children:(0,j.jsx)(Lt.IconDataOutline16,{size:20})}),(0,j.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u72EC\u7ACB\u6587\u4EF6\u8FDE\u63A5"}),(0,j.jsx)("p",{children:"SFTP \u4F1A\u663E\u793A\u5728\u6587\u4EF6\u7A97\u683C\u7684\u8FDE\u63A5\u5217\u8868\u4E2D\uFF1B\u8FD9\u91CC\u53EA\u7BA1\u7406 FTP \u4E0E FTPS\u3002"}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:g,children:"\u65B0\u5EFA FTPS \u8FDE\u63A5"})]}):(0,j.jsx)("div",{className:"dsh-ssh-ftp-profile-list",role:"list",children:e.map(m=>{let p=i!=="new"&&i?.id===m.id||a?.id===m.id;return(0,j.jsxs)("article",{role:"listitem","data-ssh-interactive":"choice","aria-selected":p,className:p?"is-active":"",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-profile-main",onClick:()=>v(m),children:[(0,j.jsx)("span",{className:`dsh-ssh-protocol-badge is-${m.protocol}`,children:fx(m.protocol)}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{title:m.name,children:m.name}),(0,j.jsxs)("small",{title:`${m.username}@${m.host}:${m.port}`,children:[m.username,"@",m.host,":",m.port]})]}),(0,j.jsx)("i",{className:m.credential.configured?"is-ready":"is-missing",children:m.credential.configured?"\u53EF\u7528":"\u7F3A\u5C11\u5BC6\u7801"})]}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664 ${m.name}`,onClick:()=>u(m),children:(0,j.jsx)(Lt.IconTrashOutline16,{size:15})})]},m.id)})})]}),(0,j.jsx)("main",{className:"dsh-ssh-ftp-manager-detail",children:a!==void 0?(0,j.jsx)(ux,{profile:a,error:l,onBack:()=>h(void 0),onDelete:()=>d(a)}):i!==void 0?(0,j.jsx)(px,{value:i==="new"?void 0:i,profiles:e,vaultEntries:t,proxyEntries:s,onBack:()=>n(void 0),onSaved:()=>{n(void 0),o()}},i==="new"?"new":i.id):(0,j.jsxs)("div",{className:"dsh-ssh-ftp-manager-overview",children:[(0,j.jsx)("span",{children:(0,j.jsx)(Lt.IconDataOutline16,{size:22})}),(0,j.jsx)("h3",{children:"\u9009\u62E9\u4E00\u4E2A\u8FDE\u63A5\u8FDB\u884C\u7F16\u8F91"}),(0,j.jsx)("p",{children:"\u6587\u4EF6\u7A97\u683C\u4F1A\u628A\u8FD9\u91CC\u4FDD\u5B58\u7684 FTP\u3001FTPS \u4E0E SSH \u4E3B\u673A\u63D0\u4F9B\u7684 SFTP \u6C47\u603B\u6210\u8FDE\u63A5\u5217\u8868\u3002"}),(0,j.jsxs)("dl",{children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"FTPS"}),(0,j.jsx)("dd",{children:"\u52A0\u5BC6\u63A7\u5236\u4E0E\u6587\u4EF6\u6570\u636E\uFF0C\u9ED8\u8BA4\u4E25\u683C\u6821\u9A8C\u8BC1\u4E66"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"FTP"}),(0,j.jsx)("dd",{children:"\u517C\u5BB9\u65E7\u670D\u52A1\u5668\uFF0C\u4F46\u8D26\u53F7\u548C\u6587\u4EF6\u5185\u5BB9\u4E0D\u52A0\u5BC6"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"SFTP"}),(0,j.jsx)("dd",{children:"\u7531 SSH \u4E3B\u673A\u7BA1\u7406\uFF0C\u4E0D\u5728\u8FD9\u91CC\u91CD\u590D\u914D\u7F6E"})]})]})]})})]})})}function ux({profile:e,error:t,onBack:s,onDelete:r}){let[o,i]=(0,Ct.useState)(!1);return(0,j.jsxs)("div",{className:"dsh-ssh-ftp-delete-panel",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:s,children:[(0,j.jsx)(Lt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,j.jsx)("span",{className:"dsh-ssh-ftp-delete-mark",children:(0,j.jsx)(Lt.IconWarningOutline16,{size:20})}),(0,j.jsxs)("h3",{children:["\u5220\u9664\u201C",e.name,"\u201D\uFF1F"]}),(0,j.jsx)("p",{children:"\u5C06\u79FB\u9664\u8BE5 FTP/FTPS \u8FDE\u63A5\u53CA\u5176\u72EC\u7ACB\u4FDD\u5B58\u7684\u5BC6\u7801\uFF0C\u4E0D\u4F1A\u5220\u9664\u8FDC\u7AEF\u670D\u52A1\u5668\u4E0A\u7684\u4EFB\u4F55\u6587\u4EF6\u3002"}),(0,j.jsxs)("code",{children:[e.username,"@",e.host,":",e.port]}),t&&(0,j.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t}),(0,j.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,disabled:o,children:"\u53D6\u6D88"}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o,onClick:()=>{i(!0),r().finally(()=>i(!1))},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u8FDE\u63A5"})]})]})}function px({value:e,profiles:t,vaultEntries:s,proxyEntries:r,onBack:o,onSaved:i}){let n=s.filter(w=>w.authType==="password"),[a,h]=(0,Ct.useState)({name:e?.name??"",group:e?.group??"",protocol:e?.protocol??"ftps-explicit",host:e?.host??"",port:String(e?.port??21),username:e?.username??"",credentialId:e?.credentialId??"",password:"",proxyId:e?.proxy.type==="saved"?e.proxy.proxyId:"",initialPath:e?.initialPath??"/",connectTimeoutMs:String(e?.connectTimeoutMs??15e3),tlsServerName:e?.tlsServerName??"",tags:e?.tags.join(", ")??""}),[l,c]=(0,Ct.useState)(!1),[f,v]=(0,Ct.useState)(!1),[g,u]=(0,Ct.useState)(),[d,m]=(0,Ct.useState)(),p=()=>({profile:{name:a.name,...a.group.trim()?{group:a.group.trim()}:{},protocol:a.protocol,host:a.host,port:Number(a.port),username:a.username,...a.credentialId?{credentialId:a.credentialId}:{},proxy:a.proxyId?{type:"saved",proxyId:a.proxyId}:{type:"none"},initialPath:a.initialPath,connectTimeoutMs:Number(a.connectTimeoutMs),...a.tlsServerName.trim()?{tlsServerName:a.tlsServerName.trim()}:{},tags:a.tags.split(/[,,]/u).map(w=>w.trim()).filter(Boolean)},secrets:{password:a.password}}),b=async w=>{w.preventDefault(),c(!0),m(void 0),u(void 0);try{await oe(e===void 0?"/ftp-profiles":`/ftp-profiles/${encodeURIComponent(e.id)}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(p())}),i()}catch(C){m(De(C))}finally{c(!1)}},x=async()=>{v(!0),m(void 0),u(void 0);try{await oe("/ftp-profiles/test-draft",{method:"POST",body:JSON.stringify({...p(),...e===void 0?{}:{profileId:e.id}})}),u("\u8FDE\u63A5\u6210\u529F\uFF0C\u521D\u59CB\u76EE\u5F55\u53EF\u8BFB\u53D6")}catch(w){m(De(w))}finally{v(!1)}},y=w=>h(C=>({...C,protocol:w,port:C.port==="21"||C.port==="990"?String(w==="ftps-implicit"?990:21):C.port})),S=(0,Ct.useMemo)(()=>t.flatMap(w=>w.group===void 0?[]:[w.group]),[t]),_=(0,Ct.useMemo)(()=>t.flatMap(w=>w.tags),[t]);return(0,j.jsxs)("form",{className:"dsh-ssh-ftp-editor-form",onSubmit:w=>{b(w)},children:[(0,j.jsxs)("header",{className:"dsh-ssh-ftp-editor-heading",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:o,children:[(0,j.jsx)(Lt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:e===void 0?"\u65B0\u5EFA\u6587\u4EF6\u8FDE\u63A5":e.name}),(0,j.jsx)("small",{children:e===void 0?"\u586B\u5199\u670D\u52A1\u5668\u548C\u8BA4\u8BC1\u4FE1\u606F":"\u4FEE\u6539\u540E\u53EF\u5148\u6D4B\u8BD5\u518D\u4FDD\u5B58"})]})]}),(0,j.jsxs)("div",{className:"dsh-ssh-ftp-editor-scroll",children:[(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8FDE\u63A5\u7C7B\u578B"}),(0,j.jsx)("small",{children:"\u4F18\u5148\u4F7F\u7528 FTPS\uFF1B\u4EC5\u5728\u670D\u52A1\u5668\u4E0D\u652F\u6301 TLS \u65F6\u9009\u62E9 FTP"})]}),(0,j.jsx)("div",{className:"dsh-ssh-ftp-protocol-options",role:"radiogroup","aria-label":"\u8FDE\u63A5\u534F\u8BAE",children:[["ftps-explicit","FTPS","\u663E\u5F0F TLS \xB7 \u63A8\u8350"],["ftps-implicit","FTPS-I","\u9690\u5F0F TLS"],["ftp","FTP","\u672A\u52A0\u5BC6"]].map(w=>(0,j.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":a.protocol===w[0],className:a.protocol===w[0]?"is-active":"",onClick:()=>y(w[0]),children:[(0,j.jsx)("span",{className:`dsh-ssh-protocol-badge is-${w[0]}`,children:w[1]}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:w[1]}),(0,j.jsx)("small",{children:w[2]})]})]},w[0]))}),a.protocol==="ftp"&&(0,j.jsx)("p",{className:"dsh-ssh-form-warning",children:"\u666E\u901A FTP \u7684\u8D26\u53F7\u3001\u5BC6\u7801\u548C\u6587\u4EF6\u5185\u5BB9\u5747\u4E0D\u52A0\u5BC6\u3002"})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u670D\u52A1\u5668"}),(0,j.jsx)("small",{children:"\u540D\u79F0\u7528\u4E8E\u8FDE\u63A5\u5217\u8868\uFF0C\u5206\u7EC4\u4E0E\u6807\u7B7E\u53EF\u590D\u7528\u5DF2\u6709\u9009\u9879"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u8FDE\u63A5\u540D\u79F0",children:(0,j.jsx)("input",{autoFocus:e===void 0,required:!0,maxLength:80,value:a.name,onChange:w=>h({...a,name:w.target.value})})}),(0,j.jsx)(le,{label:"\u5206\u7EC4\uFF08\u53EF\u9009\uFF09",children:(0,j.jsx)(Rr,{ariaLabel:"FTP \u5206\u7EC4",maxLength:64,options:S,placeholder:"\u9009\u62E9\u5DF2\u6709\u5206\u7EC4\u6216\u8F93\u5165\u65B0\u5206\u7EC4",value:a.group,onChange:w=>h(C=>({...C,group:w}))})})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,j.jsx)(le,{label:"\u670D\u52A1\u5668\u5730\u5740",children:(0,j.jsx)("input",{required:!0,maxLength:253,spellCheck:!1,value:a.host,onChange:w=>h({...a,host:w.target.value})})}),(0,j.jsx)(le,{label:"\u7AEF\u53E3",children:(0,j.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:a.port,onChange:w=>h({...a,port:w.target.value})})})]}),(0,j.jsx)(le,{label:"\u6807\u7B7E\uFF08\u53EF\u9009\uFF09",hint:"\u53EF\u9009\u62E9\u5DF2\u6709\u6807\u7B7E\u6216\u76F4\u63A5\u8F93\u5165\uFF1B\u591A\u4E2A\u6807\u7B7E\u4F7F\u7528\u9017\u53F7\u5206\u9694\u3002",children:(0,j.jsx)(Rr,{ariaLabel:"FTP \u6807\u7B7E",multiple:!0,options:_,placeholder:"\u9009\u62E9\u6216\u8F93\u5165\u6807\u7B7E",value:a.tags,onChange:w=>h(C=>({...C,tags:w}))})})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,j.jsx)("small",{children:"\u5BC6\u7801\u53EA\u5199\u5165 DSH \u51ED\u636E\u670D\u52A1\uFF0C\u4E0D\u4F1A\u5728\u754C\u9762\u56DE\u663E"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u7528\u6237\u540D",children:(0,j.jsx)("input",{required:!0,maxLength:128,autoComplete:"username",value:a.username,onChange:w=>h({...a,username:w.target.value})})}),(0,j.jsx)(le,{label:"\u51ED\u636E\u6765\u6E90",children:(0,j.jsxs)("select",{value:a.credentialId,onChange:w=>h({...a,credentialId:w.target.value}),children:[(0,j.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u5355\u72EC\u4FDD\u5B58\u5BC6\u7801"}),n.map(w=>(0,j.jsxs)("option",{value:w.id,children:[w.name," \xB7 ",w.username]},w.id))]})})]}),!a.credentialId&&(0,j.jsx)(le,{label:"\u5BC6\u7801",hint:e?.credential.configured&&e.credential.source==="profile"?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",children:(0,j.jsx)("input",{required:e===void 0||e.credential.source!=="profile"||!e.credential.configured,type:"password",autoComplete:"new-password",value:a.password,onChange:w=>h({...a,password:w.target.value})})})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8DEF\u5F84\u4E0E\u7F51\u7EDC"}),(0,j.jsx)("small",{children:"\u4EE3\u7406\u590D\u7528 SSH \u63D2\u4EF6\u7684\u4EE3\u7406\u5E93\uFF0C\u63A7\u5236\u548C\u6570\u636E\u8FDE\u63A5\u4F7F\u7528\u540C\u4E00\u8DEF\u5F84"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u521D\u59CB\u76EE\u5F55",children:(0,j.jsx)("input",{required:!0,maxLength:4096,spellCheck:!1,value:a.initialPath,onChange:w=>h({...a,initialPath:w.target.value})})}),(0,j.jsx)(le,{label:"\u8FDE\u63A5\u4EE3\u7406",children:(0,j.jsxs)("select",{value:a.proxyId,onChange:w=>h({...a,proxyId:w.target.value}),children:[(0,j.jsx)("option",{value:"",children:"\u76F4\u8FDE"}),r.map(w=>(0,j.jsxs)("option",{value:w.id,children:[w.name," \xB7 ",w.proxyType.toUpperCase()]},w.id))]})})]}),(0,j.jsxs)("details",{className:"dsh-ssh-form-advanced",children:[(0,j.jsx)("summary",{children:"\u9AD8\u7EA7\u8FDE\u63A5\u8BBE\u7F6E"}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u8FDE\u63A5\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09",children:(0,j.jsx)("input",{required:!0,type:"number",min:"1000",max:"120000",step:"1000",value:a.connectTimeoutMs,onChange:w=>h({...a,connectTimeoutMs:w.target.value})})}),(0,j.jsx)(le,{label:"TLS \u670D\u52A1\u5668\u540D\u79F0",hint:"\u8BC1\u4E66\u540D\u79F0\u4E0E\u4E3B\u673A\u4E0D\u540C\u65F6\u586B\u5199",children:(0,j.jsx)("input",{maxLength:253,spellCheck:!1,value:a.tlsServerName,onChange:w=>h({...a,tlsServerName:w.target.value})})})]})]})]}),g&&(0,j.jsx)("p",{className:"dsh-ssh-inline-success",role:"status",children:g}),d&&(0,j.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:d})]}),(0,j.jsxs)("footer",{className:"dsh-ssh-ftp-editor-actions",children:[(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>{x()},disabled:f||l,children:f?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,j.jsx)("span",{}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:o,disabled:l||f,children:"\u53D6\u6D88"}),(0,j.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:l||f,children:l?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})}function fx(e){return e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}function ef(e,t,s){let r=s==="asc"?1:-1;return e.map((o,i)=>({entry:o,index:i})).sort((o,i)=>{let n=o.entry.kind==="directory"||o.entry.navigable===!0,a=i.entry.kind==="directory"||i.entry.navigable===!0;if(n!==a)return n?-1:1;let h=mx(o.entry,i.entry,t);if(h!==0)return h*r;let l=o.entry.name.localeCompare(i.entry.name,void 0,{numeric:!0,sensitivity:"base"});return l!==0?l:o.index-i.index}).map(o=>o.entry)}function mx(e,t,s){return s==="name"?e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:"base"}):e[s]-t[s]}var M=require("react/jsx-runtime"),rf="dsh-ssh:file-transfer:tabs:v2",Il=38,gx=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"});function nf({ftpProfiles:e,vaultEntries:t,proxyEntries:s,access:r,onProfilesChanged:o}){let[i,n]=(0,be.useState)([]),[a,h]=(0,be.useState)([]),[l,c]=(0,be.useState)(()=>Px()),[f,v]=(0,be.useState)(()=>l[0]?.id??"transfer-1"),[g,u]=(0,be.useState)(!1),[d,m]=(0,be.useState)(!1),[p,b]=(0,be.useState)(),[x,y]=(0,be.useState)(),[S,_]=(0,be.useState)(),[w,C]=(0,be.useState)({}),P=(0,be.useRef)(new Map),T=(0,be.useCallback)(async()=>{try{let R=await zl();n(R),c(L=>Dx(L,R))}catch(R){_(De(R))}},[]);(0,be.useEffect)(()=>{T()},[T,e]),(0,be.useEffect)(()=>{try{localStorage.setItem(rf,JSON.stringify(l))}catch{}},[l]),(0,be.useEffect)(()=>{let R=P.current,L=a.filter(k=>tf(k.state)&&R.has(k.id)&&!tf(R.get(k.id)));P.current=new Map(a.map(k=>[k.id,k.state])),L.length!==0&&C(k=>{let $={...k};for(let X of L){let O=Nn(X.request.destinationEndpointId,X.request.destinationDirectory);$[O]=($[O]??0)+1}return $})},[a]),(0,be.useEffect)(()=>{let R=!1,L,k=async()=>{if(document.visibilityState==="hidden"){L=window.setTimeout(()=>{k()},1800);return}try{let $=await Vl();R||h($)}catch{}R||(L=window.setTimeout(()=>{k()},800))};return k(),()=>{R=!0,L!==void 0&&clearTimeout(L)}},[]);let A=l.find(R=>R.id===f)??l[0],F=R=>c(L=>L.map(k=>k.id===A?.id?R(k):k)),B=()=>{let R=`transfer-${Date.now().toString(36)}`,L=Ol(R,l.length+1);c(k=>[...k,L]),v(R)},U=R=>{if(l.length===1)return;let L=l.findIndex($=>$.id===R),k=l.filter($=>$.id!==R);c(k),f===R&&v(k[Math.max(0,L-1)].id)},N=R=>F(L=>({...L,panes:Array.from({length:R},(k,$)=>L.panes[$]??zn(`${L.id}-pane-${$}`))})),H=async(R,L,k,$,X)=>{let O={endpointId:R,directory:L},se={endpointId:$,directory:X};if(!(ei(O,se)||!ti(O,k,se)))try{_(void 0);let z=await Nr({sourceEndpointId:R,sourcePaths:k,destinationEndpointId:$,destinationDirectory:X,conflictPolicy:"fail"});h(I=>[z,...I.filter(J=>J.id!==z.id)])}catch(z){_(De(z))}},E=async(R,L,k)=>{try{_(void 0);let $=await cn(R,{paneId:L.id,endpointId:L.endpointId,directory:k});$.job!==void 0&&h(X=>[$.job,...X.filter(O=>O.id!==$.job.id)]),$.operation==="move"&&C(X=>{let O={...X};for(let se of[Nn(R.endpointId,R.directory),Nn(L.endpointId,k)])O[se]=(O[se]??0)+1;return O})}catch($){_(De($))}};return(0,M.jsxs)("div",{className:"dsh-ssh-transfer-workspace",children:[(0,M.jsxs)("header",{className:"dsh-ssh-transfer-header",children:[(0,M.jsxs)("div",{children:[(0,M.jsx)("h1",{children:"\u6587\u4EF6\u4F20\u8F93"}),(0,M.jsx)("p",{children:"FTP\u3001FTPS \u4E0E SFTP \u4E4B\u95F4\u76F4\u63A5\u6D41\u5F0F\u4E92\u4F20"})]}),(0,M.jsxs)("div",{className:"dsh-ssh-transfer-actions",children:[(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>m(!0),children:["\u4F1A\u8BDD\u8BBF\u95EE \xB7 ",r.value?.fileEndpointIds.length??0]}),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>u(!0),children:"FTP \u7BA1\u7406"})]})]}),S&&(0,M.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,M.jsx)("span",{children:S}),(0,M.jsx)("button",{type:"button",onClick:()=>_(void 0),"aria-label":"\u5173\u95ED",children:(0,M.jsx)(Ot.IconCloseOutline16,{size:16})})]}),(0,M.jsxs)("div",{className:"dsh-ssh-transfer-tabbar",role:"tablist","aria-label":"\u6587\u4EF6\u4F20\u8F93\u4EFB\u52A1\u9875",children:[(0,M.jsxs)("div",{className:"dsh-ssh-transfer-tabs",children:[l.map(R=>(0,M.jsxs)("span",{"data-ssh-interactive":"choice",className:`dsh-ssh-transfer-tab${R.id===A?.id?" is-active":""}`,children:[(0,M.jsx)("button",{type:"button",role:"tab","aria-selected":R.id===A?.id,onClick:()=>v(R.id),children:R.name}),l.length>1&&(0,M.jsx)("button",{type:"button",className:"is-close","aria-label":`\u5173\u95ED ${R.name}`,onClick:()=>U(R.id),children:(0,M.jsx)(Ot.IconCloseOutline16,{size:13})})]},R.id)),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"is-add","aria-label":"\u65B0\u5EFA\u4F20\u8F93\u4EFB\u52A1\u9875",onClick:B,children:(0,M.jsx)(Ot.IconPlusOutline16,{size:15})})]}),(0,M.jsx)("div",{className:"dsh-ssh-pane-layout","aria-label":"\u7A97\u683C\u6570\u91CF",children:[2,3,4].map(R=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":A?.panes.length===R,className:A?.panes.length===R?"is-active":"",onClick:()=>N(R),children:[R," \u680F"]},R))})]}),i.length===0?(0,M.jsxs)("div",{className:"dsh-ssh-transfer-empty",children:[(0,M.jsx)(Ot.IconDataOutline16,{size:24}),(0,M.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u6587\u4EF6\u8FDE\u63A5"}),(0,M.jsx)("p",{children:"\u65B0\u5EFA FTP/FTPS \u8FDE\u63A5\uFF0C\u6216\u5148\u6DFB\u52A0\u4E00\u53F0 SSH \u4E3B\u673A\u4F7F\u7528 SFTP\u3002"}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>u(!0),children:"\u65B0\u5EFA FTP \u8FDE\u63A5"})]}):A&&(0,M.jsx)("div",{className:`dsh-ssh-transfer-panes has-${A.panes.length}`,children:A.panes.map((R,L)=>{let k=A.panes[(L+1)%A.panes.length];return(0,M.jsx)(vx,{pane:R,endpoints:i,dragSource:x,refreshRevision:w[Nn(R.endpointId,R.path)]??0,...k===void 0?{}:{destination:k},onManageConnections:()=>u(!0),onDragSourceChange:y,onChange:$=>F(X=>({...X,panes:X.panes.map(O=>O.id===R.id?{...O,...$}:O)})),onTransfer:($,X)=>{H(R.endpointId,R.path,$,X.endpointId,X.path)},onExternalDrop:($,X)=>{E($,R,X)}},R.id)})}),(0,M.jsx)(yx,{jobs:a,endpoints:i,onCancel:async R=>{try{await jl(R),h(L=>L.map(k=>k.id===R?{...k,state:"cancelled"}:k))}catch(L){_(De(L))}},onConflict:b}),g&&(0,M.jsx)(Zp,{profiles:e,vaultEntries:t,proxyEntries:s,onClose:()=>u(!1),onChanged:()=>{o(),T()}}),d&&(0,M.jsx)(Sx,{endpoints:i,access:r,onClose:()=>m(!1)}),p&&(0,M.jsx)(wx,{job:p,onClose:()=>b(void 0),onRetry:async R=>{try{let L=await Nr({...p.request,conflictPolicy:R});h(k=>[L,...k]),b(void 0)}catch(L){_(De(L))}}})]})}function vx({pane:e,endpoints:t,destination:s,dragSource:r,refreshRevision:o,onChange:i,onTransfer:n,onExternalDrop:a,onDragSourceChange:h,onManageConnections:l}){let[c,f]=(0,be.useState)(),[v,g]=(0,be.useState)([]),[u,d]=(0,be.useState)(e.path),[m,p]=(0,be.useState)(!1),[b,x]=(0,be.useState)(0),[y,S]=(0,be.useState)({key:"name",direction:"asc"}),[_,w]=(0,be.useState)(!1),[C,P]=(0,be.useState)(),[T,A]=(0,be.useState)(),[F,B]=(0,be.useState)(),U=(0,be.useRef)(null),N=(0,be.useRef)(0),H=t.find(V=>V.id===e.endpointId),E=(0,be.useMemo)(()=>ef(c?.entries??[],y.key,y.direction),[c?.entries,y]),R=E.length>200,L=R?Math.max(0,Math.floor(b/Il)-8):0,k=(0,be.useMemo)(()=>R?E.slice(L,Math.min(E.length,L+56)):E,[E,L,R]),$=(0,be.useCallback)(async(V=e.path)=>{if(H===void 0)return;let Q=++N.current;p(!0),B(void 0);try{let W=await Hl(e.id,H.id,V);if(Q!==N.current)return;f(W),d(W.path),g([]),x(0),U.current&&(U.current.scrollTop=0),i({endpointId:H.id,path:W.path})}catch(W){Q===N.current&&B(De(W))}finally{Q===N.current&&p(!1)}},[H?.id,e.path]);(0,be.useEffect)(()=>{H!==void 0&&$(e.path)},[H?.id,o]),(0,be.useEffect)(()=>{r===void 0&&(w(!1),P(void 0))},[r]);let X=V=>{V.preventDefault(),$(u)},O=V=>{S(Q=>Q.key===V?{key:V,direction:Q.direction==="asc"?"desc":"asc"}:{key:V,direction:"asc"}),x(0),U.current&&(U.current.scrollTop=0)},se=V=>{N.current+=1,i({endpointId:V.id,path:V.initialPath}),d(V.initialPath),f(void 0),B(void 0)},z=()=>{N.current+=1,i({endpointId:"",path:"/"}),f(void 0),g([]),B(void 0),p(!1)},I=(V,Q)=>g(W=>Q?W.includes(V.path)?W.filter(ae=>ae!==V.path):[...W,V.path]:[V.path]),J=async()=>{if(!(T===void 0||c===void 0||H===void 0))try{await Br({paneId:e.id,endpointId:H.id,directory:c.path,paths:T.map(V=>V.path)}),g([])}finally{await $(c.path)}},Y=V=>{V.preventDefault(),w(!1);let Q=br(V.dataTransfer.getData(Ft));h(void 0),!(Q===void 0||Q.paneId===e.id||ei(Q,{endpointId:e.endpointId,directory:e.path}))&&a(Q,e.path)};return H===void 0?(0,M.jsxs)("section",{className:"dsh-ssh-file-pane is-connections",children:[(0,M.jsxs)("header",{children:[(0,M.jsxs)("span",{className:"dsh-ssh-pane-heading",children:[(0,M.jsx)("strong",{children:"\u8FDE\u63A5\u5217\u8868"}),(0,M.jsx)("small",{children:"\u5355\u51FB\u8FDE\u63A5\u540E\u6D4F\u89C8\u8FDC\u7AEF\u6587\u4EF6"})]}),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-pane-manage-button",onClick:l,children:"FTP \u7BA1\u7406"})]}),(0,M.jsx)("div",{className:"dsh-ssh-endpoint-list",children:t.map(V=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"row",className:"dsh-ssh-endpoint-row",onClick:()=>se(V),children:[(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${V.protocol}`,children:Ml(V.protocol)}),(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{title:V.name,children:V.name}),(0,M.jsx)("small",{title:V.address,children:V.address})]}),(0,M.jsxs)("span",{children:[(0,M.jsx)("i",{className:`dsh-ssh-protocol-dot is-${V.protocol}`,"aria-hidden":"true"}),V.group??(V.kind==="sftp"?"SSH \u4E3B\u673A":"\u6587\u4EF6\u8FDE\u63A5")]})]},V.id))}),(0,M.jsxs)("footer",{children:[(0,M.jsxs)("span",{children:[t.length," \u4E2A\u53EF\u7528\u8FDE\u63A5"]}),(0,M.jsx)("small",{children:"SFTP \u590D\u7528 SSH \u4E3B\u673A\u914D\u7F6E"})]})]}):(0,M.jsxs)("section",{className:`dsh-ssh-file-pane${_?" is-drop-target":""}`,onDragOver:V=>{V.dataTransfer.types.includes(Ft)&&Ax(r,e)?(V.preventDefault(),V.dataTransfer.dropEffect=r?.endpointId===e.endpointId?"move":"copy",P(void 0),w(!0)):_&&w(!1)},onDragLeave:V=>{V.currentTarget.contains(V.relatedTarget)||(w(!1),P(void 0))},onDrop:Y,children:[(0,M.jsxs)("header",{children:[(0,M.jsx)("button",{type:"button",className:"dsh-ssh-pane-back","aria-label":"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868",onClick:z,children:(0,M.jsx)(Ot.IconChevronLeftOutline14,{size:14})}),(0,M.jsxs)("span",{className:"dsh-ssh-pane-endpoint",children:[(0,M.jsx)("strong",{children:H.name}),(0,M.jsx)("small",{title:H.address,children:H.address})]}),(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${H.protocol}`,children:Ml(H.protocol)})]}),(0,M.jsxs)("form",{className:"dsh-ssh-file-pathbar",onSubmit:X,children:[(0,M.jsx)("button",{type:"button","aria-label":"\u4E0A\u4E00\u7EA7\u76EE\u5F55",disabled:c?.parent===null||m,onClick:()=>{c?.parent&&$(c.parent)},children:(0,M.jsx)(Fx,{})}),(0,M.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",disabled:m,onClick:()=>{$()},children:(0,M.jsx)(Bx,{})}),(0,M.jsx)("input",{"aria-label":"\u8FDC\u7AEF\u8DEF\u5F84",value:u,onChange:V=>d(V.target.value)}),(0,M.jsx)("button",{type:"submit",disabled:m,children:"\u524D\u5F80"})]}),(0,M.jsxs)("div",{className:"dsh-ssh-file-table",role:"grid","aria-busy":m,children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-table-head",role:"row",children:[(0,M.jsx)(Ll,{label:"\u540D\u79F0",sortKey:"name",current:y,onSort:O}),(0,M.jsx)(Ll,{label:"\u5927\u5C0F",sortKey:"size",current:y,onSort:O}),(0,M.jsx)(Ll,{label:"\u4FEE\u6539\u65F6\u95F4",sortKey:"modifiedAt",current:y,onSort:O}),(0,M.jsx)("span",{role:"columnheader","aria-label":"\u64CD\u4F5C"})]}),(0,M.jsx)("div",{ref:U,className:"dsh-ssh-file-table-body",onScroll:V=>{R&&x(V.currentTarget.scrollTop)},children:m&&!c?(0,M.jsx)("div",{className:"dsh-ssh-file-loading",children:"\u6B63\u5728\u8BFB\u53D6\u76EE\u5F55\u2026"}):F?(0,M.jsxs)("div",{className:"dsh-ssh-file-error",children:[(0,M.jsx)("span",{children:F}),(0,M.jsx)("button",{type:"button",onClick:()=>{$()},children:"\u91CD\u8BD5"})]}):E.length===0?(0,M.jsx)("div",{className:"dsh-ssh-table-empty",children:"\u8FD9\u4E2A\u76EE\u5F55\u662F\u7A7A\u7684\u3002"}):(0,M.jsx)("div",{className:R?"dsh-ssh-file-virtual-list":void 0,style:R?{height:`${E.length*Il}px`}:void 0,children:k.map((V,Q)=>(0,M.jsx)(xx,{entry:V,paneId:e.id,endpointId:H.id,sourceDirectory:c?.path??e.path,dragSource:r,dropTarget:C===V.path,selected:v.includes(V.path),selectedPaths:v,...R?{style:{position:"absolute",insetInline:0,transform:`translateY(${(L+Q)*Il}px)`}}:{},onDelete:()=>A([V]),onDirectoryTarget:W=>{w(!1),P(W)},onDropIntoDirectory:(W,ae)=>{P(void 0),h(void 0),a(W,ae)},onDragSourceChange:h,onSelect:W=>I(V,W),onOpen:()=>{$(V.path)}},V.path))})})]}),(0,M.jsxs)("footer",{children:[(0,M.jsx)("span",{children:v.length>0?`\u5DF2\u9009\u62E9 ${v.length} \u9879`:`${c?.entries.length??0} \u9879`}),(0,M.jsx)("span",{className:"dsh-ssh-file-pane-actions",children:(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-to-button",disabled:v.length===0||s===void 0||!s.endpointId||m,onClick:()=>{s?.endpointId&&n(v,s)},children:["\u4F20\u9001\u5230\u4E0B\u4E00\u680F ",(0,M.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]}),_&&(0,M.jsxs)("div",{className:"dsh-ssh-file-drop-overlay",children:[(0,M.jsx)("strong",{children:r?.endpointId===e.endpointId?"\u79FB\u52A8\u5230\u6B64\u76EE\u5F55":"\u590D\u5236\u5230\u6B64\u76EE\u5F55"}),(0,M.jsx)("span",{children:c?.path??e.path})]}),T!==void 0&&(0,M.jsx)(Rn,{locationName:H.name,locationKind:"remote",entries:T,onClose:()=>A(void 0),onDelete:J})]})}function Ll({label:e,sortKey:t,current:s,onSort:r}){let o=s.key===t;return(0,M.jsx)("span",{role:"columnheader","aria-sort":o?s.direction==="asc"?"ascending":"descending":"none",children:(0,M.jsxs)("button",{type:"button",onClick:()=>r(t),children:[e,(0,M.jsx)(bx,{active:o,direction:s.direction})]})})}function bx({active:e,direction:t}){return(0,M.jsx)("svg",{className:e?"is-active":"",viewBox:"0 0 12 12","aria-hidden":"true",children:(0,M.jsx)("path",{d:"m3.5 5 2.5 2.5L8.5 5",transform:t==="desc"?void 0:"rotate(180 6 6)"})})}function _x(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M8 2v7m0 0 2.6-2.6M8 9 5.4 6.4M3 11.5v1.25h10V11.5"})})}function xx({entry:e,paneId:t,endpointId:s,sourceDirectory:r,dragSource:o,dropTarget:i,selected:n,selectedPaths:a,style:h,onSelect:l,onOpen:c,onDelete:f,onDirectoryTarget:v,onDropIntoDirectory:g,onDragSourceChange:u}){let d=hn(e),m=d&&(o===void 0||ti(o,o.paths,{endpointId:s,directory:e.path})),p=b=>{if(!d)return;b.preventDefault(),b.stopPropagation(),v(void 0);let x=br(b.dataTransfer.getData(Ft));x!==void 0&&ti(x,x.paths,{endpointId:s,directory:e.path})&&g(x,e.path)};return(0,M.jsxs)("div",{role:"row","data-ssh-interactive":"row","data-ssh-context-row":!0,tabIndex:0,"aria-selected":n,"aria-label":`${e.name}${d?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":""}`,draggable:e.kind==="file"||d,className:`dsh-ssh-file-row is-${d?"directory":e.kind}${n?" is-selected":""}${i?" is-drop-target":""}`,style:h,onClick:b=>{d&&!b.ctrlKey&&!b.metaKey&&!b.shiftKey?c():l(b.ctrlKey||b.metaKey)},onKeyDown:b=>{b.target===b.currentTarget&&(b.key==="Enter"&&d&&c(),b.key===" "&&(b.preventDefault(),l(b.ctrlKey||b.metaKey)))},onDragStart:b=>{let x=n?a:[e.path],y={paneId:t,endpointId:s,directory:r,paths:x};u(y),b.dataTransfer.effectAllowed="copyMove",b.dataTransfer.setData(Ft,JSON.stringify(y))},onDragEnd:()=>u(void 0),onDragOver:b=>{b.dataTransfer.types.includes(Ft)&&m&&(b.preventDefault(),b.stopPropagation(),b.dataTransfer.dropEffect=o?.endpointId===s?"move":"copy",v(e.path))},onDragLeave:b=>{i&&!b.currentTarget.contains(b.relatedTarget)&&v(void 0)},onDrop:p,children:[(0,M.jsxs)("span",{children:[(0,M.jsx)(Nx,{directory:d}),(0,M.jsx)("i",{title:e.name,children:e.name})]}),(0,M.jsx)("span",{children:d?"\u2014":af(e.size)}),(0,M.jsx)("span",{children:e.modifiedAt>0?new Date(e.modifiedAt).toLocaleString():"\u2014"}),(0,M.jsxs)("span",{className:"dsh-ssh-file-row-actions dsh-ssh-context-action",children:[(e.kind==="file"||e.kind==="directory")&&(0,M.jsx)("a",{className:"dsh-ssh-file-row-download",href:$l(s,e.path),download:e.kind==="directory"?`${e.name}.tar`:e.name,draggable:!1,"aria-label":`\u4E0B\u8F7D ${e.name} \u5230\u672C\u5730`,title:e.kind==="directory"?`\u5C06 ${e.name} \u6253\u5305\u4E0B\u8F7D\u5230\u672C\u5730`:`\u4E0B\u8F7D ${e.name} \u5230\u672C\u5730`,onClick:b=>b.stopPropagation(),children:(0,M.jsx)(_x,{})}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-file-row-delete",draggable:!1,"aria-label":`\u5220\u9664 ${e.name}`,title:`\u5220\u9664 ${e.name}`,onClick:b=>{b.stopPropagation(),f()},children:(0,M.jsx)(Ot.IconTrashOutline16,{size:14})})]})]})}function yx({jobs:e,endpoints:t,onCancel:s,onConflict:r}){let[o,i]=(0,be.useState)(!0),n=e.filter(a=>a.state==="queued"||a.state==="scanning"||a.state==="transferring");return(0,M.jsxs)("section",{className:`dsh-ssh-transfer-queue${o?" is-open":""}`,children:[(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-queue-heading","aria-expanded":o,onClick:()=>i(a=>!a),children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u4F20\u8F93\u4EFB\u52A1"}),(0,M.jsx)("small",{children:n.length>0?`${n.length} \u4E2A\u8FDB\u884C\u4E2D`:e.length>0?"\u6700\u8FD1\u4EFB\u52A1":"\u6682\u65E0\u4EFB\u52A1"})]}),(0,M.jsx)("span",{children:o?"\u6536\u8D77":"\u5C55\u5F00"})]}),o&&(0,M.jsx)("div",{className:"dsh-ssh-transfer-job-list",children:e.length===0?(0,M.jsx)("p",{children:"\u4ECE\u4E00\u4E2A\u7A97\u683C\u62D6\u5230\u53E6\u4E00\u4E2A\u7A97\u683C\uFF0C\u6216\u9009\u4E2D\u6587\u4EF6\u540E\u70B9\u51FB\u201C\u4F20\u9001\u5230\u4E0B\u4E00\u680F\u201D\u3002"}):e.slice(0,12).map(a=>{let h=a.totalBytes>0?Math.min(100,a.transferredBytes/a.totalBytes*100):a.state==="completed"?100:0;return(0,M.jsxs)("article",{children:[(0,M.jsx)("span",{className:`dsh-ssh-transfer-state is-${a.state}`,"aria-hidden":"true"}),(0,M.jsxs)("span",{className:"dsh-ssh-transfer-job-copy",children:[(0,M.jsxs)("strong",{children:[of(a.request.sourcePaths)," ",(0,M.jsx)("i",{children:"\u2192"})," ",Rx(t,a.request.destinationEndpointId)]}),(0,M.jsx)("small",{children:a.error??Ix(a,h)}),(0,M.jsx)("span",{className:"dsh-ssh-transfer-job-time",children:Lx(a)}),(0,M.jsx)("span",{className:"dsh-ssh-transfer-progress",children:(0,M.jsx)("i",{style:{transform:`scaleX(${h/100})`}})})]}),a.state==="queued"||a.state==="scanning"||a.state==="transferring"?(0,M.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u53D6\u6D88\u4F20\u8F93",onClick:()=>{s(a.id)},children:(0,M.jsx)(Ot.IconCloseOutline16,{size:15})}):a.state==="failed"&&a.error?.includes("destination already contains")?(0,M.jsx)("button",{type:"button",className:"dsh-ssh-job-resolve",onClick:()=>r(a),children:"\u5904\u7406"}):null]},a.id)})})]})}function wx({job:e,onClose:t,onRetry:s}){let[r,o]=(0,be.useState)("rename"),[i,n]=(0,be.useState)(!1);return(0,M.jsxs)(Ye,{className:"dsh-ssh-transfer-conflict-dialog",title:"\u76EE\u6807\u4E2D\u5B58\u5728\u540C\u540D\u6587\u4EF6",subtitle:"\u4E3A\u672C\u6279\u4F20\u8F93\u9009\u62E9\u5904\u7406\u65B9\u5F0F",onClose:t,children:[(0,M.jsxs)("div",{className:"dsh-ssh-transfer-conflict-copy",children:[(0,M.jsx)("strong",{children:of(e.request.sourcePaths)}),(0,M.jsx)("span",{children:e.request.destinationDirectory})]}),(0,M.jsx)("div",{className:"dsh-ssh-conflict-options",children:[["rename","\u81EA\u52A8\u91CD\u547D\u540D","\u4FDD\u7559\u4E24\u4EFD\u6587\u4EF6\uFF0C\u5728\u540D\u79F0\u540E\u6DFB\u52A0\u5E8F\u53F7"],["skip","\u8DF3\u8FC7\u540C\u540D\u6587\u4EF6","\u7EE7\u7EED\u4F20\u8F93\u5176\u4ED6\u5185\u5BB9"],["overwrite","\u8986\u76D6\u76EE\u6807\u6587\u4EF6","\u4F7F\u7528\u6765\u6E90\u5185\u5BB9\u66FF\u6362\u76EE\u6807\u5185\u5BB9"]].map(a=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":r===a[0],className:r===a[0]?"is-active":"",onClick:()=>o(a[0]),children:[(0,M.jsx)("i",{"aria-hidden":"true"}),(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:a[1]}),(0,M.jsx)("small",{children:a[2]})]})]},a[0]))}),(0,M.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,M.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:i,onClick:()=>{n(!0),s(r).finally(()=>n(!1))},children:i?"\u6B63\u5728\u91CD\u65B0\u52A0\u5165\u961F\u5217\u2026":"\u7EE7\u7EED\u4F20\u8F93"})]})]})}function Sx({endpoints:e,access:t,onClose:s}){let r=t.value,o=e.filter(n=>r?.fileEndpointIds.includes(n.id)).length,i=n=>t.setFileEndpoints(r?.fileEndpointIds.includes(n)?r.fileEndpointIds.filter(a=>a!==n):[...r?.fileEndpointIds??[],n]);return(0,M.jsxs)(Ye,{className:"dsh-ssh-file-access-dialog",title:"\u4F1A\u8BDD\u8BBF\u95EE",subtitle:"\u5355\u72EC\u7BA1\u7406\u5F53\u524D\u4F1A\u8BDD\u53EF\u4F7F\u7528\u7684\u8FDC\u7AEF\u6587\u4EF6\u8FDE\u63A5",onClose:s,children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-access-body dsh-ssh-scroll-surface",children:[t.error&&(0,M.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t.error}),(0,M.jsxs)("section",{className:"dsh-ssh-file-access-section","aria-labelledby":"dsh-ssh-file-access-connections",children:[(0,M.jsxs)("header",{children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{id:"dsh-ssh-file-access-connections",children:"\u6587\u4EF6\u8FDE\u63A5"}),(0,M.jsx)("small",{children:"\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u6D4F\u89C8\u6307\u5B9A\u7684 FTP\u3001FTPS \u6216 SFTP"})]}),(0,M.jsxs)("i",{children:[o.toString().padStart(2,"0")," / ",e.length.toString().padStart(2,"0")]})]}),(0,M.jsx)("div",{className:"dsh-ssh-file-access-list",children:t.loading?(0,M.jsx)(Cx,{}):e.length===0?(0,M.jsxs)("div",{className:"dsh-ssh-file-access-empty",children:[(0,M.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u7528\u8FDE\u63A5"}),(0,M.jsx)("small",{children:"\u8BF7\u5148\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u6DFB\u52A0 FTP\uFF0C\u6216\u5728\u4E3B\u673A\u9762\u677F\u4E2D\u6DFB\u52A0 SSH \u4E3B\u673A\u3002"})]}):e.map(n=>(0,M.jsx)(kx,{endpoint:n,enabled:r?.fileEndpointIds.includes(n.id)??!1,onToggle:()=>i(n.id)},n.id))})]}),(0,M.jsxs)("section",{className:"dsh-ssh-file-access-section is-options","aria-labelledby":"dsh-ssh-file-access-policy",children:[(0,M.jsx)("header",{children:(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{id:"dsh-ssh-file-access-policy",children:"\u8BBF\u95EE\u7B56\u7565"}),(0,M.jsx)("small",{children:"\u6587\u4EF6\u6743\u9650\u4E0E SSH \u547D\u4EE4\u3001\u7EC8\u7AEF\u6743\u9650\u76F8\u4E92\u72EC\u7ACB"})]})}),(0,M.jsxs)("div",{className:"dsh-ssh-file-access-options",children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650"}),(0,M.jsx)("small",{children:"\u6D4F\u89C8\u6A21\u5F0F\u4E0D\u4F1A\u5411 AI \u66B4\u9732\u8DE8\u7AEF\u4F20\u8F93\u5DE5\u5177"})]}),(0,M.jsx)(Ex,{value:r?.filePermission??"browse",onChange:t.setFilePermission})]}),(0,M.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u4F20\u8F93\u524D\u786E\u8BA4"}),(0,M.jsx)("small",{children:"AI \u53D1\u8D77\u4F20\u8F93\u65F6\u8BF7\u6C42 DSH \u6388\u6743"})]}),(0,M.jsx)(Tx,{checked:r?.requireFileApproval??!0,onChange:t.setRequireFileApproval})]})]})]})]}),(0,M.jsxs)("footer",{className:"dsh-ssh-file-access-footer",children:[(0,M.jsxs)("span",{className:t.saving?"is-saving":"is-saved",children:[(0,M.jsx)("i",{"aria-hidden":"true"}),t.saving?"\u6B63\u5728\u4FDD\u5B58\u66F4\u6539":`${o>0?`\u5DF2\u6388\u6743 ${o} \u4E2A\u8FDE\u63A5`:"\u672A\u6388\u6743\u8FDE\u63A5"} \xB7 \u81EA\u52A8\u4FDD\u5B58`]}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button","data-ssh-dialog-close":!0,disabled:t.saving,onClick:s,children:t.saving?"\u4FDD\u5B58\u4E2D\u2026":"\u5B8C\u6210"})]})]})}function kx({endpoint:e,enabled:t,onToggle:s}){return(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-file-access-endpoint${t?" is-mounted":""}`,"aria-pressed":t,onClick:s,children:[(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${e.protocol}`,children:Ml(e.protocol)}),(0,M.jsxs)("span",{className:"dsh-ssh-file-access-endpoint-copy",children:[(0,M.jsx)("strong",{title:e.name,children:e.name}),(0,M.jsx)("small",{title:e.address,children:e.address})]}),(0,M.jsxs)("span",{className:"dsh-ssh-file-access-state",children:[(0,M.jsx)("i",{"aria-hidden":"true",children:(0,M.jsx)("b",{})}),(0,M.jsx)("em",{children:t?"\u5DF2\u6388\u6743":"\u672A\u6388\u6743"})]})]})}function Cx(){return(0,M.jsx)("div",{className:"dsh-ssh-file-access-skeleton","aria-label":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u6743\u9650",children:[0,1,2].map(e=>(0,M.jsxs)("span",{style:{"--ssh-skeleton-index":e},children:[(0,M.jsx)("i",{}),(0,M.jsxs)("b",{children:[(0,M.jsx)("i",{}),(0,M.jsx)("i",{})]}),(0,M.jsx)("em",{})]},e))})}function Ex({value:e,onChange:t}){return(0,M.jsx)("div",{className:"dsh-ssh-file-permission-picker",role:"radiogroup","aria-label":"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650",children:[["browse","\u4EC5\u6D4F\u89C8"],["transfer","\u5141\u8BB8\u4F20\u8F93"]].map(([s,r])=>(0,M.jsx)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":e===s,className:e===s?"is-active":"",onClick:()=>t(s),children:r},s))})}function Tx({checked:e,onChange:t}){return(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"switch","aria-checked":e,className:`dsh-ssh-file-approval-switch${e?" is-active":""}`,onClick:()=>t(!e),children:[(0,M.jsx)("i",{"aria-hidden":"true",children:(0,M.jsx)("b",{})}),(0,M.jsx)("span",{children:e?"\u9700\u8981\u786E\u8BA4":"\u76F4\u63A5\u6267\u884C"})]})}function Px(){try{let e=JSON.parse(localStorage.getItem(rf)??"[]");if(!Array.isArray(e))return[Ol("transfer-1",1)];let t=e.slice(0,8).flatMap(s=>{if(typeof s!="object"||s===null)return[];let r=s;if(typeof r.id!="string"||!/^[a-zA-Z0-9_-]{1,100}$/.test(r.id)||typeof r.name!="string"||!Array.isArray(r.panes))return[];let o=r.panes.slice(0,4).flatMap(i=>{if(typeof i!="object"||i===null)return[];let n=i;return typeof n.id=="string"&&/^[a-zA-Z0-9_-]{1,100}$/.test(n.id)&&typeof n.endpointId=="string"&&typeof n.path=="string"?[{id:n.id,endpointId:"",path:"/"}]:[]});return o.length>=2?[{id:r.id,name:r.name.slice(0,40),panes:o}]:[]});if(t.length>0)return t}catch{}return[Ol("transfer-1",1)]}function Ol(e,t){return{id:e,name:`\u4EFB\u52A1 ${t}`,panes:[zn(`${e}-a`),zn(`${e}-b`)]}}function zn(e){return{id:e,endpointId:"",path:"/"}}function Dx(e,t){return e.map(s=>({...s,panes:s.panes.map(r=>!r.endpointId||t.some(o=>o.id===r.endpointId)?r:zn(r.id))}))}function Rx(e,t){return e.find(s=>s.id===t)?.name??t}function of(e){let t=e[0]?.replaceAll("\\","/").split("/").filter(Boolean).at(-1)??"\u6587\u4EF6";return e.length>1?`${t} \u7B49 ${e.length} \u9879`:t}function Ml(e){return e==="sftp"?"SFTP":e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}function Nn(e,t){return JSON.stringify([e,t.replaceAll("\\","/").replace(/\/+$/,"")||"/"])}function Ax(e,t){return e===void 0||e.paneId!==t.id&&!ei(e,{endpointId:t.endpointId,directory:t.path})}function tf(e){return e==="completed"||e==="failed"||e==="cancelled"}function af(e){return e<1024?`${e} B`:e<1024**2?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024**2).toFixed(1)} MB`:`${(e/1024**3).toFixed(2)} GB`}function Ix(e,t){if(e.state==="queued")return"\u7B49\u5F85\u4F20\u8F93";if(e.state==="scanning")return"\u6B63\u5728\u626B\u63CF\u76EE\u5F55";if(e.state==="transferring"){let s=Math.max(1,(Date.now()-(e.startedAt??Date.now()))/1e3),r=e.transferredBytes/s,o=r>0?Math.max(0,(e.totalBytes-e.transferredBytes)/r):0;return`${t.toFixed(0)}% \xB7 ${af(r)}/s${o>1?` \xB7 \u7EA6 ${Mx(o)}`:""}`}return e.state==="completed"?`\u5DF2\u5B8C\u6210 ${e.completedFiles} \u4E2A\u6587\u4EF6${e.skippedFiles?`\uFF0C\u8DF3\u8FC7 ${e.skippedFiles}`:""}`:e.state==="cancelled"?"\u5DF2\u53D6\u6D88":"\u4F20\u8F93\u5931\u8D25"}function Lx(e){if(e.startedAt===void 0)return`\u521B\u5EFA\u4E8E ${sf(e.createdAt)}`;let t=e.completedAt??Date.now(),s=Ox(Math.max(0,t-e.startedAt));return e.completedAt===void 0?`\u5DF2\u6267\u884C ${s}`:`\u8017\u65F6 ${s} \xB7 \u5B8C\u6210\u4E8E ${sf(e.completedAt)}`}function sf(e){return gx.format(e)}function Ox(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t} \u79D2`;let s=Math.floor(t/60);return s<60?`${s} \u5206 ${String(t%60).padStart(2,"0")} \u79D2`:`${Math.floor(s/60)} \u5C0F\u65F6 ${String(s%60).padStart(2,"0")} \u5206`}function Mx(e){if(e<60)return`${Math.ceil(e)} \u79D2`;let t=Math.ceil(e/60);return t<60?`${t} \u5206\u949F`:`${Math.floor(t/60)} \u5C0F\u65F6 ${t%60} \u5206\u949F`}function Fx(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M8 12V4m0 0L4.8 7.2M8 4l3.2 3.2"})})}function Bx(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M12.2 5.2A5 5 0 1 0 13 9M12.2 5.2V2.5m0 2.7H9.5"})})}function Nx({directory:e}){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:e?(0,M.jsx)("path",{d:"M2 4.3h4l1.2 1.4H14v6.8H2z"}):(0,M.jsx)("path",{d:"M3.2 2h6l3.6 3.6V14H3.2zm6 0v3.6h3.6"})})}var lf=`.dsh-ssh-transfer-workspace {
|
|
5430
5551
|
display: grid;
|
|
5431
5552
|
grid-template-rows: auto auto minmax(0, 1fr) auto;
|
|
5432
5553
|
width: 100%;
|
|
@@ -6391,19 +6512,19 @@ body[data-ds-dark-theme] :is(
|
|
|
6391
6512
|
background: var(--ssh-modal-surface);
|
|
6392
6513
|
}
|
|
6393
6514
|
}
|
|
6394
|
-
`;var E=require("react/jsx-runtime"),zn="@lemoncat7/dsh-ssh",sf=`${zn}/client`,Mx=["slots","layout","sessions","workspaces"];function Fx(e){e.effect(ny,"dsh-ssh: styles");let t=Nx(e),r=Bx(e,()=>t.close());e.effect(()=>Ip(zn,()=>{r.close(),t.close()}),"dsh-ssh: exclusive workspace"),e.effect(()=>()=>{r.close(),t.dispose()},"dsh-ssh: workspace lifecycle"),e.slots.inject("sidebar.footer.action",()=>e.slots.register({name:"sidebar.footer.action",id:"ssh-remote",order:-100},s=>(0,E.jsx)(zx,{...s,controller:r,activityController:t,collapseSidebar:()=>e.layout.toggleSidebar()})))}function Bx(e,t){let r=e,s=new Set,o,i,n=()=>{for(let h of s)h()},a={open(h){t(),h!==void 0&&(o=h),i===void 0&&(kl(zn),i=e.slots.register({name:"conversation",priority:-2},l=>(0,E.jsx)(Hx,{...l,controller:a}))),n()},toggle(){i===void 0?a.open():a.close()},close(){if(i===void 0)return;let h=i;i=void 0,h(),n()},isOpen:()=>i!==void 0,selected:()=>o,subscribe(h){return s.add(h),()=>s.delete(h)},async createProjectSession(h,l,c,f){let v=await r.workspaces.connectWorkspace(h);return await Si({...vi(String(v)),profileIds:[l.profileId],permission:c,requireCommandApproval:f,workingDirectories:{[l.profileId]:l.path},workingProjectIds:{[l.profileId]:l.id}}),r.sessions.open(v),String(v)}};return a}function Nx(e){let t=e,r=new Set,s=new Map,o=nf(t.sessions.list.getSnapshot().current),i,n,a,h=()=>{for(let d of r)d()},l=()=>{n!==void 0&&(window.cancelAnimationFrame(n),n=void 0)},c=()=>{if(a===void 0)return!1;let d=a;return a=void 0,i=void 0,d(),!0},f=(d,m=!0)=>{i===d&&a!==void 0||(c(),i=d,a=e.slots.register({name:"details",priority:-2},p=>(0,E.jsx)(Cp,{...p,controller:g})),m&&e.layout.openDetails())},v=()=>{let d=t.sessions.list.getSnapshot(),m=nf(d.current);if(m===o)return;l();let p=c();o=m,m!==void 0&&s.get(m)?.open===!0?(f(m,!1),n=window.requestAnimationFrame(()=>{n=void 0,o===m&&i===m&&s.get(m)?.open===!0&&e.layout.openDetails()})):p&&e.layout.closeDetails(),h()},g={open(d,m,p){let b=p??(m===void 0?"local-directory":"remote-directory"),x=s.get(d),y=m??x?.selectedProfileId;s.set(d,{open:!0,...y===void 0?{}:{selectedProfileId:y},requestedView:b}),kl(zn),d===o&&(l(),f(d),e.layout.openDetails()),h()},toggle(d){if(s.get(d)?.open===!0)return g.close(d);g.open(d)},close(d){let m=d??o;if(m===void 0)return;let p=s.get(m);p!==void 0&&s.set(m,{...p,open:!1}),m===o&&(l(),c()&&e.layout.closeDetails()),h()},isOpen:d=>s.get(d)?.open===!0,selected:d=>s.get(d)?.selectedProfileId,requestedView:d=>s.get(d)?.requestedView,subscribe(d){return r.add(d),()=>r.delete(d)},dispose(){u(),l(),c(),s.clear(),r.clear()}},u=t.sessions.list.subscribe(v);return g}function nf(e){return typeof e=="string"&&e.length>0?e:void 0}function zx(e){let t=(0,ne.useRef)(null);Np(t);let r=e.useSessions(p=>p.current),s=r===void 0?void 0:String(r),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)(null),[h,l]=(0,ne.useState)(!0),c=(0,ne.useSyncExternalStore)(e.controller.subscribe,e.controller.isOpen),f=(0,ne.useSyncExternalStore)(e.activityController.subscribe,()=>s!==void 0&&e.activityController.isOpen(s));(0,ne.useEffect)(()=>Up(p=>{p.sessionId===s&&a(p)}),[s]);let v=(0,ne.useCallback)(async()=>{let p=await Vn().catch(()=>[]);i(p),a(r===void 0?null:await wi(String(r)).catch(()=>null))},[r]);(0,ne.useEffect)(()=>{v()},[v,c]);let g=n===null?[]:n.profileIds.map(p=>o.find(b=>b.id===p)).filter(p=>p!==void 0);(0,ne.useEffect)(()=>{if(s===void 0||n?.permission!=="terminal")return;let p=new EventSource(Xl(s)),b=x=>{let y=ry(x);y===void 0||y.sessionId!==s||(e.controller.close(),e.activityController.open(s,y.profileId,"terminals"))};return p.addEventListener("terminal-opened",b),()=>{p.removeEventListener("terminal-opened",b),p.close()}},[s,n?.permission,e.activityController,e.controller]);let u=p=>{s!==void 0&&(e.controller.close(),e.activityController.open(s,p,p===void 0?"local-directory":"remote-directory"))},d=()=>{s!==void 0&&(f?e.activityController.close(s):u())},m=()=>{e.controller.open(),e.wide&&window.matchMedia("(max-width: 820px)").matches&&e.collapseSidebar()};return e.wide?(0,E.jsxs)("section",{ref:t,className:"dsh-ssh-sidebar",children:[(0,E.jsxs)("div",{className:"dsh-ssh-sidebar-heading",children:[(0,E.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-title","aria-expanded":h,onClick:()=>l(p=>!p),children:[(0,E.jsx)("span",{className:"dsh-ssh-disclosure","data-open":h,children:(0,E.jsx)(ye.IconChevronDownOutline14,{size:14})}),(0,E.jsx)("span",{children:"\u8FDC\u7AEF"})]}),(0,E.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-icon-button${f?" is-active":""}`,"aria-label":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F",title:s===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":f,disabled:s===void 0,onClick:d,children:(0,E.jsx)(ye.IconPanelLeftOutline16,{size:16,className:"dsh-ssh-panel-right-icon"})})]}),h&&(0,E.jsxs)("div",{className:"dsh-ssh-sidebar-list",children:[(0,E.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-panel",onClick:m,children:[(0,E.jsx)(Cr,{}),(0,E.jsx)("span",{children:"SSH \u9762\u677F"})]}),s===void 0?(0,E.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u6253\u5F00\u4F1A\u8BDD\u540E\u663E\u793A\u53EF\u7528\u8FDC\u7AEF"}):g.length===0?(0,E.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u5F53\u524D\u4F1A\u8BDD\u672A\u6388\u6743\u8FDC\u7AEF"}):g.slice(0,6).map(p=>(0,E.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":f&&e.activityController.selected(s)===p.id,className:`dsh-ssh-sidebar-row${f&&e.activityController.selected(s)===p.id?" is-active":""}`,onClick:()=>u(p.id),children:[(0,E.jsx)("span",{className:"dsh-ssh-status-dot is-injected","aria-hidden":"true"}),(0,E.jsxs)("span",{className:"dsh-ssh-sidebar-copy",children:[(0,E.jsx)("strong",{children:p.name}),(0,E.jsx)("small",{children:p.host})]}),(0,E.jsx)("span",{className:"dsh-ssh-injected-mark",children:"\u5DF2\u6302\u8F7D"})]},p.id)),g.length>6&&(0,E.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-more",onClick:d,children:["\u8FD8\u6709 ",g.length-6," \u53F0\u53EF\u7528\u8FDC\u7AEF"]})]})]}):(0,E.jsx)("section",{ref:t,className:"dsh-ssh-sidebar is-rail",children:(0,E.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-rail-button${f?" is-active":""}`,title:s===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-label":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":f,disabled:s===void 0,onClick:d,children:(0,E.jsx)(Cr,{})})})}function Hx(e){let t=bs(),r=e.useSessions(z=>z.current),s=e.useWorkspaces(z=>z),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)([]),[h,l]=(0,ne.useState)([]),[c,f]=(0,ne.useState)([]),[v,g]=(0,ne.useState)(()=>e.controller.selected()===void 0?null:{profileId:e.controller.selected(),path:"~"}),[u,d]=(0,ne.useState)("workspace"),[m,p]=(0,ne.useState)(),[b,x]=(0,ne.useState)(),[y,w]=(0,ne.useState)(0),[_,S]=(0,ne.useState)(),T=Vp(r===void 0?void 0:String(r)),D=(0,ne.useRef)(r),P=(0,ne.useCallback)(async()=>{try{let[z,H,C,R]=await Promise.all([Vn(),Ol(),Ul(),$l()]);i(z),f(H),a(C),l(R),g(L=>L!==null&&z.some(k=>k.id===L.profileId)?L:z[0]===void 0?null:{profileId:z[0].id,path:"~"}),S(void 0)}catch(z){S(Ve(z))}},[]);(0,ne.useEffect)(()=>{let z=()=>{let H=e.controller.selected();H!==void 0&&g(C=>({profileId:H,path:C?.profileId===H?C.path:"~"}))};return z(),e.controller.subscribe(z)},[e.controller]),(0,ne.useEffect)(()=>{P()},[P,y]),(0,ne.useEffect)(()=>{D.current!==r&&e.controller.close()},[e.controller,r]);let A=o.find(z=>z.id===v?.profileId),F=s.items.find(z=>r!==void 0&&z.sessionIds.includes(r))?.workspaceId,B=(0,E.jsxs)("header",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-toolbar dsh-ssh-border-surface",children:[(0,E.jsxs)("div",{className:"dsh-ssh-brand",children:[(0,E.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u4F1A\u8BDD",title:"\u8FD4\u56DE\u4F1A\u8BDD",onClick:()=>e.controller.close(),children:(0,E.jsx)(ye.IconChevronLeftOutline14,{size:15})}),(0,E.jsx)("span",{className:"dsh-ssh-brand-glyph",children:(0,E.jsx)(Cr,{})}),(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{children:"SSH \u5DE5\u4F5C\u53F0"}),(0,E.jsx)("small",{children:u==="transfer"?"FTP \xB7 FTPS \xB7 SFTP":A===void 0?"\u9009\u62E9\u4E00\u53F0\u4E3B\u673A":`${A.username}@${A.host}`})]})]}),(0,E.jsxs)("nav",{className:"dsh-ssh-segments",role:"tablist","aria-label":"SSH \u5DE5\u4F5C\u53F0\u89C6\u56FE",children:[(0,E.jsx)(is,{active:u==="workspace",onClick:()=>d("workspace"),children:"\u7EC8\u7AEF\u4E0E\u6587\u4EF6"}),(0,E.jsx)(is,{active:u==="transfer",onClick:()=>d("transfer"),children:"\u6587\u4EF6\u4F20\u8F93"}),(0,E.jsx)(is,{active:u==="forwards",onClick:()=>d("forwards"),children:"\u7AEF\u53E3\u8F6C\u53D1"}),(0,E.jsx)(is,{active:u==="vault",onClick:()=>d("vault"),children:"\u5BC6\u94A5\u5E93"}),(0,E.jsx)(is,{active:u==="proxies",onClick:()=>d("proxies"),children:"\u4EE3\u7406\u5E93"}),(0,E.jsx)(is,{active:u==="settings",onClick:()=>d("settings"),children:"\u8BBE\u7F6E"})]})]});return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Tp,{className:"dsh-ssh-workspace",toolbar:B,notice:_&&(0,E.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,E.jsx)("span",{children:_}),(0,E.jsx)("button",{onClick:()=>S(void 0),"aria-label":"\u5173\u95ED",children:(0,E.jsx)(ye.IconCloseOutline16,{size:16})})]}),navigationLabel:"\u4E3B\u673A",navigationIcon:(0,E.jsx)(ye.IconDataOutline16,{size:15}),navigation:z=>(0,E.jsx)(Hp,{profiles:o,access:T.value,accessLoading:T.loading,accessSaving:T.saving,accessError:T.error,workspaces:s.items,currentWorkspaceId:F===void 0?void 0:String(F),recentWorkspaceId:s.recentWorkspaceId===void 0?void 0:String(s.recentWorkspaceId),selected:v,onSelect:H=>{g(H),d("workspace"),e.controller.open(H.profileId),z.closePanel()},onProfiles:T.setProfiles,onDirectory:(H,C,R)=>{T.setDirectory(H,C,R),C!==void 0&&(g({profileId:H,path:C,...R===void 0?{}:{projectId:R}}),d("workspace"))},onPermission:T.setPermission,onApproval:T.setRequireCommandApproval,onCreateSession:async(H,C)=>{await e.controller.createProjectSession(C,H,T.value?.permission??"exec",T.value?.requireCommandApproval??!0),e.controller.close()},onNewProfile:()=>{p("new"),z.closePanel()}}),children:(0,E.jsx)("section",{className:"dsh-ssh-main-panel dsh-ssh-scroll-surface",children:u==="transfer"?(0,E.jsx)(Zp,{ftpProfiles:c,vaultEntries:n,proxyEntries:h,access:T,onProfilesChanged:()=>w(z=>z+1)}):u==="vault"?(0,E.jsx)(jx,{entries:n,onChanged:()=>w(z=>z+1)}):u==="proxies"?(0,E.jsx)(qx,{entries:h,onChanged:()=>w(z=>z+1)}):A===void 0?(0,E.jsx)(fp,{}):u==="workspace"?(0,E.jsx)(Ux,{profile:A,initialPath:v?.path??"~",onEdit:()=>p(A),onDelete:()=>x(A)},A.id):u==="forwards"?(0,E.jsx)(Vx,{profiles:o,selected:A}):(0,E.jsx)(Gx,{})})}),m!==void 0&&(0,E.jsx)(Kp,{profile:m==="new"?void 0:m,profiles:o,vaultEntries:n,proxyEntries:h,onClose:()=>p(void 0),onSaved:()=>{p(void 0),w(z=>z+1)}}),b!==void 0&&(0,E.jsx)(qp,{profile:b,dependents:o.filter(z=>z.id!==b.id&&z.proxy.type==="jump"&&z.proxy.profileIds.includes(b.id)),onClose:()=>x(void 0),onDeleted:()=>{x(void 0),p(void 0),w(z=>z+1)}})]})}function Ux({profile:e,initialPath:t,onEdit:r,onDelete:s}){let[o,i]=(0,ne.useState)(!1),n=bs();return(0,E.jsxs)("div",{className:"dsh-ssh-host-workbench",children:[(0,E.jsxs)("header",{ref:n.ref,onPointerMove:n.onPointerMove,onPointerLeave:n.onPointerLeave,className:"dsh-ssh-workbench-heading dsh-ssh-border-surface",children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("span",{className:"dsh-ssh-host-monogram",children:e.name.slice(0,1).toUpperCase()}),(0,E.jsxs)("span",{children:[(0,E.jsx)("h1",{children:e.name}),(0,E.jsxs)("p",{children:[Gt(e)," \xB7 ",lf(e)]})]})]}),(0,E.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[(0,E.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:s,children:(0,E.jsx)(ye.IconTrashOutline16,{size:16})}),(0,E.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:r,children:[(0,E.jsx)(ye.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,E.jsx)(Wp,{storageKey:"dsh-ssh:workbench:sftp-width",label:"\u8C03\u6574\u7EC8\u7AEF\u4E0E SFTP \u7684\u5BBD\u5EA6",primary:(0,E.jsx)("section",{className:"dsh-ssh-workbench-terminal","aria-label":`${e.name} \u7EC8\u7AEF`,children:(0,E.jsx)($x,{profile:e,onEdit:r,onDelete:s,onConnected:()=>i(!0),embedded:!0})}),secondary:(0,E.jsx)("section",{className:"dsh-ssh-workbench-files","aria-label":`${e.name} SFTP`,children:o?(0,E.jsx)(_p,{profile:e,initialPath:t,embedded:!0},`${e.id}:${t}`):(0,E.jsxs)("div",{className:"dsh-ssh-sftp-deferred",children:[(0,E.jsx)("span",{children:"SFTP"}),(0,E.jsx)("strong",{children:"\u7B49\u5F85\u7EC8\u7AEF\u8FDE\u63A5"}),(0,E.jsx)("p",{children:"\u6253\u5F00\u7EC8\u7AEF\u540E\u518D\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u3002"})]})})})]})}function $x({profile:e,onEdit:t,onDelete:r,onConnected:s,embedded:o=!1}){let i=(0,ne.useRef)(null),n=(0,ne.useRef)(),a=(0,ne.useRef)(),h=(0,ne.useRef)(),[l,c]=(0,ne.useState)(),[f,v]=(0,ne.useState)("idle"),[g,u]=(0,ne.useState)();(0,ne.useEffect)(()=>{let p=i.current;if(p===null)return;let b=In({scrollback:5e3}),x=new of.FitAddon;b.loadAddon(x),b.open(p),n.current=b,a.current=x;let y=Ln(p,b,x,(w,_)=>{let S=h.current;S!==void 0&&oe(`/terminals/${S}/resize`,{method:"POST",body:JSON.stringify({cols:w,rows:_})}).catch(()=>{})});return()=>{y.dispose(),b.dispose(),n.current=void 0,a.current=void 0}},[]),(0,ne.useEffect)(()=>{h.current=l},[l]),(0,ne.useEffect)(()=>{if(l===void 0)return;let p=n.current;if(p===void 0)return;let b=new As({streamUrl:hh(l),read:w=>oe(`/terminals/${l}/output?cursor=${w}`),send:(w,_)=>oe(`/terminals/${l}/input`,{method:"POST",body:JSON.stringify({text:w,sequence:_})})}),x=p.onData(w=>b.sendInput(w,_=>u(Ve(_)))),y=b.observe({output:w=>{w.truncated&&p.write(`\r
|
|
6515
|
+
`;var D=require("react/jsx-runtime"),Hn="@lemoncat7/dsh-ssh",hf=`${Hn}/client`,Hx=["slots","layout","sessions","workspaces"];function $x(e){e.effect(cy,"dsh-ssh: styles");let t=Vx(e),s=Ux(e,()=>t.close());e.effect(()=>Bp(Hn,()=>{s.close(),t.close()}),"dsh-ssh: exclusive workspace"),e.effect(()=>()=>{s.close(),t.dispose()},"dsh-ssh: workspace lifecycle"),e.slots.inject("sidebar.footer.action",()=>e.slots.register({name:"sidebar.footer.action",id:"ssh-remote",order:-100},r=>(0,D.jsx)(jx,{...r,controller:s,activityController:t,collapseSidebar:()=>e.layout.toggleSidebar()})))}function Ux(e,t){let s=e,r=new Set,o,i,n=()=>{for(let h of r)h()},a={open(h){t(),h!==void 0&&(o=h),i===void 0&&(Pl(Hn),i=e.slots.register({name:"conversation",priority:-2},l=>(0,D.jsx)(Wx,{...l,controller:a}))),n()},toggle(){i===void 0?a.open():a.close()},close(){if(i===void 0)return;let h=i;i=void 0,h(),n()},isOpen:()=>i!==void 0,selected:()=>o,subscribe(h){return r.add(h),()=>r.delete(h)},async createProjectSession(h,l,c,f){let v=await s.workspaces.connectWorkspace(h);return await ki({...bi(String(v)),profileIds:[l.profileId],permission:c,requireCommandApproval:f,workingDirectories:{[l.profileId]:l.path},workingProjectIds:{[l.profileId]:l.id}}),s.sessions.open(v),String(v)}};return a}function Vx(e){let t=e,s=new Set,r=new Map,o=cf(t.sessions.list.getSnapshot().current),i,n,a,h=()=>{for(let d of s)d()},l=()=>{n!==void 0&&(window.cancelAnimationFrame(n),n=void 0)},c=()=>{if(a===void 0)return!1;let d=a;return a=void 0,i=void 0,d(),!0},f=(d,m=!0)=>{i===d&&a!==void 0||(c(),i=d,a=e.slots.register({name:"details",priority:-2},p=>(0,D.jsx)(Rp,{...p,controller:g})),m&&e.layout.openDetails())},v=()=>{let d=t.sessions.list.getSnapshot(),m=cf(d.current);if(m===o)return;l();let p=c();o=m,m!==void 0&&r.get(m)?.open===!0?(f(m,!1),n=window.requestAnimationFrame(()=>{n=void 0,o===m&&i===m&&r.get(m)?.open===!0&&e.layout.openDetails()})):p&&e.layout.closeDetails(),h()},g={open(d,m,p){let b=p??(m===void 0?"local-directory":"remote-directory"),x=r.get(d),y=m??x?.selectedProfileId;r.set(d,{open:!0,...y===void 0?{}:{selectedProfileId:y},requestedView:b}),Pl(Hn),d===o&&(l(),f(d),e.layout.openDetails()),h()},toggle(d){if(r.get(d)?.open===!0)return g.close(d);g.open(d)},close(d){let m=d??o;if(m===void 0)return;let p=r.get(m);p!==void 0&&r.set(m,{...p,open:!1}),m===o&&(l(),c()&&e.layout.closeDetails()),h()},isOpen:d=>r.get(d)?.open===!0,selected:d=>r.get(d)?.selectedProfileId,requestedView:d=>r.get(d)?.requestedView,subscribe(d){return s.add(d),()=>s.delete(d)},dispose(){u(),l(),c(),r.clear(),s.clear()}},u=t.sessions.list.subscribe(v);return g}function cf(e){return typeof e=="string"&&e.length>0?e:void 0}function jx(e){let t=(0,ne.useRef)(null);Vp(t);let s=e.useSessions(p=>p.current),r=s===void 0?void 0:String(s),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)(null),[h,l]=(0,ne.useState)(!0),c=(0,ne.useSyncExternalStore)(e.controller.subscribe,e.controller.isOpen),f=(0,ne.useSyncExternalStore)(e.activityController.subscribe,()=>r!==void 0&&e.activityController.isOpen(r));(0,ne.useEffect)(()=>qp(p=>{p.sessionId===r&&a(p)}),[r]);let v=(0,ne.useCallback)(async()=>{let p=await jn().catch(()=>[]);i(p),a(s===void 0?null:await Si(String(s)).catch(()=>null))},[s]);(0,ne.useEffect)(()=>{v()},[v,c]);let g=n===null?[]:n.profileIds.map(p=>o.find(b=>b.id===p)).filter(p=>p!==void 0);(0,ne.useEffect)(()=>{if(r===void 0||n?.permission!=="terminal")return;let p=new EventSource(Zl(r)),b=x=>{let y=ay(x);y===void 0||y.sessionId!==r||(e.controller.close(),e.activityController.open(r,y.profileId,"terminals"))};return p.addEventListener("terminal-opened",b),()=>{p.removeEventListener("terminal-opened",b),p.close()}},[r,n?.permission,e.activityController,e.controller]);let u=p=>{r!==void 0&&(e.controller.close(),e.activityController.open(r,p,p===void 0?"local-directory":"remote-directory"))},d=()=>{r!==void 0&&(f?e.activityController.close(r):u())},m=()=>{e.controller.open(),e.wide&&window.matchMedia("(max-width: 820px)").matches&&e.collapseSidebar()};return e.wide?(0,D.jsxs)("section",{ref:t,className:"dsh-ssh-sidebar",children:[(0,D.jsxs)("div",{className:"dsh-ssh-sidebar-heading",children:[(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-title","aria-expanded":h,onClick:()=>l(p=>!p),children:[(0,D.jsx)("span",{className:"dsh-ssh-disclosure","data-open":h,children:(0,D.jsx)(ye.IconChevronDownOutline14,{size:14})}),(0,D.jsx)("span",{children:"\u8FDC\u7AEF"})]}),(0,D.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-icon-button${f?" is-active":""}`,"aria-label":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F",title:r===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":f,disabled:r===void 0,onClick:d,children:(0,D.jsx)(ye.IconPanelLeftOutline16,{size:16,className:"dsh-ssh-panel-right-icon"})})]}),h&&(0,D.jsxs)("div",{className:"dsh-ssh-sidebar-list",children:[(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-panel",onClick:m,children:[(0,D.jsx)(Ts,{}),(0,D.jsx)("span",{children:"SSH \u9762\u677F"})]}),r===void 0?(0,D.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u6253\u5F00\u4F1A\u8BDD\u540E\u663E\u793A\u53EF\u7528\u8FDC\u7AEF"}):g.length===0?(0,D.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u5F53\u524D\u4F1A\u8BDD\u672A\u6388\u6743\u8FDC\u7AEF"}):g.slice(0,6).map(p=>(0,D.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":f&&e.activityController.selected(r)===p.id,className:`dsh-ssh-sidebar-row${f&&e.activityController.selected(r)===p.id?" is-active":""}`,onClick:()=>u(p.id),children:[(0,D.jsx)("span",{className:"dsh-ssh-status-dot is-injected","aria-hidden":"true"}),(0,D.jsxs)("span",{className:"dsh-ssh-sidebar-copy",children:[(0,D.jsx)("strong",{children:p.name}),(0,D.jsx)("small",{children:p.host})]}),(0,D.jsx)("span",{className:"dsh-ssh-injected-mark",children:"\u5DF2\u6302\u8F7D"})]},p.id)),g.length>6&&(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-more",onClick:d,children:["\u8FD8\u6709 ",g.length-6," \u53F0\u53EF\u7528\u8FDC\u7AEF"]})]})]}):(0,D.jsx)("section",{ref:t,className:"dsh-ssh-sidebar is-rail",children:(0,D.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-rail-button${f?" is-active":""}`,title:r===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-label":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":f,disabled:r===void 0,onClick:d,children:(0,D.jsx)(Ts,{})})})}function Wx(e){let t=_r(),s=e.useSessions(N=>N.current),r=e.useWorkspaces(N=>N),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)([]),[h,l]=(0,ne.useState)([]),[c,f]=(0,ne.useState)([]),[v,g]=(0,ne.useState)(()=>e.controller.selected()===void 0?null:{profileId:e.controller.selected(),path:"~"}),[u,d]=(0,ne.useState)("workspace"),[m,p]=(0,ne.useState)(),[b,x]=(0,ne.useState)(),[y,S]=(0,ne.useState)(0),[_,w]=(0,ne.useState)(),C=Gp(s===void 0?void 0:String(s)),P=(0,ne.useRef)(s),T=(0,ne.useCallback)(async()=>{try{let[N,H,E,R]=await Promise.all([jn(),Nl(),Wl(),ql()]);i(N),f(H),a(E),l(R),g(L=>L!==null&&N.some(k=>k.id===L.profileId)?L:N[0]===void 0?null:{profileId:N[0].id,path:"~"}),w(void 0)}catch(N){w(je(N))}},[]);(0,ne.useEffect)(()=>{let N=()=>{let H=e.controller.selected();H!==void 0&&g(E=>({profileId:H,path:E?.profileId===H?E.path:"~"}))};return N(),e.controller.subscribe(N)},[e.controller]),(0,ne.useEffect)(()=>{T()},[T,y]),(0,ne.useEffect)(()=>{P.current!==s&&e.controller.close()},[e.controller,s]);let A=o.find(N=>N.id===v?.profileId),F=r.items.find(N=>s!==void 0&&N.sessionIds.includes(s))?.workspaceId,B=(0,D.jsxs)("header",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-toolbar dsh-ssh-border-surface",children:[(0,D.jsxs)("div",{className:"dsh-ssh-brand",children:[(0,D.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u4F1A\u8BDD",title:"\u8FD4\u56DE\u4F1A\u8BDD",onClick:()=>e.controller.close(),children:(0,D.jsx)(ye.IconChevronLeftOutline14,{size:15})}),(0,D.jsx)("span",{className:"dsh-ssh-brand-glyph",children:(0,D.jsx)(Ts,{})}),(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"SSH \u5DE5\u4F5C\u53F0"}),(0,D.jsx)("small",{children:u==="transfer"?"FTP \xB7 FTPS \xB7 SFTP":A===void 0?"\u9009\u62E9\u4E00\u53F0\u4E3B\u673A":`${A.username}@${A.host}`})]})]}),(0,D.jsxs)("nav",{className:"dsh-ssh-segments",role:"tablist","aria-label":"SSH \u5DE5\u4F5C\u53F0\u89C6\u56FE",children:[(0,D.jsx)(nr,{active:u==="workspace",onClick:()=>d("workspace"),children:"\u7EC8\u7AEF\u4E0E\u6587\u4EF6"}),(0,D.jsx)(nr,{active:u==="transfer",onClick:()=>d("transfer"),children:"\u6587\u4EF6\u4F20\u8F93"}),(0,D.jsx)(nr,{active:u==="forwards",onClick:()=>d("forwards"),children:"\u7AEF\u53E3\u8F6C\u53D1"}),(0,D.jsx)(nr,{active:u==="vault",onClick:()=>d("vault"),children:"\u5BC6\u94A5\u5E93"}),(0,D.jsx)(nr,{active:u==="proxies",onClick:()=>d("proxies"),children:"\u4EE3\u7406\u5E93"}),(0,D.jsx)(nr,{active:u==="settings",onClick:()=>d("settings"),children:"\u8BBE\u7F6E"})]})]});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Ip,{className:"dsh-ssh-workspace",toolbar:B,notice:_&&(0,D.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,D.jsx)("span",{children:_}),(0,D.jsx)("button",{onClick:()=>w(void 0),"aria-label":"\u5173\u95ED",children:(0,D.jsx)(ye.IconCloseOutline16,{size:16})})]}),navigationLabel:"\u4E3B\u673A",navigationIcon:(0,D.jsx)(ye.IconDataOutline16,{size:15}),navigation:N=>(0,D.jsx)(Wp,{profiles:o,access:C.value,accessLoading:C.loading,accessSaving:C.saving,accessError:C.error,workspaces:r.items,currentWorkspaceId:F===void 0?void 0:String(F),recentWorkspaceId:r.recentWorkspaceId===void 0?void 0:String(r.recentWorkspaceId),selected:v,onSelect:H=>{g(H),d("workspace"),e.controller.open(H.profileId),N.closePanel()},onProfiles:C.setProfiles,onDirectory:(H,E,R)=>{C.setDirectory(H,E,R),E!==void 0&&(g({profileId:H,path:E,...R===void 0?{}:{projectId:R}}),d("workspace"))},onPermission:C.setPermission,onApproval:C.setRequireCommandApproval,onCreateSession:async(H,E)=>{await e.controller.createProjectSession(E,H,C.value?.permission??"exec",C.value?.requireCommandApproval??!0),e.controller.close()},onNewProfile:()=>{p("new"),N.closePanel()}}),children:(0,D.jsx)("section",{className:"dsh-ssh-main-panel dsh-ssh-scroll-surface",children:u==="transfer"?(0,D.jsx)(nf,{ftpProfiles:c,vaultEntries:n,proxyEntries:h,access:C,onProfilesChanged:()=>S(N=>N+1)}):u==="vault"?(0,D.jsx)(Xx,{entries:n,onChanged:()=>S(N=>N+1)}):u==="proxies"?(0,D.jsx)(Yx,{entries:h,onChanged:()=>S(N=>N+1)}):A===void 0?(0,D.jsx)(_p,{}):u==="workspace"?(0,D.jsx)(qx,{profile:A,initialPath:v?.path??"~",onEdit:()=>p(A),onDelete:()=>x(A)},A.id):u==="forwards"?(0,D.jsx)(Gx,{profiles:o,selected:A}):(0,D.jsx)(Zx,{})})}),m!==void 0&&(0,D.jsx)(Qp,{profile:m==="new"?void 0:m,profiles:o,vaultEntries:n,proxyEntries:h,onClose:()=>p(void 0),onSaved:()=>{p(void 0),S(N=>N+1)}}),b!==void 0&&(0,D.jsx)(Yp,{profile:b,dependents:o.filter(N=>N.id!==b.id&&N.proxy.type==="jump"&&N.proxy.profileIds.includes(b.id)),onClose:()=>x(void 0),onDeleted:()=>{x(void 0),p(void 0),S(N=>N+1)}})]})}function qx({profile:e,initialPath:t,onEdit:s,onDelete:r}){let[o,i]=(0,ne.useState)(!1),n=_r();return(0,D.jsxs)("div",{className:"dsh-ssh-host-workbench",children:[(0,D.jsxs)("header",{ref:n.ref,onPointerMove:n.onPointerMove,onPointerLeave:n.onPointerLeave,className:"dsh-ssh-workbench-heading dsh-ssh-border-surface",children:[(0,D.jsxs)("div",{children:[(0,D.jsx)("span",{className:"dsh-ssh-host-monogram",children:e.name.slice(0,1).toUpperCase()}),(0,D.jsxs)("span",{children:[(0,D.jsx)("h1",{children:e.name}),(0,D.jsxs)("p",{children:[Yt(e)," \xB7 ",pf(e)]})]})]}),(0,D.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[(0,D.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:r,children:(0,D.jsx)(ye.IconTrashOutline16,{size:16})}),(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,children:[(0,D.jsx)(ye.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,D.jsx)(Jp,{storageKey:"dsh-ssh:workbench:sftp-width",label:"\u8C03\u6574\u7EC8\u7AEF\u4E0E SFTP \u7684\u5BBD\u5EA6",primary:(0,D.jsx)("section",{className:"dsh-ssh-workbench-terminal","aria-label":`${e.name} \u7EC8\u7AEF`,children:(0,D.jsx)(Kx,{profile:e,onEdit:s,onDelete:r,onConnected:()=>i(!0),embedded:!0})}),secondary:(0,D.jsx)("section",{className:"dsh-ssh-workbench-files","aria-label":`${e.name} SFTP`,children:o?(0,D.jsx)(kp,{profile:e,initialPath:t,embedded:!0},`${e.id}:${t}`):(0,D.jsxs)("div",{className:"dsh-ssh-sftp-deferred",children:[(0,D.jsx)("span",{children:"SFTP"}),(0,D.jsx)("strong",{children:"\u7B49\u5F85\u7EC8\u7AEF\u8FDE\u63A5"}),(0,D.jsx)("p",{children:"\u6253\u5F00\u7EC8\u7AEF\u540E\u518D\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u3002"})]})})})]})}function Kx({profile:e,onEdit:t,onDelete:s,onConnected:r,embedded:o=!1}){let i=(0,ne.useRef)(null),n=(0,ne.useRef)(),a=(0,ne.useRef)(),h=(0,ne.useRef)(),[l,c]=(0,ne.useState)(),[f,v]=(0,ne.useState)("idle"),[g,u]=(0,ne.useState)();(0,ne.useEffect)(()=>{let p=i.current;if(p===null)return;let b=Ln({scrollback:5e3}),x=new df.FitAddon;b.loadAddon(x),b.open(p),n.current=b,a.current=x;let y=On(p,b,x,(S,_)=>{let w=h.current;w!==void 0&&oe(`/terminals/${w}/resize`,{method:"POST",body:JSON.stringify({cols:S,rows:_})}).catch(()=>{})});return()=>{y.dispose(),b.dispose(),n.current=void 0,a.current=void 0}},[]),(0,ne.useEffect)(()=>{h.current=l},[l]),(0,ne.useEffect)(()=>{if(l===void 0)return;let p=n.current;if(p===void 0)return;let b=new Ir({streamUrl:ph(l),read:S=>oe(`/terminals/${l}/output?cursor=${S}`),send:(S,_)=>oe(`/terminals/${l}/input`,{method:"POST",body:JSON.stringify({text:S,sequence:_})})}),x=p.onData(S=>b.sendInput(S,_=>u(je(_)))),y=b.observe({output:S=>{S.truncated&&p.write(`\r
|
|
6395
6516
|
\x1B[33m[\u8F83\u65E9\u8F93\u51FA\u5DF2\u622A\u65AD]\x1B[0m\r
|
|
6396
|
-
`),
|
|
6397
|
-
`);try{a.current?.fit();let b=await oe("/terminals",{method:"POST",body:JSON.stringify({profileId:e.id,cols:p.cols,rows:p.rows})});c(b.id),v("connected"),
|
|
6398
|
-
\x1B[31m${
|
|
6399
|
-
`)}}},m=async()=>{l!==void 0&&await oe(`/terminals/${l}`,{method:"DELETE"}).catch(()=>{}),c(void 0),v("idle")};return(0,E.jsxs)("div",{className:`dsh-ssh-terminal-pane${o?" is-embedded":""}`,children:[(0,E.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{className:"dsh-ssh-title-line",children:[(0,E.jsx)("span",{className:`dsh-ssh-live-dot is-${f}`})," ",(0,E.jsx)("h1",{children:o?"\u7EC8\u7AEF":e.name})]}),(0,E.jsx)("p",{children:o?Gt(e):`${Gt(e)} \xB7 ${lf(e)}`})]}),(0,E.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[!o&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:r,children:(0,E.jsx)(ye.IconTrashOutline16,{size:16})}),(0,E.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:t,children:[(0,E.jsx)(ye.IconEditOutline16,{size:16}),"\u7F16\u8F91"]})]}),f==="connected"?(0,E.jsxs)("button",{type:"button",className:"dsh-ssh-danger-button",onClick:()=>{m()},children:[(0,E.jsx)(ye.IconStopFill16,{size:16}),"\u65AD\u5F00"]}):(0,E.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:f==="connecting",onClick:()=>{d()},children:f==="connecting"?"\u8FDE\u63A5\u4E2D\u2026":"\u6253\u5F00\u7EC8\u7AEF"})]})]}),g&&(0,E.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:g}),(0,E.jsxs)("div",{className:"dsh-ssh-terminal-frame",children:[(0,E.jsx)("div",{className:"dsh-ssh-xterm",children:(0,E.jsx)("div",{ref:i,className:"dsh-ssh-terminal-viewport"})}),(0,E.jsxs)("div",{className:"dsh-ssh-terminal-status",children:[(0,E.jsx)("span",{children:f==="connected"?"\u5DF2\u8FDE\u63A5":f==="connecting"?"\u6B63\u5728\u5EFA\u7ACB\u5B89\u5168\u8FDE\u63A5":"\u7EC8\u7AEF\u672A\u8FDE\u63A5"}),(0,E.jsxs)("span",{children:["UTF-8 \xB7 ",e.terminalType]})]})]})]})}function Vx({profiles:e,selected:t}){let[r,s]=(0,ne.useState)([]),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)(),[h,l]=(0,ne.useState)(),c=(0,ne.useCallback)(async()=>{try{let u=await Vl();s(u.rules),i(u.statuses)}catch(u){l(Ve(u))}},[]);(0,ne.useEffect)(()=>{let u=!1,d,m=async()=>{await c(),u||(d=window.setTimeout(()=>{m()},document.visibilityState==="hidden"?15e3:4e3))};return m(),()=>{u=!0,d!==void 0&&window.clearTimeout(d)}},[c]);let f=r.filter(u=>u.profileId===t.id),v=async(u,d)=>{try{await oe(`/forwards/${u}/${d}`,{method:"POST",body:"{}"}),await c()}catch(m){l(Ve(m))}},g=async u=>{try{await oe(`/forwards/${u}`,{method:"DELETE"}),await c()}catch(d){l(Ve(d))}};return(0,E.jsxs)("div",{className:"dsh-ssh-forward-pane",children:[(0,E.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("h1",{children:"\u7AEF\u53E3\u8F6C\u53D1"}),(0,E.jsxs)("p",{children:[t.name," \xB7 \u672C\u5730\u3001\u8FDC\u7A0B\u4E0E\u52A8\u6001 SOCKS5"]})]}),(0,E.jsxs)("button",{className:"dsh-ssh-primary-button",onClick:()=>a("new"),children:[(0,E.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u89C4\u5219"]})]}),h&&(0,E.jsx)("p",{className:"dsh-ssh-inline-error",children:h}),(0,E.jsx)("div",{className:"dsh-ssh-forward-list",children:f.length===0?(0,E.jsx)("div",{className:"dsh-ssh-table-empty",children:"\u8FD9\u53F0\u4E3B\u673A\u8FD8\u6CA1\u6709\u7AEF\u53E3\u8F6C\u53D1\u89C4\u5219\u3002"}):f.map(u=>{let d=o.find(m=>m.ruleId===u.id);return(0,E.jsxs)("article",{className:"dsh-ssh-forward-row",children:[(0,E.jsx)("span",{className:`dsh-ssh-forward-kind is-${u.kind}`,children:u.kind==="local"?"L":u.kind==="remote"?"R":"D"}),(0,E.jsxs)("span",{className:"dsh-ssh-forward-copy",children:[(0,E.jsx)("strong",{children:u.name}),(0,E.jsx)("small",{children:sy(u,d)})]}),(0,E.jsx)("span",{className:`dsh-ssh-state-label is-${d?.state??"stopped"}`,children:iy(d)}),(0,E.jsx)("button",{className:"dsh-ssh-icon-button",onClick:()=>a(u),"aria-label":"\u7F16\u8F91",children:(0,E.jsx)(ye.IconEditOutline16,{size:16})}),d?.state==="running"?(0,E.jsx)("button",{className:"dsh-ssh-icon-button",onClick:()=>{v(u.id,"stop")},"aria-label":"\u505C\u6B62",children:(0,E.jsx)(ye.IconStopFill16,{size:16})}):(0,E.jsx)("button",{className:"dsh-ssh-small-primary",onClick:()=>{v(u.id,"start")},children:"\u542F\u52A8"}),(0,E.jsx)("button",{className:"dsh-ssh-icon-button is-danger",onClick:()=>{g(u.id)},"aria-label":"\u5220\u9664",children:(0,E.jsx)(ye.IconTrashOutline16,{size:16})})]},u.id)})}),n!==void 0&&(0,E.jsx)(ty,{profile:t,value:n==="new"?void 0:n,profiles:e,onClose:()=>a(void 0),onSaved:()=>{a(void 0),c()}})]})}function jx({entries:e,onChanged:t}){let[r,s]=(0,ne.useState)(),[o,i]=(0,ne.useState)(),n=async a=>{if(window.confirm(`\u5220\u9664\u5BC6\u94A5\u5E93\u6761\u76EE\u201C${a.name}\u201D\uFF1F\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002`))try{await oe(`/vault/${a.id}`,{method:"DELETE"}),t()}catch(h){i(Ve(h))}};return(0,E.jsxs)("div",{className:"dsh-ssh-vault-pane",children:[(0,E.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("h1",{children:"\u5BC6\u94A5\u5E93"}),(0,E.jsx)("p",{children:"\u96C6\u4E2D\u4FDD\u5B58\u5E38\u7528\u8D26\u53F7\uFF0C\u8FDE\u63A5\u914D\u7F6E\u53EA\u5F15\u7528\u51ED\u636E\u3002"})]}),(0,E.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>s("new"),children:[(0,E.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u51ED\u636E"]})]}),o&&(0,E.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:o}),e.length===0?(0,E.jsxs)("div",{className:"dsh-ssh-vault-empty",children:[(0,E.jsx)("span",{children:(0,E.jsx)(ye.IconUserOutline16,{size:20})}),(0,E.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u5E38\u7528\u51ED\u636E"}),(0,E.jsx)("p",{children:"\u5BC6\u7801\u548C\u79C1\u94A5\u53EA\u4FDD\u5B58\u5728 DSH \u51ED\u636E\u670D\u52A1\u4E2D\uFF0C\u4E0D\u5199\u5165 SSH \u914D\u7F6E\u6587\u4EF6\u3002"}),(0,E.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>s("new"),children:[(0,E.jsx)(ye.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u51ED\u636E"]})]}):(0,E.jsx)("div",{className:"dsh-ssh-vault-list",children:e.map(a=>(0,E.jsxs)("article",{className:"dsh-ssh-vault-row",children:[(0,E.jsx)("span",{className:"dsh-ssh-vault-glyph",children:(0,E.jsx)(ye.IconUserOutline16,{size:16})}),(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{children:a.name}),(0,E.jsxs)("small",{children:[a.username," \xB7 ",a.authType==="password"?"\u5BC6\u7801":"\u79C1\u94A5"]})]}),(0,E.jsx)("span",{className:`dsh-ssh-vault-state${a.credential.configured?" is-ready":""}`,children:a.credential.configured?"\u53EF\u7528":"\u7F3A\u5C11\u51ED\u636E"}),(0,E.jsxs)("small",{children:[a.references," \u4E2A\u8FDE\u63A5"]}),(0,E.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":`\u7F16\u8F91 ${a.name}`,onClick:()=>s(a),children:(0,E.jsx)(ye.IconEditOutline16,{size:16})}),(0,E.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger",disabled:a.references>0,"aria-label":`\u5220\u9664 ${a.name}`,title:a.references>0?"\u4ECD\u6709\u8FDE\u63A5\u6B63\u5728\u4F7F\u7528":"\u5220\u9664\u51ED\u636E",onClick:()=>{n(a)},children:(0,E.jsx)(ye.IconTrashOutline16,{size:16})})]},a.id))}),r!==void 0&&(0,E.jsx)(Wx,{value:r==="new"?void 0:r,onClose:()=>s(void 0),onSaved:()=>{s(void 0),t()}})]})}function Wx({value:e,onClose:t,onSaved:r}){let[s,o]=(0,ne.useState)({name:e?.name??"",username:e?.username??"",authType:e?.authType??"password",password:"",privateKey:"",passphrase:""}),[i,n]=(0,ne.useState)(!1),[a,h]=(0,ne.useState)(),l=async c=>{c.preventDefault(),n(!0),h(void 0);try{await oe(e===void 0?"/vault":`/vault/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify({entry:{name:s.name,username:s.username,authType:s.authType},secrets:{password:s.password,privateKey:s.privateKey,passphrase:s.passphrase}})}),r()}catch(f){h(Ve(f))}finally{n(!1)}};return(0,E.jsx)(Je,{title:e===void 0?"\u65B0\u5EFA\u5E38\u7528\u51ED\u636E":`\u7F16\u8F91 ${e.name}`,subtitle:"\u5BC6\u7801\u548C\u79C1\u94A5\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:t,children:(0,E.jsxs)("form",{className:"dsh-ssh-form",onSubmit:c=>{l(c)},children:[(0,E.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,E.jsx)(he,{label:"\u540D\u79F0",children:(0,E.jsx)("input",{required:!0,maxLength:80,value:s.name,onChange:c=>o({...s,name:c.target.value}),placeholder:"\u751F\u4EA7\u73AF\u5883\u8FD0\u7EF4"})}),(0,E.jsx)(he,{label:"\u7528\u6237\u540D",children:(0,E.jsx)("input",{required:!0,maxLength:128,autoComplete:"username",value:s.username,onChange:c=>o({...s,username:c.target.value})})})]}),(0,E.jsx)(he,{label:"\u8BA4\u8BC1\u65B9\u5F0F",children:(0,E.jsxs)("select",{value:s.authType,onChange:c=>o({...s,authType:c.target.value}),children:[(0,E.jsx)("option",{value:"password",children:"\u5BC6\u7801"}),(0,E.jsx)("option",{value:"private-key",children:"\u79C1\u94A5"})]})}),s.authType==="password"?(0,E.jsx)(he,{label:"\u5BC6\u7801",hint:e?.credential.fields.includes("password")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u5FC5\u586B\uFF0C\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,E.jsx)("input",{required:e===void 0||!e.credential.fields.includes("password"),type:"password",autoComplete:"new-password",value:s.password,onChange:c=>o({...s,password:c.target.value})})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(he,{label:"\u79C1\u94A5",hint:e?.credential.fields.includes("privateKey")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u7C98\u8D34 OpenSSH \u6216 PEM \u79C1\u94A5",children:(0,E.jsx)("textarea",{required:e===void 0||!e.credential.fields.includes("privateKey"),rows:7,spellCheck:!1,value:s.privateKey,onChange:c=>o({...s,privateKey:c.target.value})})}),(0,E.jsx)(he,{label:"\u79C1\u94A5\u53E3\u4EE4",children:(0,E.jsx)("input",{type:"password",autoComplete:"new-password",value:s.passphrase,onChange:c=>o({...s,passphrase:c.target.value})})})]}),a&&(0,E.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,E.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,E.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,E.jsx)("button",{className:"dsh-ssh-primary-button",disabled:i,children:i?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u51ED\u636E"})]})]})})}function qx({entries:e,onChanged:t}){let[r,s]=(0,ne.useState)(),[o,i]=(0,ne.useState)(),n=async a=>{if(window.confirm(`\u5220\u9664\u4EE3\u7406\u201C${a.name}\u201D\uFF1F\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002`))try{await oe(`/proxies/${a.id}`,{method:"DELETE"}),t()}catch(h){i(Ve(h))}};return(0,E.jsxs)("div",{className:"dsh-ssh-proxy-pane",children:[(0,E.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("h1",{children:"\u4EE3\u7406\u5E93"}),(0,E.jsx)("p",{children:"\u96C6\u4E2D\u4FDD\u5B58\u5E38\u7528 HTTP \u4E0E SOCKS5 \u4EE3\u7406\uFF0C\u4E3B\u673A\u914D\u7F6E\u53EA\u4FDD\u7559\u5F15\u7528\u3002"})]}),(0,E.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>s("new"),children:[(0,E.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u4EE3\u7406"]})]}),o&&(0,E.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:o}),e.length===0?(0,E.jsxs)("div",{className:"dsh-ssh-vault-empty",children:[(0,E.jsx)("span",{children:(0,E.jsx)(ye.IconDataOutline16,{size:20})}),(0,E.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u5E38\u7528\u4EE3\u7406"}),(0,E.jsx)("p",{children:"\u4FDD\u5B58\u4E00\u6B21\u540E\uFF0C\u591A\u53F0 SSH \u4E3B\u673A\u53EF\u4EE5\u5171\u7528\u540C\u4E00\u6761\u8FDE\u63A5\u8DEF\u5F84\u3002"}),(0,E.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>s("new"),children:[(0,E.jsx)(ye.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u4EE3\u7406"]})]}):(0,E.jsx)("div",{className:"dsh-ssh-proxy-list",children:e.map(a=>(0,E.jsxs)("article",{className:"dsh-ssh-proxy-row",children:[(0,E.jsx)("span",{className:"dsh-ssh-vault-glyph",children:(0,E.jsx)(ye.IconDataOutline16,{size:16})}),(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{children:a.name}),(0,E.jsxs)("small",{children:[a.host,":",a.port,a.username?` \xB7 ${a.username}`:""]})]}),(0,E.jsx)("span",{className:"dsh-ssh-proxy-kind",children:a.proxyType==="http"?"HTTP":"SOCKS5"}),(0,E.jsxs)("small",{children:[a.references," \u4E2A\u8FDE\u63A5"]}),(0,E.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":`\u7F16\u8F91 ${a.name}`,onClick:()=>s(a),children:(0,E.jsx)(ye.IconEditOutline16,{size:16})}),(0,E.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger",disabled:a.references>0,"aria-label":`\u5220\u9664 ${a.name}`,title:a.references>0?"\u4ECD\u6709\u8FDE\u63A5\u6B63\u5728\u4F7F\u7528":"\u5220\u9664\u4EE3\u7406",onClick:()=>{n(a)},children:(0,E.jsx)(ye.IconTrashOutline16,{size:16})})]},a.id))}),r!==void 0&&(0,E.jsx)(Kx,{value:r==="new"?void 0:r,onClose:()=>s(void 0),onSaved:()=>{s(void 0),t()}})]})}function Kx({value:e,onClose:t,onSaved:r}){let[s,o]=(0,ne.useState)({name:e?.name??"",proxyType:e?.proxyType??"socks5",host:e?.host??"",port:String(e?.port??1080),username:e?.username??"",password:""}),[i,n]=(0,ne.useState)(!1),[a,h]=(0,ne.useState)(),l=async c=>{c.preventDefault(),n(!0),h(void 0);try{await oe(e===void 0?"/proxies":`/proxies/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify({entry:{name:s.name,proxyType:s.proxyType,host:s.host,port:Number(s.port),...s.username.trim()?{username:s.username.trim()}:{}},secrets:{proxyPassword:s.password}})}),r()}catch(f){h(Ve(f))}finally{n(!1)}};return(0,E.jsx)(Je,{title:e===void 0?"\u65B0\u5EFA\u5E38\u7528\u4EE3\u7406":`\u7F16\u8F91 ${e.name}`,subtitle:"\u4EE3\u7406\u5BC6\u7801\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:t,children:(0,E.jsxs)("form",{className:"dsh-ssh-form",onSubmit:c=>{l(c)},children:[(0,E.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,E.jsx)(he,{label:"\u540D\u79F0",children:(0,E.jsx)("input",{required:!0,maxLength:80,value:s.name,onChange:c=>o({...s,name:c.target.value}),placeholder:"\u529E\u516C\u5BA4 SOCKS5"})}),(0,E.jsx)(he,{label:"\u4EE3\u7406\u7C7B\u578B",children:(0,E.jsxs)("select",{value:s.proxyType,onChange:c=>o({...s,proxyType:c.target.value}),children:[(0,E.jsx)("option",{value:"socks5",children:"SOCKS5"}),(0,E.jsx)("option",{value:"http",children:"HTTP CONNECT"})]})})]}),(0,E.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,E.jsx)(he,{label:"\u4EE3\u7406\u4E3B\u673A",children:(0,E.jsx)("input",{required:!0,maxLength:253,value:s.host,onChange:c=>o({...s,host:c.target.value}),placeholder:"127.0.0.1"})}),(0,E.jsx)(he,{label:"\u4EE3\u7406\u7AEF\u53E3",children:(0,E.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:s.port,onChange:c=>o({...s,port:c.target.value})})})]}),(0,E.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,E.jsx)(he,{label:"\u4EE3\u7406\u7528\u6237\u540D",children:(0,E.jsx)("input",{maxLength:128,value:s.username,onChange:c=>o({...s,username:c.target.value}),autoComplete:"username"})}),(0,E.jsx)(he,{label:"\u4EE3\u7406\u5BC6\u7801",hint:e?.credential.fields.includes("proxyPassword")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u53EF\u9009\uFF0C\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,E.jsx)("input",{type:"password",autoComplete:"new-password",value:s.password,onChange:c=>o({...s,password:c.target.value})})})]}),a&&(0,E.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,E.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,E.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,E.jsx)("button",{className:"dsh-ssh-primary-button",disabled:i,children:i?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u4EE3\u7406"})]})]})})}function Gx(){let[e,t]=(0,ne.useState)(),[r,s]=(0,ne.useState)(),[o,i]=(0,ne.useState)(""),[n,a]=(0,ne.useState)(""),[h,l]=(0,ne.useState)(!1),[c,f]=(0,ne.useState)(),[v,g]=(0,ne.useState)(),[u,d]=(0,ne.useState)(),[m,p]=(0,ne.useState)();(0,ne.useEffect)(()=>{Promise.all([oe("/settings"),oe("/gist-sync")]).then(([T,D])=>{t(T),s(D)}).catch(T=>p(Ve(T)))},[]),(0,ne.useEffect)(()=>{if(c===void 0)return;let T=!1,D,P=async()=>{try{let A=await oe("/gist-sync/oauth/poll",{method:"POST",body:JSON.stringify({id:c.id})});if(T)return;if(A.state==="complete"){f(void 0),s(await oe("/gist-sync")),d(`GitHub \u5DF2\u8FDE\u63A5 \xB7 ${A.login}`);return}D=setTimeout(()=>{P()},Math.max(1e3,A.retryAfterMs))}catch(A){if(T)return;f(void 0),p(Ve(A))}};return D=setTimeout(()=>{P()},Math.max(1e3,c.retryAfterMs)),()=>{T=!0,D!==void 0&&clearTimeout(D)}},[c?.id]);let b=async T=>{try{t(await oe("/settings",{method:"PUT",body:JSON.stringify(T)}))}catch(D){p(Ve(D))}},x=async()=>{if(e!==void 0){g("network"),p(void 0),d(void 0);try{let T=await oe("/settings",{method:"PUT",body:JSON.stringify(e)});t(T);let D=await oe("/gist-sync/network/test",{method:"POST"});d(`GitHub \u7F51\u7EDC\u8FDE\u63A5\u6210\u529F \xB7 ${D.route==="proxy"?"\u901A\u8FC7\u4EE3\u7406":"\u76F4\u8FDE"}`)}catch(T){p(Ve(T))}finally{g(void 0)}}},y=async()=>{if(r===void 0)throw new Error("Gist \u540C\u6B65\u8BBE\u7F6E\u5C1A\u672A\u52A0\u8F7D");let T=await oe("/gist-sync",{method:"PUT",body:JSON.stringify({settings:{autoSync:r.autoSync,strategy:r.strategy,backupRetention:r.backupRetention,gistId:r.gistId??"",oauthClientId:r.oauthClientId??""},...o.trim()?{token:o.trim()}:{},...n?{encryptionPassphrase:n}:{}})});return s(T),i(""),a(""),T},w=async T=>{if(r!==void 0){g(T),p(void 0),d(void 0);try{let D=await y();if(T==="save")return d("Gist \u540C\u6B65\u8BBE\u7F6E\u5DF2\u4FDD\u5B58"),D;if(T==="test"){let A=await oe("/gist-sync/test",{method:"POST"});return d(`\u8FDE\u63A5\u6210\u529F \xB7 ${A.login}`),s(await oe("/gist-sync")),D}let P=await oe("/gist-sync/run",{method:"POST"});return s(P),d(ey(P.lastResult)),P}catch(D){p(Ve(D));return}finally{g(void 0)}}},_=async()=>{g("oauth"),p(void 0),d(void 0);try{await y();let T=await oe("/gist-sync/oauth/start",{method:"POST"});f(T),d("\u8BBE\u5907\u4EE3\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u5728\u6388\u6743\u7A97\u53E3\u4E2D\u590D\u5236\u540E\u524D\u5F80 GitHub")}catch(T){p(Ve(T))}finally{g(void 0)}},S=async()=>{g("disconnect"),p(void 0),d(void 0),f(void 0);try{s(await oe("/gist-sync/oauth/disconnect",{method:"POST"})),d("GitHub \u8D26\u53F7\u5DF2\u65AD\u5F00\uFF0C\u540C\u6B65\u52A0\u5BC6\u5BC6\u7801\u4ECD\u4FDD\u7559\u5728\u672C\u673A")}catch(T){p(Ve(T))}finally{g(void 0)}};return(0,E.jsxs)("div",{className:"dsh-ssh-settings-pane",children:[(0,E.jsx)("div",{className:"dsh-ssh-content-heading",children:(0,E.jsxs)("div",{children:[(0,E.jsx)("h1",{children:"SSH \u8BBE\u7F6E"}),(0,E.jsx)("p",{children:"\u5B89\u5168\u8FB9\u754C\u3001\u547D\u4EE4\u9650\u5236\u4E0E\u8DE8\u8BBE\u5907\u914D\u7F6E\u540C\u6B65"})]})}),(0,E.jsxs)("div",{className:"dsh-ssh-settings-stack",children:[r&&(0,E.jsxs)("section",{className:"dsh-ssh-settings-section","aria-labelledby":"dsh-ssh-gist-title",children:[(0,E.jsxs)("div",{className:"dsh-ssh-settings-section-heading",children:[(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{id:"dsh-ssh-gist-title",children:"GitHub Gist \u540C\u6B65"}),(0,E.jsx)("small",{children:"\u4E3B\u673A\u3001FTP/FTPS\u3001\u9879\u76EE\u76EE\u5F55\u3001\u4EE3\u7406\u4E0E\u5BC6\u94A5\u5E93\u7AEF\u5230\u7AEF\u52A0\u5BC6\u540C\u6B65"})]}),(0,E.jsx)(Zx,{view:r})]}),(0,E.jsxs)("div",{className:"dsh-ssh-github-auth",children:[(0,E.jsx)("span",{className:"dsh-ssh-github-mark","aria-hidden":"true",children:"GH"}),(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{children:r.tokenConfigured?`\u5DF2\u8FDE\u63A5 ${r.githubLogin??"GitHub"}`:"\u8FDE\u63A5 GitHub"}),(0,E.jsx)("small",{children:r.tokenConfigured?"\u6388\u6743\u51ED\u636E\u5B89\u5168\u4FDD\u5B58\u5728\u5F53\u524D DSH":"\u901A\u8FC7 GitHub \u8BBE\u5907\u6388\u6743\u83B7\u53D6 Gist \u8BBF\u95EE\u6743\u9650"})]}),(0,E.jsxs)("span",{className:"dsh-ssh-github-auth-actions",children:[(0,E.jsx)("button",{type:"button",className:r.tokenConfigured?"dsh-ssh-secondary-button":"dsh-ssh-primary-button",disabled:v!==void 0||!r.oauthClientId,onClick:()=>{_()},children:v==="oauth"?"\u8FDE\u63A5\u4E2D\u2026":r.tokenConfigured?"\u91CD\u65B0\u8FDE\u63A5":"\u8FDE\u63A5 GitHub"}),r.tokenConfigured&&(0,E.jsx)("button",{type:"button",className:"dsh-ssh-text-button",disabled:v!==void 0,onClick:()=>{S()},children:v==="disconnect"?"\u65AD\u5F00\u4E2D\u2026":"\u65AD\u5F00"})]})]}),!r.oauthClientId&&(0,E.jsx)("p",{className:"dsh-ssh-auth-hint",children:"\u9996\u6B21\u4F7F\u7528\u9700\u5728\u4E0B\u65B9\u201C\u9AD8\u7EA7\u6388\u6743\u8BBE\u7F6E\u201D\u4E2D\u586B\u5199 GitHub OAuth Client ID\u3002\u5B83\u4E0D\u662F\u5BC6\u94A5\uFF0C\u53EA\u7528\u4E8E\u6807\u8BC6\u6388\u6743\u5E94\u7528\u3002"}),(0,E.jsxs)("div",{className:"dsh-ssh-gist-fields is-two",children:[(0,E.jsx)(he,{label:"Gist ID",hint:"\u7559\u7A7A\u540E\u9996\u6B21\u540C\u6B65\u4F1A\u81EA\u52A8\u521B\u5EFA\u79C1\u6709 Gist",children:(0,E.jsx)("input",{maxLength:64,spellCheck:!1,value:r.gistId??"",onChange:T=>s(Jx(r,T.target.value)),placeholder:"\u81EA\u52A8\u521B\u5EFA"})}),(0,E.jsx)(he,{label:"\u540C\u6B65\u52A0\u5BC6\u5BC6\u7801",hint:r.encryptionConfigured?"\u5DF2\u5B89\u5168\u4FDD\u5B58\uFF1B\u65B0\u8BBE\u5907\u9700\u8F93\u5165\u76F8\u540C\u5BC6\u7801":"\u81F3\u5C11 6 \u4E2A\u5B57\u7B26\uFF0C\u5EFA\u8BAE\u4F7F\u7528\u66F4\u957F\u5BC6\u7801",children:(0,E.jsx)("input",{type:"password",minLength:6,maxLength:512,autoComplete:"new-password",value:n,onChange:T=>a(T.target.value),placeholder:r.encryptionConfigured?"\u5DF2\u914D\u7F6E":"\u8BBE\u7F6E\u72EC\u7ACB\u52A0\u5BC6\u5BC6\u7801"})})]}),(0,E.jsxs)("div",{className:"dsh-ssh-sync-meta","aria-label":"\u540C\u6B65\u7248\u672C\u4FE1\u606F",children:[(0,E.jsxs)("span",{children:[(0,E.jsx)("small",{children:"\u4E91\u7AEF\u7248\u672C"}),(0,E.jsx)("strong",{title:r.cloudVersion,children:r.cloudVersion?r.cloudVersion.slice(0,10):"\u5C1A\u672A\u8BFB\u53D6"})]}),(0,E.jsxs)("span",{children:[(0,E.jsx)("small",{children:"\u4E0A\u6B21\u540C\u6B65"}),(0,E.jsx)("strong",{children:r.lastSyncAt?af(r.lastSyncAt):"\u5C1A\u672A\u540C\u6B65"})]})]}),(0,E.jsxs)("fieldset",{className:"dsh-ssh-sync-strategy",children:[(0,E.jsx)("legend",{children:"\u540C\u6B65\u7B56\u7565"}),(0,E.jsxs)("div",{role:"group","aria-label":"Gist \u540C\u6B65\u7B56\u7565",children:[(0,E.jsx)(Il,{active:r.strategy==="smart",title:"\u667A\u80FD",description:"\u81EA\u52A8\u5224\u65AD\u4E24\u7AEF\u53D8\u5316\u5E76\u6309\u6761\u76EE\u5408\u5E76",onClick:()=>s({...r,strategy:"smart"})}),(0,E.jsx)(Il,{active:r.strategy==="local-first",title:"\u672C\u5730\u4F18\u5148",description:"\u53CC\u65B9\u540C\u65F6\u4FEE\u6539\u65F6\u4FDD\u7559\u672C\u673A\u914D\u7F6E",onClick:()=>s({...r,strategy:"local-first"})}),(0,E.jsx)(Il,{active:r.strategy==="cloud-first",title:"\u4E91\u7AEF\u4F18\u5148",description:"\u53CC\u65B9\u540C\u65F6\u4FEE\u6539\u65F6\u91C7\u7528 Gist \u914D\u7F6E",onClick:()=>s({...r,strategy:"cloud-first"})})]})]}),(0,E.jsxs)("div",{className:"dsh-ssh-sync-options",children:[(0,E.jsxs)("label",{className:"dsh-ssh-switch-row",children:[(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{children:"\u81EA\u52A8\u540C\u6B65"}),(0,E.jsx)("small",{children:"\u542F\u52A8\u540E\u3001\u914D\u7F6E\u53D8\u5316\u540E\u548C\u540E\u53F0\u6BCF\u4E94\u5206\u949F\u68C0\u67E5\u4E00\u6B21"})]}),(0,E.jsx)("input",{type:"checkbox",checked:r.autoSync,onChange:T=>s({...r,autoSync:T.target.checked})})]}),(0,E.jsxs)("label",{className:"dsh-ssh-number-row",children:[(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{children:"\u5907\u4EFD\u4FDD\u7559\u6570\u91CF"}),(0,E.jsx)("small",{children:"\u4E3B Gist \u5185\u4FDD\u7559\u7684\u663E\u5F0F\u5386\u53F2\u5FEB\u7167\uFF1BGitHub \u81EA\u8EAB\u4FEE\u8BA2\u5386\u53F2\u4E0D\u53D7\u5F71\u54CD"})]}),(0,E.jsx)("input",{type:"number",min:"0",max:"50",step:"1",value:r.backupRetention,onChange:T=>s({...r,backupRetention:Number(T.target.value)})}),(0,E.jsx)("em",{children:"\u4EFD"})]})]}),(0,E.jsxs)("button",{type:"button",className:"dsh-ssh-advanced-toggle","aria-expanded":h,onClick:()=>l(T=>!T),children:[(0,E.jsx)("span",{children:"\u9AD8\u7EA7\u6388\u6743\u8BBE\u7F6E"}),(0,E.jsx)(ye.IconChevronDownOutline14,{})]}),h&&(0,E.jsxs)("div",{className:"dsh-ssh-advanced-auth",children:[(0,E.jsx)(he,{label:"GitHub OAuth Client ID",hint:"\u5728 GitHub OAuth App \u4E2D\u542F\u7528 Device Flow\uFF1B\u4E0D\u9700\u8981 Client Secret",children:(0,E.jsx)("input",{maxLength:128,spellCheck:!1,value:r.oauthClientId??"",onChange:T=>s(Yx(r,T.target.value)),placeholder:"Ov23li\u2026"})}),(0,E.jsx)(he,{label:"Personal Access Token\uFF08\u5907\u7528\uFF09",hint:r.tokenConfigured?"\u5DF2\u6709\u6388\u6743\uFF1B\u586B\u5199\u540E\u4F1A\u66FF\u6362\u5F53\u524D\u6388\u6743":"\u4EC5\u5728\u65E0\u6CD5\u4F7F\u7528 OAuth \u65F6\u586B\u5199\uFF0C\u9700\u8981 gist \u6743\u9650",children:(0,E.jsx)("input",{type:"password",autoComplete:"new-password",spellCheck:!1,value:o,onChange:T=>i(T.target.value),placeholder:"ghp_\u2026 / github_pat_\u2026"})}),(0,E.jsxs)("p",{children:["\u6CA1\u6709 OAuth App\uFF1F",(0,E.jsx)("a",{href:"https://github.com/settings/applications/new",target:"_blank",rel:"noreferrer",children:"\u524D\u5F80 GitHub \u521B\u5EFA"}),"\uFF0C\u521B\u5EFA\u540E\u5728\u5E94\u7528\u8BBE\u7F6E\u4E2D\u542F\u7528 Device Flow\u3002"]})]}),(0,E.jsxs)("p",{className:"dsh-ssh-sync-scope",children:[(0,E.jsx)("strong",{children:"\u540C\u6B65\u5185\u5BB9\uFF1A"}),"\u4E3B\u673A\u3001FTP/FTPS\u3001\u56FA\u5B9A\u9879\u76EE\u76EE\u5F55\u3001\u4EE3\u7406\u5E93\u3001\u5BC6\u94A5\u5E93\uFF0C\u4EE5\u53CA\u5176\u4E2D\u7684\u5BC6\u7801\u548C\u79C1\u94A5\u3002\u654F\u611F\u5B57\u6BB5\u4E0A\u4F20\u524D\u4F1A\u52A0\u5BC6\u3002",(0,E.jsx)("br",{}),(0,E.jsx)("strong",{children:"\u4EC5\u4FDD\u7559\u672C\u673A\uFF1A"}),"\u5F53\u524D\u4F1A\u8BDD\u6388\u6743\u3001\u7AEF\u53E3\u8F6C\u53D1\u3001\u516C\u5F00\u7ED1\u5B9A\u4E0E\u547D\u4EE4\u9650\u5236\u3002GitHub Token \u548C\u540C\u6B65\u52A0\u5BC6\u5BC6\u7801\u4E5F\u59CB\u7EC8\u53EA\u4FDD\u5B58\u5728\u672C\u673A DSH \u51ED\u636E\u670D\u52A1\u3002"]}),r.lastError&&(0,E.jsxs)("p",{className:"dsh-ssh-inline-error",role:"alert",children:["\u4E0A\u6B21\u540C\u6B65\u5931\u8D25\uFF1A",r.lastError]}),(0,E.jsxs)("div",{className:"dsh-ssh-settings-actions",children:[r.gistUrl&&(0,E.jsx)("a",{className:"dsh-ssh-secondary-button",href:r.gistUrl,target:"_blank",rel:"noreferrer",children:"\u6253\u5F00 Gist"}),(0,E.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:v!==void 0,onClick:()=>{w("test")},children:v==="test"?"\u6D4B\u8BD5\u4E2D\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,E.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:v!==void 0,onClick:()=>{w("sync")},children:v==="sync"?"\u540C\u6B65\u4E2D\u2026":"\u7ACB\u5373\u540C\u6B65"}),(0,E.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:v!==void 0,onClick:()=>{w("save")},children:v==="save"?"\u4FDD\u5B58\u4E2D\u2026":"\u4FDD\u5B58\u540C\u6B65\u8BBE\u7F6E"})]})]}),e&&(0,E.jsxs)("section",{className:"dsh-ssh-settings-section","aria-labelledby":"dsh-ssh-local-title",children:[(0,E.jsx)("div",{className:"dsh-ssh-settings-section-heading",children:(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{id:"dsh-ssh-local-title",children:"\u672C\u673A\u8FD0\u884C\u8BBE\u7F6E"}),(0,E.jsx)("small",{children:"\u53EA\u5F71\u54CD\u5F53\u524D DSH\uFF0C\u4E0D\u53C2\u4E0E Gist \u540C\u6B65"})]})}),(0,E.jsxs)("div",{className:"dsh-ssh-settings-group",children:[(0,E.jsx)(he,{label:"GitHub \u51FA\u7AD9\u4EE3\u7406",hint:"\u4EC5\u7528\u4E8E OAuth \u4E0E Gist API\uFF1B\u4F8B\u5982 http://host.docker.internal:7893\uFF0C\u7559\u7A7A\u65F6\u4F7F\u7528\u7CFB\u7EDF HTTPS_PROXY",children:(0,E.jsxs)("div",{className:"dsh-ssh-github-proxy-control",children:[(0,E.jsx)("input",{maxLength:2048,spellCheck:!1,value:e.githubProxy??"",onChange:T=>t(Qx(e,T.target.value)),placeholder:"\u76F4\u8FDE GitHub"}),(0,E.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:v!==void 0,onClick:()=>{x()},children:v==="network"?"\u6D4B\u8BD5\u4E2D\u2026":"\u6D4B\u8BD5 GitHub \u7F51\u7EDC"})]})}),(0,E.jsxs)("label",{className:"dsh-ssh-switch-row",children:[(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{children:"\u5141\u8BB8\u516C\u5F00\u7AEF\u53E3\u7ED1\u5B9A"}),(0,E.jsx)("small",{children:"\u5141\u8BB8\u8F6C\u53D1\u76D1\u542C 0.0.0.0 \u6216\u5176\u4ED6\u975E\u56DE\u73AF\u5730\u5740\u3002\u4EC5\u5728\u660E\u786E\u914D\u7F6E\u9632\u706B\u5899\u540E\u5F00\u542F\u3002"})]}),(0,E.jsx)("input",{type:"checkbox",checked:e.allowPublicBind,onChange:T=>{b({...e,allowPublicBind:T.target.checked})}})]}),(0,E.jsxs)("label",{className:"dsh-ssh-number-row",children:[(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{children:"\u9ED8\u8BA4\u547D\u4EE4\u8D85\u65F6"}),(0,E.jsx)("small",{children:"AI \u7684 ssh_exec \u6700\u957F\u7B49\u5F85\u65F6\u95F4"})]}),(0,E.jsx)("input",{type:"number",min:"1000",max:"300000",step:"1000",value:e.defaultCommandTimeoutMs,onChange:T=>t({...e,defaultCommandTimeoutMs:Number(T.target.value)}),onBlur:()=>{b(e)}}),(0,E.jsx)("em",{children:"\u6BEB\u79D2"})]}),(0,E.jsxs)("label",{className:"dsh-ssh-number-row",children:[(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{children:"\u6700\u5927\u547D\u4EE4\u8F93\u51FA"}),(0,E.jsx)("small",{children:"\u8D85\u51FA\u540E\u4FDD\u7559\u6700\u65B0\u8F93\u51FA\uFF0C\u907F\u514D\u6324\u5360\u4E0A\u4E0B\u6587"})]}),(0,E.jsx)("input",{type:"number",min:"1000",max:"1000000",step:"1000",value:e.maxOutputChars,onChange:T=>t({...e,maxOutputChars:Number(T.target.value)}),onBlur:()=>{b(e)}}),(0,E.jsx)("em",{children:"\u5B57\u7B26"})]})]})]})]}),c&&(0,E.jsx)(Xx,{flow:c,onClose:()=>f(void 0)}),u&&(0,E.jsx)("p",{className:"dsh-ssh-inline-success",role:"status",children:u}),m&&(0,E.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:m})]})}function Xx({flow:e,onClose:t}){let[r,s]=(0,ne.useState)("idle"),o=async()=>{try{await navigator.clipboard.writeText(e.userCode),s("copied")}catch{s("failed")}};return(0,E.jsx)(Je,{title:"\u8FDE\u63A5 GitHub",subtitle:"\u590D\u5236\u8BBE\u5907\u4EE3\u7801\uFF0C\u518D\u524D\u5F80 GitHub \u5B8C\u6210\u672C\u6B21\u6388\u6743",className:"dsh-ssh-device-auth-dialog",onClose:t,children:(0,E.jsxs)("div",{className:"dsh-ssh-device-auth-content",children:[(0,E.jsxs)("div",{className:"dsh-ssh-device-code-block",children:[(0,E.jsxs)("span",{children:[(0,E.jsx)("small",{children:"\u4E00\u6B21\u6027\u8BBE\u5907\u4EE3\u7801"}),(0,E.jsx)("code",{children:e.userCode})]}),(0,E.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>{o()},children:r==="copied"?"\u5DF2\u590D\u5236":"\u590D\u5236\u4EE3\u7801"})]}),(0,E.jsxs)("ol",{className:"dsh-ssh-device-auth-steps",children:[(0,E.jsxs)("li",{children:[(0,E.jsx)("span",{children:"1"}),(0,E.jsxs)("p",{children:[(0,E.jsx)("strong",{children:"\u590D\u5236\u4E0A\u65B9\u4EE3\u7801"}),(0,E.jsx)("small",{children:"\u8BBE\u5907\u4EE3\u7801\u53EA\u7528\u4E8E\u8FD9\u4E00\u6B21\u6388\u6743"})]})]}),(0,E.jsxs)("li",{children:[(0,E.jsx)("span",{children:"2"}),(0,E.jsxs)("p",{children:[(0,E.jsx)("strong",{children:"\u6253\u5F00 GitHub \u6388\u6743\u9875"}),(0,E.jsx)("small",{children:"\u7C98\u8D34\u4EE3\u7801\u5E76\u786E\u8BA4\u6388\u6743\u7ED9\u5F53\u524D OAuth App"})]})]}),(0,E.jsxs)("li",{children:[(0,E.jsx)("span",{children:"3"}),(0,E.jsxs)("p",{children:[(0,E.jsx)("strong",{children:"\u8FD4\u56DE DSH"}),(0,E.jsx)("small",{children:"\u6388\u6743\u6210\u529F\u540E\u4F1A\u81EA\u52A8\u5B8C\u6210\u8FDE\u63A5"})]})]})]}),r==="failed"&&(0,E.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:"\u6D4F\u89C8\u5668\u672A\u5141\u8BB8\u81EA\u52A8\u590D\u5236\uFF0C\u8BF7\u9009\u4E2D\u8BBE\u5907\u4EE3\u7801\u624B\u52A8\u590D\u5236\u3002"}),(0,E.jsxs)("p",{className:"dsh-ssh-device-auth-expiry",children:["\u4EE3\u7801\u5C06\u5728 ",new Date(e.expiresAt).toLocaleTimeString()," \u5931\u6548"]}),(0,E.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,E.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u7A0D\u540E\u518D\u8BF4"}),(0,E.jsx)("a",{className:"dsh-ssh-primary-button",href:e.verificationUri,target:"_blank",rel:"noreferrer",children:"\u524D\u5F80 GitHub \u6388\u6743"})]})]})})}function Il({active:e,title:t,description:r,onClick:s}){return(0,E.jsxs)("button",{type:"button",className:e?"is-active":"","aria-pressed":e,onClick:s,children:[(0,E.jsx)("strong",{children:t}),(0,E.jsx)("small",{children:r})]})}function Jx(e,t){let r=t.trim();if(r)return{...e,gistId:r};let{gistId:s,gistUrl:o,...i}=e;return i}function Yx(e,t){let r=t.trim();if(r)return{...e,oauthClientId:r,oauthAvailable:!0};let{oauthClientId:s,...o}=e;return{...o,oauthAvailable:!1}}function Qx(e,t){if(t!=="")return{...e,githubProxy:t};let{githubProxy:r,...s}=e;return s}function Zx({view:e}){let t=e.tokenConfigured&&e.encryptionConfigured,r=e.running?"\u540C\u6B65\u4E2D":e.lastError?"\u9700\u8981\u5904\u7406":e.lastSyncAt===void 0?t?"\u7B49\u5F85\u9996\u6B21\u540C\u6B65":"\u5C1A\u672A\u914D\u7F6E":`\u4E0A\u6B21\u540C\u6B65 ${af(e.lastSyncAt)}`;return(0,E.jsxs)("span",{className:`dsh-ssh-sync-status${e.running?" is-running":e.lastError?" is-error":t?" is-ready":""}`,role:"status",children:[(0,E.jsx)("i",{"aria-hidden":"true"}),r]})}function ey(e){return e==="uploaded"?"\u672C\u5730\u914D\u7F6E\u5DF2\u4E0A\u4F20":e==="downloaded"?"\u4E91\u7AEF\u914D\u7F6E\u5DF2\u5E94\u7528":e==="merged"?"\u4E24\u7AEF\u914D\u7F6E\u5DF2\u667A\u80FD\u5408\u5E76":"\u914D\u7F6E\u5DF2\u7ECF\u662F\u6700\u65B0\u72B6\u6001"}function af(e){let t=Math.max(0,Date.now()-e);return t<6e4?"\u521A\u521A":t<36e5?`${Math.floor(t/6e4)} \u5206\u949F\u524D`:t<864e5?`${Math.floor(t/36e5)} \u5C0F\u65F6\u524D`:new Date(e).toLocaleString()}function ty({profile:e,value:t,onClose:r,onSaved:s}){let[o,i]=(0,ne.useState)({name:t?.name??"",kind:t?.kind??"local",bindHost:t?.bindHost??"127.0.0.1",bindPort:String(t?.bindPort??0),targetHost:t?.targetHost??"127.0.0.1",targetPort:String(t?.targetPort??80),autoStart:t?.autoStart??!1}),[n,a]=(0,ne.useState)(),h=async l=>{l.preventDefault();try{await oe(t===void 0?"/forwards":`/forwards/${t.id}`,{method:t===void 0?"POST":"PUT",body:JSON.stringify({rule:{profileId:e.id,name:o.name,kind:o.kind,bindHost:o.bindHost,bindPort:Number(o.bindPort),...o.kind==="dynamic"?{}:{targetHost:o.targetHost,targetPort:Number(o.targetPort)},autoStart:o.autoStart}})}),s()}catch(c){a(Ve(c))}};return(0,E.jsx)(Je,{title:t===void 0?"\u65B0\u5EFA\u7AEF\u53E3\u8F6C\u53D1":`\u7F16\u8F91 ${t.name}`,subtitle:e.name,onClose:r,children:(0,E.jsxs)("form",{className:"dsh-ssh-form",onSubmit:l=>{h(l)},children:[(0,E.jsx)(he,{label:"\u540D\u79F0",children:(0,E.jsx)("input",{required:!0,value:o.name,onChange:l=>i({...o,name:l.target.value})})}),(0,E.jsx)(he,{label:"\u7C7B\u578B",children:(0,E.jsxs)("select",{value:o.kind,onChange:l=>i({...o,kind:l.target.value}),children:[(0,E.jsx)("option",{value:"local",children:"\u672C\u5730\u8F6C\u53D1\uFF08L\uFF09"}),(0,E.jsx)("option",{value:"remote",children:"\u8FDC\u7A0B\u8F6C\u53D1\uFF08R\uFF09"}),(0,E.jsx)("option",{value:"dynamic",children:"\u52A8\u6001 SOCKS5\uFF08D\uFF09"})]})}),(0,E.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,E.jsx)(he,{label:"\u76D1\u542C\u5730\u5740",children:(0,E.jsx)("input",{required:!0,value:o.bindHost,onChange:l=>i({...o,bindHost:l.target.value})})}),(0,E.jsx)(he,{label:"\u76D1\u542C\u7AEF\u53E3",hint:"0 \u8868\u793A\u81EA\u52A8\u9009\u62E9",children:(0,E.jsx)("input",{required:!0,type:"number",min:"0",max:"65535",value:o.bindPort,onChange:l=>i({...o,bindPort:l.target.value})})})]}),o.kind!=="dynamic"&&(0,E.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,E.jsx)(he,{label:"\u76EE\u6807\u4E3B\u673A",children:(0,E.jsx)("input",{required:!0,value:o.targetHost,onChange:l=>i({...o,targetHost:l.target.value})})}),(0,E.jsx)(he,{label:"\u76EE\u6807\u7AEF\u53E3",children:(0,E.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:o.targetPort,onChange:l=>i({...o,targetPort:l.target.value})})})]}),(0,E.jsxs)("label",{className:"dsh-ssh-switch-row",children:[(0,E.jsxs)("span",{children:[(0,E.jsx)("strong",{children:"\u81EA\u52A8\u542F\u52A8"}),(0,E.jsx)("small",{children:"DSH \u542F\u52A8\u65F6\u6062\u590D\u6B64\u8F6C\u53D1"})]}),(0,E.jsx)("input",{type:"checkbox",checked:o.autoStart,onChange:l=>i({...o,autoStart:l.target.checked})})]}),n&&(0,E.jsx)("p",{className:"dsh-ssh-inline-error",children:n}),(0,E.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,E.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:r,children:"\u53D6\u6D88"}),(0,E.jsx)("button",{className:"dsh-ssh-primary-button",children:"\u4FDD\u5B58\u89C4\u5219"})]})]})})}function lf(e){return e.proxy.type==="none"?"\u76F4\u8FDE":e.proxy.type==="saved"?"\u5E38\u7528\u4EE3\u7406":e.proxy.type==="jump"?"SSH \u8DF3\u677F":e.proxy.type==="http"?"HTTP \u4EE3\u7406":"SOCKS5 \u4EE3\u7406"}var Ve=Pe;function ry(e){if(!(!(e instanceof MessageEvent)||typeof e.data!="string"))try{let t=JSON.parse(e.data);return t.type!=="terminal-opened"||typeof t.sessionId!="string"||typeof t.terminalId!="string"||typeof t.profileId!="string"||typeof t.createdAt!="number"?void 0:t}catch{return}}function sy(e,t){let r=`${e.bindHost}:${t?.bindPort??e.bindPort}`;return e.kind==="dynamic"?`${r} \u2192 SOCKS5`:`${r} \u2192 ${e.targetHost}:${e.targetPort}`}function iy(e){return e?.state==="running"?`\u8FD0\u884C\u4E2D \xB7 ${e.connections}`:e?.state==="starting"?"\u542F\u52A8\u4E2D":e?.state==="error"?"\u5931\u8D25":"\u5DF2\u505C\u6B62"}function ny(){if(document.getElementById(sf)!==null)return()=>{};let t=document.createElement("style");return t.id=sf,t.textContent=`${Lp}
|
|
6400
|
-
${
|
|
6401
|
-
${Dp}
|
|
6402
|
-
${Rp}
|
|
6517
|
+
`),S.data&&p.write(S.data),S.closed&&(v("idle"),c(void 0))},error:S=>{u(je(S)),v("error")}});return()=>{y(),b.dispose(),x.dispose()}},[l]),(0,ne.useEffect)(()=>()=>{l!==void 0&&oe(`/terminals/${l}`,{method:"DELETE"}).catch(()=>{})},[l]),(0,ne.useEffect)(()=>{c(void 0),v("idle"),n.current?.clear()},[e.id]);let d=async()=>{let p=n.current;if(p!==void 0){v("connecting"),u(void 0),p.clear(),p.write(`\x1B[2m\u6B63\u5728\u8FDE\u63A5 ${Yt(e)}\u2026\x1B[0m\r
|
|
6518
|
+
`);try{a.current?.fit();let b=await oe("/terminals",{method:"POST",body:JSON.stringify({profileId:e.id,cols:p.cols,rows:p.rows})});c(b.id),v("connected"),r?.(),p.focus()}catch(b){v("error"),u(je(b)),p.write(`\r
|
|
6519
|
+
\x1B[31m${je(b)}\x1B[0m\r
|
|
6520
|
+
`)}}},m=async()=>{l!==void 0&&await oe(`/terminals/${l}`,{method:"DELETE"}).catch(()=>{}),c(void 0),v("idle")};return(0,D.jsxs)("div",{className:`dsh-ssh-terminal-pane${o?" is-embedded":""}`,children:[(0,D.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,D.jsxs)("div",{children:[(0,D.jsxs)("div",{className:"dsh-ssh-title-line",children:[(0,D.jsx)("span",{className:`dsh-ssh-live-dot is-${f}`})," ",(0,D.jsx)("h1",{children:o?"\u7EC8\u7AEF":e.name})]}),(0,D.jsx)("p",{children:o?Yt(e):`${Yt(e)} \xB7 ${pf(e)}`})]}),(0,D.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[!o&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:s,children:(0,D.jsx)(ye.IconTrashOutline16,{size:16})}),(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:t,children:[(0,D.jsx)(ye.IconEditOutline16,{size:16}),"\u7F16\u8F91"]})]}),f==="connected"?(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-danger-button",onClick:()=>{m()},children:[(0,D.jsx)(ye.IconStopFill16,{size:16}),"\u65AD\u5F00"]}):(0,D.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:f==="connecting",onClick:()=>{d()},children:f==="connecting"?"\u8FDE\u63A5\u4E2D\u2026":"\u6253\u5F00\u7EC8\u7AEF"})]})]}),g&&(0,D.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:g}),(0,D.jsxs)("div",{className:"dsh-ssh-terminal-frame",children:[(0,D.jsx)("div",{className:"dsh-ssh-xterm",children:(0,D.jsx)("div",{ref:i,className:"dsh-ssh-terminal-viewport"})}),(0,D.jsxs)("div",{className:"dsh-ssh-terminal-status",children:[(0,D.jsx)("span",{children:f==="connected"?"\u5DF2\u8FDE\u63A5":f==="connecting"?"\u6B63\u5728\u5EFA\u7ACB\u5B89\u5168\u8FDE\u63A5":"\u7EC8\u7AEF\u672A\u8FDE\u63A5"}),(0,D.jsxs)("span",{children:["UTF-8 \xB7 ",e.terminalType]})]})]})]})}function Gx({profiles:e,selected:t}){let[s,r]=(0,ne.useState)([]),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)(),[h,l]=(0,ne.useState)(),c=(0,ne.useCallback)(async()=>{try{let u=await Kl();r(u.rules),i(u.statuses)}catch(u){l(je(u))}},[]);(0,ne.useEffect)(()=>{let u=!1,d,m=async()=>{await c(),u||(d=window.setTimeout(()=>{m()},document.visibilityState==="hidden"?15e3:4e3))};return m(),()=>{u=!0,d!==void 0&&window.clearTimeout(d)}},[c]);let f=s.filter(u=>u.profileId===t.id),v=async(u,d)=>{try{await oe(`/forwards/${u}/${d}`,{method:"POST",body:"{}"}),await c()}catch(m){l(je(m))}},g=async u=>{try{await oe(`/forwards/${u}`,{method:"DELETE"}),await c()}catch(d){l(je(d))}};return(0,D.jsxs)("div",{className:"dsh-ssh-forward-pane",children:[(0,D.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,D.jsxs)("div",{children:[(0,D.jsx)("h1",{children:"\u7AEF\u53E3\u8F6C\u53D1"}),(0,D.jsxs)("p",{children:[t.name," \xB7 \u672C\u5730\u3001\u8FDC\u7A0B\u4E0E\u52A8\u6001 SOCKS5"]})]}),(0,D.jsxs)("button",{className:"dsh-ssh-primary-button",onClick:()=>a("new"),children:[(0,D.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u89C4\u5219"]})]}),h&&(0,D.jsx)("p",{className:"dsh-ssh-inline-error",children:h}),(0,D.jsx)("div",{className:"dsh-ssh-forward-list",children:f.length===0?(0,D.jsx)("div",{className:"dsh-ssh-table-empty",children:"\u8FD9\u53F0\u4E3B\u673A\u8FD8\u6CA1\u6709\u7AEF\u53E3\u8F6C\u53D1\u89C4\u5219\u3002"}):f.map(u=>{let d=o.find(m=>m.ruleId===u.id);return(0,D.jsxs)("article",{className:"dsh-ssh-forward-row",children:[(0,D.jsx)("span",{className:`dsh-ssh-forward-kind is-${u.kind}`,children:u.kind==="local"?"L":u.kind==="remote"?"R":"D"}),(0,D.jsxs)("span",{className:"dsh-ssh-forward-copy",children:[(0,D.jsx)("strong",{children:u.name}),(0,D.jsx)("small",{children:ly(u,d)})]}),(0,D.jsx)("span",{className:`dsh-ssh-state-label is-${d?.state??"stopped"}`,children:hy(d)}),(0,D.jsx)("button",{className:"dsh-ssh-icon-button",onClick:()=>a(u),"aria-label":"\u7F16\u8F91",children:(0,D.jsx)(ye.IconEditOutline16,{size:16})}),d?.state==="running"?(0,D.jsx)("button",{className:"dsh-ssh-icon-button",onClick:()=>{v(u.id,"stop")},"aria-label":"\u505C\u6B62",children:(0,D.jsx)(ye.IconStopFill16,{size:16})}):(0,D.jsx)("button",{className:"dsh-ssh-small-primary",onClick:()=>{v(u.id,"start")},children:"\u542F\u52A8"}),(0,D.jsx)("button",{className:"dsh-ssh-icon-button is-danger",onClick:()=>{g(u.id)},"aria-label":"\u5220\u9664",children:(0,D.jsx)(ye.IconTrashOutline16,{size:16})})]},u.id)})}),n!==void 0&&(0,D.jsx)(oy,{profile:t,value:n==="new"?void 0:n,profiles:e,onClose:()=>a(void 0),onSaved:()=>{a(void 0),c()}})]})}function Xx({entries:e,onChanged:t}){let[s,r]=(0,ne.useState)(),[o,i]=(0,ne.useState)(),n=async a=>{if(window.confirm(`\u5220\u9664\u5BC6\u94A5\u5E93\u6761\u76EE\u201C${a.name}\u201D\uFF1F\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002`))try{await oe(`/vault/${a.id}`,{method:"DELETE"}),t()}catch(h){i(je(h))}};return(0,D.jsxs)("div",{className:"dsh-ssh-vault-pane",children:[(0,D.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,D.jsxs)("div",{children:[(0,D.jsx)("h1",{children:"\u5BC6\u94A5\u5E93"}),(0,D.jsx)("p",{children:"\u96C6\u4E2D\u4FDD\u5B58\u5E38\u7528\u8D26\u53F7\uFF0C\u8FDE\u63A5\u914D\u7F6E\u53EA\u5F15\u7528\u51ED\u636E\u3002"})]}),(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>r("new"),children:[(0,D.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u51ED\u636E"]})]}),o&&(0,D.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:o}),e.length===0?(0,D.jsxs)("div",{className:"dsh-ssh-vault-empty",children:[(0,D.jsx)("span",{children:(0,D.jsx)(ye.IconUserOutline16,{size:20})}),(0,D.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u5E38\u7528\u51ED\u636E"}),(0,D.jsx)("p",{children:"\u5BC6\u7801\u548C\u79C1\u94A5\u53EA\u4FDD\u5B58\u5728 DSH \u51ED\u636E\u670D\u52A1\u4E2D\uFF0C\u4E0D\u5199\u5165 SSH \u914D\u7F6E\u6587\u4EF6\u3002"}),(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>r("new"),children:[(0,D.jsx)(ye.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u51ED\u636E"]})]}):(0,D.jsx)("div",{className:"dsh-ssh-vault-list",children:e.map(a=>(0,D.jsxs)("article",{className:"dsh-ssh-vault-row",children:[(0,D.jsx)("span",{className:"dsh-ssh-vault-glyph",children:(0,D.jsx)(ye.IconUserOutline16,{size:16})}),(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:a.name}),(0,D.jsxs)("small",{children:[a.username," \xB7 ",a.authType==="password"?"\u5BC6\u7801":"\u79C1\u94A5"]})]}),(0,D.jsx)("span",{className:`dsh-ssh-vault-state${a.credential.configured?" is-ready":""}`,children:a.credential.configured?"\u53EF\u7528":"\u7F3A\u5C11\u51ED\u636E"}),(0,D.jsxs)("small",{children:[a.references," \u4E2A\u8FDE\u63A5"]}),(0,D.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":`\u7F16\u8F91 ${a.name}`,onClick:()=>r(a),children:(0,D.jsx)(ye.IconEditOutline16,{size:16})}),(0,D.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger",disabled:a.references>0,"aria-label":`\u5220\u9664 ${a.name}`,title:a.references>0?"\u4ECD\u6709\u8FDE\u63A5\u6B63\u5728\u4F7F\u7528":"\u5220\u9664\u51ED\u636E",onClick:()=>{n(a)},children:(0,D.jsx)(ye.IconTrashOutline16,{size:16})})]},a.id))}),s!==void 0&&(0,D.jsx)(Jx,{value:s==="new"?void 0:s,onClose:()=>r(void 0),onSaved:()=>{r(void 0),t()}})]})}function Jx({value:e,onClose:t,onSaved:s}){let[r,o]=(0,ne.useState)({name:e?.name??"",username:e?.username??"",authType:e?.authType??"password",password:"",privateKey:"",passphrase:""}),[i,n]=(0,ne.useState)(!1),[a,h]=(0,ne.useState)(),l=async c=>{c.preventDefault(),n(!0),h(void 0);try{await oe(e===void 0?"/vault":`/vault/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify({entry:{name:r.name,username:r.username,authType:r.authType},secrets:{password:r.password,privateKey:r.privateKey,passphrase:r.passphrase}})}),s()}catch(f){h(je(f))}finally{n(!1)}};return(0,D.jsx)(Ye,{title:e===void 0?"\u65B0\u5EFA\u5E38\u7528\u51ED\u636E":`\u7F16\u8F91 ${e.name}`,subtitle:"\u5BC6\u7801\u548C\u79C1\u94A5\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:t,children:(0,D.jsxs)("form",{className:"dsh-ssh-form",onSubmit:c=>{l(c)},children:[(0,D.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,D.jsx)(le,{label:"\u540D\u79F0",children:(0,D.jsx)("input",{required:!0,maxLength:80,value:r.name,onChange:c=>o({...r,name:c.target.value}),placeholder:"\u751F\u4EA7\u73AF\u5883\u8FD0\u7EF4"})}),(0,D.jsx)(le,{label:"\u7528\u6237\u540D",children:(0,D.jsx)("input",{required:!0,maxLength:128,autoComplete:"username",value:r.username,onChange:c=>o({...r,username:c.target.value})})})]}),(0,D.jsx)(le,{label:"\u8BA4\u8BC1\u65B9\u5F0F",children:(0,D.jsxs)("select",{value:r.authType,onChange:c=>o({...r,authType:c.target.value}),children:[(0,D.jsx)("option",{value:"password",children:"\u5BC6\u7801"}),(0,D.jsx)("option",{value:"private-key",children:"\u79C1\u94A5"})]})}),r.authType==="password"?(0,D.jsx)(le,{label:"\u5BC6\u7801",hint:e?.credential.fields.includes("password")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u5FC5\u586B\uFF0C\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,D.jsx)(wl,{required:e===void 0||!e.credential.fields.includes("password"),autoComplete:"new-password",value:r.password,onChange:c=>o({...r,password:c.target.value})})}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(le,{label:"\u79C1\u94A5",hint:e?.credential.fields.includes("privateKey")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u7C98\u8D34 OpenSSH \u6216 PEM \u79C1\u94A5",children:(0,D.jsx)("textarea",{required:e===void 0||!e.credential.fields.includes("privateKey"),rows:7,spellCheck:!1,value:r.privateKey,onChange:c=>o({...r,privateKey:c.target.value})})}),(0,D.jsx)(le,{label:"\u79C1\u94A5\u53E3\u4EE4",children:(0,D.jsx)(wl,{autoComplete:"new-password",value:r.passphrase,onChange:c=>o({...r,passphrase:c.target.value})})})]}),a&&(0,D.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,D.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,D.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,D.jsx)("button",{className:"dsh-ssh-primary-button",disabled:i,children:i?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u51ED\u636E"})]})]})})}function Yx({entries:e,onChanged:t}){let[s,r]=(0,ne.useState)(),[o,i]=(0,ne.useState)(),n=async a=>{if(window.confirm(`\u5220\u9664\u4EE3\u7406\u201C${a.name}\u201D\uFF1F\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002`))try{await oe(`/proxies/${a.id}`,{method:"DELETE"}),t()}catch(h){i(je(h))}};return(0,D.jsxs)("div",{className:"dsh-ssh-proxy-pane",children:[(0,D.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,D.jsxs)("div",{children:[(0,D.jsx)("h1",{children:"\u4EE3\u7406\u5E93"}),(0,D.jsx)("p",{children:"\u96C6\u4E2D\u4FDD\u5B58\u5E38\u7528 HTTP \u4E0E SOCKS5 \u4EE3\u7406\uFF0C\u4E3B\u673A\u914D\u7F6E\u53EA\u4FDD\u7559\u5F15\u7528\u3002"})]}),(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>r("new"),children:[(0,D.jsx)(ye.IconPlusOutline16,{size:16}),"\u65B0\u5EFA\u4EE3\u7406"]})]}),o&&(0,D.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:o}),e.length===0?(0,D.jsxs)("div",{className:"dsh-ssh-vault-empty",children:[(0,D.jsx)("span",{children:(0,D.jsx)(ye.IconDataOutline16,{size:20})}),(0,D.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u5E38\u7528\u4EE3\u7406"}),(0,D.jsx)("p",{children:"\u4FDD\u5B58\u4E00\u6B21\u540E\uFF0C\u591A\u53F0 SSH \u4E3B\u673A\u53EF\u4EE5\u5171\u7528\u540C\u4E00\u6761\u8FDE\u63A5\u8DEF\u5F84\u3002"}),(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>r("new"),children:[(0,D.jsx)(ye.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u4EE3\u7406"]})]}):(0,D.jsx)("div",{className:"dsh-ssh-proxy-list",children:e.map(a=>(0,D.jsxs)("article",{className:"dsh-ssh-proxy-row",children:[(0,D.jsx)("span",{className:"dsh-ssh-vault-glyph",children:(0,D.jsx)(ye.IconDataOutline16,{size:16})}),(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:a.name}),(0,D.jsxs)("small",{children:[a.host,":",a.port,a.username?` \xB7 ${a.username}`:""]})]}),(0,D.jsx)("span",{className:"dsh-ssh-proxy-kind",children:a.proxyType==="http"?"HTTP":"SOCKS5"}),(0,D.jsxs)("small",{children:[a.references," \u4E2A\u8FDE\u63A5"]}),(0,D.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":`\u7F16\u8F91 ${a.name}`,onClick:()=>r(a),children:(0,D.jsx)(ye.IconEditOutline16,{size:16})}),(0,D.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger",disabled:a.references>0,"aria-label":`\u5220\u9664 ${a.name}`,title:a.references>0?"\u4ECD\u6709\u8FDE\u63A5\u6B63\u5728\u4F7F\u7528":"\u5220\u9664\u4EE3\u7406",onClick:()=>{n(a)},children:(0,D.jsx)(ye.IconTrashOutline16,{size:16})})]},a.id))}),s!==void 0&&(0,D.jsx)(Qx,{value:s==="new"?void 0:s,onClose:()=>r(void 0),onSaved:()=>{r(void 0),t()}})]})}function Qx({value:e,onClose:t,onSaved:s}){let[r,o]=(0,ne.useState)({name:e?.name??"",proxyType:e?.proxyType??"socks5",host:e?.host??"",port:String(e?.port??1080),username:e?.username??"",password:""}),[i,n]=(0,ne.useState)(!1),[a,h]=(0,ne.useState)(),l=async c=>{c.preventDefault(),n(!0),h(void 0);try{await oe(e===void 0?"/proxies":`/proxies/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify({entry:{name:r.name,proxyType:r.proxyType,host:r.host,port:Number(r.port),...r.username.trim()?{username:r.username.trim()}:{}},secrets:{proxyPassword:r.password}})}),s()}catch(f){h(je(f))}finally{n(!1)}};return(0,D.jsx)(Ye,{title:e===void 0?"\u65B0\u5EFA\u5E38\u7528\u4EE3\u7406":`\u7F16\u8F91 ${e.name}`,subtitle:"\u4EE3\u7406\u5BC6\u7801\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:t,children:(0,D.jsxs)("form",{className:"dsh-ssh-form",onSubmit:c=>{l(c)},children:[(0,D.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,D.jsx)(le,{label:"\u540D\u79F0",children:(0,D.jsx)("input",{required:!0,maxLength:80,value:r.name,onChange:c=>o({...r,name:c.target.value}),placeholder:"\u529E\u516C\u5BA4 SOCKS5"})}),(0,D.jsx)(le,{label:"\u4EE3\u7406\u7C7B\u578B",children:(0,D.jsxs)("select",{value:r.proxyType,onChange:c=>o({...r,proxyType:c.target.value}),children:[(0,D.jsx)("option",{value:"socks5",children:"SOCKS5"}),(0,D.jsx)("option",{value:"http",children:"HTTP CONNECT"})]})})]}),(0,D.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,D.jsx)(le,{label:"\u4EE3\u7406\u4E3B\u673A",children:(0,D.jsx)("input",{required:!0,maxLength:253,value:r.host,onChange:c=>o({...r,host:c.target.value}),placeholder:"127.0.0.1"})}),(0,D.jsx)(le,{label:"\u4EE3\u7406\u7AEF\u53E3",children:(0,D.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:r.port,onChange:c=>o({...r,port:c.target.value})})})]}),(0,D.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,D.jsx)(le,{label:"\u4EE3\u7406\u7528\u6237\u540D",children:(0,D.jsx)("input",{maxLength:128,value:r.username,onChange:c=>o({...r,username:c.target.value}),autoComplete:"username"})}),(0,D.jsx)(le,{label:"\u4EE3\u7406\u5BC6\u7801",hint:e?.credential.fields.includes("proxyPassword")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u53EF\u9009\uFF0C\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,D.jsx)("input",{type:"password",autoComplete:"new-password",value:r.password,onChange:c=>o({...r,password:c.target.value})})})]}),a&&(0,D.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,D.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,D.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,D.jsx)("button",{className:"dsh-ssh-primary-button",disabled:i,children:i?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u4EE3\u7406"})]})]})})}function Zx(){let[e,t]=(0,ne.useState)(),[s,r]=(0,ne.useState)(),[o,i]=(0,ne.useState)(""),[n,a]=(0,ne.useState)(""),[h,l]=(0,ne.useState)(!1),[c,f]=(0,ne.useState)(),[v,g]=(0,ne.useState)(),[u,d]=(0,ne.useState)(),[m,p]=(0,ne.useState)();(0,ne.useEffect)(()=>{Promise.all([oe("/settings"),oe("/gist-sync")]).then(([C,P])=>{t(C),r(P)}).catch(C=>p(je(C)))},[]),(0,ne.useEffect)(()=>{if(c===void 0)return;let C=!1,P,T=async()=>{try{let A=await oe("/gist-sync/oauth/poll",{method:"POST",body:JSON.stringify({id:c.id})});if(C)return;if(A.state==="complete"){f(void 0),r(await oe("/gist-sync")),d(`GitHub \u5DF2\u8FDE\u63A5 \xB7 ${A.login}`);return}P=setTimeout(()=>{T()},Math.max(1e3,A.retryAfterMs))}catch(A){if(C)return;f(void 0),p(je(A))}};return P=setTimeout(()=>{T()},Math.max(1e3,c.retryAfterMs)),()=>{C=!0,P!==void 0&&clearTimeout(P)}},[c?.id]);let b=async C=>{try{t(await oe("/settings",{method:"PUT",body:JSON.stringify(C)}))}catch(P){p(je(P))}},x=async()=>{if(e!==void 0){g("network"),p(void 0),d(void 0);try{let C=await oe("/settings",{method:"PUT",body:JSON.stringify(e)});t(C);let P=await oe("/gist-sync/network/test",{method:"POST"});d(`GitHub \u7F51\u7EDC\u8FDE\u63A5\u6210\u529F \xB7 ${P.route==="proxy"?"\u901A\u8FC7\u4EE3\u7406":"\u76F4\u8FDE"}`)}catch(C){p(je(C))}finally{g(void 0)}}},y=async()=>{if(s===void 0)throw new Error("Gist \u540C\u6B65\u8BBE\u7F6E\u5C1A\u672A\u52A0\u8F7D");let C=await oe("/gist-sync",{method:"PUT",body:JSON.stringify({settings:{autoSync:s.autoSync,strategy:s.strategy,backupRetention:s.backupRetention,gistId:s.gistId??"",oauthClientId:s.oauthClientId??""},...o.trim()?{token:o.trim()}:{},...n?{encryptionPassphrase:n}:{}})});return r(C),i(""),a(""),C},S=async C=>{if(s!==void 0){g(C),p(void 0),d(void 0);try{let P=await y();if(C==="save")return d("Gist \u540C\u6B65\u8BBE\u7F6E\u5DF2\u4FDD\u5B58"),P;if(C==="test"){let A=await oe("/gist-sync/test",{method:"POST"});return d(`\u8FDE\u63A5\u6210\u529F \xB7 ${A.login}`),r(await oe("/gist-sync")),P}let T=await oe("/gist-sync/run",{method:"POST"});return r(T),d(ny(T.lastResult)),T}catch(P){p(je(P));return}finally{g(void 0)}}},_=async()=>{g("oauth"),p(void 0),d(void 0);try{await y();let C=await oe("/gist-sync/oauth/start",{method:"POST"});f(C),d("\u8BBE\u5907\u4EE3\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u5728\u6388\u6743\u7A97\u53E3\u4E2D\u590D\u5236\u540E\u524D\u5F80 GitHub")}catch(C){p(je(C))}finally{g(void 0)}},w=async()=>{g("disconnect"),p(void 0),d(void 0),f(void 0);try{r(await oe("/gist-sync/oauth/disconnect",{method:"POST"})),d("GitHub \u8D26\u53F7\u5DF2\u65AD\u5F00\uFF0C\u540C\u6B65\u52A0\u5BC6\u5BC6\u7801\u4ECD\u4FDD\u7559\u5728\u672C\u673A")}catch(C){p(je(C))}finally{g(void 0)}};return(0,D.jsxs)("div",{className:"dsh-ssh-settings-pane",children:[(0,D.jsx)("div",{className:"dsh-ssh-content-heading",children:(0,D.jsxs)("div",{children:[(0,D.jsx)("h1",{children:"SSH \u8BBE\u7F6E"}),(0,D.jsx)("p",{children:"\u5B89\u5168\u8FB9\u754C\u3001\u547D\u4EE4\u9650\u5236\u4E0E\u8DE8\u8BBE\u5907\u914D\u7F6E\u540C\u6B65"})]})}),(0,D.jsxs)("div",{className:"dsh-ssh-settings-stack",children:[s&&(0,D.jsxs)("section",{className:"dsh-ssh-settings-section","aria-labelledby":"dsh-ssh-gist-title",children:[(0,D.jsxs)("div",{className:"dsh-ssh-settings-section-heading",children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{id:"dsh-ssh-gist-title",children:"GitHub Gist \u540C\u6B65"}),(0,D.jsx)("small",{children:"\u4E3B\u673A\u3001FTP/FTPS\u3001\u9879\u76EE\u76EE\u5F55\u3001\u4EE3\u7406\u4E0E\u5BC6\u94A5\u5E93\u7AEF\u5230\u7AEF\u52A0\u5BC6\u540C\u6B65"})]}),(0,D.jsx)(iy,{view:s})]}),(0,D.jsxs)("div",{className:"dsh-ssh-github-auth",children:[(0,D.jsx)("span",{className:"dsh-ssh-github-mark","aria-hidden":"true",children:"GH"}),(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:s.tokenConfigured?`\u5DF2\u8FDE\u63A5 ${s.githubLogin??"GitHub"}`:"\u8FDE\u63A5 GitHub"}),(0,D.jsx)("small",{children:s.tokenConfigured?"\u6388\u6743\u51ED\u636E\u5B89\u5168\u4FDD\u5B58\u5728\u5F53\u524D DSH":"\u901A\u8FC7 GitHub \u8BBE\u5907\u6388\u6743\u83B7\u53D6 Gist \u8BBF\u95EE\u6743\u9650"})]}),(0,D.jsxs)("span",{className:"dsh-ssh-github-auth-actions",children:[(0,D.jsx)("button",{type:"button",className:s.tokenConfigured?"dsh-ssh-secondary-button":"dsh-ssh-primary-button",disabled:v!==void 0||!s.oauthClientId,onClick:()=>{_()},children:v==="oauth"?"\u8FDE\u63A5\u4E2D\u2026":s.tokenConfigured?"\u91CD\u65B0\u8FDE\u63A5":"\u8FDE\u63A5 GitHub"}),s.tokenConfigured&&(0,D.jsx)("button",{type:"button",className:"dsh-ssh-text-button",disabled:v!==void 0,onClick:()=>{w()},children:v==="disconnect"?"\u65AD\u5F00\u4E2D\u2026":"\u65AD\u5F00"})]})]}),!s.oauthClientId&&(0,D.jsx)("p",{className:"dsh-ssh-auth-hint",children:"\u9996\u6B21\u4F7F\u7528\u9700\u5728\u4E0B\u65B9\u201C\u9AD8\u7EA7\u6388\u6743\u8BBE\u7F6E\u201D\u4E2D\u586B\u5199 GitHub OAuth Client ID\u3002\u5B83\u4E0D\u662F\u5BC6\u94A5\uFF0C\u53EA\u7528\u4E8E\u6807\u8BC6\u6388\u6743\u5E94\u7528\u3002"}),(0,D.jsxs)("div",{className:"dsh-ssh-gist-fields is-two",children:[(0,D.jsx)(le,{label:"Gist ID",hint:"\u7559\u7A7A\u540E\u9996\u6B21\u540C\u6B65\u4F1A\u81EA\u52A8\u521B\u5EFA\u79C1\u6709 Gist",children:(0,D.jsx)("input",{maxLength:64,spellCheck:!1,value:s.gistId??"",onChange:C=>r(ty(s,C.target.value)),placeholder:"\u81EA\u52A8\u521B\u5EFA"})}),(0,D.jsx)(le,{label:"\u540C\u6B65\u52A0\u5BC6\u5BC6\u7801",hint:s.encryptionConfigured?"\u5DF2\u5B89\u5168\u4FDD\u5B58\uFF1B\u65B0\u8BBE\u5907\u9700\u8F93\u5165\u76F8\u540C\u5BC6\u7801":"\u81F3\u5C11 6 \u4E2A\u5B57\u7B26\uFF0C\u5EFA\u8BAE\u4F7F\u7528\u66F4\u957F\u5BC6\u7801",children:(0,D.jsx)("input",{type:"password",minLength:6,maxLength:512,autoComplete:"new-password",value:n,onChange:C=>a(C.target.value),placeholder:s.encryptionConfigured?"\u5DF2\u914D\u7F6E":"\u8BBE\u7F6E\u72EC\u7ACB\u52A0\u5BC6\u5BC6\u7801"})})]}),(0,D.jsxs)("div",{className:"dsh-ssh-sync-meta","aria-label":"\u540C\u6B65\u7248\u672C\u4FE1\u606F",children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("small",{children:"\u4E91\u7AEF\u7248\u672C"}),(0,D.jsx)("strong",{title:s.cloudVersion,children:s.cloudVersion?s.cloudVersion.slice(0,10):"\u5C1A\u672A\u8BFB\u53D6"})]}),(0,D.jsxs)("span",{children:[(0,D.jsx)("small",{children:"\u4E0A\u6B21\u540C\u6B65"}),(0,D.jsx)("strong",{children:s.lastSyncAt?uf(s.lastSyncAt):"\u5C1A\u672A\u540C\u6B65"})]})]}),(0,D.jsxs)("fieldset",{className:"dsh-ssh-sync-strategy",children:[(0,D.jsx)("legend",{children:"\u540C\u6B65\u7B56\u7565"}),(0,D.jsxs)("div",{role:"group","aria-label":"Gist \u540C\u6B65\u7B56\u7565",children:[(0,D.jsx)(Fl,{active:s.strategy==="smart",title:"\u667A\u80FD",description:"\u81EA\u52A8\u5224\u65AD\u4E24\u7AEF\u53D8\u5316\u5E76\u6309\u6761\u76EE\u5408\u5E76",onClick:()=>r({...s,strategy:"smart"})}),(0,D.jsx)(Fl,{active:s.strategy==="local-first",title:"\u672C\u5730\u4F18\u5148",description:"\u53CC\u65B9\u540C\u65F6\u4FEE\u6539\u65F6\u4FDD\u7559\u672C\u673A\u914D\u7F6E",onClick:()=>r({...s,strategy:"local-first"})}),(0,D.jsx)(Fl,{active:s.strategy==="cloud-first",title:"\u4E91\u7AEF\u4F18\u5148",description:"\u53CC\u65B9\u540C\u65F6\u4FEE\u6539\u65F6\u91C7\u7528 Gist \u914D\u7F6E",onClick:()=>r({...s,strategy:"cloud-first"})})]})]}),(0,D.jsxs)("div",{className:"dsh-ssh-sync-options",children:[(0,D.jsxs)("label",{className:"dsh-ssh-switch-row",children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"\u81EA\u52A8\u540C\u6B65"}),(0,D.jsx)("small",{children:"\u542F\u52A8\u540E\u3001\u914D\u7F6E\u53D8\u5316\u540E\u548C\u540E\u53F0\u6BCF\u4E94\u5206\u949F\u68C0\u67E5\u4E00\u6B21"})]}),(0,D.jsx)("input",{type:"checkbox",checked:s.autoSync,onChange:C=>r({...s,autoSync:C.target.checked})})]}),(0,D.jsxs)("label",{className:"dsh-ssh-number-row",children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"\u5907\u4EFD\u4FDD\u7559\u6570\u91CF"}),(0,D.jsx)("small",{children:"\u4E3B Gist \u5185\u4FDD\u7559\u7684\u663E\u5F0F\u5386\u53F2\u5FEB\u7167\uFF1BGitHub \u81EA\u8EAB\u4FEE\u8BA2\u5386\u53F2\u4E0D\u53D7\u5F71\u54CD"})]}),(0,D.jsx)("input",{type:"number",min:"0",max:"50",step:"1",value:s.backupRetention,onChange:C=>r({...s,backupRetention:Number(C.target.value)})}),(0,D.jsx)("em",{children:"\u4EFD"})]})]}),(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-advanced-toggle","aria-expanded":h,onClick:()=>l(C=>!C),children:[(0,D.jsx)("span",{children:"\u9AD8\u7EA7\u6388\u6743\u8BBE\u7F6E"}),(0,D.jsx)(ye.IconChevronDownOutline14,{})]}),h&&(0,D.jsxs)("div",{className:"dsh-ssh-advanced-auth",children:[(0,D.jsx)(le,{label:"GitHub OAuth Client ID",hint:"\u5728 GitHub OAuth App \u4E2D\u542F\u7528 Device Flow\uFF1B\u4E0D\u9700\u8981 Client Secret",children:(0,D.jsx)("input",{maxLength:128,spellCheck:!1,value:s.oauthClientId??"",onChange:C=>r(sy(s,C.target.value)),placeholder:"Ov23li\u2026"})}),(0,D.jsx)(le,{label:"Personal Access Token\uFF08\u5907\u7528\uFF09",hint:s.tokenConfigured?"\u5DF2\u6709\u6388\u6743\uFF1B\u586B\u5199\u540E\u4F1A\u66FF\u6362\u5F53\u524D\u6388\u6743":"\u4EC5\u5728\u65E0\u6CD5\u4F7F\u7528 OAuth \u65F6\u586B\u5199\uFF0C\u9700\u8981 gist \u6743\u9650",children:(0,D.jsx)("input",{type:"password",autoComplete:"new-password",spellCheck:!1,value:o,onChange:C=>i(C.target.value),placeholder:"ghp_\u2026 / github_pat_\u2026"})}),(0,D.jsxs)("p",{children:["\u6CA1\u6709 OAuth App\uFF1F",(0,D.jsx)("a",{href:"https://github.com/settings/applications/new",target:"_blank",rel:"noreferrer",children:"\u524D\u5F80 GitHub \u521B\u5EFA"}),"\uFF0C\u521B\u5EFA\u540E\u5728\u5E94\u7528\u8BBE\u7F6E\u4E2D\u542F\u7528 Device Flow\u3002"]})]}),(0,D.jsxs)("p",{className:"dsh-ssh-sync-scope",children:[(0,D.jsx)("strong",{children:"\u540C\u6B65\u5185\u5BB9\uFF1A"}),"\u4E3B\u673A\u3001FTP/FTPS\u3001\u56FA\u5B9A\u9879\u76EE\u76EE\u5F55\u3001\u4EE3\u7406\u5E93\u3001\u5BC6\u94A5\u5E93\uFF0C\u4EE5\u53CA\u5176\u4E2D\u7684\u5BC6\u7801\u548C\u79C1\u94A5\u3002\u654F\u611F\u5B57\u6BB5\u4E0A\u4F20\u524D\u4F1A\u52A0\u5BC6\u3002",(0,D.jsx)("br",{}),(0,D.jsx)("strong",{children:"\u4EC5\u4FDD\u7559\u672C\u673A\uFF1A"}),"\u5F53\u524D\u4F1A\u8BDD\u6388\u6743\u3001\u7AEF\u53E3\u8F6C\u53D1\u3001\u516C\u5F00\u7ED1\u5B9A\u4E0E\u547D\u4EE4\u9650\u5236\u3002GitHub Token \u548C\u540C\u6B65\u52A0\u5BC6\u5BC6\u7801\u4E5F\u59CB\u7EC8\u53EA\u4FDD\u5B58\u5728\u672C\u673A DSH \u51ED\u636E\u670D\u52A1\u3002"]}),s.lastError&&(0,D.jsxs)("p",{className:"dsh-ssh-inline-error",role:"alert",children:["\u4E0A\u6B21\u540C\u6B65\u5931\u8D25\uFF1A",s.lastError]}),(0,D.jsxs)("div",{className:"dsh-ssh-settings-actions",children:[s.gistUrl&&(0,D.jsx)("a",{className:"dsh-ssh-secondary-button",href:s.gistUrl,target:"_blank",rel:"noreferrer",children:"\u6253\u5F00 Gist"}),(0,D.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:v!==void 0,onClick:()=>{S("test")},children:v==="test"?"\u6D4B\u8BD5\u4E2D\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,D.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:v!==void 0,onClick:()=>{S("sync")},children:v==="sync"?"\u540C\u6B65\u4E2D\u2026":"\u7ACB\u5373\u540C\u6B65"}),(0,D.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:v!==void 0,onClick:()=>{S("save")},children:v==="save"?"\u4FDD\u5B58\u4E2D\u2026":"\u4FDD\u5B58\u540C\u6B65\u8BBE\u7F6E"})]})]}),e&&(0,D.jsxs)("section",{className:"dsh-ssh-settings-section","aria-labelledby":"dsh-ssh-local-title",children:[(0,D.jsx)("div",{className:"dsh-ssh-settings-section-heading",children:(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{id:"dsh-ssh-local-title",children:"\u672C\u673A\u8FD0\u884C\u8BBE\u7F6E"}),(0,D.jsx)("small",{children:"\u53EA\u5F71\u54CD\u5F53\u524D DSH\uFF0C\u4E0D\u53C2\u4E0E Gist \u540C\u6B65"})]})}),(0,D.jsxs)("div",{className:"dsh-ssh-settings-group",children:[(0,D.jsx)(le,{label:"GitHub \u51FA\u7AD9\u4EE3\u7406",hint:"\u4EC5\u7528\u4E8E OAuth \u4E0E Gist API\uFF1B\u4F8B\u5982 http://host.docker.internal:7893\uFF0C\u7559\u7A7A\u65F6\u4F7F\u7528\u7CFB\u7EDF HTTPS_PROXY",children:(0,D.jsxs)("div",{className:"dsh-ssh-github-proxy-control",children:[(0,D.jsx)("input",{maxLength:2048,spellCheck:!1,value:e.githubProxy??"",onChange:C=>t(ry(e,C.target.value)),placeholder:"\u76F4\u8FDE GitHub"}),(0,D.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:v!==void 0,onClick:()=>{x()},children:v==="network"?"\u6D4B\u8BD5\u4E2D\u2026":"\u6D4B\u8BD5 GitHub \u7F51\u7EDC"})]})}),(0,D.jsxs)("label",{className:"dsh-ssh-switch-row",children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"\u5141\u8BB8\u516C\u5F00\u7AEF\u53E3\u7ED1\u5B9A"}),(0,D.jsx)("small",{children:"\u5141\u8BB8\u8F6C\u53D1\u76D1\u542C 0.0.0.0 \u6216\u5176\u4ED6\u975E\u56DE\u73AF\u5730\u5740\u3002\u4EC5\u5728\u660E\u786E\u914D\u7F6E\u9632\u706B\u5899\u540E\u5F00\u542F\u3002"})]}),(0,D.jsx)("input",{type:"checkbox",checked:e.allowPublicBind,onChange:C=>{b({...e,allowPublicBind:C.target.checked})}})]}),(0,D.jsxs)("label",{className:"dsh-ssh-number-row",children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"\u9ED8\u8BA4\u547D\u4EE4\u8D85\u65F6"}),(0,D.jsx)("small",{children:"AI \u7684 ssh_exec \u6700\u957F\u7B49\u5F85\u65F6\u95F4"})]}),(0,D.jsx)("input",{type:"number",min:"1000",max:"300000",step:"1000",value:e.defaultCommandTimeoutMs,onChange:C=>t({...e,defaultCommandTimeoutMs:Number(C.target.value)}),onBlur:()=>{b(e)}}),(0,D.jsx)("em",{children:"\u6BEB\u79D2"})]}),(0,D.jsxs)("label",{className:"dsh-ssh-number-row",children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"\u6700\u5927\u547D\u4EE4\u8F93\u51FA"}),(0,D.jsx)("small",{children:"\u8D85\u51FA\u540E\u4FDD\u7559\u6700\u65B0\u8F93\u51FA\uFF0C\u907F\u514D\u6324\u5360\u4E0A\u4E0B\u6587"})]}),(0,D.jsx)("input",{type:"number",min:"1000",max:"1000000",step:"1000",value:e.maxOutputChars,onChange:C=>t({...e,maxOutputChars:Number(C.target.value)}),onBlur:()=>{b(e)}}),(0,D.jsx)("em",{children:"\u5B57\u7B26"})]})]})]})]}),c&&(0,D.jsx)(ey,{flow:c,onClose:()=>f(void 0)}),u&&(0,D.jsx)("p",{className:"dsh-ssh-inline-success",role:"status",children:u}),m&&(0,D.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:m})]})}function ey({flow:e,onClose:t}){let[s,r]=(0,ne.useState)("idle"),o=async()=>{try{await navigator.clipboard.writeText(e.userCode),r("copied")}catch{r("failed")}};return(0,D.jsx)(Ye,{title:"\u8FDE\u63A5 GitHub",subtitle:"\u590D\u5236\u8BBE\u5907\u4EE3\u7801\uFF0C\u518D\u524D\u5F80 GitHub \u5B8C\u6210\u672C\u6B21\u6388\u6743",className:"dsh-ssh-device-auth-dialog",onClose:t,children:(0,D.jsxs)("div",{className:"dsh-ssh-device-auth-content",children:[(0,D.jsxs)("div",{className:"dsh-ssh-device-code-block",children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("small",{children:"\u4E00\u6B21\u6027\u8BBE\u5907\u4EE3\u7801"}),(0,D.jsx)("code",{children:e.userCode})]}),(0,D.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>{o()},children:s==="copied"?"\u5DF2\u590D\u5236":"\u590D\u5236\u4EE3\u7801"})]}),(0,D.jsxs)("ol",{className:"dsh-ssh-device-auth-steps",children:[(0,D.jsxs)("li",{children:[(0,D.jsx)("span",{children:"1"}),(0,D.jsxs)("p",{children:[(0,D.jsx)("strong",{children:"\u590D\u5236\u4E0A\u65B9\u4EE3\u7801"}),(0,D.jsx)("small",{children:"\u8BBE\u5907\u4EE3\u7801\u53EA\u7528\u4E8E\u8FD9\u4E00\u6B21\u6388\u6743"})]})]}),(0,D.jsxs)("li",{children:[(0,D.jsx)("span",{children:"2"}),(0,D.jsxs)("p",{children:[(0,D.jsx)("strong",{children:"\u6253\u5F00 GitHub \u6388\u6743\u9875"}),(0,D.jsx)("small",{children:"\u7C98\u8D34\u4EE3\u7801\u5E76\u786E\u8BA4\u6388\u6743\u7ED9\u5F53\u524D OAuth App"})]})]}),(0,D.jsxs)("li",{children:[(0,D.jsx)("span",{children:"3"}),(0,D.jsxs)("p",{children:[(0,D.jsx)("strong",{children:"\u8FD4\u56DE DSH"}),(0,D.jsx)("small",{children:"\u6388\u6743\u6210\u529F\u540E\u4F1A\u81EA\u52A8\u5B8C\u6210\u8FDE\u63A5"})]})]})]}),s==="failed"&&(0,D.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:"\u6D4F\u89C8\u5668\u672A\u5141\u8BB8\u81EA\u52A8\u590D\u5236\uFF0C\u8BF7\u9009\u4E2D\u8BBE\u5907\u4EE3\u7801\u624B\u52A8\u590D\u5236\u3002"}),(0,D.jsxs)("p",{className:"dsh-ssh-device-auth-expiry",children:["\u4EE3\u7801\u5C06\u5728 ",new Date(e.expiresAt).toLocaleTimeString()," \u5931\u6548"]}),(0,D.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,D.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u7A0D\u540E\u518D\u8BF4"}),(0,D.jsx)("a",{className:"dsh-ssh-primary-button",href:e.verificationUri,target:"_blank",rel:"noreferrer",children:"\u524D\u5F80 GitHub \u6388\u6743"})]})]})})}function Fl({active:e,title:t,description:s,onClick:r}){return(0,D.jsxs)("button",{type:"button",className:e?"is-active":"","aria-pressed":e,onClick:r,children:[(0,D.jsx)("strong",{children:t}),(0,D.jsx)("small",{children:s})]})}function ty(e,t){let s=t.trim();if(s)return{...e,gistId:s};let{gistId:r,gistUrl:o,...i}=e;return i}function sy(e,t){let s=t.trim();if(s)return{...e,oauthClientId:s,oauthAvailable:!0};let{oauthClientId:r,...o}=e;return{...o,oauthAvailable:!1}}function ry(e,t){if(t!=="")return{...e,githubProxy:t};let{githubProxy:s,...r}=e;return r}function iy({view:e}){let t=e.tokenConfigured&&e.encryptionConfigured,s=e.running?"\u540C\u6B65\u4E2D":e.lastError?"\u9700\u8981\u5904\u7406":e.lastSyncAt===void 0?t?"\u7B49\u5F85\u9996\u6B21\u540C\u6B65":"\u5C1A\u672A\u914D\u7F6E":`\u4E0A\u6B21\u540C\u6B65 ${uf(e.lastSyncAt)}`;return(0,D.jsxs)("span",{className:`dsh-ssh-sync-status${e.running?" is-running":e.lastError?" is-error":t?" is-ready":""}`,role:"status",children:[(0,D.jsx)("i",{"aria-hidden":"true"}),s]})}function ny(e){return e==="uploaded"?"\u672C\u5730\u914D\u7F6E\u5DF2\u4E0A\u4F20":e==="downloaded"?"\u4E91\u7AEF\u914D\u7F6E\u5DF2\u5E94\u7528":e==="merged"?"\u4E24\u7AEF\u914D\u7F6E\u5DF2\u667A\u80FD\u5408\u5E76":"\u914D\u7F6E\u5DF2\u7ECF\u662F\u6700\u65B0\u72B6\u6001"}function uf(e){let t=Math.max(0,Date.now()-e);return t<6e4?"\u521A\u521A":t<36e5?`${Math.floor(t/6e4)} \u5206\u949F\u524D`:t<864e5?`${Math.floor(t/36e5)} \u5C0F\u65F6\u524D`:new Date(e).toLocaleString()}function oy({profile:e,value:t,onClose:s,onSaved:r}){let[o,i]=(0,ne.useState)({name:t?.name??"",kind:t?.kind??"local",bindHost:t?.bindHost??"127.0.0.1",bindPort:String(t?.bindPort??0),targetHost:t?.targetHost??"127.0.0.1",targetPort:String(t?.targetPort??80),autoStart:t?.autoStart??!1}),[n,a]=(0,ne.useState)(),h=async l=>{l.preventDefault();try{await oe(t===void 0?"/forwards":`/forwards/${t.id}`,{method:t===void 0?"POST":"PUT",body:JSON.stringify({rule:{profileId:e.id,name:o.name,kind:o.kind,bindHost:o.bindHost,bindPort:Number(o.bindPort),...o.kind==="dynamic"?{}:{targetHost:o.targetHost,targetPort:Number(o.targetPort)},autoStart:o.autoStart}})}),r()}catch(c){a(je(c))}};return(0,D.jsx)(Ye,{title:t===void 0?"\u65B0\u5EFA\u7AEF\u53E3\u8F6C\u53D1":`\u7F16\u8F91 ${t.name}`,subtitle:e.name,onClose:s,children:(0,D.jsxs)("form",{className:"dsh-ssh-form",onSubmit:l=>{h(l)},children:[(0,D.jsx)(le,{label:"\u540D\u79F0",children:(0,D.jsx)("input",{required:!0,value:o.name,onChange:l=>i({...o,name:l.target.value})})}),(0,D.jsx)(le,{label:"\u7C7B\u578B",children:(0,D.jsxs)("select",{value:o.kind,onChange:l=>i({...o,kind:l.target.value}),children:[(0,D.jsx)("option",{value:"local",children:"\u672C\u5730\u8F6C\u53D1\uFF08L\uFF09"}),(0,D.jsx)("option",{value:"remote",children:"\u8FDC\u7A0B\u8F6C\u53D1\uFF08R\uFF09"}),(0,D.jsx)("option",{value:"dynamic",children:"\u52A8\u6001 SOCKS5\uFF08D\uFF09"})]})}),(0,D.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,D.jsx)(le,{label:"\u76D1\u542C\u5730\u5740",children:(0,D.jsx)("input",{required:!0,value:o.bindHost,onChange:l=>i({...o,bindHost:l.target.value})})}),(0,D.jsx)(le,{label:"\u76D1\u542C\u7AEF\u53E3",hint:"0 \u8868\u793A\u81EA\u52A8\u9009\u62E9",children:(0,D.jsx)("input",{required:!0,type:"number",min:"0",max:"65535",value:o.bindPort,onChange:l=>i({...o,bindPort:l.target.value})})})]}),o.kind!=="dynamic"&&(0,D.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,D.jsx)(le,{label:"\u76EE\u6807\u4E3B\u673A",children:(0,D.jsx)("input",{required:!0,value:o.targetHost,onChange:l=>i({...o,targetHost:l.target.value})})}),(0,D.jsx)(le,{label:"\u76EE\u6807\u7AEF\u53E3",children:(0,D.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:o.targetPort,onChange:l=>i({...o,targetPort:l.target.value})})})]}),(0,D.jsxs)("label",{className:"dsh-ssh-switch-row",children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"\u81EA\u52A8\u542F\u52A8"}),(0,D.jsx)("small",{children:"DSH \u542F\u52A8\u65F6\u6062\u590D\u6B64\u8F6C\u53D1"})]}),(0,D.jsx)("input",{type:"checkbox",checked:o.autoStart,onChange:l=>i({...o,autoStart:l.target.checked})})]}),n&&(0,D.jsx)("p",{className:"dsh-ssh-inline-error",children:n}),(0,D.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,D.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:s,children:"\u53D6\u6D88"}),(0,D.jsx)("button",{className:"dsh-ssh-primary-button",children:"\u4FDD\u5B58\u89C4\u5219"})]})]})})}function pf(e){return e.proxy.type==="none"?"\u76F4\u8FDE":e.proxy.type==="saved"?"\u5E38\u7528\u4EE3\u7406":e.proxy.type==="jump"?"SSH \u8DF3\u677F":e.proxy.type==="http"?"HTTP \u4EE3\u7406":"SOCKS5 \u4EE3\u7406"}var je=De;function ay(e){if(!(!(e instanceof MessageEvent)||typeof e.data!="string"))try{let t=JSON.parse(e.data);return t.type!=="terminal-opened"||typeof t.sessionId!="string"||typeof t.terminalId!="string"||typeof t.profileId!="string"||typeof t.createdAt!="number"?void 0:t}catch{return}}function ly(e,t){let s=`${e.bindHost}:${t?.bindPort??e.bindPort}`;return e.kind==="dynamic"?`${s} \u2192 SOCKS5`:`${s} \u2192 ${e.targetHost}:${e.targetPort}`}function hy(e){return e?.state==="running"?`\u8FD0\u884C\u4E2D \xB7 ${e.connections}`:e?.state==="starting"?"\u542F\u52A8\u4E2D":e?.state==="error"?"\u5931\u8D25":"\u5DF2\u505C\u6B62"}function cy(){if(document.getElementById(hf)!==null)return()=>{};let t=document.createElement("style");return t.id=hf,t.textContent=`${Np}
|
|
6521
|
+
${Lp}
|
|
6403
6522
|
${Op}
|
|
6404
6523
|
${Mp}
|
|
6405
|
-
${
|
|
6406
|
-
${
|
|
6407
|
-
${
|
|
6524
|
+
${zp}
|
|
6525
|
+
${Hp}
|
|
6526
|
+
${$p}
|
|
6527
|
+
${lf}
|
|
6528
|
+
${Fp}`,document.head.append(t),()=>t.remove()}
|
|
6408
6529
|
return module.exports; } });
|
|
6409
6530
|
//# sourceMappingURL=client.js.map
|