var __kbnSharedDeps__=function(e){function t(t){for(var i,o,s=t[0],r=t[1],a=0,h=[];a{let n=i.relatedTarget;for(;n&&n!==e;)n=n.parentNode;n!==e&&t(i)}))}function x(e,t){return _(e,"pointerout",(i=>{let n=i.relatedTarget;for(;n&&n!==e;)n=n.parentNode;n!==e&&t(i)}))}let L,k,D=null;class N{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Object(l.e)(e)}}static sort(e,t){return t.priority-e.priority}}!function(){let e=[],t=null,i=!1,n=!1,o=()=>{for(i=!1,t=e,e=[],n=!0;t.length>0;)t.sort(N.sort),t.shift().execute();n=!1};k=(t,n=0)=>{let s=new N(t,n);return e.push(s),i||(i=!0,function(e){if(!D){const e=e=>setTimeout((()=>e((new Date).getTime())),0);D=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||e}D.call(self,e)}(o)),s},L=(e,i)=>{if(n){let n=new N(e,i);return t.push(n),n}return k(e,i)}}();const E=function(e,t){return t};class O extends c.a{constructor(e,t,i,n=E,o=8){super();let s=null,r=0,l=this._register(new a.g),h=()=>{r=(new Date).getTime(),i(s),s=null};this._register(_(e,t,(e=>{s=n(s,e);let t=(new Date).getTime()-r;t>=o?(l.cancel(),h()):l.setIfNotSet(h,o-t)})))}}function I(e,t,i,n,o){return new O(e,t,i,n,o)}function T(e){return document.defaultView.getComputedStyle(e,null)}function M(e){if(e!==document.body)return new R(e.clientWidth,e.clientHeight);if(d.c&&window.visualViewport){const e=window.visualViewport.width,t=window.visualViewport.height-(n.i?24:0);return new R(e,t)}if(window.innerWidth&&window.innerHeight)return new R(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new R(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new R(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class A{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){let n=T(e),o="0";return n&&(o=n.getPropertyValue?n.getPropertyValue(t):n.getAttribute(i)),A.convertToPixels(e,o)}static getBorderLeftWidth(e){return A.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return A.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return A.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return A.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return A.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return A.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return A.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return A.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return A.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return A.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return A.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return A.getDimension(e,"margin-bottom","marginBottom")}}class R{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new R(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof R?e:new R(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&e.width===t.width&&e.height===t.height}}function P(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement;){i-=e.scrollTop;const o=q(e)?null:T(e);o&&(n-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=A.getBorderLeftWidth(e),i+=A.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}function F(e,t,i){"number"==typeof t&&(e.style.width=`${t}px`),"number"==typeof i&&(e.style.height=`${i}px`)}function W(e){let t=e.getBoundingClientRect();return{left:t.left+B.scrollX,top:t.top+B.scrollY,width:t.width,height:t.height}}const B=new class{get scrollX(){return"number"==typeof window.scrollX?window.scrollX:document.body.scrollLeft+document.documentElement.scrollLeft}get scrollY(){return"number"==typeof window.scrollY?window.scrollY:document.body.scrollTop+document.documentElement.scrollTop}};function j(e){let t=A.getMarginLeft(e)+A.getMarginRight(e);return e.offsetWidth+t}function V(e){let t=A.getBorderLeftWidth(e)+A.getBorderRightWidth(e),i=A.getPaddingLeft(e)+A.getPaddingRight(e);return e.offsetWidth-t-i}function H(e){let t=A.getBorderTopWidth(e)+A.getBorderBottomWidth(e),i=A.getPaddingTop(e)+A.getPaddingBottom(e);return e.offsetHeight-t-i}function z(e){let t=A.getMarginTop(e)+A.getMarginBottom(e);return e.offsetHeight+t}function U(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function K(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i)if("string"==typeof i){if(e.classList.contains(i))return null}else if(e===i)return null;e=e.parentNode}return null}function $(e,t,i){return!!K(e,t,i)}function q(e){return e&&!!e.host&&!!e.mode}function G(e){return!!Y(e)}function Y(e){for(;e.parentNode;){if(e===document.body)return null;e=e.parentNode}return q(e)?e:null}function Z(){let e=document.activeElement;for(;null==e?void 0:e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Q(e=document.getElementsByTagName("head")[0]){let t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}let X=null;function J(){return X||(X=Q()),X}function ee(e,t,i=J()){i&&t&&i.sheet.insertRule(e+"{"+t+"}",0)}function te(e,t=J()){if(!t)return;let i=function(e){var t,i;return(null===(t=null==e?void 0:e.sheet)||void 0===t?void 0:t.rules)?e.sheet.rules:(null===(i=null==e?void 0:e.sheet)||void 0===i?void 0:i.cssRules)?e.sheet.cssRules:[]}(t),n=[];for(let t=0;t=0;e--)t.sheet.deleteRule(n[e])}function ie(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName}const ne={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:n.j?"webkitAnimationStart":"animationstart",ANIMATION_END:n.j?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:n.j?"webkitAnimationIteration":"animationiteration"},oe={stop:function(e,t){e.preventDefault?e.preventDefault():e.returnValue=!1,t&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)}};function se(e){let t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}function re(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}class ae extends c.a{constructor(e){super(),this._onDidFocus=this._register(new h.a),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new h.a),this.onDidBlur=this._onDidBlur.event;let t=U(document.activeElement,e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},s=()=>{t&&(i=!0,window.setTimeout((()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{U(document.activeElement,e)!==t&&(t?s():n())},this._register(Object(o.a)(e,ne.FOCUS,!0)(n)),this._register(Object(o.a)(e,ne.BLUR,!0)(s))}}function le(e){return new ae(e)}function he(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function ce(e,...t){e.innerText="",he(e,...t)}const de=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var ue;function ge(e,t,i,...n){let o=de.exec(t);if(!o)throw new Error("Bad use of emmet");i=Object.assign({},i||{});let s,r=o[1]||"div";return s=e!==ue.HTML?document.createElementNS(e,r):document.createElement(r),o[3]&&(s.id=o[3]),o[4]&&(s.className=o[4].replace(/\./g," ").trim()),Object.keys(i).forEach((e=>{const t=i[e];void 0!==t&&(/^on\w+$/.test(e)?s[e]=t:"selected"===e?t&&s.setAttribute(e,"true"):s.setAttribute(e,t))})),s.append(...n),s}function me(e,t,...i){return ge(ue.HTML,e,t,...i)}function pe(...e){for(let t of e)t.style.display="",t.removeAttribute("aria-hidden")}function fe(...e){for(let t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function _e(e){return Array.prototype.slice.call(document.getElementsByTagName(e),0)}function be(e){const t=window.devicePixelRatio*e;return Math.max(1,Math.floor(t))/window.devicePixelRatio}function ve(e){window.open(e,"_blank","noopener")}function Ce(e){const t=()=>{e(),i=k(t)};let i=k(t);return Object(c.h)((()=>i.dispose()))}function we(e){return e?`url('${u.a.asBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function ye(e){return`'${e.replace(/'/g,"%27")}'`}!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.SVG="http://www.w3.org/2000/svg"}(ue||(ue={})),me.SVG=function(e,t,...i){return ge(ue.SVG,e,t,...i)},u.b.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");class Se extends h.a{constructor(){super(),this._subscriptions=new c.b,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(Object(o.a)(window,"keydown",!0)((e=>{const t=new s.a(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}}))),this._subscriptions.add(Object(o.a)(window,"keyup",!0)((e=>{!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus))}))),this._subscriptions.add(Object(o.a)(document.body,"mousedown",!0)((e=>{this._keyStatus.lastKeyPressed=void 0}))),this._subscriptions.add(Object(o.a)(document.body,"mouseup",!0)((e=>{this._keyStatus.lastKeyPressed=void 0}))),this._subscriptions.add(Object(o.a)(document.body,"mousemove",!0)((e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)}))),this._subscriptions.add(Object(o.a)(window,"blur")((e=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return Se.instance||(Se.instance=new Se),Se.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}function xe(e,t){const i=window.matchMedia(e);"function"==typeof i.addEventListener?i.addEventListener("change",t):i.addListener(t)}},function(e,t,i){"use strict";i.d(t,"g",(function(){return l})),i.d(t,"f",(function(){return h})),i.d(t,"e",(function(){return c})),i.d(t,"h",(function(){return d})),i.d(t,"b",(function(){return u})),i.d(t,"a",(function(){return g})),i.d(t,"d",(function(){return m})),i.d(t,"c",(function(){return p}));var n=i(35);let o=null;function s(e){o&&o.markTracked(e)}function r(e){return o?(o.trackDisposable(e),e):e}class a extends Error{constructor(e){super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function l(e){return"function"==typeof e.dispose&&0===e.dispose.length}function h(e){if(n.a.is(e)){let t=[];for(const i of e)if(i){s(i);try{i.dispose()}catch(e){t.push(e)}}if(1===t.length)throw t[0];if(t.length>1)throw new a(t);return Array.isArray(e)?[]:e}if(e)return s(e),e.dispose(),e}function c(...e){return e.forEach(s),d((()=>h(e)))}function d(e){const t=r({dispose:()=>{s(t),e()}});return t}class u{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(s(this),this._isDisposed=!0,this.clear())}clear(){try{h(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return s(e),this._isDisposed?u.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}u.DISABLE_DISPOSED_WARNING=!1;class g{constructor(){this._store=new u,r(this)}dispose(){s(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}g.None=Object.freeze({dispose(){}});class m{constructor(){this._isDisposed=!1,r(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||(null===(t=this._value)||void 0===t||t.dispose(),e&&s(e),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,s(this),null===(e=this._value)||void 0===e||e.dispose(),this._value=void 0}}class p{constructor(e){this.object=e}dispose(){}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(10);class o{constructor(e,t,i,n){e>i||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return o.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return o.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}containsRange(e){return o.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return o.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return o.plusRange(this,e)}static plusRange(e,t){let i,n,s,r;return t.startLineNumbere.endLineNumber?(s=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(s=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(s=e.endLineNumber,r=e.endColumn),new o(i,n,s,r)}intersectRanges(e){return o.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn,a=t.startLineNumber,l=t.startColumn,h=t.endLineNumber,c=t.endColumn;return ih?(s=h,r=c):s===h&&(r=Math.min(r,c)),i>s||i===s&&n>r?null:new o(i,n,s,r)}equalsRange(e){return o.equalsRange(this,e)}static equalsRange(e,t){return!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return o.getEndPosition(this)}static getEndPosition(e){return new n.a(e.endLineNumber,e.endColumn)}getStartPosition(){return o.getStartPosition(this)}static getStartPosition(e){return new n.a(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new o(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new o(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return o.collapseToStart(this)}static collapseToStart(e){return new o(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}static fromPositions(e,t=e){return new o(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new o(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return h})),i.d(t,"ac",(function(){return d})),i.d(t,"T",(function(){return u})),i.d(t,"U",(function(){return g})),i.d(t,"S",(function(){return m})),i.d(t,"h",(function(){return p})),i.d(t,"b",(function(){return f})),i.d(t,"mc",(function(){return _})),i.d(t,"lc",(function(){return b})),i.d(t,"pc",(function(){return v})),i.d(t,"V",(function(){return C})),i.d(t,"X",(function(){return w})),i.d(t,"W",(function(){return y})),i.d(t,"bb",(function(){return S})),i.d(t,"db",(function(){return x})),i.d(t,"cb",(function(){return L})),i.d(t,"eb",(function(){return k})),i.d(t,"gb",(function(){return D})),i.d(t,"fb",(function(){return N})),i.d(t,"Y",(function(){return E})),i.d(t,"ab",(function(){return O})),i.d(t,"Z",(function(){return I})),i.d(t,"f",(function(){return A})),i.d(t,"e",(function(){return R})),i.d(t,"g",(function(){return P})),i.d(t,"c",(function(){return F})),i.d(t,"d",(function(){return W})),i.d(t,"cc",(function(){return B})),i.d(t,"ec",(function(){return j})),i.d(t,"fc",(function(){return V})),i.d(t,"dc",(function(){return H})),i.d(t,"Vb",(function(){return z})),i.d(t,"s",(function(){return U})),i.d(t,"u",(function(){return K})),i.d(t,"t",(function(){return $})),i.d(t,"N",(function(){return q})),i.d(t,"P",(function(){return G})),i.d(t,"O",(function(){return Y})),i.d(t,"F",(function(){return Z})),i.d(t,"H",(function(){return Q})),i.d(t,"G",(function(){return X})),i.d(t,"y",(function(){return J})),i.d(t,"x",(function(){return ee})),i.d(t,"r",(function(){return te})),i.d(t,"w",(function(){return ie})),i.d(t,"Q",(function(){return ne})),i.d(t,"R",(function(){return se})),i.d(t,"Wb",(function(){return re})),i.d(t,"Xb",(function(){return ae})),i.d(t,"Zb",(function(){return le})),i.d(t,"Rb",(function(){return he})),i.d(t,"Qb",(function(){return ce})),i.d(t,"hb",(function(){return de})),i.d(t,"kb",(function(){return ue})),i.d(t,"ib",(function(){return ge})),i.d(t,"jb",(function(){return me})),i.d(t,"K",(function(){return pe})),i.d(t,"L",(function(){return fe})),i.d(t,"E",(function(){return _e})),i.d(t,"M",(function(){return be})),i.d(t,"v",(function(){return ve})),i.d(t,"C",(function(){return Ce})),i.d(t,"z",(function(){return we})),i.d(t,"B",(function(){return ye})),i.d(t,"A",(function(){return Se})),i.d(t,"D",(function(){return xe})),i.d(t,"q",(function(){return Le})),i.d(t,"J",(function(){return ke})),i.d(t,"I",(function(){return De})),i.d(t,"i",(function(){return Ne})),i.d(t,"j",(function(){return Ee})),i.d(t,"m",(function(){return Oe})),i.d(t,"o",(function(){return Ie})),i.d(t,"n",(function(){return Te})),i.d(t,"p",(function(){return Me})),i.d(t,"k",(function(){return Ae})),i.d(t,"l",(function(){return Re})),i.d(t,"rb",(function(){return Pe})),i.d(t,"sb",(function(){return Fe})),i.d(t,"tb",(function(){return We})),i.d(t,"lb",(function(){return Be})),i.d(t,"mb",(function(){return je})),i.d(t,"zb",(function(){return Ve})),i.d(t,"Ab",(function(){return He})),i.d(t,"xb",(function(){return ze})),i.d(t,"yb",(function(){return Ue})),i.d(t,"vb",(function(){return Ke})),i.d(t,"wb",(function(){return $e})),i.d(t,"nb",(function(){return qe})),i.d(t,"ub",(function(){return Ge})),i.d(t,"ob",(function(){return Ye})),i.d(t,"qb",(function(){return Ze})),i.d(t,"pb",(function(){return Qe})),i.d(t,"oc",(function(){return Xe})),i.d(t,"kc",(function(){return Je})),i.d(t,"Yb",(function(){return tt})),i.d(t,"Cb",(function(){return it})),i.d(t,"Db",(function(){return nt})),i.d(t,"Bb",(function(){return ot})),i.d(t,"Gb",(function(){return st})),i.d(t,"Eb",(function(){return rt})),i.d(t,"Fb",(function(){return at})),i.d(t,"Hb",(function(){return lt})),i.d(t,"ic",(function(){return ht})),i.d(t,"jc",(function(){return ct})),i.d(t,"gc",(function(){return dt})),i.d(t,"hc",(function(){return ut})),i.d(t,"Kb",(function(){return gt})),i.d(t,"Jb",(function(){return mt})),i.d(t,"Ob",(function(){return pt})),i.d(t,"Ib",(function(){return ft})),i.d(t,"Mb",(function(){return _t})),i.d(t,"Nb",(function(){return bt})),i.d(t,"Lb",(function(){return vt})),i.d(t,"Sb",(function(){return Ct})),i.d(t,"Ub",(function(){return wt})),i.d(t,"Tb",(function(){return yt})),i.d(t,"nc",(function(){return Lt})),i.d(t,"Pb",(function(){return kt})),i.d(t,"bc",(function(){return Nt}));var n=i(51),o=i(12),s=i(5),r=i(0),a=i(156),l=i(21);const h={ColorContribution:"base.contributions.colors"},c=new class{constructor(){this._onDidChangeSchema=new s.a,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,o){let s={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=s;let r={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(r.deprecationMessage=o),this.colorSchema.properties[e]=r,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults)return Nt(i.defaults[t.type],t)}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort(((e,t)=>{let i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)})).map((e=>`- \`${e}\`: ${this.colorsById[e].description}`)).join("\n")}};function d(e,t,i,n,o){return c.registerColor(e,t,i,n,o)}n.a.add(h.ColorContribution,c);const u=d("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},r.a("foreground","Overall foreground color. This color is only used if not overridden by a component.")),g=(d("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},r.a("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),d("icon.foreground",{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},r.a("iconForeground","The default color for icons in the workbench."))),m=d("focusBorder",{dark:"#007FD4",light:"#0090F1",hc:"#F38518"},r.a("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),p=d("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},r.a("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),f=d("contrastActiveBorder",{light:null,dark:null,hc:m},r.a("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),_=d("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},r.a("textLinkForeground","Foreground color for links in text.")),b=d("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:o.a.black},r.a("textCodeBlockBackground","Background color for code blocks in text.")),v=d("widget.shadow",{dark:Lt(o.a.black,.36),light:Lt(o.a.black,.16),hc:null},r.a("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),C=d("input.background",{dark:"#3C3C3C",light:o.a.white,hc:o.a.black},r.a("inputBoxBackground","Input box background.")),w=d("input.foreground",{dark:u,light:u,hc:u},r.a("inputBoxForeground","Input box foreground.")),y=d("input.border",{dark:null,light:null,hc:p},r.a("inputBoxBorder","Input box border.")),S=(d("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:p},r.a("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),d("inputOption.activeBackground",{dark:Lt(m,.4),light:Lt(m,.2),hc:o.a.transparent},r.a("inputOption.activeBackground","Background color of activated options in input fields.")),d("inputOption.activeForeground",{dark:o.a.white,light:o.a.black,hc:null},r.a("inputOption.activeForeground","Foreground color of activated options in input fields.")),d("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:o.a.black},r.a("inputValidationInfoBackground","Input validation background color for information severity."))),x=d("inputValidation.infoForeground",{dark:null,light:null,hc:null},r.a("inputValidationInfoForeground","Input validation foreground color for information severity.")),L=d("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:p},r.a("inputValidationInfoBorder","Input validation border color for information severity.")),k=d("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:o.a.black},r.a("inputValidationWarningBackground","Input validation background color for warning severity.")),D=d("inputValidation.warningForeground",{dark:null,light:null,hc:null},r.a("inputValidationWarningForeground","Input validation foreground color for warning severity.")),N=d("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:p},r.a("inputValidationWarningBorder","Input validation border color for warning severity.")),E=d("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:o.a.black},r.a("inputValidationErrorBackground","Input validation background color for error severity.")),O=d("inputValidation.errorForeground",{dark:null,light:null,hc:null},r.a("inputValidationErrorForeground","Input validation foreground color for error severity.")),I=d("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:p},r.a("inputValidationErrorBorder","Input validation border color for error severity.")),T=d("dropdown.background",{dark:"#3C3C3C",light:o.a.white,hc:o.a.black},r.a("dropdownBackground","Dropdown background.")),M=d("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:o.a.white},r.a("dropdownForeground","Dropdown foreground.")),A=d("button.foreground",{dark:o.a.white,light:o.a.white,hc:o.a.white},r.a("buttonForeground","Button foreground color.")),R=d("button.background",{dark:"#0E639C",light:"#007ACC",hc:null},r.a("buttonBackground","Button background color.")),P=d("button.hoverBackground",{dark:xt(R,.2),light:St(R,.2),hc:null},r.a("buttonHoverBackground","Button background color when hovering.")),F=d("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:o.a.black},r.a("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),W=d("badge.foreground",{dark:o.a.white,light:"#333",hc:o.a.white},r.a("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),B=d("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},r.a("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),j=d("scrollbarSlider.background",{dark:o.a.fromHex("#797979").transparent(.4),light:o.a.fromHex("#646464").transparent(.4),hc:Lt(p,.6)},r.a("scrollbarSliderBackground","Scrollbar slider background color.")),V=d("scrollbarSlider.hoverBackground",{dark:o.a.fromHex("#646464").transparent(.7),light:o.a.fromHex("#646464").transparent(.7),hc:Lt(p,.8)},r.a("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),H=d("scrollbarSlider.activeBackground",{dark:o.a.fromHex("#BFBFBF").transparent(.4),light:o.a.fromHex("#000000").transparent(.6),hc:p},r.a("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),z=d("progressBar.background",{dark:o.a.fromHex("#0E70C0"),light:o.a.fromHex("#0E70C0"),hc:p},r.a("progressBarBackground","Background color of the progress bar that can show for long running operations.")),U=d("editorError.background",{dark:null,light:null,hc:null},r.a("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),K=d("editorError.foreground",{dark:"#F48771",light:"#E51400",hc:null},r.a("editorError.foreground","Foreground color of error squigglies in the editor.")),$=d("editorError.border",{dark:null,light:null,hc:o.a.fromHex("#E47777").transparent(.8)},r.a("errorBorder","Border color of error boxes in the editor.")),q=d("editorWarning.background",{dark:null,light:null,hc:null},r.a("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),G=d("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hc:null},r.a("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Y=d("editorWarning.border",{dark:null,light:null,hc:o.a.fromHex("#FFCC00").transparent(.8)},r.a("warningBorder","Border color of warning boxes in the editor.")),Z=d("editorInfo.background",{dark:null,light:null,hc:null},r.a("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Q=d("editorInfo.foreground",{dark:"#75BEFF",light:"#75BEFF",hc:null},r.a("editorInfo.foreground","Foreground color of info squigglies in the editor.")),X=d("editorInfo.border",{dark:null,light:null,hc:o.a.fromHex("#75BEFF").transparent(.8)},r.a("infoBorder","Border color of info boxes in the editor.")),J=d("editorHint.foreground",{dark:o.a.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},r.a("editorHint.foreground","Foreground color of hint squigglies in the editor.")),ee=d("editorHint.border",{dark:null,light:null,hc:o.a.fromHex("#eeeeee").transparent(.8)},r.a("hintBorder","Border color of hint boxes in the editor.")),te=d("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:o.a.black},r.a("editorBackground","Editor background color.")),ie=d("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:o.a.white},r.a("editorForeground","Editor default foreground color.")),ne=d("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},r.a("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),oe=d("editorWidget.foreground",{dark:u,light:u,hc:u},r.a("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),se=d("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:p},r.a("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),re=(d("editorWidget.resizeBorder",{light:null,dark:null,hc:null},r.a("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),d("quickInput.background",{dark:ne,light:ne,hc:ne},r.a("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette."))),ae=d("quickInput.foreground",{dark:oe,light:oe,hc:oe},r.a("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),le=d("quickInputTitle.background",{dark:new o.a(new o.c(255,255,255,.105)),light:new o.a(new o.c(0,0,0,.06)),hc:"#000000"},r.a("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),he=d("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:o.a.white},r.a("pickerGroupForeground","Quick picker color for grouping labels.")),ce=d("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:o.a.white},r.a("pickerGroupBorder","Quick picker color for grouping borders.")),de=d("keybindingLabel.background",{dark:new o.a(new o.c(128,128,128,.17)),light:new o.a(new o.c(221,221,221,.4)),hc:o.a.transparent},r.a("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),ue=d("keybindingLabel.foreground",{dark:o.a.fromHex("#CCCCCC"),light:o.a.fromHex("#555555"),hc:o.a.white},r.a("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),ge=d("keybindingLabel.border",{dark:new o.a(new o.c(51,51,51,.6)),light:new o.a(new o.c(204,204,204,.4)),hc:new o.a(new o.c(111,195,223))},r.a("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),me=d("keybindingLabel.bottomBorder",{dark:new o.a(new o.c(68,68,68,.6)),light:new o.a(new o.c(187,187,187,.4)),hc:new o.a(new o.c(111,195,223))},r.a("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),pe=d("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},r.a("editorSelectionBackground","Color of the editor selection.")),fe=d("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},r.a("editorSelectionForeground","Color of the selected text for high contrast.")),_e=d("editor.inactiveSelectionBackground",{light:Lt(pe,.5),dark:Lt(pe,.5),hc:Lt(pe,.5)},r.a("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),be=d("editor.selectionHighlightBackground",{light:Dt(pe,te,.3,.6),dark:Dt(pe,te,.3,.6),hc:null},r.a("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),ve=(d("editor.selectionHighlightBorder",{light:null,dark:null,hc:f},r.a("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),d("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},r.a("editorFindMatch","Color of the current search match.")),d("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},r.a("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0)),Ce=(d("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},r.a("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),d("editor.findMatchBorder",{light:null,dark:null,hc:f},r.a("editorFindMatchBorder","Border color of the current search match.")),d("editor.findMatchHighlightBorder",{light:null,dark:null,hc:f},r.a("findMatchHighlightBorder","Border color of the other search matches.")),d("editor.findRangeHighlightBorder",{dark:null,light:null,hc:Lt(f,.4)},r.a("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),d("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},r.a("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0)),we=d("editorHoverWidget.background",{light:ne,dark:ne,hc:ne},r.a("hoverBackground","Background color of the editor hover.")),ye=d("editorHoverWidget.foreground",{light:oe,dark:oe,hc:oe},r.a("hoverForeground","Foreground color of the editor hover.")),Se=d("editorHoverWidget.border",{light:se,dark:se,hc:se},r.a("hoverBorder","Border color of the editor hover.")),xe=d("editorHoverWidget.statusBarBackground",{dark:xt(we,.2),light:St(we,.05),hc:ne},r.a("statusBarBackground","Background color of the editor hover status bar.")),Le=d("editorLink.activeForeground",{dark:"#4E94CE",light:o.a.blue,hc:o.a.cyan},r.a("activeLinkForeground","Color of active links.")),ke=(d("editorInlineHint.foreground",{dark:ne,light:oe,hc:ne},r.a("editorInlineHintForeground","Foreground color of inline hints")),d("editorInlineHint.background",{dark:oe,light:ne,hc:oe},r.a("editorInlineHintBackground","Background color of inline hints")),d("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hc:"#FFCC00"},r.a("editorLightBulbForeground","The color used for the lightbulb actions icon."))),De=d("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},r.a("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon.")),Ne=new o.a(new o.c(155,185,85,.2)),Ee=new o.a(new o.c(255,0,0,.2)),Oe=d("diffEditor.insertedTextBackground",{dark:Ne,light:Ne,hc:null},r.a("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Ie=d("diffEditor.removedTextBackground",{dark:Ee,light:Ee,hc:null},r.a("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),Te=d("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},r.a("diffEditorInsertedOutline","Outline color for the text that got inserted.")),Me=d("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},r.a("diffEditorRemovedOutline","Outline color for text that got removed.")),Ae=d("diffEditor.border",{dark:null,light:null,hc:p},r.a("diffEditorBorder","Border color between the two text editors.")),Re=d("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hc:null},r.a("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),Pe=d("list.focusBackground",{dark:null,light:null,hc:null},r.a("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Fe=d("list.focusForeground",{dark:null,light:null,hc:null},r.a("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),We=d("list.focusOutline",{dark:m,light:m,hc:f},r.a("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Be=d("list.activeSelectionBackground",{dark:"#094771",light:"#0060C0",hc:null},r.a("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),je=d("list.activeSelectionForeground",{dark:o.a.white,light:o.a.white,hc:null},r.a("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Ve=d("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},r.a("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),He=d("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},r.a("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),ze=d("list.inactiveFocusBackground",{dark:null,light:null,hc:null},r.a("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Ue=d("list.inactiveFocusOutline",{dark:null,light:null,hc:null},r.a("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Ke=d("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},r.a("listHoverBackground","List/Tree background when hovering over items using the mouse.")),$e=d("list.hoverForeground",{dark:null,light:null,hc:null},r.a("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),qe=d("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},r.a("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),Ge=d("list.highlightForeground",{dark:"#0097fb",light:"#0066BF",hc:m},r.a("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),Ye=d("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:o.a.black},r.a("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),Ze=d("listFilterWidget.outline",{dark:o.a.transparent,light:o.a.transparent,hc:"#f38518"},r.a("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),Qe=d("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:p},r.a("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),Xe=d("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},r.a("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Je=d("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hc:null},r.a("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),et=d("quickInput.list.focusBackground",{dark:null,light:null,hc:null},"",void 0,r.a("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),tt=d("quickInputList.focusBackground",{dark:kt(et,Pe,"#062F4A"),light:kt(et,Pe,"#D6EBFF"),hc:null},r.a("quickInput.listFocusBackground","Quick picker background color for the focused item.")),it=d("menu.border",{dark:null,light:null,hc:p},r.a("menuBorder","Border color of menus.")),nt=d("menu.foreground",{dark:M,light:u,hc:M},r.a("menuForeground","Foreground color of menu items.")),ot=d("menu.background",{dark:T,light:T,hc:T},r.a("menuBackground","Background color of menu items.")),st=d("menu.selectionForeground",{dark:je,light:je,hc:je},r.a("menuSelectionForeground","Foreground color of the selected menu item in menus.")),rt=d("menu.selectionBackground",{dark:Be,light:Be,hc:Be},r.a("menuSelectionBackground","Background color of the selected menu item in menus.")),at=d("menu.selectionBorder",{dark:null,light:null,hc:f},r.a("menuSelectionBorder","Border color of the selected menu item in menus.")),lt=d("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:p},r.a("menuSeparatorBackground","Color of a separator menu item in menus.")),ht=d("editor.snippetTabstopHighlightBackground",{dark:new o.a(new o.c(124,124,124,.3)),light:new o.a(new o.c(10,50,100,.2)),hc:new o.a(new o.c(124,124,124,.3))},r.a("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),ct=d("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},r.a("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),dt=d("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},r.a("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),ut=d("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new o.a(new o.c(10,50,100,.5)),hc:"#525252"},r.a("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet.")),gt=(d("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},r.a("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),d("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},r.a("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),d("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},r.a("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),d("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hc:"#ffffff"},r.a("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0)),mt=d("minimap.errorHighlight",{dark:new o.a(new o.c(255,18,18,.7)),light:new o.a(new o.c(255,18,18,.7)),hc:new o.a(new o.c(255,50,50,1))},r.a("minimapError","Minimap marker color for errors.")),pt=d("minimap.warningHighlight",{dark:G,light:G,hc:Y},r.a("overviewRuleWarning","Minimap marker color for warnings.")),ft=d("minimap.background",{dark:null,light:null,hc:null},r.a("minimapBackground","Minimap background color.")),_t=d("minimapSlider.background",{light:Lt(j,.5),dark:Lt(j,.5),hc:Lt(j,.5)},r.a("minimapSliderBackground","Minimap slider background color.")),bt=d("minimapSlider.hoverBackground",{light:Lt(V,.5),dark:Lt(V,.5),hc:Lt(V,.5)},r.a("minimapSliderHoverBackground","Minimap slider background color when hovering.")),vt=d("minimapSlider.activeBackground",{light:Lt(H,.5),dark:Lt(H,.5),hc:Lt(H,.5)},r.a("minimapSliderActiveBackground","Minimap slider background color when clicked on.")),Ct=d("problemsErrorIcon.foreground",{dark:K,light:K,hc:K},r.a("problemsErrorIconForeground","The color used for the problems error icon.")),wt=d("problemsWarningIcon.foreground",{dark:G,light:G,hc:G},r.a("problemsWarningIconForeground","The color used for the problems warning icon.")),yt=d("problemsInfoIcon.foreground",{dark:Q,light:Q,hc:Q},r.a("problemsInfoIconForeground","The color used for the problems info icon."));function St(e,t){return i=>{let n=Nt(e,i);if(n)return n.darken(t)}}function xt(e,t){return i=>{let n=Nt(e,i);if(n)return n.lighten(t)}}function Lt(e,t){return i=>{let n=Nt(e,i);if(n)return n.transparent(t)}}function kt(...e){return t=>{for(let i of e){let e=Nt(i,t);if(e)return e}}}function Dt(e,t,i,n){return s=>{let r=Nt(e,s);if(r){let e=Nt(t,s);return e?r.isDarkerThan(e)?o.a.getLighterColor(r,e,i).transparent(n):o.a.getDarkerColor(r,e,i).transparent(n):r.transparent(i*n)}}}function Nt(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?o.a.fromHex(e):t.getColor(e):e instanceof o.a?e:"function"==typeof e?e(t):void 0}const Et="vscode://schemas/workbench-colors";let Ot=n.a.as(a.a.JSONContribution);Ot.registerSchema(Et,c.getColorSchema());const It=new l.e((()=>Ot.notifySchemaChanged(Et)),200);c.onDidChangeSchema((()=>{It.isScheduled()||It.schedule()}))},function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return h})),i.d(t,"d",(function(){return c})),i.d(t,"c",(function(){return d})),i.d(t,"e",(function(){return u}));var n,o=i(18),s=i(2),r=i(72),a=i(105);!function(e){function t(e){return(t,i=null,n)=>{let o,s=!1;return o=e((e=>{if(!s)return o?o.dispose():s=!0,t.call(i,e)}),null,n),s&&o.dispose(),o}}function i(e,t){return a(((i,n=null,o)=>e((e=>i.call(n,t(e))),null,o)))}function n(e,t){return a(((i,n=null,o)=>e((e=>{t(e),i.call(n,e)}),null,o)))}function o(e,t){return a(((i,n=null,o)=>e((e=>t(e)&&i.call(n,e)),null,o)))}function r(e,t,n){let o=n;return i(e,(e=>(o=t(o,e),o)))}function a(e){let t;const i=new h({onFirstListenerAdd(){t=e(i.fire,i)},onLastListenerRemove(){t.dispose()}});return i.event}function l(e,t,i=100,n=!1,o){let s,r,a,l=0;const c=new h({leakWarningThreshold:o,onFirstListenerAdd(){s=e((e=>{l++,r=t(r,e),n&&!a&&(c.fire(r),r=void 0),clearTimeout(a),a=setTimeout((()=>{const e=r;r=void 0,a=void 0,(!n||l>1)&&c.fire(e),l=0}),i)}))},onLastListenerRemove(){s.dispose()}});return c.event}function c(e){let t,i=!0;return o(e,(e=>{const n=i||e!==t;return i=!1,t=e,n}))}e.None=()=>s.a.None,e.once=t,e.map=i,e.forEach=n,e.filter=o,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,n)=>Object(s.e)(...e.map((e=>e((e=>t.call(i,e)),null,n))))},e.reduce=r,e.snapshot=a,e.debounce=l,e.stopwatch=function(e){const n=(new Date).getTime();return i(t(e),(e=>(new Date).getTime()-n))},e.latch=c,e.buffer=function(e,t=!1,i=[]){let n=i.slice(),o=e((e=>{n?n.push(e):r.fire(e)}));const s=()=>{n&&n.forEach((e=>r.fire(e))),n=null},r=new h({onFirstListenerAdd(){o||(o=e((e=>r.fire(e))))},onFirstListenerDidAdd(){n&&(t?setTimeout(s):s())},onLastListenerRemove(){o&&o.dispose(),o=null}});return r.event};class d{constructor(e){this.event=e}map(e){return new d(i(this.event,e))}forEach(e){return new d(n(this.event,e))}filter(e){return new d(o(this.event,e))}reduce(e,t){return new d(r(this.event,e,t))}latch(){return new d(c(this.event))}debounce(e,t=100,i=!1,n){return new d(l(this.event,e,t,i,n))}on(e,t,i){return this.event(e,t,i)}once(e,i,n){return t(this.event)(e,i,n)}}e.chain=function(e){return new d(e)},e.fromNodeEventEmitter=function(e,t,i=(e=>e)){const n=(...e)=>o.fire(i(...e)),o=new h({onFirstListenerAdd:()=>e.on(t,n),onLastListenerRemove:()=>e.removeListener(t,n)});return o.event},e.fromDOMEventEmitter=function(e,t,i=(e=>e)){const n=(...e)=>o.fire(i(...e)),o=new h({onFirstListenerAdd:()=>e.addEventListener(t,n),onLastListenerRemove:()=>e.removeEventListener(t,n)});return o.event},e.fromPromise=function(e){const t=new h;let i=!1;return e.then(void 0,(()=>null)).then((()=>{i?t.fire(void 0):setTimeout((()=>t.fire(void 0)),0)})),i=!0,t.event},e.toPromise=function(e){return new Promise((i=>t(e)(i)))}}(n||(n={}));class l{constructor(e){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${e}_${l._idPool++}`}start(e){this._stopWatch=new a.a(!0),this._listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this._elapsedOverall+=e,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${e.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}l._idPool=0;class h{constructor(e){var t;this._disposed=!1,this._options=e,this._leakageMon=void 0,this._perfMon=(null===(t=this._options)||void 0===t?void 0:t._profName)?new l(this._options._profName):void 0}get event(){return this._event||(this._event=(e,t,i)=>{var n;this._listeners||(this._listeners=new r.a);const o=this._listeners.isEmpty();o&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const a=this._listeners.push(t?[e,t]:e);o&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t);const l=null===(n=this._leakageMon)||void 0===n?void 0:n.check(this._listeners.size);let c;return c={dispose:()=>{l&&l(),c.dispose=h._noop,!this._disposed&&(a(),this._options&&this._options.onLastListenerRemove)&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this))}},i instanceof s.b?i.add(c):Array.isArray(i)&&i.push(c),c}),this._event}fire(e){var t,i;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new r.a);for(let t of this._listeners)this._deliveryQueue.push([t,e]);for(null===(t=this._perfMon)||void 0===t||t.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[e,t]=this._deliveryQueue.shift();try{"function"==typeof e?e.call(void 0,t):e[0].call(e[1],t)}catch(e){Object(o.e)(e)}}null===(i=this._perfMon)||void 0===i||i.stop()}}dispose(){var e,t,i;null===(e=this._listeners)||void 0===e||e.clear(),null===(t=this._deliveryQueue)||void 0===t||t.clear(),null===(i=this._leakageMon)||void 0===i||i.dispose(),this._disposed=!0}}h._noop=function(){};class c extends h{constructor(e){super(e),this._isPaused=0,this._eventQueue=new r.a,this._mergeFn=null==e?void 0:e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class d{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,n)=>e((e=>{const n=this.buffers[this.buffers.length-1];n?n.push((()=>t.call(i,e))):t.call(i,e)}),void 0,n)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach((e=>e())),i}}class u{constructor(){this.listening=!1,this.inputEvent=n.None,this.inputEventListener=s.a.None,this.emitter=new h({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},function(e,t,i){"use strict";function n(e){return!e||"string"!=typeof e||0===e.trim().length}i.d(t,"B",(function(){return n})),i.d(t,"v",(function(){return s})),i.d(t,"s",(function(){return r})),i.d(t,"t",(function(){return a})),i.d(t,"I",(function(){return l})),i.d(t,"N",(function(){return h})),i.d(t,"o",(function(){return c})),i.d(t,"p",(function(){return d})),i.d(t,"M",(function(){return u})),i.d(t,"L",(function(){return g})),i.d(t,"P",(function(){return m})),i.d(t,"u",(function(){return p})),i.d(t,"x",(function(){return f})),i.d(t,"H",(function(){return _})),i.d(t,"f",(function(){return b})),i.d(t,"h",(function(){return v})),i.d(t,"g",(function(){return C})),i.d(t,"i",(function(){return w})),i.d(t,"F",(function(){return y})),i.d(t,"G",(function(){return S})),i.d(t,"r",(function(){return L})),i.d(t,"Q",(function(){return D})),i.d(t,"d",(function(){return N})),i.d(t,"e",(function(){return E})),i.d(t,"D",(function(){return O})),i.d(t,"E",(function(){return I})),i.d(t,"j",(function(){return T})),i.d(t,"y",(function(){return M})),i.d(t,"J",(function(){return R})),i.d(t,"K",(function(){return P})),i.d(t,"q",(function(){return F})),i.d(t,"m",(function(){return B})),i.d(t,"k",(function(){return V})),i.d(t,"z",(function(){return z})),i.d(t,"a",(function(){return U})),i.d(t,"n",(function(){return K})),i.d(t,"l",(function(){return $})),i.d(t,"C",(function(){return q})),i.d(t,"A",(function(){return G})),i.d(t,"b",(function(){return Y})),i.d(t,"R",(function(){return Z})),i.d(t,"O",(function(){return Q})),i.d(t,"w",(function(){return X})),i.d(t,"c",(function(){return J}));const o=/{(\d+)}/g;function s(e,...t){return 0===t.length?e:e.replace(o,(function(e,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]}))}function r(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))}function a(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function l(e,t){if(!e||!t)return e;const i=t.length;if(0===i||0===e.length)return e;let n=0;for(;e.indexOf(t,n)===n;)n+=i;return e.substring(n)}function h(e,t){if(!e||!t)return e;const i=t.length,n=e.length;if(0===i||0===n)return e;let o=n,s=-1;for(;s=e.lastIndexOf(t,o-1),-1!==s&&s+i===o;){if(0===s)return"";o=s}return e.substring(0,o)}function c(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function d(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=a(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let n="";return i.global&&(n+="g"),i.matchCase||(n+="i"),i.multiline&&(n+="m"),i.unicode&&(n+="u"),new RegExp(e,n)}function u(e){return"^"!==e.source&&"^$"!==e.source&&"$"!==e.source&&"^\\s*$"!==e.source&&!(!e.exec("")||0!==e.lastIndex)}function g(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")}function m(e){return e.split(/\r\n|\r|\n/)}function p(e){for(let t=0,i=e.length;t=0;i--){const t=e.charCodeAt(i);if(32!==t&&9!==t)return i}return-1}function b(e,t){return et?1:0}function v(e,t,i=0,n=e.length,o=0,s=t.length){for(;is)return 1}const r=n-i,a=s-o;return ra?1:0}function C(e,t){return w(e,t,0,e.length,0,t.length)}function w(e,t,i=0,n=e.length,o=0,s=t.length){for(;ia?1:0}function y(e){return e>=97&&e<=122}function S(e){return e>=65&&e<=90}function x(e){return y(e)||S(e)}function L(e,t){return e.length===t.length&&k(e,t)}function k(e,t,i=e.length){for(let n=0;ne.length)&&k(e,t,i)}function N(e,t){let i,n=Math.min(e.length,t.length);for(i=0;i1){const n=e.charCodeAt(t-2);if(O(n))return T(n,i)}return i}function R(e,t){const i=ee.getInstance(),n=t,o=e.length,s=M(e,o,t);t+=s>=65536?2:1;let r=i.getGraphemeBreakType(s);for(;t=65536?2:1,r=s}return t-n}function P(e,t){const i=ee.getInstance(),n=t,o=A(e,t);t-=o>=65536?2:1;let s=i.getGraphemeBreakType(o);for(;t>0;){const n=A(e,t),o=i.getGraphemeBreakType(n);if(J(o,s))break;t-=n>=65536?2:1,s=o}return n-t}function F(e){const t=e.byteLength,i=[];let n=0;for(;n=240&&n+3>>0|(63&e[n++])<<12>>>0|(63&e[n++])<<6>>>0|(63&e[n++])<<0>>>0:o>=224&&n+2>>0|(63&e[n++])<<6>>>0|(63&e[n++])<<0>>>0:o>=192&&n+1>>0|(63&e[n++])<<0>>>0:e[n++],s>=0&&s<=55295||s>=57344&&s<=65535)i.push(String.fromCharCode(s));else if(s>=65536&&s<=1114111){const e=s-65536,t=55296+((1047552&e)>>>10),n=56320+((1023&e)>>>0);i.push(String.fromCharCode(t)),i.push(String.fromCharCode(n))}else i.push(String.fromCharCode(65533))}return i.join("")}const W=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function B(e){return W.test(e)}const j=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function V(e){return j.test(e)}const H=/^[\t\n\r\x20-\x7E]*$/;function z(e){return H.test(e)}const U=/[\u2028\u2029]/;function K(e){return U.test(e)}function $(e){for(let t=0,i=e.length;t=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function G(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129003||e>=129280&&e<=129535||e>=129648&&e<=129750}const Y=String.fromCharCode(65279);function Z(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function Q(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function X(e){return ee.getInstance().getGraphemeBreakType(e)}function J(e,t){return 0===e?5!==t&&7!==t:!(2===e&&3===t||4!==e&&2!==e&&3!==e&&4!==t&&2!==t&&3!==t&&(8===e&&(8===t||9===t||11===t||12===t)||!(11!==e&&9!==e||9!==t&&10!==t)||(12===e||10===e)&&10===t||5===t||13===t||7===t||1===e||13===e&&14===t||6===e&&6===t))}class ee{constructor(){this._data=JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}static getInstance(){return ee._INSTANCE||(ee._INSTANCE=new ee),ee._INSTANCE}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(et[3*n+1]))return t[3*n+2];n=2*n+1}return 0}}ee._INSTANCE=null},function(e,t,i){"use strict";i.d(t,"a",(function(){return b})),i.d(t,"c",(function(){return w})),i.d(t,"b",(function(){return y})),i.d(t,"l",(function(){return S})),i.d(t,"i",(function(){return x})),i.d(t,"h",(function(){return L})),i.d(t,"k",(function(){return k})),i.d(t,"j",(function(){return D})),i.d(t,"d",(function(){return n})),i.d(t,"g",(function(){return O})),i.d(t,"e",(function(){return I})),i.d(t,"f",(function(){return T}));var n,o=i(0),s=i(22),r=i(38),a=i(10),l=i(55),h=i(91),c=i(28),d=i(27),u=i(8),g=i(81),m=i(51),p=i(119),f=i(14),_=i(73);class b{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){let e=this._kbOpts.kbExpr;this.precondition&&(e=e?u.a.and(e,this.precondition):this.precondition),g.a.registerCommandAndKeybindingRule({id:this.id,handler:(e,t)=>this.runCommand(e,t),weight:this._kbOpts.weight,args:this._kbOpts.args,when:e,primary:this._kbOpts.primary,secondary:this._kbOpts.secondary,win:this._kbOpts.win,linux:this._kbOpts.linux,mac:this._kbOpts.mac,description:this._description})}else d.a.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){c.d.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class v extends b{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i){return this._implementations.push({priority:e,name:t,implementation:i}),this._implementations.sort(((e,t)=>t.priority-e.priority)),{dispose:()=>{for(let e=0;e{if(e.get(u.b).contextMatchesRules(Object(f.n)(this.precondition)))return this.runEditorCommand(e,n,t)}))}}class y extends w{constructor(e){super(y.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=c.b.EditorContext),t.title||(t.title=e.label),t.when=u.a.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(p.a).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}function S(e,t){d.a.registerCommand(e,(function(e,...i){const[n,o]=i;Object(f.b)(s.a.isUri(n)),Object(f.b)(a.a.isIPosition(o));const r=e.get(l.a).getModel(n);if(r){const e=a.a.lift(o);return t(r,e,...i.slice(2))}return e.get(h.a).createModelReference(n).then((e=>new Promise(((n,s)=>{try{n(t(e.object.textEditorModel,a.a.lift(o),i.slice(2)))}catch(e){s(e)}})).finally((()=>{e.dispose()}))))}))}function x(e){return N.INSTANCE.registerEditorCommand(e),e}function L(e){const t=new e;return N.INSTANCE.registerEditorAction(t),t}function k(e){N.INSTANCE.registerEditorAction(e)}function D(e,t){N.INSTANCE.registerEditorContribution(e,t)}!function(e){e.getEditorCommand=function(e){return N.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return N.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return N.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return N.INSTANCE.getEditorContributions().filter((t=>e.indexOf(t.id)>=0))},e.getDiffEditorContributions=function(){return N.INSTANCE.getDiffEditorContributions()}}(n||(n={}));class N{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t){this.editorContributions.push({id:e,ctor:t})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions.slice(0)}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function E(e){return e.register(),e}N.INSTANCE=new N,m.a.add("editor.contributions",N.INSTANCE);const O=E(new v({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:c.b.MenubarEditMenu,group:"1_do",title:o.a({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:c.b.CommandPalette,group:"",title:o.a("undo","Undo"),order:1}]}));E(new C(O,{id:"default:undo",precondition:void 0}));const I=E(new v({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:c.b.MenubarEditMenu,group:"1_do",title:o.a({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:c.b.CommandPalette,group:"",title:o.a("redo","Redo"),order:1}]}));E(new C(I,{id:"default:redo",precondition:void 0}));const T=E(new v({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:c.b.MenubarSelectionMenu,group:"1_basic",title:o.a({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:c.b.CommandPalette,group:"",title:o.a("selectAll","Select All"),order:1}]}))},function(e,t,i){"use strict";i.d(t,"a",(function(){return h})),i.d(t,"c",(function(){return D})),i.d(t,"b",(function(){return N})),i.d(t,"d",(function(){return E}));var n=i(6),o=i(15),s=i(13);let r=s.l||"";const a=new Map;a.set("false",!1),a.set("true",!0),a.set("isMac",s.f),a.set("isLinux",s.d),a.set("isWindows",s.j),a.set("isWeb",s.i),a.set("isMacNative",s.f&&!s.i),a.set("isEdge",r.indexOf("Edg/")>=0),a.set("isFirefox",r.indexOf("Firefox")>=0),a.set("isChrome",r.indexOf("Chrome")>=0),a.set("isSafari",r.indexOf("Safari")>=0),a.set("isIPad",r.indexOf("iPad")>=0);const l=Object.prototype.hasOwnProperty;class h{static has(e){return g.create(e)}static equals(e,t){return m.create(e,t)}static regex(e,t){return S.create(e,t)}static not(e){return b.create(e)}static and(...e){return L.create(e)}static or(...e){return k.create(e)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let i=e.split("||");return k.create(i.map((e=>this._deserializeAndExpression(e,t))))}static _deserializeAndExpression(e,t){let i=e.split("&&");return L.create(i.map((e=>this._deserializeOne(e,t))))}static _deserializeOne(e,t){if((e=e.trim()).indexOf("!=")>=0){let i=e.split("!=");return _.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){let i=e.split("==");return m.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){let i=e.split("=~");return S.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" in ")>=0){let t=e.split(" in ");return p.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const t=e.split(">=");return C.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const t=e.split(">");return v.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const t=e.split("<=");return y.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const t=e.split("<");return w.create(t[0].trim(),t[1].trim())}return/^\!\s*/.test(e)?b.create(e.substr(1).trim()):g.create(e)}static _deserializeValue(e,t){if("true"===(e=e.trim()))return!0;if("false"===e)return!1;let i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e}static _deserializeRegexValue(e,t){if(Object(n.B)(e)){if(t)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let i=e.indexOf("/"),o=e.lastIndexOf("/");if(i===o||i<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}let s=e.slice(i+1,o),r="i"===e[o+1]?"i":"";try{return new RegExp(s,r)}catch(i){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${i}`);return console.warn(`bad regexp-value '${e}', parse error: ${i}`),null}}}function c(e,t){return e.cmp(t)}class d{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return u.INSTANCE}}d.INSTANCE=new d;class u{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return d.INSTANCE}}u.INSTANCE=new u;class g{constructor(e){this.key=e,this.type=2}static create(e){const t=a.get(e);return"boolean"==typeof t?t?u.INSTANCE:d.INSTANCE:new g(e)}cmp(e){return e.type!==this.type?this.type-e.type:O(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return b.create(this.key)}}class m{constructor(e,t){this.key=e,this.value=t,this.type=4}static create(e,t){if("boolean"==typeof t)return t?g.create(e):b.create(e);const i=a.get(e);return"boolean"==typeof i?t===(i?"true":"false")?u.INSTANCE:d.INSTANCE:new m(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:I(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return _.create(this.key,this.value)}}class p{constructor(e,t){this.key=e,this.valueKey=t,this.type=10}static create(e,t){return new p(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:I(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&this.key===e.key&&this.valueKey===e.valueKey}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.indexOf(i)>=0:"string"==typeof i&&"object"==typeof t&&null!==t&&l.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return f.create(this)}}class f{constructor(e){this._actual=e,this.type=11}static create(e){return new f(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class _{constructor(e,t){this.key=e,this.value=t,this.type=5}static create(e,t){if("boolean"==typeof t)return t?b.create(e):g.create(e);const i=a.get(e);return"boolean"==typeof i?t===(i?"true":"false")?d.INSTANCE:u.INSTANCE:new _(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:I(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return m.create(this.key,this.value)}}class b{constructor(e){this.key=e,this.type=3}static create(e){const t=a.get(e);return"boolean"==typeof t?t?d.INSTANCE:u.INSTANCE:new b(e)}cmp(e){return e.type!==this.type?this.type-e.type:O(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return g.create(this.key)}}class v{constructor(e,t){this.key=e,this.value=t,this.type=12}static create(e,t){return new v(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:I(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}evaluate(e){return parseFloat(e.getValue(this.key))>parseFloat(this.value)}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return y.create(this.key,this.value)}}class C{constructor(e,t){this.key=e,this.value=t,this.type=13}static create(e,t){return new C(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:I(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}evaluate(e){return parseFloat(e.getValue(this.key))>=parseFloat(this.value)}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return w.create(this.key,this.value)}}class w{constructor(e,t){this.key=e,this.value=t,this.type=14}static create(e,t){return new w(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:I(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}evaluate(e){return parseFloat(e.getValue(this.key))e.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}evaluate(e){let t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return x.create(this)}}class x{constructor(e){this._actual=e,this.type=8}static create(e){return new x(e)}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}evaluate(e){return!this._actual.evaluate(e)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class L{constructor(e){this.expr=e,this.type=6}static create(e){return L._normalizeArr(e)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const e=t[t.length-1];if(9!==e.type)break;t.pop();const i=t.pop(),n=k.create(e.expr.map((e=>L.create([e,i]))));n&&(t.push(n),t.sort(c))}return 1===t.length?t[0]:new L(t)}}serialize(){return this.expr.map((e=>e.serialize())).join(" && ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){let e=[];for(let t of this.expr)e.push(t.negate());return k.create(e)}}class k{constructor(e){this.expr=e,this.type=9}static create(e){const t=k._normalizeArr(e);if(0!==t.length)return 1===t.length?t[0]:new k(t)}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize())).join(" || ")}keys(){const e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){let e=[];for(let t of this.expr)e.push(t.negate());const t=e=>9===e.type?e.expr:[e];for(;e.length>1;){const i=e.shift(),n=e.shift(),o=[];for(const e of t(i))for(const i of t(n))o.push(h.and(e,i));e.unshift(h.or(...o))}return e[0]}}class D extends g{constructor(e,t,i){super(e),this._defaultValue=t,"object"==typeof i?D._info.push(Object.assign(Object.assign({},i),{key:e})):!0!==i&&D._info.push({key:e,description:i,type:null!=t?typeof t:void 0})}static all(){return D._info.values()}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return h.not(this.key)}isEqualTo(e){return h.equals(this.key,e)}}D._info=[];const N=Object(o.c)("contextKeyService"),E="setContext";function O(e,t){return et?1:0}function I(e,t,i,n){return ei?1:tn?1:0}},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var n,o=i(0),s=i(8);!function(e){e.editorSimpleInput=new s.c("editorSimpleInput",!1,!0),e.editorTextFocus=new s.c("editorTextFocus",!1,o.a("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),e.focus=new s.c("editorFocus",!1,o.a("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),e.textInputFocus=new s.c("textInputFocus",!1,o.a("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),e.readOnly=new s.c("editorReadonly",!1,o.a("editorReadonly","Whether the editor is read only")),e.inDiffEditor=new s.c("inDiffEditor",!1,o.a("inDiffEditor","Whether the context is a diff editor")),e.columnSelection=new s.c("editorColumnSelection",!1,o.a("editorColumnSelection","Whether `editor.columnSelection` is enabled")),e.writable=e.readOnly.toNegated(),e.hasNonEmptySelection=new s.c("editorHasSelection",!1,o.a("editorHasSelection","Whether the editor has text selected")),e.hasOnlyEmptySelection=e.hasNonEmptySelection.toNegated(),e.hasMultipleSelections=new s.c("editorHasMultipleSelections",!1,o.a("editorHasMultipleSelections","Whether the editor has multiple selections")),e.hasSingleSelection=e.hasMultipleSelections.toNegated(),e.tabMovesFocus=new s.c("editorTabMovesFocus",!1,o.a("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),e.tabDoesNotMoveFocus=e.tabMovesFocus.toNegated(),e.isInWalkThroughSnippet=new s.c("isInEmbeddedEditor",!1,!0),e.canUndo=new s.c("canUndo",!1,!0),e.canRedo=new s.c("canRedo",!1,!0),e.hoverVisible=new s.c("editorHoverVisible",!1,o.a("editorHoverVisible","Whether the editor hover is visible")),e.inCompositeEditor=new s.c("inCompositeEditor",void 0,o.a("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),e.notInCompositeEditor=e.inCompositeEditor.toNegated(),e.languageId=new s.c("editorLangId","",o.a("editorLangId","The language identifier of the editor")),e.hasCompletionItemProvider=new s.c("editorHasCompletionItemProvider",!1,o.a("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),e.hasCodeActionsProvider=new s.c("editorHasCodeActionsProvider",!1,o.a("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),e.hasCodeLensProvider=new s.c("editorHasCodeLensProvider",!1,o.a("editorHasCodeLensProvider","Whether the editor has a code lens provider")),e.hasDefinitionProvider=new s.c("editorHasDefinitionProvider",!1,o.a("editorHasDefinitionProvider","Whether the editor has a definition provider")),e.hasDeclarationProvider=new s.c("editorHasDeclarationProvider",!1,o.a("editorHasDeclarationProvider","Whether the editor has a declaration provider")),e.hasImplementationProvider=new s.c("editorHasImplementationProvider",!1,o.a("editorHasImplementationProvider","Whether the editor has an implementation provider")),e.hasTypeDefinitionProvider=new s.c("editorHasTypeDefinitionProvider",!1,o.a("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),e.hasHoverProvider=new s.c("editorHasHoverProvider",!1,o.a("editorHasHoverProvider","Whether the editor has a hover provider")),e.hasDocumentHighlightProvider=new s.c("editorHasDocumentHighlightProvider",!1,o.a("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),e.hasDocumentSymbolProvider=new s.c("editorHasDocumentSymbolProvider",!1,o.a("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),e.hasReferenceProvider=new s.c("editorHasReferenceProvider",!1,o.a("editorHasReferenceProvider","Whether the editor has a reference provider")),e.hasRenameProvider=new s.c("editorHasRenameProvider",!1,o.a("editorHasRenameProvider","Whether the editor has a rename provider")),e.hasSignatureHelpProvider=new s.c("editorHasSignatureHelpProvider",!1,o.a("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),e.hasInlineHintsProvider=new s.c("editorHasInlineHintsProvider",!1,o.a("editorHasInlineHintsProvider","Whether the editor has an inline hints provider")),e.hasDocumentFormattingProvider=new s.c("editorHasDocumentFormattingProvider",!1,o.a("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),e.hasDocumentSelectionFormattingProvider=new s.c("editorHasDocumentSelectionFormattingProvider",!1,o.a("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),e.hasMultipleDocumentFormattingProvider=new s.c("editorHasMultipleDocumentFormattingProvider",!1,o.a("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),e.hasMultipleDocumentSelectionFormattingProvider=new s.c("editorHasMultipleDocumentSelectionFormattingProvider",!1,o.a("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))}(n||(n={}))},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));class n{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new n(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return n.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return n.isBefore(this,e)}static isBefore(e,t){return e.lineNumbero&&(o=e)}return o}if("string"==typeof e)return n?"*"===e?5:e===i?10:0:0;if(e){const{language:o,pattern:s,scheme:r,hasAccessToAllModels:h}=e;if(!n&&!h)return 0;let c=0;if(r)if(r===t.scheme)c=10;else{if("*"!==r)return 0;c=5}if(o)if(o===i)c=10;else{if("*"!==o)return 0;c=Math.max(c,5)}if(s){let e;if(e="string"==typeof s?s:Object.assign(Object.assign({},s),{base:Object(l.d)(s.base)}),e!==t.fsPath&&!Object(a.a)(e,t.fsPath))return 0;c=10}return c}return 0}var c=i(55);function d(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(d):!!e.exclusive)}class u{constructor(){this._clock=0,this._entries=[],this._onDidChange=new s.a}get onDidChange(){return this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Object(r.h)((()=>{if(i){let e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}}))}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(let e of this._entries)e._score>0&&t.push(e.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,(e=>t.push(e.provider))),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,(e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))})),t}_orderedForEach(e,t){if(e){this._updateScores(e);for(const e of this._entries)e._score>0&&t(e)}}_updateScores(e){let t={uri:e.uri.toString(),language:e.getLanguageIdentifier().language};if(!this._lastCandidate||this._lastCandidate.language!==t.language||this._lastCandidate.uri!==t.uri){this._lastCandidate=t;for(let t of this._entries)if(t._score=h(t.selector,e.uri,e.getLanguageIdentifier().language,Object(c.b)(e)),d(t.selector)&&t._score>0){for(let e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(u._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:e._timet._time?-1:0}}var g=i(19);class m{constructor(e,t){this.language=e,this.id=t}}class p{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(1792&e)>>>8}static getFontStyle(e){return(14336&e)>>>11}static getForeground(e){return(8372224&e)>>>14}static getBackground(e){return(4286578688&e)>>>23}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e),i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),t}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;return 1&n&&(o+="font-style: italic;"),2&n&&(o+="font-weight: bold;"),4&n&&(o+="text-decoration: underline;"),o}}const f=function(){let e=Object.create(null);return e[0]="symbol-method",e[1]="symbol-function",e[2]="symbol-constructor",e[3]="symbol-field",e[4]="symbol-variable",e[5]="symbol-class",e[6]="symbol-struct",e[7]="symbol-interface",e[8]="symbol-module",e[9]="symbol-property",e[10]="symbol-event",e[11]="symbol-operator",e[12]="symbol-unit",e[13]="symbol-value",e[14]="symbol-constant",e[15]="symbol-enum",e[16]="symbol-enum-member",e[17]="symbol-keyword",e[27]="symbol-snippet",e[18]="symbol-text",e[19]="symbol-color",e[20]="symbol-file",e[21]="symbol-reference",e[22]="symbol-customcolor",e[23]="symbol-folder",e[24]="symbol-type-parameter",e[25]="account",e[26]="issues",function(t){const i=e[t];let n=i&&g.d.get(i);return n||(console.info("No codicon found for CompletionItemKind "+t),n=g.b.symbolProperty),n.classNames}}();let _=function(){let e=Object.create(null);return e.method=0,e.function=1,e.constructor=2,e.field=3,e.variable=4,e.class=5,e.struct=6,e.interface=7,e.module=8,e.property=9,e.event=10,e.operator=11,e.unit=12,e.value=13,e.constant=14,e.enum=15,e["enum-member"]=16,e.enumMember=16,e.keyword=17,e.snippet=27,e.text=18,e.color=19,e.file=20,e.reference=21,e.customcolor=22,e.folder=23,e["type-parameter"]=24,e.typeParameter=24,e.account=25,e.issue=26,function(t,i){let n=e[t];return void 0!==n||i||(n=9),n}}();var b,v,C,w;function y(e){return e&&n.a.isUri(e.uri)&&o.a.isIRange(e.range)&&(o.a.isIRange(e.originSelectionRange)||o.a.isIRange(e.targetSelectionRange))}!function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(b||(b={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(v||(v={})),function(e){const t=new Map;t.set("file",0),t.set("module",1),t.set("namespace",2),t.set("package",3),t.set("class",4),t.set("method",5),t.set("property",6),t.set("field",7),t.set("constructor",8),t.set("enum",9),t.set("interface",10),t.set("function",11),t.set("variable",12),t.set("constant",13),t.set("string",14),t.set("number",15),t.set("boolean",16),t.set("array",17),t.set("object",18),t.set("key",19),t.set("null",20),t.set("enum-member",21),t.set("struct",22),t.set("event",23),t.set("operator",24),t.set("type-parameter",25);const i=new Map;i.set(0,"file"),i.set(1,"module"),i.set(2,"namespace"),i.set(3,"package"),i.set(4,"class"),i.set(5,"method"),i.set(6,"property"),i.set(7,"field"),i.set(8,"constructor"),i.set(9,"enum"),i.set(10,"interface"),i.set(11,"function"),i.set(12,"variable"),i.set(13,"constant"),i.set(14,"string"),i.set(15,"number"),i.set(16,"boolean"),i.set(17,"array"),i.set(18,"object"),i.set(19,"key"),i.set(20,"null"),i.set(21,"enum-member"),i.set(22,"struct"),i.set(23,"event"),i.set(24,"operator"),i.set(25,"type-parameter"),e.fromString=function(e){return t.get(e)},e.toString=function(e){return i.get(e)},e.toCssClassName=function(e,t){const n=i.get(e);let o=n&&g.d.get("symbol-"+n);return o||(console.info("No codicon found for SymbolKind "+e),o=g.b.symbolProperty),`${t?"inline":"block"} ${o.classNames}`}}(C||(C={}));class S{constructor(e){this.value=e}}S.Comment=new S("comment"),S.Imports=new S("imports"),S.Region=new S("region"),function(e){e[e.Other=0]="Other",e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(w||(w={}));const x=new u,L=new u,k=new u,D=new u,N=new u,E=new u,O=new u,I=new u,T=new u,M=new u,A=new u,R=new u,P=new u,F=new u,W=new u,B=new u,j=new u,V=new u,H=new u,z=new u,U=new u,K=new u,$=new u,q=new u,G=new class{constructor(){this._map=new Map,this._promises=new Map,this._onDidChange=new s.a,this.onDidChange=this._onDidChange.event,this._colorMap=null}fire(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._map.set(e,t),this.fire([e]),Object(r.h)((()=>{this._map.get(e)===t&&(this._map.delete(e),this.fire([e]))}))}registerPromise(e,t){let i=null,n=!1;return this._promises.set(e,t.then((t=>{this._promises.delete(e),!n&&t&&(i=this.register(e,t))}))),Object(r.h)((()=>{n=!0,i&&i.dispose()}))}getPromise(e){const t=this.get(e);if(t)return Promise.resolve(t);const i=this._promises.get(e);return i?i.then((t=>this.get(e))):null}get(e){return this._map.get(e)||null}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._map.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}}},function(e,t,i){"use strict";function n(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}i.d(t,"c",(function(){return o})),i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return a}));class o{constructor(e,t,i,o=1){this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,i)),this.a=n(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class s{constructor(e,t,i,o){this.h=0|Math.max(Math.min(360,e),0),this.s=n(Math.max(Math.min(1,t),0),3),this.l=n(Math.max(Math.min(1,i),0),3),this.a=n(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=e.a,r=Math.max(t,i,n),a=Math.min(t,i,n);let l=0,h=0;const c=(a+r)/2,d=r-a;if(d>0){switch(h=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),r){case t:l=(i-n)/d+(i1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:n,a:r}=e;let a,l,h;if(0===i)a=l=h=n;else{const e=n<.5?n*(1+i):n+i-n*i,o=2*n-e;a=s._hue2rgb(o,e,t+1/3),l=s._hue2rgb(o,e,t),h=s._hue2rgb(o,e,t-1/3)}return new o(Math.round(255*a),Math.round(255*l),Math.round(255*h),r)}}class r{constructor(e,t,i,o){this.h=0|Math.max(Math.min(360,e),0),this.s=n(Math.max(Math.min(1,t),0),3),this.v=n(Math.max(Math.min(1,i),0),3),this.a=n(Math.max(Math.min(1,o),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,o=Math.max(t,i,n),s=o-Math.min(t,i,n),a=0===o?0:s/o;let l;return l=0===s?0:o===t?((i-n)/s%6+6)%6:o===i?(n-t)/s+2:(t-i)/s+4,new r(Math.round(60*l),a,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:s}=e,r=n*i,a=r*(1-Math.abs(t/60%2-1)),l=n-r;let[h,c,d]=[0,0,0];return t<60?(h=r,c=a):t<120?(h=a,c=r):t<180?(c=r,d=a):t<240?(c=a,d=r):t<300?(h=a,d=r):t<=360&&(h=r,d=a),h=Math.round(255*(h+l)),c=Math.round(255*(c+l)),d=Math.round(255*(d+l)),new o(h,c,d,s)}}class a{constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof o)this.rgba=e;else if(e instanceof s)this._hsla=e,this.rgba=s.toRGBA(e);else{if(!(e instanceof r))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=r.toRGBA(e)}}static fromHex(e){return a.Format.CSS.parseHex(e)||a.red}get hsla(){return this._hsla?this._hsla:s.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:r.fromRGBA(this.rgba)}equals(e){return!!e&&o.equals(this.rgba,e.rgba)&&s.equals(this.hsla,e.hsla)&&r.equals(this.hsva,e.hsva)}getRelativeLuminance(){return n(.2126*a._relativeLuminanceForComponent(this.rgba.r)+.7152*a._relativeLuminanceForComponent(this.rgba.g)+.0722*a._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance(){if(C)return"bypassHeatCheck";const e=null==b?void 0:b.env.VSCODE_BROWSER_CODE_LOADING;return"string"==typeof e?"none"===e||"code"===e||"bypassHeatCheck"===e||"bypassHeatCheckAndEagerCompile"===e?e:"bypassHeatCheck":void 0})();if("object"!=typeof navigator||v)if("object"==typeof b){h="win32"===b.platform,c="darwin"===b.platform,d="linux"===b.platform,u=d&&!!b.env.SNAP&&!!b.env.SNAP_REVISION,r=s,f=s;const e=b.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),i=t.availableLanguages["*"];r=t.locale,f=i||s,a=t._translationsConfigFile}catch(e){}g=!0}else console.error("Unable to resolve platform.");else l=navigator.userAgent,h=l.indexOf("Windows")>=0,c=l.indexOf("Macintosh")>=0,p=(l.indexOf("Macintosh")>=0||l.indexOf("iPad")>=0||l.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,d=l.indexOf("Linux")>=0,m=!0,r=navigator.language,f=r;let y=0;c?y=1:h?y=3:d&&(y=2);const S=h,x=c,L=d,k=g,D=m,N=p,E=l,O=function(){if(_.setImmediate)return _.setImmediate.bind(_);if("function"==typeof _.postMessage&&!_.importScripts){let e=[];_.addEventListener("message",(t=>{if(t.data&&t.data.vscodeSetImmediateId)for(let i=0,n=e.length;i{const n=++t;e.push({id:n,callback:i}),_.postMessage({vscodeSetImmediateId:n},"*")}}if("function"==typeof(null==b?void 0:b.nextTick))return b.nextTick.bind(b);const e=Promise.resolve();return t=>e.then(t)}(),I=c||p?2:h?1:3;let T=!0,M=!1;function A(){if(!M){M=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);T=513===t[0]}return T}}).call(this,i(196),i(186))},function(e,t,i){"use strict";function n(e){return Array.isArray(e)}function o(e){return"string"==typeof e}function s(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function r(e){return"number"==typeof e&&!isNaN(e)}function a(e){return!0===e||!1===e}function l(e){return void 0===e}function h(e){return l(e)||null===e}function c(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function d(e){if(h(e))throw new Error("Assertion Failed: argument is undefined or null");return e}function u(e){return"function"==typeof e}function g(e,t){const i=Math.min(e.length,t.length);for(let n=0;nfunction(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)};let n={};for(const t of e)n[t]=i(t);return n}function _(e){return null===e?void 0:e}i.d(t,"e",(function(){return n})),i.d(t,"j",(function(){return o})),i.d(t,"i",(function(){return s})),i.d(t,"h",(function(){return r})),i.d(t,"f",(function(){return a})),i.d(t,"k",(function(){return l})),i.d(t,"l",(function(){return h})),i.d(t,"b",(function(){return c})),i.d(t,"a",(function(){return d})),i.d(t,"g",(function(){return u})),i.d(t,"m",(function(){return g})),i.d(t,"d",(function(){return p})),i.d(t,"c",(function(){return f})),i.d(t,"n",(function(){return _}))},function(e,t,i){"use strict";var n;i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o})),i.d(t,"c",(function(){return r})),i.d(t,"d",(function(){return a})),function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(n||(n={}));const o=r("instantiationService");function s(e,t,i,o){t[n.DI_TARGET]===t?t[n.DI_DEPENDENCIES].push({id:e,index:i,optional:o}):(t[n.DI_DEPENDENCIES]=[{id:e,index:i,optional:o}],t[n.DI_TARGET]=t)}function r(e){if(n.serviceIds.has(e))return n.serviceIds.get(e);const t=function(e,i,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");s(t,e,n,!1)};return t.toString=()=>e,n.serviceIds.set(e,t),t}function a(e){return function(t,i,n){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");s(e,t,n,!0)}}},function(e,t,i){"use strict";i.d(t,"b",(function(){return g})),i.d(t,"f",(function(){return m})),i.d(t,"c",(function(){return p})),i.d(t,"d",(function(){return b})),i.d(t,"e",(function(){return v})),i.d(t,"a",(function(){return C})),i.d(t,"g",(function(){return w}));var n=i(18),o=i(6),s=i(10),r=i(3),a=i(23),l=i(39),h=i(32);const c=()=>!0,d=()=>!1,u=e=>" "===e||"\t"===e;class g{constructor(e,t,i){this._languageIdentifier=e;const n=i.options,o=n.get(127);this.readOnly=n.get(77),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=n.get(101),this.lineHeight=n.get(55),this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=n.get(112),this.wordSeparators=n.get(113),this.emptySelectionClipboard=n.get(30),this.copyWithSyntaxHighlighting=n.get(19),this.multiCursorMergeOverlapping=n.get(65),this.multiCursorPaste=n.get(67),this.autoClosingBrackets=n.get(5),this.autoClosingQuotes=n.get(8),this.autoClosingDelete=n.get(6),this.autoClosingOvertype=n.get(7),this.autoSurround=n.get(11),this.autoIndent=n.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:g._getShouldAutoClose(e,this.autoClosingQuotes),bracket:g._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=h.a.getAutoClosingPairs(e.id);let s=g._getSurroundingPairs(e);if(s)for(const e of s)this.surroundingPairs[e.open]=e.close}static shouldRecreate(e){return e.hasChanged(127)||e.hasChanged(113)||e.hasChanged(30)||e.hasChanged(65)||e.hasChanged(67)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(112)||e.hasChanged(55)||e.hasChanged(77)}get electricChars(){if(!this._electricChars){this._electricChars={};let e=g._getElectricCharacters(this._languageIdentifier);if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}normalizeIndentation(e){return l.b.normalizeIndentation(e,this.indentSize,this.insertSpaces)}static _getElectricCharacters(e){try{return h.a.getElectricCharacters(e.id)}catch(e){return Object(n.e)(e),null}}static _getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return u;case"languageDefined":return g._getLanguageDefinedShouldAutoClose(e);case"always":return c;case"never":return d}}static _getLanguageDefinedShouldAutoClose(e){try{const t=h.a.getAutoCloseBeforeSet(e.id);return e=>-1!==t.indexOf(e)}catch(e){return Object(n.e)(e),d}}static _getSurroundingPairs(e){try{return h.a.getSurroundingPairs(e.id)}catch(e){return Object(n.e)(e),null}}}class m{constructor(e,t,i,n){this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=i,this.leftoverVisibleColumns=n,this.selection=m._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,n){return e?new m(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new s.a(t,i),n):new m(new r.a(t,i,t,i),n,new s.a(t,i),n)}static _computeSelection(e,t){let i,n,o,s;return e.isEmpty()?(i=e.startLineNumber,n=e.startColumn,o=t.lineNumber,s=t.column):t.isBeforeOrEqual(e.getStartPosition())?(i=e.endLineNumber,n=e.endColumn,o=t.lineNumber,s=t.column):(i=e.startLineNumber,n=e.startColumn,o=t.lineNumber,s=t.column),new a.a(i,n,o,s)}}class p{constructor(e,t,i){this.model=e,this.coordinatesConverter=t,this.cursorConfig=i}}class f{constructor(e){this.modelState=e,this.viewState=null}}class _{constructor(e){this.modelState=null,this.viewState=e}}class b{constructor(e,t){this.modelState=e,this.viewState=t}static fromModelState(e){return new f(e)}static fromViewState(e){return new _(e)}static fromModelSelection(e){const t=e.selectionStartLineNumber,i=e.selectionStartColumn,n=e.positionLineNumber,o=e.positionColumn,a=new m(new r.a(t,i,t,i),0,new s.a(n,o),0);return b.fromModelState(a)}static fromModelSelections(e){let t=[];for(let i=0,n=e.length;i=65536?2:1,9===t)r=C.nextRenderTabStop(r,i);else{let i=o.w(t);for(;a=65536?2:1,i=n}o.C(t)||o.A(t)?r+=2:r+=1}}return r}static visibleColumnFromColumn2(e,t,i){return this.visibleColumnFromColumn(t.getLineContent(i.lineNumber),i.column,e.tabSize)}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length;let s=0,r=1,a=0;for(;a=65536?2:1,9===l)h=C.nextRenderTabStop(s,i);else{let t=o.w(l);for(;a=65536?2:1,t=s}h=o.C(l)||o.A(l)?s+2:s+1}const c=a+1;if(h>=t)return h-tr?r:o}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return e+t-e%t}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}}function w(e){return"'"===e||'"'===e||"`"===e}},function(e,t,i){"use strict";i.d(t,"b",(function(){return h})),i.d(t,"g",(function(){return u})),i.d(t,"d",(function(){return d})),i.d(t,"e",(function(){return g})),i.d(t,"a",(function(){return m})),i.d(t,"f",(function(){return f})),i.d(t,"c",(function(){return _}));var n=i(15),o=i(2),s=i(51),r=i(5),a=i(97),l=i(19);const h=Object(n.c)("themeService");var c,d;function u(e){return{id:e}}function g(e){switch(e){case a.a.DARK:return"vs-dark";case a.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}!function(e){e.isThemeColor=function(e){return e&&"object"==typeof e&&"string"==typeof e.id}}(c||(c={})),function(e){e.isThemeIcon=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||c.isThemeColor(e.color))};const t=new RegExp(`^\\$\\((${l.a.iconNameExpression}(?:${l.a.iconModifierExpression})?)\\)$`);e.fromString=function(e){const i=t.exec(e);if(!i)return;let[,n]=i;return{id:n}},e.modify=function(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}},e.isEqual=function(e,t){var i,n;return e.id===t.id&&(null===(i=e.color)||void 0===i?void 0:i.id)===(null===(n=t.color)||void 0===n?void 0:n.id)},e.asClassNameArray=l.a.asClassNameArray,e.asClassName=l.a.asClassName,e.asCSSSelector=l.a.asCSSSelector}(d||(d={}));const m={ThemingContribution:"base.contributions.theming"};let p=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new r.a}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Object(o.h)((()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)}))}getThemingParticipants(){return this.themingParticipants}};function f(e){return p.onColorThemeChange(e)}s.a.add(m.ThemingContribution,p);class _ extends o.a{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((e=>this.onThemeChange(e))))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}},function(e,t,i){"use strict";i.d(t,"e",(function(){return o})),i.d(t,"f",(function(){return s})),i.d(t,"g",(function(){return r})),i.d(t,"d",(function(){return l})),i.d(t,"a",(function(){return h})),i.d(t,"b",(function(){return c})),i.d(t,"c",(function(){return d}));const n=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function o(e){l(e)||n.onUnexpectedError(e)}function s(e){l(e)||n.onUnexpectedExternalError(e)}function r(e){if(e instanceof Error){let{name:t,message:i}=e;return{$isError:!0,name:t,message:i,stack:e.stacktrace||e.stack}}return e}const a="Canceled";function l(e){return e instanceof Error&&e.name===a&&e.message===a}function h(){const e=new Error(a);return e.name=e.message,e}function c(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function d(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}},function(e,t,i){"use strict";i.d(t,"d",(function(){return s})),i.d(t,"e",(function(){return r})),i.d(t,"c",(function(){return a})),i.d(t,"b",(function(){return l})),i.d(t,"a",(function(){return h}));var n=i(5);const o=new class{constructor(){this._icons=new Map,this._onDidRegister=new n.a}add(e){const t=this._icons.get(e.id);t?e.description?t.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}},s=o;function r(e,t){return new l(e,t)}function a(e){return e?e.replace(/\$\((.*?)\)/g,((e,t)=>` ${t} `)).trim():""}class l{constructor(e,t,i){this.id=e,this.definition=t,this.description=i,o.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var h;!function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function i(e){if(e instanceof l)return["codicon","codicon-"+e.id];const n=t.exec(e.id);if(!n)return i(l.error);let[,o,s]=n;const r=["codicon","codicon-"+o];return s&&r.push("codicon-modifier-"+s.substr(1)),r}e.asClassNameArray=i,e.asClassName=function(e){return i(e).join(" ")},e.asCSSSelector=function(e){return"."+i(e).join(".")}}(h||(h={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",{fontCharacter:"\\ea60"}),e.gistNew=new e("gist-new",{fontCharacter:"\\ea60"}),e.repoCreate=new e("repo-create",{fontCharacter:"\\ea60"}),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eb0a"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition)}(l||(l={}))},function(e,t,i){"use strict";function n(e,t=0){return e[e.length-(1+t)]}function o(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function s(e,t,i=((e,t)=>e===t)){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let n=0,o=e.length;n0))return s;o=s-1}}return-(n+1)}function a(e,t){let i=0,n=e.length;if(0===n)return 0;for(;i=t.length)throw new TypeError("invalid index");let n=t[Math.floor(t.length*Math.random())],o=[],s=[],r=[];for(let e of t){const t=i(e,n);t<0?o.push(e):t>0?s.push(e):r.push(e)}return e!!e))}function d(e){return!Array.isArray(e)||0===e.length}function u(e){return Array.isArray(e)&&e.length>0}function g(e,t){if(!t)return e.filter(((t,i)=>e.indexOf(t)===i));const i=Object.create(null);return e.filter((e=>{const n=t(e);return!i[n]&&(i[n]=!0,!0)}))}function m(e){const t=new Set;return e.filter((e=>!t.has(e)&&(t.add(e),!0)))}function p(e,t){return e.length>0?e[0]:t}function f(e){return[].concat(...e)}function _(e,t){let i="number"==typeof t?e:0;"number"==typeof t?i=e:(i=0,t=e);const n=[];if(i<=t)for(let e=i;et;e--)n.push(e);return n}function b(e,t,i){const n=e.slice(0,t),o=e.slice(t);return n.concat(i,o)}function v(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function C(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function w(e){return Array.isArray(e)?e:[e]}i.d(t,"r",(function(){return n})),i.d(t,"s",(function(){return o})),i.d(t,"g",(function(){return s})),i.d(t,"c",(function(){return r})),i.d(t,"h",(function(){return a})),i.d(t,"p",(function(){return l})),i.d(t,"k",(function(){return h})),i.d(t,"d",(function(){return c})),i.d(t,"l",(function(){return d})),i.d(t,"m",(function(){return u})),i.d(t,"e",(function(){return g})),i.d(t,"f",(function(){return m})),i.d(t,"i",(function(){return p})),i.d(t,"j",(function(){return f})),i.d(t,"q",(function(){return _})),i.d(t,"a",(function(){return b})),i.d(t,"o",(function(){return v})),i.d(t,"n",(function(){return C})),i.d(t,"b",(function(){return w}))},function(e,t,i){"use strict";i.d(t,"j",(function(){return a})),i.d(t,"h",(function(){return l})),i.d(t,"k",(function(){return h})),i.d(t,"a",(function(){return d})),i.d(t,"f",(function(){return u})),i.d(t,"l",(function(){return g})),i.d(t,"i",(function(){return m})),i.d(t,"g",(function(){return p})),i.d(t,"c",(function(){return f})),i.d(t,"e",(function(){return _})),i.d(t,"b",(function(){return v})),i.d(t,"d",(function(){return C}));var n=i(31),o=i(18),s=i(2),r=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function a(e){return!!e&&"function"==typeof e.then}function l(e){const t=new n.b,i=e(t.token),s=new Promise(((e,n)=>{t.token.onCancellationRequested((()=>{n(Object(o.a)())})),Promise.resolve(i).then((i=>{t.dispose(),e(i)}),(e=>{t.dispose(),n(e)}))}));return new class{cancel(){t.cancel()}then(e,t){return s.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return s.finally(e)}}}function h(e,t,i){return Promise.race([e,new Promise((e=>t.onCancellationRequested((()=>e(i)))))])}class c{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{this.queuedPromise=null;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise((t=>{this.activePromise.then(e,e).then(t)}))}return new Promise(((e,t)=>{this.queuedPromise.then(e,t)}))}return this.activePromise=e(),new Promise(((e,t)=>{this.activePromise.then((t=>{this.activePromise=null,e(t)}),(e=>{this.activePromise=null,t(e)}))}))}}class d{constructor(e){this.defaultDelay=e,this.timeout=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){return this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(((e,t)=>{this.doResolve=e,this.doReject=t})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}}))),this.timeout=setTimeout((()=>{this.timeout=null,this.doResolve&&this.doResolve(null)}),t),this.completionPromise}isTriggered(){return null!==this.timeout}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject&&this.doReject(Object(o.a)()),this.completionPromise=null)}cancelTimeout(){null!==this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){this.cancelTimeout()}}class u{constructor(e){this.delayer=new d(e),this.throttler=new c}trigger(e,t){return this.delayer.trigger((()=>this.throttler.queue(e)),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose()}}function g(e,t){return t?new Promise(((i,n)=>{const s=setTimeout(i,e);t.onCancellationRequested((()=>{clearTimeout(s),n(Object(o.a)())}))})):l((t=>g(e,t)))}function m(e,t=0){const i=setTimeout(e,t);return Object(s.h)((()=>clearTimeout(i)))}class p{constructor(e,t){this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout((()=>{this._token=-1,e()}),t)}setIfNotSet(e,t){-1===this._token&&(this._token=setTimeout((()=>{this._token=-1,e()}),t))}}class f{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval((()=>{e()}),t)}}class _{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return-1!==this.timeoutToken}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner&&this.runner()}}let b;!function(){if("function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback){const e=Object.freeze({didTimeout:!0,timeRemaining:()=>15});b=t=>{const i=setTimeout((()=>t(e)));let n=!1;return{dispose(){n||(n=!0,clearTimeout(i))}}}}else b=(e,t)=>{const i=requestIdleCallback(e,"number"==typeof t?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(i))}}}}();class v{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(e){this._error=e}finally{this._didRun=!0}},this._handle=b((()=>this._executor()))}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}}var C;!function(e){e.allSettled=function(e){return r(this,void 0,void 0,(function*(){return"function"==typeof Promise.allSettled?function(e){return r(this,void 0,void 0,(function*(){return Promise.allSettled(e)}))}(e):function(e){return r(this,void 0,void 0,(function*(){return Promise.all(e.map((e=>e.then((e=>({status:"fulfilled",value:e})),(e=>({status:"rejected",reason:e}))))))}))}(e)}))},e.settled=function(e){return r(this,void 0,void 0,(function*(){let t;const i=yield Promise.all(e.map((e=>e.then((e=>e),(e=>{t||(t=e)})))));if(void 0!==t)throw t;return i}))}}(C||(C={}))},function(e,t,i){"use strict";i.d(t,"a",(function(){return d})),i.d(t,"b",(function(){return _}));var n=i(13),o=i(50);const s=/^\w[\w\d+.-]*$/,r=/^\//,a=/^\/\//,l="",h="/",c=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{constructor(e,t,i,n,o,c=!1){"object"==typeof e?(this.scheme=e.scheme||l,this.authority=e.authority||l,this.path=e.path||l,this.query=e.query||l,this.fragment=e.fragment||l):(this.scheme=function(e,t){return e||t?e:"file"}(e,c),this.authority=t||l,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==h&&(t=h+t):t=h}return t}(this.scheme,i||l),this.query=n||l,this.fragment=o||l,function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!s.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!r.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,c))}static isUri(e){return e instanceof d||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString}get fsPath(){return _(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:s}=e;return void 0===t?t=this.scheme:null===t&&(t=l),void 0===i?i=this.authority:null===i&&(i=l),void 0===n?n=this.path:null===n&&(n=l),void 0===o?o=this.query:null===o&&(o=l),void 0===s?s=this.fragment:null===s&&(s=l),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&s===this.fragment?this:new g(t,i,n,o,s)}static parse(e,t=!1){const i=c.exec(e);return i?new g(i[2]||l,w(i[4]||l),w(i[5]||l),w(i[7]||l),w(i[9]||l),t):new g(l,l,l,l,l)}static file(e){let t=l;if(n.j&&(e=e.replace(/\\/g,h)),e[0]===h&&e[1]===h){const i=e.indexOf(h,2);-1===i?(t=e.substring(2),e=h):(t=e.substring(2,i),e=e.substring(i)||h)}return new g("file",t,e,l,l)}static from(e){return new g(e.scheme,e.authority,e.path,e.query,e.fragment)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return i=n.j&&"file"===e.scheme?d.file(o.i.join(_(e,!0),...t)).path:o.e.join(e.path,...t),e.with({path:i})}toString(e=!1){return b(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof d)return e;{const t=new g(e);return t._formatted=e.external,t._fsPath=e._sep===u?e.fsPath:null,t}}return e}}const u=n.j?1:void 0;class g extends d{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=_(this,!1)),this._fsPath}toString(e=!1){return e?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=u),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const m={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function p(e,t){let i,n=-1;for(let o=0;o=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||t&&47===s)-1!==n&&(i+=encodeURIComponent(e.substring(n,o)),n=-1),void 0!==i&&(i+=e.charAt(o));else{void 0===i&&(i=e.substr(0,o));const t=m[s];void 0!==t?(-1!==n&&(i+=encodeURIComponent(e.substring(n,o)),n=-1),i+=t):-1===n&&(n=o)}}return-1!==n&&(i+=encodeURIComponent(e.substring(n))),void 0!==i?i:e}function f(e){let t;for(let i=0;i1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,n.j&&(i=i.replace(/\//g,"\\")),i}function b(e,t){const i=t?f:p;let n="",{scheme:o,authority:s,path:r,query:a,fragment:l}=e;if(o&&(n+=o,n+=":"),(s||"file"===o)&&(n+=h,n+=h),s){let e=s.indexOf("@");if(-1!==e){const t=s.substr(0,e);s=s.substr(e+1),e=t.indexOf(":"),-1===e?n+=i(t,!1):(n+=i(t.substr(0,e),!1),n+=":",n+=i(t.substr(e+1),!1)),n+="@"}s=s.toLowerCase(),e=s.indexOf(":"),-1===e?n+=i(s,!1):(n+=i(s.substr(0,e),!1),n+=s.substr(e))}if(r){if(r.length>=3&&47===r.charCodeAt(0)&&58===r.charCodeAt(2)){const e=r.charCodeAt(1);e>=65&&e<=90&&(r=`/${String.fromCharCode(e+32)}:${r.substr(3)}`)}else if(r.length>=2&&58===r.charCodeAt(1)){const e=r.charCodeAt(0);e>=65&&e<=90&&(r=`${String.fromCharCode(e+32)}:${r.substr(2)}`)}n+=i(r,!0)}return a&&(n+="?",n+=i(a,!1)),l&&(n+="#",n+=t?l:p(l,!1)),n}function v(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+v(e.substr(3)):e}}const C=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function w(e){return e.match(C)?e.replace(C,(e=>v(e))):e}},function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i(10),o=i(3);class s extends o.a{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return s.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return 0===this.getDirection()?new s(this.startLineNumber,this.startColumn,e,t):new s(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new n.a(this.positionLineNumber,this.positionColumn)}setStartPosition(e,t){return 0===this.getDirection()?new s(e,t,this.endLineNumber,this.endColumn):new s(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new s(e.lineNumber,e.column,t.lineNumber,t.column)}static liftSelection(e){return new s(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;ii?i:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const i=parseFloat(e);return isNaN(i)?t:i}validate(e){return this.validationFn(f.float(e,this.defaultValue))}}class _ extends u{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n=undefined){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return _.string(e,this.defaultValue)}}function b(e,t,i){return"string"!=typeof e||-1===i.indexOf(e)?t:e}class v extends u{constructor(e,t,i,n,o=undefined){void 0!==o&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return b(e,this.defaultValue,this._allowedValues)}}class C extends c{constructor(e,t,i,n,o,s,r=undefined){void 0!==r&&(r.type="string",r.enum=o,r.default=n),super(e,t,i,r),this._allowedValues=o,this._convert=s}validate(e){return"string"!=typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}var w;!function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(w||(w={}));class y extends c{constructor(){super(41,"fontLigatures",y.OFF,{anyOf:[{type:"boolean",description:n.a("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:n.a("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:n.a("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?y.OFF:"true"===e?y.ON:e:Boolean(e)?y.ON:y.OFF}}y.OFF='"liga" off, "calt" off',y.ON='"liga" on, "calt" on';class S extends c{constructor(){super(43,"fontWeight",D.fontWeight,{anyOf:[{type:"number",minimum:S.MINIMUM_VALUE,maximum:S.MAXIMUM_VALUE,errorMessage:n.a("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:S.SUGGESTION_VALUES}],default:D.fontWeight,description:n.a("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return"normal"===e||"bold"===e?e:String(p.clampedInt(e,D.fontWeight,S.MINIMUM_VALUE,S.MAXIMUM_VALUE))}}S.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],S.MINIMUM_VALUE=1,S.MAXIMUM_VALUE=1e3;class x extends d{constructor(){super(127,[46,54,35,61,89,56,57,91,114,117,118,119,2])}compute(e,t,i){return x.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=e.scrollBeyondLastLine?t-1:0,n=(e.viewLineCount+i)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeyondLastLine:i,desiredRatio:n,minimapLineCount:Math.floor(e.viewLineCount/n)}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,l=e.lineHeight,h=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let u=o>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const g=e.minimap.maxColumn,m=e.minimap.size,p=e.minimap.side,f=e.verticalScrollbarWidth,_=e.viewLineCount,b=e.remainingWidth,v=e.isViewportWrapping,C=d?2:3;let w=Math.floor(o*n);const y=w/o;let S=!1,L=!1,k=C*u,D=u/o,N=1;if("fill"===m||"fit"===m){const{typicalViewportLineCount:i,extraLinesBeyondLastLine:s,desiredRatio:r,minimapLineCount:h}=x.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:c,height:n,lineHeight:l,pixelRatio:o});if(_/h>1)S=!0,L=!0,u=1,k=1,D=u/o;else{let n=!1,h=u+1;if("fit"===m){const i=Math.ceil((_+s)*k);v&&a&&b<=t.stableFitRemainingWidth?(n=!0,h=t.stableFitMaxMinimapScale):(n=i>w,v&&n?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0))}if("fill"===m||n){S=!0;const e=u;k=Math.min(l*o,Math.max(1,Math.floor(1/r))),u=Math.min(h,Math.max(1,Math.floor(k/C))),u>e&&(N=Math.min(2,u/e)),D=u/o/N,w=Math.ceil(Math.max(i,_+s)*k),v&&n&&(t.stableFitMaxMinimapScale=u)}}}const E=Math.floor(g*D),O=Math.min(E,Math.max(0,Math.floor((b-f-2)*D/(h+D)))+r);let I=Math.floor(o*O);const T=I/o;return I=Math.floor(I*N),{renderMinimap:d?1:2,minimapLeft:"left"===p?0:i-O-f,minimapWidth:O,minimapHeightIsEditorHeight:S,minimapIsSampling:L,minimapScale:u,minimapLineHeight:k,minimapCanvasInnerWidth:I,minimapCanvasInnerHeight:w,minimapCanvasOuterWidth:T,minimapCanvasOuterHeight:y}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,o=0|t.lineHeight,s=0|t.lineNumbersDigitCount,r=t.typicalHalfwidthCharacterWidth,a=t.maxDigitWidth,l=t.pixelRatio,c=t.viewLineCount,d=e.get(119),u="inherit"===d?e.get(118):d,g="inherit"===u?e.get(114):u,m=e.get(117),f=e.get(2),_=t.isDominatedByLongLines,b=e.get(46),v=0!==e.get(56).renderType,C=e.get(57),w=e.get(91),y=e.get(61),S=e.get(89),L=S.verticalScrollbarSize,k=S.verticalHasArrows,D=S.arrowSize,N=S.horizontalScrollbarSize,E=e.get(54),O=e.get(35);let I;if("string"==typeof E&&/^\d+(\.\d+)?ch$/.test(E)){const e=parseFloat(E.substr(0,E.length-2));I=p.clampedInt(e*r,0,0,1e3)}else I=p.clampedInt(E,0,0,1e3);O&&(I+=16);let T=0;if(v){const e=Math.max(s,C);T=Math.round(e*a)}let M=0;b&&(M=o);let A=0,R=A+M,P=R+T,F=P+I;const W=i-M-T-I;let B=!1,j=!1,V=-1;2!==f&&("inherit"===u&&_?(B=!0,j=!0):"on"===g||"bounded"===g?j=!0:"wordWrapColumn"===g&&(V=m));const H=x._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:w,minimap:y,verticalScrollbarWidth:L,viewLineCount:c,remainingWidth:W,isViewportWrapping:j},t.memory||new h);0!==H.renderMinimap&&0===H.minimapLeft&&(A+=H.minimapWidth,R+=H.minimapWidth,P+=H.minimapWidth,F+=H.minimapWidth);const z=W-H.minimapWidth,U=Math.max(1,Math.floor((z-L-2)/r)),K=k?D:0;return j&&(V=Math.max(1,U),"bounded"===g&&(V=Math.min(V,m))),{width:i,height:n,glyphMarginLeft:A,glyphMarginWidth:M,lineNumbersLeft:R,lineNumbersWidth:T,decorationsLeft:P,decorationsWidth:I,contentLeft:F,contentWidth:z,minimap:H,viewportColumn:U,isWordWrapMinified:B,isViewportWrapping:j,wrappingColumn:V,verticalScrollbarWidth:L,horizontalScrollbarHeight:N,overviewRuler:{top:K,width:L,height:n-2*K,right:0}}}}function L(e){const t=e.get(84);return"editable"===t?e.get(77):"on"!==t}function k(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}const D={fontFamily:o.f?"Menlo, Monaco, 'Courier New', monospace":o.d?"'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:o.f?12:14,lineHeight:0,letterSpacing:0},N={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0},E=[];function O(e){return E[e.id]=e,e}const I={acceptSuggestionOnCommitCharacter:O(new m(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:n.a("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:O(new v(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",n.a("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:n.a("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:O(new class extends c{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[n.a("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),n.a("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled."),n.a("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:"auto",description:n.a("accessibilitySupport","Controls whether the editor should run in a mode where it is optimized for screen readers. Setting to on will disable word wrapping.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}}),accessibilityPageSize:O(new p(3,"accessibilityPageSize",10,1,1073741824,{description:n.a("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default.")})),ariaLabel:O(new _(4,"ariaLabel",n.a("editorViewAccessibleLabel","Editor content"))),autoClosingBrackets:O(new v(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",n.a("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),n.a("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:n.a("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingDelete:O(new v(6,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",n.a("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:n.a("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:O(new v(7,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",n.a("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:n.a("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:O(new v(8,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",n.a("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),n.a("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:n.a("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:O(new C(9,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],(function(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}),{enumDescriptions:[n.a("editor.autoIndent.none","The editor will not insert indentation automatically."),n.a("editor.autoIndent.keep","The editor will keep the current line's indentation."),n.a("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),n.a("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),n.a("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:n.a("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:O(new m(10,"automaticLayout",!1)),autoSurround:O(new v(11,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[n.a("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),n.a("editor.autoSurround.quotes","Surround with quotes but not brackets."),n.a("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:n.a("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),stickyTabStops:O(new m(101,"stickyTabStops",!1,{description:n.a("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:O(new m(12,"codeLens",!0,{description:n.a("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:O(new _(13,"codeLensFontFamily","",{description:n.a("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:O(new p(14,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,description:n.a("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to `0`, the 90% of `#editor.fontSize#` is used.")})),colorDecorators:O(new m(15,"colorDecorators",!0,{description:n.a("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),columnSelection:O(new m(16,"columnSelection",!1,{description:n.a("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:O(new class extends c{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(17,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:n.a("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:n.a("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:g(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:g(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}),contextmenu:O(new m(18,"contextmenu",!0)),copyWithSyntaxHighlighting:O(new m(19,"copyWithSyntaxHighlighting",!0,{description:n.a("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:O(new C(20,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],(function(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}),{description:n.a("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:O(new m(21,"cursorSmoothCaretAnimation",!1,{description:n.a("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:O(new C(22,"cursorStyle",w.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],(function(e){switch(e){case"line":return w.Line;case"block":return w.Block;case"underline":return w.Underline;case"line-thin":return w.LineThin;case"block-outline":return w.BlockOutline;case"underline-thin":return w.UnderlineThin}}),{description:n.a("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:O(new p(23,"cursorSurroundingLines",0,0,1073741824,{description:n.a("cursorSurroundingLines","Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:O(new v(24,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[n.a("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),n.a("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],description:n.a("cursorSurroundingLinesStyle","Controls when `cursorSurroundingLines` should be enforced.")})),cursorWidth:O(new p(25,"cursorWidth",0,0,1073741824,{markdownDescription:n.a("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:O(new m(26,"disableLayerHinting",!1)),disableMonospaceOptimizations:O(new m(27,"disableMonospaceOptimizations",!1)),domReadOnly:O(new m(28,"domReadOnly",!1)),dragAndDrop:O(new m(29,"dragAndDrop",!0,{description:n.a("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:O(new class extends m{constructor(){super(30,"emptySelectionClipboard",!0,{description:n.a("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}),extraEditorClassName:O(new _(31,"extraEditorClassName","")),fastScrollSensitivity:O(new f(32,"fastScrollSensitivity",5,(e=>e<=0?5:e),{markdownDescription:n.a("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:O(new class extends c{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:!0,autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(33,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:n.a("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"boolean",default:e.seedSearchStringFromSelection,description:n.a("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[n.a("editor.find.autoFindInSelection.never","Never turn on Find in selection automatically (default)."),n.a("editor.find.autoFindInSelection.always","Always turn on Find in selection automatically."),n.a("editor.find.autoFindInSelection.multiline","Turn on Find in selection automatically when multiple lines of content are selected.")],description:n.a("find.autoFindInSelection","Controls the condition for turning on find in selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:n.a("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:o.f},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:n.a("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:n.a("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:g(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:g(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":b(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:g(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:g(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:g(t.loop,this.defaultValue.loop)}}}),fixedOverflowWidgets:O(new m(34,"fixedOverflowWidgets",!1)),folding:O(new m(35,"folding",!0,{description:n.a("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:O(new v(36,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[n.a("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),n.a("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:n.a("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:O(new m(37,"foldingHighlight",!0,{description:n.a("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),unfoldOnClickAfterEndOfLine:O(new m(38,"unfoldOnClickAfterEndOfLine",!1,{description:n.a("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:O(new _(39,"fontFamily",D.fontFamily,{description:n.a("fontFamily","Controls the font family.")})),fontInfo:O(new class extends d{constructor(){super(40)}compute(e,t,i){return e.fontInfo}}),fontLigatures2:O(new y),fontSize:O(new class extends u{constructor(){super(42,"fontSize",D.fontSize,{type:"number",minimum:6,maximum:100,default:D.fontSize,description:n.a("fontSize","Controls the font size in pixels.")})}validate(e){let t=f.float(e,this.defaultValue);return 0===t?D.fontSize:f.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}),fontWeight:O(new S),formatOnPaste:O(new m(44,"formatOnPaste",!1,{description:n.a("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:O(new m(45,"formatOnType",!1,{description:n.a("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:O(new m(46,"glyphMargin",!0,{description:n.a("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:O(new class extends c{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[n.a("editor.gotoLocation.multiple.peek","Show peek view of the results (default)"),n.a("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),n.a("editor.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(47,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:n.a("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:n.a("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:n.a("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:n.a("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:n.a("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:n.a("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:n.a("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:n.a("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:n.a("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:n.a("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:n.a("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,o,s;if(!e||"object"!=typeof e)return this.defaultValue;const r=e;return{multiple:b(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:b(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:b(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:b(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(o=r.multipleImplementations)&&void 0!==o?o:b(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(s=r.multipleReferences)&&void 0!==s?s:b(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:_.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:_.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:_.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:_.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:_.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}),hideCursorInOverviewRuler:O(new m(48,"hideCursorInOverviewRuler",!1,{description:n.a("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),highlightActiveIndentGuide:O(new m(49,"highlightActiveIndentGuide",!0,{description:n.a("highlightActiveIndentGuide","Controls whether the editor should highlight the active indent guide.")})),hover:O(new class extends c{constructor(){const e={enabled:!0,delay:300,sticky:!0};super(50,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:n.a("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,description:n.a("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:n.a("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:g(t.enabled,this.defaultValue.enabled),delay:p.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:g(t.sticky,this.defaultValue.sticky)}}}),inDiffEditor:O(new m(51,"inDiffEditor",!1)),letterSpacing:O(new f(52,"letterSpacing",D.letterSpacing,(e=>f.clamp(e,-5,20)),{description:n.a("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:O(new class extends c{constructor(){const e={enabled:!0};super(53,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:n.a("codeActions","Enables the code action lightbulb in the editor.")}})}validate(e){return e&&"object"==typeof e?{enabled:g(e.enabled,this.defaultValue.enabled)}:this.defaultValue}}),lineDecorationsWidth:O(new u(54,"lineDecorationsWidth",10)),lineHeight:O(new class extends p{constructor(){super(55,"lineHeight",D.lineHeight,0,150,{description:n.a("lineHeight","Controls the line height. Use 0 to compute the line height from the font size.")})}compute(e,t,i){return e.fontInfo.lineHeight}}),lineNumbers:O(new class extends c{constructor(){super(56,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[n.a("lineNumbers.off","Line numbers are not rendered."),n.a("lineNumbers.on","Line numbers are rendered as absolute number."),n.a("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),n.a("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:n.a("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}),lineNumbersMinChars:O(new p(57,"lineNumbersMinChars",5,1,300)),linkedEditing:O(new m(58,"linkedEditing",!1,{description:n.a("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.")})),links:O(new m(59,"links",!0,{description:n.a("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:O(new v(60,"matchBrackets","always",["always","near","never"],{description:n.a("matchBrackets","Highlight matching brackets.")})),minimap:O(new class extends c{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(61,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:n.a("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[n.a("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),n.a("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),n.a("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:n.a("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:n.a("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:n.a("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:n.a("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:n.a("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:n.a("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:g(t.enabled,this.defaultValue.enabled),size:b(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:b(t.side,this.defaultValue.side,["right","left"]),showSlider:b(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:g(t.renderCharacters,this.defaultValue.renderCharacters),scale:p.clampedInt(t.scale,1,1,3),maxColumn:p.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}),mouseStyle:O(new v(62,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:O(new f(63,"mouseWheelScrollSensitivity",1,(e=>0===e?1:e),{markdownDescription:n.a("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:O(new m(64,"mouseWheelZoom",!1,{markdownDescription:n.a("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:O(new m(65,"multiCursorMergeOverlapping",!0,{description:n.a("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:O(new C(66,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],(function(e){return"ctrlCmd"===e?o.f?"metaKey":"ctrlKey":"altKey"}),{markdownEnumDescriptions:[n.a("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),n.a("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:n.a({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go To Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier. [Read more](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:O(new v(67,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[n.a("multiCursorPaste.spread","Each cursor pastes a single line of the text."),n.a("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:n.a("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),occurrencesHighlight:O(new m(68,"occurrencesHighlight",!0,{description:n.a("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:O(new m(69,"overviewRulerBorder",!0,{description:n.a("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:O(new p(70,"overviewRulerLanes",3,0,3)),padding:O(new class extends c{constructor(){super(71,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:n.a("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:n.a("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:p.clampedInt(t.top,0,0,1e3),bottom:p.clampedInt(t.bottom,0,0,1e3)}}}),parameterHints:O(new class extends c{constructor(){const e={enabled:!0,cycle:!1};super(72,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:n.a("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:n.a("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:g(t.enabled,this.defaultValue.enabled),cycle:g(t.cycle,this.defaultValue.cycle)}}}),peekWidgetDefaultFocus:O(new v(73,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[n.a("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),n.a("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:n.a("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:O(new m(74,"definitionLinkOpensInPeek",!1,{description:n.a("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:O(new class extends c{constructor(){const e={other:!0,comments:!1,strings:!1};super(75,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:n.a("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{type:"boolean",default:e.comments,description:n.a("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{type:"boolean",default:e.other,description:n.a("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}}}],default:e,description:n.a("quickSuggestions","Controls whether suggestions should automatically show up while typing.")}),this.defaultValue=e}validate(e){if("boolean"==typeof e)return e;if(e&&"object"==typeof e){const t=e,i={other:g(t.other,this.defaultValue.other),comments:g(t.comments,this.defaultValue.comments),strings:g(t.strings,this.defaultValue.strings)};return!!(i.other&&i.comments&&i.strings)||!!(i.other||i.comments||i.strings)&&i}return this.defaultValue}}),quickSuggestionsDelay:O(new p(76,"quickSuggestionsDelay",10,0,1073741824,{description:n.a("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:O(new m(77,"readOnly",!1)),renameOnType:O(new m(78,"renameOnType",!1,{description:n.a("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:n.a("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:O(new m(79,"renderControlCharacters",!1,{description:n.a("renderControlCharacters","Controls whether the editor should render control characters.")})),renderIndentGuides:O(new m(80,"renderIndentGuides",!0,{description:n.a("renderIndentGuides","Controls whether the editor should render indent guides.")})),renderFinalNewline:O(new m(81,"renderFinalNewline",!0,{description:n.a("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:O(new v(82,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",n.a("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:n.a("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:O(new m(83,"renderLineHighlightOnlyWhenFocus",!1,{description:n.a("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:O(new v(84,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:O(new v(85,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",n.a("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),n.a("renderWhitespace.selection","Render whitespace characters only on selected text."),n.a("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:n.a("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:O(new p(86,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:O(new m(87,"roundedSelection",!0,{description:n.a("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:O(new class extends c{constructor(){const e=[],t={type:"number",description:n.a("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(88,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:n.a("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:n.a("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){let t=[];for(let i of e)if("number"==typeof i)t.push({column:p.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:p.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort(((e,t)=>e.column-t.column)),t}return this.defaultValue}}),scrollbar:O(new class extends c{constructor(){super(89,"scrollbar",{vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=p.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=p.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:p.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:k(t.vertical,this.defaultValue.vertical),horizontal:k(t.horizontal,this.defaultValue.horizontal),useShadows:g(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:g(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:g(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:g(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:g(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:p.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:p.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:g(t.scrollByPage,this.defaultValue.scrollByPage)}}}),scrollBeyondLastColumn:O(new p(90,"scrollBeyondLastColumn",5,0,1073741824,{description:n.a("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:O(new m(91,"scrollBeyondLastLine",!0,{description:n.a("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:O(new m(92,"scrollPredominantAxis",!0,{description:n.a("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:O(new m(93,"selectionClipboard",!0,{description:n.a("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:o.d})),selectionHighlight:O(new m(94,"selectionHighlight",!0,{description:n.a("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:O(new m(95,"selectOnLineNumbers",!0)),showFoldingControls:O(new v(96,"showFoldingControls","mouseover",["always","mouseover"],{enumDescriptions:[n.a("showFoldingControls.always","Always show the folding controls."),n.a("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:n.a("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:O(new m(97,"showUnused",!0,{description:n.a("showUnused","Controls fading out of unused code.")})),showDeprecated:O(new m(122,"showDeprecated",!0,{description:n.a("showDeprecated","Controls strikethrough deprecated variables.")})),inlineHints:O(new class extends c{constructor(){const e={enabled:!0,fontSize:0,fontFamily:D.fontFamily};super(123,"inlineHints",e,{"editor.inlineHints.enabled":{type:"boolean",default:e.enabled,description:n.a("inlineHints.enable","Enables the inline hints in the editor.")},"editor.inlineHints.fontSize":{type:"number",default:e.fontSize,description:n.a("inlineHints.fontSize","Controls font size of inline hints in the editor. When set to `0`, the 90% of `#editor.fontSize#` is used.")},"editor.inlineHints.fontFamily":{type:"string",default:e.fontFamily,description:n.a("inlineHints.fontFamily","Controls font family of inline hints in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:g(t.enabled,this.defaultValue.enabled),fontSize:p.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:_.string(t.fontFamily,this.defaultValue.fontFamily)}}}),snippetSuggestions:O(new v(98,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[n.a("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),n.a("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),n.a("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),n.a("snippetSuggestions.none","Do not show snippet suggestions.")],description:n.a("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:O(new class extends c{constructor(){super(99,"smartSelect",{selectLeadingAndTrailingWhitespace:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:n.a("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"==typeof e?{selectLeadingAndTrailingWhitespace:g(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}:this.defaultValue}}),smoothScrolling:O(new m(100,"smoothScrolling",!1,{description:n.a("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:O(new p(102,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:O(new class extends c{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!0,localityBonus:!1,shareSuggestSelections:!1,showIcons:!0,showStatusBar:!1,showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(103,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[n.a("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),n.a("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:n.a("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:n.a("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:n.a("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:n.a("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:n.a("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:n.a("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:n.a("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:n.a("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:n.a("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:n.a("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:n.a("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertMode:b(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:g(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:g(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:g(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:g(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:g(t.showIcons,this.defaultValue.showIcons),showStatusBar:g(t.showStatusBar,this.defaultValue.showStatusBar),showInlineDetails:g(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:g(t.showMethods,this.defaultValue.showMethods),showFunctions:g(t.showFunctions,this.defaultValue.showFunctions),showConstructors:g(t.showConstructors,this.defaultValue.showConstructors),showFields:g(t.showFields,this.defaultValue.showFields),showVariables:g(t.showVariables,this.defaultValue.showVariables),showClasses:g(t.showClasses,this.defaultValue.showClasses),showStructs:g(t.showStructs,this.defaultValue.showStructs),showInterfaces:g(t.showInterfaces,this.defaultValue.showInterfaces),showModules:g(t.showModules,this.defaultValue.showModules),showProperties:g(t.showProperties,this.defaultValue.showProperties),showEvents:g(t.showEvents,this.defaultValue.showEvents),showOperators:g(t.showOperators,this.defaultValue.showOperators),showUnits:g(t.showUnits,this.defaultValue.showUnits),showValues:g(t.showValues,this.defaultValue.showValues),showConstants:g(t.showConstants,this.defaultValue.showConstants),showEnums:g(t.showEnums,this.defaultValue.showEnums),showEnumMembers:g(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:g(t.showKeywords,this.defaultValue.showKeywords),showWords:g(t.showWords,this.defaultValue.showWords),showColors:g(t.showColors,this.defaultValue.showColors),showFiles:g(t.showFiles,this.defaultValue.showFiles),showReferences:g(t.showReferences,this.defaultValue.showReferences),showFolders:g(t.showFolders,this.defaultValue.showFolders),showTypeParameters:g(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:g(t.showSnippets,this.defaultValue.showSnippets),showUsers:g(t.showUsers,this.defaultValue.showUsers),showIssues:g(t.showIssues,this.defaultValue.showIssues)}}}),suggestFontSize:O(new p(104,"suggestFontSize",0,0,1e3,{markdownDescription:n.a("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")})),suggestLineHeight:O(new p(105,"suggestLineHeight",0,0,1e3,{markdownDescription:n.a("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used. The minimum value is 8.")})),suggestOnTriggerCharacters:O(new m(106,"suggestOnTriggerCharacters",!0,{description:n.a("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:O(new v(107,"suggestSelection","recentlyUsed",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[n.a("suggestSelection.first","Always select the first suggestion."),n.a("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),n.a("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:n.a("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:O(new v(108,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[n.a("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),n.a("tabCompletion.off","Disable tab completions."),n.a("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:n.a("tabCompletion","Enables tab completions.")})),tabIndex:O(new p(109,"tabIndex",0,-1,1073741824)),unusualLineTerminators:O(new v(110,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[n.a("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),n.a("unusualLineTerminators.off","Unusual line terminators are ignored."),n.a("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:n.a("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:O(new m(111,"useShadowDOM",!0)),useTabStops:O(new m(112,"useTabStops",!0,{description:n.a("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordSeparators:O(new _(113,"wordSeparators",s.b,{description:n.a("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:O(new v(114,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[n.a("wordWrap.off","Lines will never wrap."),n.a("wordWrap.on","Lines will wrap at the viewport width."),n.a({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),n.a({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:n.a({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:O(new _(115,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:O(new _(116,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:O(new p(117,"wordWrapColumn",80,1,1073741824,{markdownDescription:n.a({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:O(new v(118,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:O(new v(119,"wordWrapOverride2","inherit",["off","on","inherit"])),wrappingIndent:O(new C(120,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],(function(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}),{enumDescriptions:[n.a("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),n.a("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),n.a("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),n.a("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:n.a("wrappingIndent","Controls the indentation of wrapped lines.")})),wrappingStrategy:O(new v(121,"wrappingStrategy","simple",["simple","advanced"],{enumDescriptions:[n.a("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),n.a("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],description:n.a("wrappingStrategy","Controls the algorithm that computes wrapping points.")})),editorClassName:O(new class extends d{constructor(){super(124,[62,31])}compute(e,t,i){const n=["monaco-editor"];return t.get(31)&&n.push(t.get(31)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(62)?n.push("mouse-default"):"copy"===t.get(62)&&n.push("mouse-copy"),t.get(97)&&n.push("showUnused"),t.get(122)&&n.push("showDeprecated"),n.join(" ")}}),pixelRatio:O(new class extends d{constructor(){super(125)}compute(e,t,i){return e.pixelRatio}}),tabFocusMode:O(new class extends d{constructor(){super(126,[77])}compute(e,t,i){return!!t.get(77)||e.tabFocusMode}}),layoutInfo:O(new x),wrappingInfo:O(new class extends d{constructor(){super(128,[127])}compute(e,t,i){const n=t.get(127);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}})}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),i.d(t,"c",(function(){return s})),i.d(t,"b",(function(){return r}));var n=i(5);const o=(e,t,i)=>{const o=e=>s.fire(e),s=new n.a({onFirstListenerAdd:()=>{e.addEventListener(t,o,i)},onLastListenerRemove:()=>{e.removeEventListener(t,o,i)}});return s.event};function s(e){return e.preventDefault(),e.stopPropagation(),e}function r(e){return n.b.map(e,s)}},function(e,t,i){"use strict";i.d(t,"b",(function(){return h})),i.d(t,"a",(function(){return c}));var n=i(2),o=i(14),s=i(15),r=i(5),a=i(72),l=i(35);const h=Object(s.c)("commandService"),c=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new r.a,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){const t=[];for(let i of e.description.args)t.push(i.constraint);const i=e.handler;e.handler=function(e,...n){return Object(o.m)(n,t),i(e,...n)}}const{id:i}=e;let s=this._commands.get(i);s||(s=new a.a,this._commands.set(i,s));let r=s.unshift(e),l=Object(n.h)((()=>{r();const e=this._commands.get(i);(null==e?void 0:e.isEmpty())&&this._commands.delete(i)}));return this._onDidRegisterCommand.fire(i),l}registerCommandAlias(e,t){return c.registerCommand(e,((e,...i)=>e.get(h).executeCommand(t,...i)))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return l.a.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const i=this.getCommand(t);i&&e.set(t,i)}return e}};c.registerCommand("noop",(()=>{}))},function(e,t,i){"use strict";i.d(t,"f",(function(){return m})),i.d(t,"b",(function(){return p})),i.d(t,"a",(function(){return f})),i.d(t,"d",(function(){return _})),i.d(t,"e",(function(){return b})),i.d(t,"c",(function(){return v}));var n=i(48),o=i(15),s=i(8),r=i(27),a=i(2),l=i(5),h=i(17),c=i(35),d=i(72),u=i(19),g=function(e,t){return function(i,n){t(i,n,e)}};function m(e){return void 0!==e.command}class p{constructor(e){this.id=p._idPool++,this._debugName=e}}p._idPool=0,p.CommandPalette=new p("CommandPalette"),p.EditorContext=new p("EditorContext"),p.EditorContextCopy=new p("EditorContextCopy"),p.EditorContextPeek=new p("EditorContextPeek"),p.MenubarEditMenu=new p("MenubarEditMenu"),p.MenubarCopy=new p("MenubarCopy"),p.MenubarGoMenu=new p("MenubarGoMenu"),p.MenubarSelectionMenu=new p("MenubarSelectionMenu");const f=Object(o.c)("menuService"),_=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new l.a,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:e=>e===p.CommandPalette}}addCommand(e){return this.addCommands(c.a.single(e))}addCommands(e){for(const t of e)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(a.h)((()=>{let t=!1;for(const i of e)t=this._commands.delete(i.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)}))}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach(((t,i)=>e.set(i,t))),e}appendMenuItem(e,t){return this.appendMenuItems(c.a.single({id:e,item:t}))}appendMenuItems(e){const t=new Set,i=new d.a;for(const{id:n,item:o}of e){let e=this._menuItems.get(n);e||(e=new d.a,this._menuItems.set(n,e)),i.push(e.push(o)),t.add(n)}return this._onDidChangeMenu.fire(t),Object(a.h)((()=>{if(i.size>0){for(let e of i)e();this._onDidChangeMenu.fire(t),i.clear()}}))}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===p.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)m(i)&&(t.add(i.command.id),i.alt&&t.add(i.alt.id));this._commands.forEach(((i,n)=>{t.has(n)||e.push({command:i})}))}};class b extends n.e{constructor(e,t,i,n){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,[],"submenu"),this.item=e,this._menuService=t,this._contextKeyService=i,this._options=n}get actions(){const e=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),i=t.getActions(this._options);t.dispose();for(const[,t]of i)t.length>0&&(e.push(...t),e.push(new n.d));return e.length&&e.pop(),e}}let v=class e{constructor(t,i,n,o,s){var r;if(this._commandService=s,this.id=t.id,this.label="string"==typeof t.title?t.title:t.title.value,this.tooltip=null!==(r=t.tooltip)&&void 0!==r?r:"",this.enabled=!t.precondition||o.contextMatchesRules(t.precondition),this.checked=!1,t.toggled){const e=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=o.contextMatchesRules(e.condition),this.checked&&e.tooltip&&(this.tooltip="string"==typeof e.tooltip?e.tooltip:e.tooltip.value),e.title&&(this.label="string"==typeof e.title?e.title:e.title.value)}this.item=t,this.alt=i?new e(i,void 0,n,o,s):void 0,this._options=n,h.d.isThemeIcon(t.icon)&&(this.class=u.a.asClassName(t.icon))}dispose(){}run(...e){var t,i;let n=[];return(null===(t=this._options)||void 0===t?void 0:t.arg)&&(n=[...n,this._options.arg]),(null===(i=this._options)||void 0===i?void 0:i.shouldForwardArgs)&&(n=[...n,...e]),this._commandService.executeCommand(this.id,...n)}};v=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([g(3,s.b),g(4,r.b)],v)},function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return o}));class n{constructor(e){this.domNode=e,this._maxWidth=-1,this._width=-1,this._height=-1,this._top=-1,this._left=-1,this._bottom=-1,this._right=-1,this._fontFamily="",this._fontWeight="",this._fontSize=-1,this._fontFeatureSettings="",this._lineHeight=-1,this._letterSpacing=-100,this._className="",this._display="",this._position="",this._visibility="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth+"px")}setWidth(e){this._width!==e&&(this._width=e,this.domNode.style.width=this._width+"px")}setHeight(e){this._height!==e&&(this._height=e,this.domNode.style.height=this._height+"px")}setTop(e){this._top!==e&&(this._top=e,this.domNode.style.top=this._top+"px")}unsetTop(){-1!==this._top&&(this._top=-1,this.domNode.style.top="")}setLeft(e){this._left!==e&&(this._left=e,this.domNode.style.left=this._left+"px")}setBottom(e){this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom+"px")}setRight(e){this._right!==e&&(this._right=e,this.domNode.style.right=this._right+"px")}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize+"px")}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setLineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight+"px")}setLetterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing+"px")}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function o(e){return new n(e)}},function(e,t,i){"use strict";i.d(t,"d",(function(){return s})),i.d(t,"b",(function(){return r})),i.d(t,"l",(function(){return a})),i.d(t,"c",(function(){return l})),i.d(t,"a",(function(){return h})),i.d(t,"g",(function(){return d})),i.d(t,"j",(function(){return u})),i.d(t,"f",(function(){return g})),i.d(t,"h",(function(){return m})),i.d(t,"k",(function(){return p})),i.d(t,"e",(function(){return f})),i.d(t,"i",(function(){return _}));var n=i(5);class o{constructor(){this._zoomLevel=0,this._lastZoomLevelChangeTime=0,this._onDidChangeZoomLevel=new n.a,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this._zoomFactor=1}getZoomLevel(){return this._zoomLevel}getTimeSinceLastZoomLevelChanged(){return Date.now()-this._lastZoomLevelChangeTime}getZoomFactor(){return this._zoomFactor}getPixelRatio(){let e=document.createElement("canvas").getContext("2d");return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}}function s(){return o.INSTANCE.getZoomLevel()}function r(){return o.INSTANCE.getTimeSinceLastZoomLevelChanged()}function a(e){return o.INSTANCE.onDidChangeZoomLevel(e)}function l(){return o.INSTANCE.getZoomFactor()}function h(){return o.INSTANCE.getPixelRatio()}o.INSTANCE=new o;const c=navigator.userAgent,d=c.indexOf("Firefox")>=0,u=c.indexOf("AppleWebKit")>=0,g=c.indexOf("Chrome")>=0,m=!g&&c.indexOf("Safari")>=0,p=!g&&!m&&u,f=(c.indexOf("iPad")>=0||m&&navigator.maxTouchPoints,c.indexOf("Android")>=0),_=window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches},function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return a}));var n=i(5);const o=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var s;!function(e){e.isCancellationToken=function(t){return t===e.None||t===e.Cancelled||t instanceof r||!(!t||"object"!=typeof t)&&"boolean"==typeof t.isCancellationRequested&&"function"==typeof t.onCancellationRequested},e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.b.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:o})}(s||(s={}));class r{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?o:(this._emitter||(this._emitter=new n.a),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class a{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new r),this._token}cancel(){this._token?this._token instanceof r&&this._token.cancel():this._token=s.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof r&&this._token.dispose():this._token=s.None}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return C}));var n=i(5),o=i(2),s=i(6),r=i(113),a=i(57),l=i(90);class h{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map((e=>new a.c(e))):e.brackets?this._autoClosingPairs=e.brackets.map((e=>new a.c({open:e[0],close:e[1]}))):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new a.c({open:t.open,close:t.close||""}))}this._autoCloseBefore="string"==typeof e.autoCloseBefore?e.autoCloseBefore:h.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(){return this._autoCloseBefore}static shouldAutoClosePair(e,t,i){if(0===t.getTokenCount())return!0;const n=t.findTokenIndexAtOffset(i-2),o=t.getStandardTokenType(n);return e.isOK(o)}getSurroundingPairs(){return this._surroundingPairs}}h.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=";:.,=}])> \n\t";var c=i(96);class d{constructor(e){this._richEditBrackets=e}getElectricCharacters(){let e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const t=i.charAt(i.length-1);e.push(t)}return e=e.filter(((e,t,i)=>i.indexOf(e)===t)),e}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const n=t.findTokenIndexAtOffset(i-1);if(Object(l.b)(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,r=c.a.findPrevBracketInRange(o,1,s,0,s.length);if(!r)return null;const a=s.substring(r.startColumn-1,r.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;const h=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(h)?{matchOpenBracket:a}:null}}function u(e){return e.global&&(e.lastIndex=0),!0}class g{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&u(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&u(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&u(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&u(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}var m=i(18);class p{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach((e=>{const t=p._createOpenBracketRegExp(e[0]),i=p._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})})),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let e=0,o=this._regExpRules.length;e!e.reg||e.reg.test(e.text))))return o.action}if(e>=2&&i.length>0&&n.length>0)for(let e=0,t=this._brackets.length;e=2&&i.length>0)for(let e=0,t=this._brackets.length;e{for(let e=0;e{s.dispose(),this._onDidChange.fire(new _(e))}))}_getRichEditSupport(e){const t=this._entries2.get(e);return t?t.getRichEditSupport():null}getIndentationRules(e){const t=this._getRichEditSupport(e);return t&&t.indentationRules||null}_getElectricCharacterSupport(e){let t=this._getRichEditSupport(e);return t&&t.electricCharacter||null}getElectricCharacters(e){let t=this._getElectricCharacterSupport(e);return t?t.getElectricCharacters():[]}onElectricCharacter(e,t,i){let n=Object(l.a)(t,i-1),o=this._getElectricCharacterSupport(n.languageId);return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}getComments(e){let t=this._getRichEditSupport(e);return t&&t.comments||null}_getCharacterPairSupport(e){let t=this._getRichEditSupport(e);return t&&t.characterPair||null}getAutoClosingPairs(e){const t=this._getCharacterPairSupport(e);return new a.a(t?t.getAutoClosingPairs():[])}getAutoCloseBeforeSet(e){let t=this._getCharacterPairSupport(e);return t?t.getAutoCloseBeforeSet():h.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED}getSurroundingPairs(e){let t=this._getCharacterPairSupport(e);return t?t.getSurroundingPairs():[]}shouldAutoClosePair(e,t,i){const n=Object(l.a)(t,i-1);return h.shouldAutoClosePair(e,n,i-n.firstCharOffset)}getWordDefinition(e){let t=this._getRichEditSupport(e);return t?Object(r.c)(t.wordDefinition||null):Object(r.c)(null)}getFoldingRules(e){let t=this._getRichEditSupport(e);return t?t.foldingRules:{}}getIndentRulesSupport(e){let t=this._getRichEditSupport(e);return t&&t.indentRulesSupport||null}getPrecedingValidLine(e,t,i){let n=e.getLanguageIdAtPosition(t,0);if(t>1){let o,s=-1;for(o=t-1;o>=1;o--){if(e.getLanguageIdAtPosition(o,0)!==n)return s;let t=e.getLineContent(o);if(!i.shouldIgnore(t)&&!/^\s+$/.test(t)&&""!==t)return o;s=o}}return-1}getInheritIndentForLine(e,t,i,n=!0){if(e<4)return null;const o=this.getIndentRulesSupport(t.getLanguageIdentifier().id);if(!o)return null;if(i<=1)return{indentation:"",action:null};const r=this.getPrecedingValidLine(t,i,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const l=t.getLineContent(r);if(o.shouldIncrease(l)||o.shouldIndentNextLine(l))return{indentation:s.x(l),action:a.b.Indent,line:r};if(o.shouldDecrease(l))return{indentation:s.x(l),action:null,line:r};{if(1===r)return{indentation:s.x(t.getLineContent(r)),action:null,line:r};const e=r-1,i=o.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let n=e-1;n>0;n--)if(!o.shouldIndentNextLine(t.getLineContent(n))){i=n;break}return{indentation:s.x(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:s.x(t.getLineContent(r)),action:null,line:r};for(let e=r;e>0;e--){const i=t.getLineContent(e);if(o.shouldIncrease(i))return{indentation:s.x(i),action:a.b.Indent,line:e};if(o.shouldIndentNextLine(i)){let i=0;for(let n=e-1;n>0;n--)if(!o.shouldIndentNextLine(t.getLineContent(e))){i=n;break}return{indentation:s.x(t.getLineContent(i+1)),action:null,line:i+1}}if(o.shouldDecrease(i))return{indentation:s.x(i),action:null,line:e}}return{indentation:s.x(t.getLineContent(1)),action:null,line:1}}}getGoodIndentForLine(e,t,i,n,o){if(e<4)return null;const r=this._getRichEditSupport(i);if(!r)return null;const l=this.getIndentRulesSupport(i);if(!l)return null;const h=this.getInheritIndentForLine(e,t,n),c=t.getLineContent(n);if(h){const i=h.line;if(void 0!==i){const n=r.onEnter(e,"",t.getLineContent(i),"");if(n){let e=s.x(t.getLineContent(i));return n.removeText&&(e=e.substring(0,e.length-n.removeText)),n.indentAction===a.b.Indent||n.indentAction===a.b.IndentOutdent?e=o.shiftIndent(e):n.indentAction===a.b.Outdent&&(e=o.unshiftIndent(e)),l.shouldDecrease(c)&&(e=o.unshiftIndent(e)),n.appendText&&(e+=n.appendText),s.x(e)}}return l.shouldDecrease(c)?h.action===a.b.Indent?h.indentation:o.unshiftIndent(h.indentation):h.action===a.b.Indent?o.shiftIndent(h.indentation):h.indentation}return null}getIndentForEnter(e,t,i,n){if(e<4)return null;t.forceTokenization(i.startLineNumber);const o=t.getLineTokens(i.startLineNumber),r=Object(l.a)(o,i.startColumn-1),h=r.getLineContent();let c,d,u=!1;r.firstCharOffset>0&&o.getLanguageId(0)!==r.languageId?(u=!0,c=h.substr(0,i.startColumn-1-r.firstCharOffset)):c=o.getLineContent().substring(0,i.startColumn-1),d=i.isEmpty()?h.substr(i.startColumn-1-r.firstCharOffset):this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset);const g=this.getIndentRulesSupport(r.languageId);if(!g)return null;const m=c,p=s.x(c),f={getLineTokens:e=>t.getLineTokens(e),getLanguageIdentifier:()=>t.getLanguageIdentifier(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i),getLineContent:e=>e===i.startLineNumber?m:t.getLineContent(e)},_=s.x(o.getLineContent()),b=this.getInheritIndentForLine(e,f,i.startLineNumber+1);if(!b){const e=u?_:p;return{beforeEnter:e,afterEnter:e}}let v=u?_:b.indentation;return b.action===a.b.Indent&&(v=n.shiftIndent(v)),g.shouldDecrease(d)&&(v=n.unshiftIndent(v)),{beforeEnter:u?_:p,afterEnter:v}}getIndentActionForType(e,t,i,n,o){if(e<4)return null;const s=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn);if(s.firstCharOffset)return null;const r=this.getIndentRulesSupport(s.languageId);if(!r)return null;const l=s.getLineContent(),h=l.substr(0,i.startColumn-1-s.firstCharOffset);let c;if(c=i.isEmpty()?l.substr(i.startColumn-1-s.firstCharOffset):this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-s.firstCharOffset),!r.shouldDecrease(h+c)&&r.shouldDecrease(h+n+c)){const n=this.getInheritIndentForLine(e,t,i.startLineNumber,!1);if(!n)return null;let s=n.indentation;return n.action!==a.b.Indent&&(s=o.unshiftIndent(s)),s}return null}getIndentMetadata(e,t){const i=this.getIndentRulesSupport(e.getLanguageIdentifier().id);return i?t<1||t>e.getLineCount()?null:i.getIndentMetadata(e.getLineContent(t)):null}getEnterAction(e,t,i){const n=this.getScopedLineTokens(t,i.startLineNumber,i.startColumn),o=this._getRichEditSupport(n.languageId);if(!o)return null;const s=n.getLineContent(),r=s.substr(0,i.startColumn-1-n.firstCharOffset);let l;l=i.isEmpty()?s.substr(i.startColumn-1-n.firstCharOffset):this.getScopedLineTokens(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-n.firstCharOffset);let h="";if(i.startLineNumber>1&&0===n.firstCharOffset){const e=this.getScopedLineTokens(t,i.startLineNumber-1);e.languageId===n.languageId&&(h=e.getLineContent())}const c=o.onEnter(e,h,r,l);if(!c)return null;const d=c.indentAction;let u=c.appendText;const g=c.removeText||0;u?d===a.b.Indent&&(u="\t"+u):u=d===a.b.Indent||d===a.b.IndentOutdent?"\t":"";let m=this.getIndentationAtPosition(t,i.startLineNumber,i.startColumn);return g&&(m=m.substring(0,m.length-g)),{indentAction:d,appendText:u,removeText:g,indentation:m}}getIndentationAtPosition(e,t,i){const n=e.getLineContent(t);let o=s.x(n);return o.length>i-1&&(o=o.substring(0,i-1)),o}getScopedLineTokens(e,t,i){e.forceTokenization(t);const n=e.getLineTokens(t),o=void 0===i?e.getLineMaxColumn(t)-1:i-1;return Object(l.a)(n,o)}getBracketsSupport(e){const t=this._getRichEditSupport(e);return t&&t.brackets||null}}},function(e,t){e.exports=__kbnSharedDeps_npm__},function(e,t,i){"use strict";i.d(t,"c",(function(){return n})),i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return a}));var n,o=i(22),s=i(13);!function(e){e.inMemory="inmemory",e.vscode="vscode",e.internal="private",e.walkThrough="walkThrough",e.walkThroughSnippet="walkThroughSnippet",e.http="http",e.https="https",e.file="file",e.mailto="mailto",e.untitled="untitled",e.data="data",e.command="command",e.vscodeRemote="vscode-remote",e.vscodeRemoteResource="vscode-remote-resource",e.userData="vscode-userdata",e.vscodeCustomEditor="vscode-custom-editor",e.vscodeNotebook="vscode-notebook",e.vscodeNotebookCell="vscode-notebook-cell",e.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",e.vscodeSettings="vscode-settings",e.vscodeWorkspaceTrust="vscode-workspace-trust",e.vscodeTerminal="vscode-terminal",e.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.extension="extension",e.vscodeFileResource="vscode-file",e.tmp="tmp"}(n||(n={}));const r=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)return this._delegate(e);const t=e.authority;let i=this._hosts[t];i&&-1!==i.indexOf(":")&&(i=`[${i}]`);const r=this._ports[t],a=this._connectionTokens[t];let l=`path=${encodeURIComponent(e.path)}`;return"string"==typeof a&&(l+=`&tkn=${encodeURIComponent(a)}`),o.a.from({scheme:s.i?this._preferredWebSchema:n.vscodeRemoteResource,authority:`${i}:${r}`,path:"/vscode-remote-resource",query:l})}},a=new class{constructor(){this.FALLBACK_AUTHORITY="vscode-app"}asBrowserUri(e,t,i){const o=this.toUri(e,t);return o.scheme===n.vscodeRemote?r.rewrite(o):s.g&&(i||s.h)&&o.scheme===n.file?o.with({scheme:n.vscodeFileResource,authority:o.authority||this.FALLBACK_AUTHORITY,query:null,fragment:null}):o}toUri(e,t){return o.a.isUri(e)?e:o.a.parse(t.toUrl(e))}}},function(e,t,i){"use strict";var n;i.d(t,"a",(function(){return n})),function(e){e.is=function(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]};const t=Object.freeze([]);e.empty=function(){return t},e.single=function*(e){yield e},e.from=function(e){return e||t},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const i of e)if(t(i))return!0;return!1},e.find=function(e,t){for(const i of e)if(t(i))return i},e.filter=function*(e,t){for(const i of e)t(i)&&(yield i)},e.map=function*(e,t){for(const i of e)yield t(i)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.concatNested=function*(e){for(const t of e)for(const e of t)yield e},e.reduce=function(e,t,i){let n=i;for(const i of e)n=t(n,i);return n},e.slice=function*(e,t,i=e.length){for(t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);to}]},e.equals=function(e,t,i=((e,t)=>e===t)){const n=e[Symbol.iterator](),o=t[Symbol.iterator]();for(;;){const e=n.next(),t=o.next();if(e.done!==t.done)return!1;if(e.done)return!0;if(!i(e.value,t.value))return!1}}}(n||(n={}))},function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return s})),i.d(t,"a",(function(){return a})),i.d(t,"f",(function(){return h})),i.d(t,"d",(function(){return c})),i.d(t,"e",(function(){return d}));var n=i(14);function o(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;const t=Array.isArray(e)?[]:{};return Object.keys(e).forEach((i=>{e[i]&&"object"==typeof e[i]?t[i]=o(e[i]):t[i]=e[i]})),t}function s(e){if(!e||"object"!=typeof e)return e;const t=[e];for(;t.length>0;){const e=t.shift();Object.freeze(e);for(const i in e)if(r.call(e,i)){const n=e[i];"object"!=typeof n||Object.isFrozen(n)||t.push(n)}}return e}const r=Object.prototype.hasOwnProperty;function a(e,t){return l(e,t,new Set)}function l(e,t,i){if(Object(n.l)(e))return e;const o=t(e);if(void 0!==o)return o;if(Object(n.e)(e)){const n=[];for(const o of e)n.push(l(o,t,i));return n}if(Object(n.i)(e)){if(i.has(e))throw new Error("Cannot clone recursive data-structure");i.add(e);const n={};for(let o in e)r.call(e,o)&&(n[o]=l(e[o],t,i));return i.delete(e),n}return e}function h(e,t,i=!0){return Object(n.i)(e)?(Object(n.i)(t)&&Object.keys(t).forEach((o=>{o in e?i&&(Object(n.i)(e[o])&&Object(n.i)(t[o])?h(e[o],t[o],i):e[o]=t[o]):e[o]=t[o]})),e):t}function c(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;let i,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(i=0;i0&&a>0)return;if(l>0&&h>0)return;let c=Math.abs(a-h),d=Math.abs(r-l);if(0===c)return o.spacesDiff=d,void(d>0&&0<=l-1&&l-10?o++:f>1&&s++,p(r,a,d,m,c),c.looksLikeAlignment&&(!i||t!==c.spacesDiff))continue;let b=c.spacesDiff;b<=8&&h[b]++,r=d,a=m}let d=i;o!==s&&(d=o{let i=h[t];i>e&&(e=i,u=t)})),4===u&&h[4]>0&&h[2]>0&&h[2]>=h[4]/2&&(u=2)}return{insertSpaces:d,tabSize:u}}function _(e){return(1&e.metadata)>>>0}function b(e,t){e.metadata=254&e.metadata|t<<0}function v(e){return(2&e.metadata)>>>1==1}function C(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function w(e){return(4&e.metadata)>>>2==1}function y(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function S(e){return(8&e.metadata)>>>3==1}function x(e,t){e.metadata=247&e.metadata|(t?1:0)<<3}function L(e,t){e.metadata=207&e.metadata|t<<4}function k(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}class D{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,b(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,y(this,!1),L(this,1),x(this,!1),k(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,C(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;let t=this.options.className;y(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),L(this,this.options.stickiness),x(this,!(!this.options.overviewRuler||!this.options.overviewRuler.color)),k(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const N=new D(null,0,0);N.parent=N,N.left=N,N.right=N,b(N,0);class E{constructor(){this.root=N,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o){return this.root===N?[]:function(e,t,i,n,o,s){let r=e.root,a=0,l=0,h=0,c=0,d=[],u=0;for(;r!==N;)if(v(r))C(r.left,!1),C(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;else{if(!v(r.left)){if(l=a+r.maxEnd,li)C(r,!0);else{if(c=a+r.end,c>=t){r.setCachedOffsets(h,c,s);let e=!0;n&&r.ownerId&&r.ownerId!==n&&(e=!1),o&&w(r)&&(e=!1),e&&(d[u++]=r)}C(r,!0),r.right===N||v(r.right)||(a+=r.delta,r=r.right)}}return C(e.root,!1),d}(this,e,t,i,n,o)}search(e,t,i){return this.root===N?[]:function(e,t,i,n){let o=e.root,s=0,r=0,a=0,l=[],h=0;for(;o!==N;){if(v(o)){C(o.left,!1),C(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==N&&!v(o.left)){o=o.left;continue}r=s+o.start,a=s+o.end,o.setCachedOffsets(r,a,n);let e=!0;t&&o.ownerId&&o.ownerId!==t&&(e=!1),i&&w(o)&&(e=!1),e&&(l[h++]=o),C(o,!0),o.right===N||v(o.right)||(s+=o.delta,o=o.right)}return C(e.root,!1),l}(this,e,t,i)}collectNodesFromOwner(e){return function(e,t){let i=e.root,n=[],o=0;for(;i!==N;)v(i)?(C(i.left,!1),C(i.right,!1),i=i.parent):i.left===N||v(i.left)?(i.ownerId===t&&(n[o++]=i),C(i,!0),i.right===N||v(i.right)||(i=i.right)):i=i.left;return C(e.root,!1),n}(this,e)}collectNodesPostOrder(){return function(e){let t=e.root,i=[],n=0;for(;t!==N;)v(t)?(C(t.left,!1),C(t.right,!1),t=t.parent):t.left===N||v(t.left)?t.right===N||v(t.right)?(i[n++]=t,C(t,!0)):t=t.right:t=t.left;return C(e.root,!1),i}(this)}insert(e){T(this,e),this._normalizeDeltaIfNecessary()}delete(e){M(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const o=i.start+n,s=i.end+n;i.setCachedOffsets(o,s,t)}acceptReplace(e,t,i,n){const o=function(e,t,i){let n=e.root,o=0,s=0,r=0,a=0,l=[],h=0;for(;n!==N;)if(v(n))C(n.left,!1),C(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;else{if(!v(n.left)){if(s=o+n.maxEnd,si?C(n,!0):(a=o+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[h++]=n),C(n,!0),n.right===N||v(n.right)||(o+=n.delta,n=n.right))}return C(e.root,!1),l}(this,e,e+t);for(let e=0,t=o.length;ei?(o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),C(o,!0)):(C(o,!0),o.right===N||v(o.right)||(s+=o.delta,o=o.right))}C(e.root,!1)}(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let s=0,r=o.length;si)&&1!==n&&(2===n||t)}function I(e,t,i,n,o){const s=function(e){return(48&e.metadata)>>>4}(e),r=0===s||2===s,a=1===s||2===s,l=i-t,h=n,c=Math.min(l,h),d=e.start;let u=!1;const g=e.end;let m=!1;t<=d&&g<=i&&function(e){return(64&e.metadata)>>>6==1}(e)&&(e.start=t,u=!0,e.end=t,m=!0);{const e=o?1:l>0?2:0;!u&&O(d,r,t,e)&&(u=!0),!m&&O(g,a,t,e)&&(m=!0)}if(c>0&&!o){const e=l>h?2:0;!u&&O(d,r,t+c,e)&&(u=!0),!m&&O(g,a,t+c,e)&&(m=!0)}{const n=o?1:0;!u&&O(d,r,i,n)&&(e.start=t+h,u=!0),!m&&O(g,a,i,n)&&(e.end=t+h,m=!0)}const p=h-l;u||(e.start=Math.max(0,d+p)),m||(e.end=Math.max(0,g+p)),e.start>e.end&&(e.end=e.start)}function T(e,t){if(e.root===N)return t.parent=N,t.left=N,t.right=N,b(t,0),e.root=t,e.root;!function(e,t){let i=0,n=e.root;const o=t.start,s=t.end;for(;;)if(r=o,a=s,l=n.start+i,h=n.end+i,(r===l?a-h:r-l)<0){if(n.left===N){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===N){t.start-=i+n.delta,t.end-=i+n.delta,t.maxEnd-=i+n.delta,n.right=t;break}i+=n.delta,n=n.right}var r,a,l,h;t.parent=n,t.left=N,t.right=N,b(t,1)}(e,t),B(t.parent);let i=t;for(;i!==e.root&&1===_(i.parent);)if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===_(t)?(b(i.parent,0),b(t,0),b(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,R(e,i)),b(i.parent,0),b(i.parent.parent,1),P(e,i.parent.parent))}else{const t=i.parent.parent.left;1===_(t)?(b(i.parent,0),b(t,0),b(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,P(e,i)),b(i.parent,0),b(i.parent.parent,1),R(e,i.parent.parent))}return b(e.root,0),t}function M(e,t){let i,n;if(t.left===N?(i=t.right,n=t,i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta):t.right===N?(i=t.left,n=t):(n=function(e){for(;e.left!==N;)e=e.left;return e}(t.right),i=n.right,i.start+=n.delta,i.end+=n.delta,i.delta+=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,n.delta=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0)),n===e.root)return e.root=i,b(i,0),t.detach(),A(),W(i),void(e.root.parent=N);let o,s=1===_(n);if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?i.parent=n.parent:(n.parent===t?i.parent=n:i.parent=n.parent,n.left=t.left,n.right=t.right,n.parent=t.parent,b(n,_(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==N&&(n.left.parent=n),n.right!==N&&(n.right.parent=n)),t.detach(),s)return B(i.parent),n!==t&&(B(n),B(n.parent)),void A();for(B(i),B(i.parent),n!==t&&(B(n),B(n.parent));i!==e.root&&0===_(i);)i===i.parent.left?(o=i.parent.right,1===_(o)&&(b(o,0),b(i.parent,1),R(e,i.parent),o=i.parent.right),0===_(o.left)&&0===_(o.right)?(b(o,1),i=i.parent):(0===_(o.right)&&(b(o.left,0),b(o,1),P(e,o),o=i.parent.right),b(o,_(i.parent)),b(i.parent,0),b(o.right,0),R(e,i.parent),i=e.root)):(o=i.parent.left,1===_(o)&&(b(o,0),b(i.parent,1),P(e,i.parent),o=i.parent.left),0===_(o.left)&&0===_(o.right)?(b(o,1),i=i.parent):(0===_(o.left)&&(b(o.right,0),b(o,1),R(e,o),o=i.parent.left),b(o,_(i.parent)),b(i.parent,0),b(o.left,0),P(e,i.parent),i=e.root));b(i,0),A()}function A(){N.parent=N,N.delta=0,N.start=0,N.end=0}function R(e,t){const i=t.right;i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,t.right=i.left,i.left!==N&&(i.left.parent=t),i.parent=t.parent,t.parent===N?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,W(t),W(i)}function P(e,t){const i=t.left;t.delta-=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=i.delta,t.end-=i.delta,t.left=i.right,i.right!==N&&(i.right.parent=t),i.parent=t.parent,t.parent===N?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,W(t),W(i)}function F(e){let t=e.end;if(e.left!==N){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==N){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function W(e){e.maxEnd=F(e)}function B(e){for(;e!==N;){const t=F(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}class j{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==V)return H(this.right);let e=this;for(;e.parent!==V&&e.parent.left!==e;)e=e.parent;return e.parent===V?V:e.parent}prev(){if(this.left!==V)return z(this.left);let e=this;for(;e.parent!==V&&e.parent.right!==e;)e=e.parent;return e.parent===V?V:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const V=new j(null,0);function H(e){for(;e.left!==V;)e=e.left;return e}function z(e){for(;e.right!==V;)e=e.right;return e}function U(e){return e===V?0:e.size_left+e.piece.length+U(e.right)}function K(e){return e===V?0:e.lf_left+e.piece.lineFeedCnt+K(e.right)}function $(){V.parent=V}function q(e,t){let i=t.right;i.size_left+=t.size_left+(t.piece?t.piece.length:0),i.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=i.left,i.left!==V&&(i.left.parent=t),i.parent=t.parent,t.parent===V?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function G(e,t){let i=t.left;t.left=i.right,i.right!==V&&(i.right.parent=t),i.parent=t.parent,t.size_left-=i.size_left+(i.piece?i.piece.length:0),t.lf_left-=i.lf_left+(i.piece?i.piece.lineFeedCnt:0),t.parent===V?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function Y(e,t){let i,n;if(t.left===V?(n=t,i=n.right):t.right===V?(n=t,i=n.left):(n=H(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),$(),void(e.root.parent=V);let o,s=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,X(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,X(e,i),n.left=t.left,n.right=t.right,n.parent=t.parent,n.color=t.color,t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==V&&(n.left.parent=n),n.right!==V&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,X(e,n)),t.detach(),i.parent.left===i){let t=U(i),n=K(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){let o=t-i.parent.size_left,s=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,Q(e,i.parent,o,s)}}if(X(e,i.parent),s)$();else{for(;i!==e.root&&0===i.color;)i===i.parent.left?(o=i.parent.right,1===o.color&&(o.color=0,i.parent.color=1,q(e,i.parent),o=i.parent.right),0===o.left.color&&0===o.right.color?(o.color=1,i=i.parent):(0===o.right.color&&(o.left.color=0,o.color=1,G(e,o),o=i.parent.right),o.color=i.parent.color,i.parent.color=0,o.right.color=0,q(e,i.parent),i=e.root)):(o=i.parent.left,1===o.color&&(o.color=0,i.parent.color=1,G(e,i.parent),o=i.parent.left),0===o.left.color&&0===o.right.color?(o.color=1,i=i.parent):(0===o.left.color&&(o.right.color=0,o.color=1,q(e,o),o=i.parent.left),o.color=i.parent.color,i.parent.color=0,o.left.color=0,G(e,i.parent),i=e.root));i.color=0,$()}}function Z(e,t){for(X(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&q(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,G(e,t.parent.parent))}else{const i=t.parent.parent.left;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&G(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,q(e,t.parent.parent))}e.root.color=0}function Q(e,t,i,n){for(;t!==e.root&&t!==V;)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function X(e,t){let i=0,n=0;if(t!==e.root){if(0===i){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t===e.root)return;i=U((t=t.parent).left)-t.size_left,n=K(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n}for(;t!==e.root&&(0!==i||0!==n);)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}V.parent=V,V.left=V,V.right=V,V.color=0;var J=i(87);class ee{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?function(e){if(!e||0===e.length)return!1;for(let t=0,i=e.length;t=i)break;const n=e.charCodeAt(t);if(110===n||114===n||87===n||119===n)return!0}return!1}(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=r.p(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(e){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new te(t,this.wordSeparators?Object(J.a)(this.wordSeparators):null,i?this.searchString:null)}}class te{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}function ie(e,t,i){if(!i)return new u.b(e,null);let n=[];for(let e=0,i=t.length;e>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class oe{static findMatches(e,t,i,n,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new re(s.wordSeparators,s.regex),n,o):this._doFindMatchesLineByLine(e,i,s,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,s){let r,a,l=0;if(n?(l=n.findLineFeedCountBeforeOffset(o),r=t+o+l):r=t+o,n){let e=n.findLineFeedCountBeforeOffset(o+s.length)-l;a=r+s.length+e}else a=r+s.length;const h=e.getPositionAt(r),d=e.getPositionAt(a);return new c.a(h.lineNumber,h.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,n,o){const s=e.getOffsetAt(t.getStartPosition()),r=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new ne(r):null,l=[];let h,c=0;for(i.reset(0);h=i.next(r);)if(l[c++]=ie(this._getMultilineMatchRange(e,s,r,a,h.index,h[0]),h,n),c>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,o){const s=[];let r=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o),s}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o);for(let a=t.startLineNumber+1;a=a))return o;return o}const h=new re(e.wordSeparators,e.regex);let d;h.reset(0);do{if(d=h.next(t),d&&(s[o++]=ie(new c.a(i,d.index+1+n,i,d.index+1+d[0].length+n),d,r),o>=a))return o}while(d);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new re(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,s,n):this._doFindNextMatchLineByLine(e,i,s,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new h.a(t.lineNumber,1),s=e.getOffsetAt(o),r=e.getLineCount(),a=e.getValueInRange(new c.a(o.lineNumber,o.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new ne(a):null;i.reset(t.column-1);let d=i.next(a);return d?ie(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new h.a(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s),a=this._findFirstMatchInLine(i,r,s,t.column,n);if(a)return a;for(let t=1;t<=o;t++){const r=(s+t-1)%o,a=e.getLineContent(r+1),l=this._findFirstMatchInLine(i,a,r+1,1,n);if(l)return l}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const s=e.next(t);return s?ie(new c.a(i,s.index+1,i,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new re(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,s,n):this._doFindPreviousMatchLineByLine(e,i,s,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new c.a(1,1,t.lineNumber,t.column),i,n,9990);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new h.a(s,e.getLineMaxColumn(s)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s).substring(0,t.column-1),a=this._findLastMatchInLine(i,r,s,n);if(a)return a;for(let t=1;t<=o;t++){const r=(o+s-t-1)%o,a=e.getLineContent(r+1),l=this._findLastMatchInLine(i,a,r+1,n);if(l)return l}return null}static _findLastMatchInLine(e,t,i,n){let o,s=null;for(e.reset(0);o=e.next(t);)s=ie(new c.a(i,o.index+1,i,o.index+1+o[0].length),o,n);return s}}function se(e,t,i,n,o){return function(e,t,i,n,o){if(0===n)return!0;const s=t.charCodeAt(n-1);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}(e,t,0,n,o)&&function(e,t,i,n,o){if(n+o===i)return!0;const s=t.charCodeAt(n+o);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n+o-1);if(0!==e.get(i))return!0}return!1}(e,t,i,n,o)}class re{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t)return null;if(i=this._searchRegex.exec(e),!i)return null;const n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(0===o){r.y(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||se(this._wordSeparators,e,t,n,o))return i}while(i);return null}}const ae=65535;function le(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class he{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function ce(e,t=!0){let i=[0],n=1;for(let t=0,o=e.length;t(e!==V&&this._pieces.push(e.piece),!0)))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class me{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1,i=this._cache;for(let n=0;n=e)&&(i[n]=null,t=!0)}if(t){let e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}}class pe{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new ue("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=V,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let t=0,i=e.length;t0){e[t].lineStarts||(e[t].lineStarts=ce(e[t].buffer));let i=new de(t+1,{line:0,column:0},{line:e[t].lineStarts.length-1,column:e[t].buffer.length-e[t].lineStarts[e[t].lineStarts.length-1]},e[t].lineStarts.length-1,e[t].buffer.length);this._buffers.push(e[t]),n=this.rbInsertRight(n,i)}this._searchCache=new me(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let t=65535-Math.floor(21845),i=2*t,n="",o=0,s=[];if(this.iterate(this.root,(r=>{let a=this.getNodeContent(r),l=a.length;if(o<=t||o+l0){let t=n.replace(/\r\n|\r|\n/g,e);s.push(new ue(t,ce(t)))}this.create(s,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new ge(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==V;)if(n.left!==V&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e)return i+=n.size_left,i+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1);e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0,n=e;for(;t!==V;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){let o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,0===o.index){let e=n-this.getOffsetAt(i+1,1);return new h.a(i+1,e+1)}return new h.a(i+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===V){let t=n-e-this.getOffsetAt(i+1,1);return new h.a(i+1,t+1)}t=t.right}return new h.a(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";let i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){let i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(o+e.remainder,o+t.remainder)}let i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start),s=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==V;){let e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){s+=e.substring(n,n+t.remainder);break}s+=e.substr(n,i.piece.length),i=i.next()}return s}getLinesContent(){let e=[],t=0,i="",n=!1;return this.iterate(this.root,(o=>{if(o===V)return!0;const s=o.piece;let r=s.length;if(0===r)return!0;const a=this._buffers[s.bufferIndex].buffer,l=this._buffers[s.bufferIndex].lineStarts,h=s.start.line,c=s.end.line;let d=l[h]+s.start.column;if(n&&(10===a.charCodeAt(d)&&(d++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(h===c)return this._EOLNormalized||13!==a.charCodeAt(d+r-1)?i+=a.substr(d,r):(n=!0,i+=a.substr(d,r-1)),!0;i+=this._EOLNormalized?a.substring(d,Math.max(d,l[h+1]-this._EOLLength)):a.substring(d,l[h+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=h+1;ne+_,t.reset(0)):(g=p.buffer,m=e=>e,t.reset(_));do{if(u=t.next(g),u){if(m(u.index)>=b)return h;this.positionInBuffer(e,m(u.index)-f,v);let t=this.getLineFeedCnt(e.piece.bufferIndex,o,v),s=v.line===o.line?v.column-o.column+n:v.column+1,r=s+u[0].length;if(d[h++]=ie(new c.a(i+t,s,i+t,r),u,a),m(u.index)+u[0].length>=b)return h;if(h>=l)return h}}while(u);return h}findMatchesLineByLine(e,t,i,n){const o=[];let s=0;const r=new re(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];let l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let h=this.positionInBuffer(a.node,a.remainder),c=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,h,c,t,i,n,s,o),o;let d=e.startLineNumber,u=a.node;for(;u!==l.node;){let l=this.getLineFeedCnt(u.piece.bufferIndex,h,u.piece.end);if(l>=1){let a=this._buffers[u.piece.bufferIndex].lineStarts,c=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[h.line+l],m=d===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(u,r,d,m,h,this.positionInBuffer(u,g-c),t,i,n,s,o),s>=n)return o;d+=l}let c=d===e.startLineNumber?e.startColumn-1:0;if(d===e.endLineNumber){const a=this.getLineContent(d).substring(c,e.endColumn-1);return s=this._findMatchesInLine(t,r,a,e.endLineNumber,c,s,o,i,n),o}if(s=this._findMatchesInLine(t,r,this.getLineContent(d).substr(c),d,c,s,o,i,n),s>=n)return o;d++,a=this.nodeAt2(d,1),u=a.node,h=this.positionInBuffer(a.node,a.remainder)}if(d===e.endLineNumber){let a=d===e.startLineNumber?e.startColumn-1:0;const l=this.getLineContent(d).substring(a,e.endColumn-1);return s=this._findMatchesInLine(t,r,l,e.endLineNumber,a,s,o,i,n),o}let g=d===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(l.node,r,d,g,h,c,t,i,n,s,o),o}_findMatchesInLine(e,t,i,n,o,s,r,a,l){const h=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,d=i.length;let g=-a;for(;-1!==(g=i.indexOf(t,g+a));)if((!h||se(h,i,d,g,a))&&(r[s++]=new u.b(new c.a(n,g+1+o,n,g+1+a+o),null),s>=l))return s;return s}let d;t.reset(0);do{if(d=t.next(i),d&&(r[s++]=ie(new c.a(n,d.index+1+o,n,d.index+1+d[0].length+o),d,a),s>=l))return s}while(d);return s}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==V){let{node:i,remainder:n,nodeStartOffset:o}=this.nodeAt(e),s=i.piece,r=s.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&s.end.line===this._lastChangeBufferPos.line&&s.end.column===this._lastChangeBufferPos.column&&o+s.length===e&&t.lengthe){let e=[],o=new de(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),this.offsetInBuffer(r,s.end)-this.offsetInBuffer(r,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&10===this.nodeCharCodeAt(i,n)){let e={line:o.start.line+1,column:0};o=new de(o.bufferIndex,e,o.end,this.getLineFeedCnt(o.bufferIndex,e,o.end),o.length-1),t+="\n"}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(13===this.nodeCharCodeAt(i,n-1)){let o=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,o),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a);else this.deleteNodeTail(i,a);let l=this.createNewPieces(t);o.length>0&&this.rbInsertRight(i,o);let h=i;for(let e=0;e=0;e--)o=this.rbInsertLeft(o,n[e]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");let i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]),o=n;for(let e=1;e=c))break;a=h+1}return i?(i.line=h,i.column=r-d,null):{line:h,column:r-d}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;let n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;let o=n[i.line+1],s=n[i.line]+i.column;if(o>s+1)return i.line-t.line;let r=s-1;return 13===this._buffers[e].buffer.charCodeAt(r)?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tae){let t=[];for(;e.length>ae;){const i=e.charCodeAt(65534);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,65534),e=e.substring(65534)):(n=e.substring(0,ae),e=e.substring(ae));let o=ce(n);t.push(new de(this._buffers.length,{line:0,column:0},{line:o.length-1,column:n.length-o[o.length-1]},o.length-1,n.length)),this._buffers.push(new ue(n,o))}let i=ce(e);return t.push(new de(this._buffers.length,{line:0,column:0},{line:i.length-1,column:e.length-i[i.length-1]},i.length-1,e.length)),this._buffers.push(new ue(e,i)),t}let t=this._buffers[0].buffer.length;const i=ce(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let e=0;e=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){let n=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:s-(e-1-i.lf_left)}),a.substring(l+n,l+r-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){let t=this.getAccumulatedValue(i,e-i.lf_left-2),o=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=o.substring(s+t,s+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}}for(i=i.next();i!==V;){let e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){let o=this.getAccumulatedValue(i,0),s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(s,s+o-t),n}{let t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substr(t,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==V;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){let i=e.piece,n=this.positionInBuffer(e,t),o=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){let t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==o)return{index:t,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;let i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),s=t,r=this.offsetInBuffer(i.bufferIndex,s),a=this.getLineFeedCnt(i.bufferIndex,i.start,s),l=a-n,h=r-o,c=i.length+h;e.piece=new de(i.bufferIndex,i.start,s,a,c),Q(this,e,h,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),s=t,r=this.getLineFeedCnt(i.bufferIndex,s,i.end),a=r-n,l=o-this.offsetInBuffer(i.bufferIndex,s),h=i.length+l;e.piece=new de(i.bufferIndex,s,i.end,r,h),Q(this,e,l,a)}shrinkNode(e,t,i){const n=e.piece,o=n.start,s=n.end,r=n.length,a=n.lineFeedCnt,l=t,h=this.getLineFeedCnt(n.bufferIndex,n.start,l),c=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new de(n.bufferIndex,n.start,l,h,c),Q(this,e,c-r,h-a);let d=new de(n.bufferIndex,i,s,this.getLineFeedCnt(n.bufferIndex,i,s),this.offsetInBuffer(n.bufferIndex,s)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,d);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=ce(t,!1);for(let e=0;ee)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;let i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right}return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==V;)if(i.left!==V&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){let o=this.getAccumulatedValue(i,e-i.lf_left-2),s=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,s),nodeStartOffset:n}}if(i.lf_left+i.piece.lineFeedCnt===e-1){let o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==V;){if(i.piece.lineFeedCnt>0){let e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1)return{node:i,remainder:t-1,nodeStartOffset:this.offsetOfNode(i)};t-=i.piece.length,i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;let i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===V||0===e.piece.lineFeedCnt)return!1;let t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n!==i.length-1&&!(i[n+1]>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o)}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==V&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let i,n=[],o=this._buffers[e.piece.bufferIndex].lineStarts;i=0===e.piece.end.column?{line:e.piece.end.line-1,column:o[e.piece.end.line]-o[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,r=e.piece.lineFeedCnt-1;e.piece=new de(e.piece.bufferIndex,e.piece.start,i,r,s),Q(this,e,-1,-1),0===e.piece.length&&n.push(e);let a={line:t.piece.start.line+1,column:0};const l=t.piece.length-1,h=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new de(t.piece.bufferIndex,a,t.piece.end,h,l),Q(this,t,-1,-1),0===t.piece.length&&n.push(t);let c=this.createNewPieces("\r\n");this.rbInsertRight(e,c[0]);for(let e=0;ee.sortIndex-t.sortIndex))}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const m=this._doApplyEdits(l);let p=null;if(t&&d.length>0){d.sort(((e,t)=>t.lineNumber-e.lineNumber)),p=[];for(let e=0,t=d.length;e0&&d[e-1].lineNumber===t)continue;let i=d[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===r.u(n)&&p.push(t)}}return this._onDidChangeContent.fire(),new u.a(g,m,p)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,o=new c.a(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let s=i.startLineNumber,r=i.startColumn;const a=[];for(let i=0,n=e.length;i0&&a.push(n.text),s=o.endLineNumber,r=o.endColumn}const l=a.join(""),[h,d,u]=Object(fe.f)(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:l,eolCount:h,firstLineLength:d,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(be._sortOpsDescending);let t=[];for(let i=0;i0){const e=h.eolCount+1;l=1===e?new c.a(r,a,r,a+h.firstLineLength):new c.a(r,a,r+e-1,h.lastLineLength+1)}else l=new c.a(r,a,r,a);i=l.endLineNumber,n=l.endColumn,t.push(l),o=h}return t}static _sortOpsAscending(e,t){let i=c.a.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=c.a.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class ve{constructor(e,t,i,n,o,s,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e);let i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let e=0,n=i.length;e=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=function(e,t){e.length=0,e[0]=0;let i=1,n=0,o=0,s=0,r=!0;for(let a=0,l=t.length;a126)&&(r=!1)}const a=new he(le(e),n,o,s,r);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new ue(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),this.isBasicASCII||this.containsRTL||(this.containsRTL=r.m(e)),this.isBasicASCII||this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=r.n(e))}finish(e=!0){return this._finish(),new ve(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);let t=ce(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}class we{constructor(){this.changeType=1}}class ye{constructor(e,t){this.changeType=2,this.lineNumber=e,this.detail=t}}class Se{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class xe{constructor(e,t,i){this.changeType=4,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Le{constructor(){this.changeType=5}}class ke{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t=this._len;)this._beginState[this._len]=null,this._valid[this._len]=!1,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._beginState.splice(e,t),this._valid.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;let i=[],n=[];for(let e=0;e=0;t--)this._invalidateLine(e.startLineNumber+t-1);this._acceptDeleteRange(e),this._acceptInsertText(new h.a(e.startLineNumber,e.startColumn),t)}_acceptDeleteRange(e){e.startLineNumber-1>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){e.lineNumber-1>=this._len||this._insertLines(e.lineNumber,t)}}class Re extends s.a{constructor(e){super(),this._isDisposed=!1,this._textModel=e,this._tokenizationStateStore=new Ae,this._tokenizationSupport=null,this._register(Oe.B.onDidChange((e=>{const t=this._textModel.getLanguageIdentifier();-1!==e.changedLanguages.indexOf(t.language)&&(this._resetTokenizationState(),this._textModel.clearTokens())}))),this._register(this._textModel.onDidChangeRawContentFast((e=>{e.containsEvent(1)&&this._resetTokenizationState()}))),this._register(this._textModel.onDidChangeContentFast((e=>{for(let t=0,i=e.changes.length;t{this._beginBackgroundTokenization()}))),this._register(this._textModel.onDidChangeLanguage((()=>{this._resetTokenizationState(),this._textModel.clearTokens()}))),this._resetTokenizationState()}dispose(){this._isDisposed=!0,super.dispose()}_resetTokenizationState(){const[e,t]=function(e){const t=e.getLanguageIdentifier();let i=e.isTooLargeForTokenization()?null:Oe.B.get(t.language),o=null;if(i)try{o=i.getInitialState()}catch(e){Object(n.e)(e),i=null}return[i,o]}(this._textModel);this._tokenizationSupport=e,this._tokenizationStateStore.flush(t),this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&Me.k((()=>{this._isDisposed||this._revalidateTokensNow()}))}_revalidateTokensNow(e=this._textModel.getLineCount()){const t=new fe.b,i=Te.a.create(!1);for(;this._hasLinesToTokenize()&&!(i.elapsed()>1)&&!(this._tokenizeOneInvalidLine(t)>=e););this._beginBackgroundTokenization(),this._textModel.setTokens(t.tokens)}tokenizeViewport(e,t){const i=new fe.b;this._tokenizeViewport(i,e,t),this._textModel.setTokens(i.tokens)}reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new fe.b;this._updateTokensUntilLine(t,e),this._textModel.setTokens(t.tokens)}isCheapToTokenize(e){if(!this._tokenizationSupport)return!0;const t=this._tokenizationStateStore.invalidLineStartIndex+1;return!(e>t)&&(e0&&e>=1;e--){let t=this._textModel.getLineFirstNonWhitespaceColumn(e);if(0!==t&&t=0;e--)a=Pe(r,this._tokenizationSupport,o[e],!1,a).endState;for(let n=t;n<=i;n++){let t=this._textModel.getLineContent(n),i=Pe(r,this._tokenizationSupport,t,!0,a);e.add(n,i.tokens),this._tokenizationStateStore.setFakeTokens(n-1),a=i.endState}}}function Pe(e,t,i,o,s){let r=null;if(t)try{r=t.tokenize2(i,o,s.clone(),0)}catch(e){Object(n.e)(e)}return r||(r=Object(Ie.e)(e.id,i,s,0)),Ee.a.convertToEndOffset(r.tokens,i.length),r}var Fe=i(113),We=i(32),Be=i(90),je=i(96),Ve=i(12);function He(e,t){return("string"==typeof e?function(e){const t=new Ce;return t.acceptChunk(e),t.finish()}(e):e).create(t)}let ze=0;class Ue{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;let e=[],t=0,i=0;for(;;){let n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}const Ke=()=>{throw new Error("Invalid change accessor")};class $e{constructor(){this._searchCanceledBrand=void 0}}function qe(e){return e instanceof $e?null:e}$e.INSTANCE=new $e;class Ge extends s.a{constructor(e,t,i,n=null,s){super(),this._onWillDispose=this._register(new o.a),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new nt),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeLanguage=this._register(new o.a),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new o.a),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new o.a),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidChangeOptions=this._register(new o.a),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new o.a),this.onDidChangeAttached=this._onDidChangeAttached.event,this._eventEmitter=this._register(new ot),ze++,this.id="$model"+ze,this.isForSimpleWidget=t.isForSimpleWidget,this._associatedResource=null==n?a.a.parse("inmemory://model/"+ze):n,this._undoRedoService=s,this._attachedEditorCount=0;const{textBuffer:l,disposable:h}=He(e,t.defaultEOL);this._buffer=l,this._bufferDisposable=h,this._options=Ge.resolveOptions(this._buffer,t);const d=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new c.a(1,1,d,this._buffer.getLineLength(d)+1),0);t.largeFileOptimizations?this._isTooLargeForTokenization=u>Ge.LARGE_FILE_SIZE_THRESHOLD||d>Ge.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=u>Ge.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageIdentifier=i||Ie.a,this._languageRegistryListener=We.a.onDidChange((e=>{e.languageIdentifier.id===this._languageIdentifier.id&&this._onDidChangeLanguageConfiguration.fire({})})),this._instanceId=r.O(ze),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new Ye,this._commandManager=new g.a(this,s),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new fe.d,this._tokens2=new fe.e,this._tokenization=new Re(this)}static resolveOptions(e,t){if(t.detectIndentation){const i=f(e,t.tabSize,t.insertSpaces);return new u.e({tabSize:i.tabSize,indentSize:i.tabSize,insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}return new u.e({tabSize:t.tabSize,indentSize:t.indentSize,insertSpaces:t.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}onDidChangeRawContentFast(e){return this._eventEmitter.fastEvent((t=>e(t.rawContentChangedEvent)))}onDidChangeContentFast(e){return this._eventEmitter.fastEvent((t=>e(t.contentChangedEvent)))}onDidChangeContent(e){return this._eventEmitter.slowEvent((t=>e(t.contentChangedEvent)))}dispose(){this._isDisposing=!0,this._onWillDispose.fire(),this._languageRegistryListener.dispose(),this._tokenization.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this._isDisposing=!1;const e=new be([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this._isDisposing||this._eventEmitter.fire(new De(e,t))}setValue(e){if(this._assertNotDisposed(),null===e)return;const{textBuffer:t,disposable:i}=He(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,s,r){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:r}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokens.flush(),this._tokens2.flush(),this._decorations=Object.create(null),this._decorationsTree=new Ye,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new ke([new we],this._versionId,!1,!1),this._createContentChanged2(new c.a(1,1,o,s),0,n,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new ke([new Le],this._versionId,!1,!1),this._createContentChanged2(new c.a(1,1,o,s),0,n,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.search(0,!1,!1,e);this._ensureNodesHaveRanges(t)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const i=this._buffer.getLineLength(n);i>=1e4?t+=i:e+=i}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();let t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.indentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=new u.e({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o});if(this._options.equals(s))return;let r=this._options.createChangeEvent(s);this._options=s,this._onDidChangeOptions.fire(r)}detectIndentation(e,t){this._assertNotDisposed();let i=f(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}static _normalizeIndentationFromWhitespace(e,t,i){let n=0;for(let i=0;i({range:e.range,text:null}))),(()=>null))}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();let t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();let t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new Ue(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){return this._assertNotDisposed(),this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor("number"!=typeof i||isNaN(i)?1:i),s=Math.floor("number"!=typeof n||isNaN(n)?1:n);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const e=this.getLineMaxColumn(o);s>=e&&(s=e)}const r=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!=typeof r||isNaN(r)?1:r),h=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,h=1;else if(l>t)l=t,h=this.getLineMaxColumn(l);else if(h<=1)h=1;else{const e=this.getLineMaxColumn(l);h>=e&&(h=e)}return i===o&&n===s&&r===l&&a===h&&e instanceof c.a&&!(e instanceof d.a)?e:new c.a(o,s,l,h)}_isValidPosition(e,t,i){if("number"!=typeof e||"number"!=typeof t)return!1;if(isNaN(e)||isNaN(t))return!1;if(e<1||t<1)return!1;if((0|e)!==e||(0|t)!==t)return!1;if(e>this._buffer.getLineCount())return!1;if(1===t)return!0;if(t>this.getLineMaxColumn(e))return!1;if(1===i){const i=this._buffer.getLineCharCode(e,t-2);if(r.D(i))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),o=Math.floor("number"!=typeof t||isNaN(t)?1:t),s=this._buffer.getLineCount();if(n<1)return new h.a(1,1);if(n>s)return new h.a(s,this.getLineMaxColumn(s));if(o<=1)return new h.a(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new h.a(n,a);if(1===i){const e=this._buffer.getLineCharCode(n,o-2);if(r.D(e))return new h.a(n,o-1)}return new h.a(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof h.a&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(o,s,0))return!1;if(1===t){const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,a=r.D(e),l=r.D(t);return!a&&!l}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof c.a&&!(e instanceof d.a)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,o=t.column,s=i.lineNumber,a=i.column;{const e=o>1?this._buffer.getLineCharCode(n,o-2):0,t=a>1&&a<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,a-2):0,i=r.D(e),l=r.D(t);return i||l?n===s&&o===a?new c.a(n,o-1,s,a-1):i&&l?new c.a(n,o-1,s,a+1):i?new c.a(n,o-1,s,a):new c.a(n,o,s,a+1):new c.a(n,o,s,a)}}modifyPosition(e,t){this._assertNotDisposed();let i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new c.a(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,s,r=999){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every((e=>c.a.isIRange(e)))&&(a=t.map((e=>this.validateRange(e))))),null===a&&(a=[this.getFullModelRange()]),a=a.sort(((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn));const l=[];let h;if(l.push(a.reduce(((e,t)=>c.a.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t)))),!i&&e.indexOf("\n")<0){const t=new ee(e,i,n,o).parseSearchRequest();if(!t)return[];h=e=>this.findMatchesLineByLine(e,t,s,r)}else h=t=>oe.findMatches(this,new ee(e,i,n,o),t,s,r);return l.map(h).reduce(((e,t)=>e.concat(t)),[])}findNextMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new ee(e,i,n,o).parseSearchRequest();if(!t)return null;const a=this.getLineCount();let l=new c.a(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),h=this.findMatchesLineByLine(l,t,s,1);return oe.findNextMatch(this,new ee(e,i,n,o),r,s),h.length>0?h[0]:(l=new c.a(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),h=this.findMatchesLineByLine(l,t,s,1),h.length>0?h[0]:null)}return oe.findNextMatch(this,new ee(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return oe.findPreviousMatch(this,new ee(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof u.f?e:new u.f(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i({range:this.validateRange(e.range),text:e.text}))),n=!0;if(e)for(let t=0,o=e.length;to.endLineNumber,r=o.startLineNumber>t.endLineNumber;if(!n&&!r){s=!0;break}}if(!s){n=!1;break}}if(n)for(let e=0,n=this._trimAutoWhitespaceLines.length;et.endLineNumber||n===t.startLineNumber&&t.startColumn===o&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){s=!1;break}}if(s){const e=new c.a(n,1,n,o);t.push(new u.f(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i)}_applyUndo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new c.a(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}}));this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map((e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new c.a(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}}));this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==s.length){let e=[],t=i;for(let i=0,n=s.length;i0?n.text.charCodeAt(0):0),this._onDidChangeDecorations.fire(),this._decorationsTree.acceptReplace(n.rangeOffset,n.rangeLength,n.text.length,n.forceMoveMarkers);const h=n.range.startLineNumber,c=n.range.endLineNumber,d=c-h,u=r,g=Math.min(d,u),m=u-d;for(let i=g;i>=0;i--){const n=h+i,s=o-t-m+n;e.push(new ye(n,this.getLineContent(s)))}if(gthis._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,it(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)},o=null;try{o=t(i)}catch(e){Object(n.e)(e)}return i.addDecoration=Ke,i.changeDecoration=Ke,i.changeDecorationOptions=Ke,i.removeDecoration=Ke,i.deltaDecorations=Ke,o}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:tt[i]}])[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),s,r,o),n.setOptions(tt[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let e=0,i=t.length;ethis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,n=!1){let o=this.getLineCount(),s=Math.min(o,Math.max(1,e)),r=Math.min(o,Math.max(1,t)),a=this.getLineMaxColumn(r);return this._getDecorationsInRange(new c.a(s,1,r,a),i,n)}getDecorationsInRange(e,t=0,i=!1){let n=this.validateRange(e);return this._getDecorationsInRange(n,t,i)}getOverviewRulerDecorations(e=0,t=!1){const i=this.getVersionId(),n=this._decorationsTree.search(e,t,!0,i);return this._ensureNodesHaveRanges(n)}getAllDecorations(e=0,t=!1){const i=this.getVersionId(),n=this._decorationsTree.search(e,t,!1,i);return this._ensureNodesHaveRanges(n)}_getDecorationsInRange(e,t,i){const n=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn),s=this.getVersionId(),r=this._decorationsTree.intervalSearch(n,o,t,i,s);return this._ensureNodesHaveRanges(r)}_ensureNodesHaveRanges(e){for(let t=0,i=e.length;t0&&this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!1,ranges:t})}setSemanticTokens(e,t){this._tokens2.set(e,t),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this.getLineCount()}]})}hasCompleteSemanticTokens(){return this._tokens2.isComplete()}hasSomeSemanticTokens(){return!this._tokens2.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._tokens2.setPartial(e,t);this._emitModelTokensChangedEvent({tokenizationSupportChanged:!1,semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}tokenizeViewport(e,t){e=Math.max(1,e),t=Math.min(this._buffer.getLineCount(),t),this._tokenization.tokenizeViewport(e,t)}clearTokens(){this._tokens.flush(),this._emitModelTokensChangedEvent({tokenizationSupportChanged:!0,semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._buffer.getLineCount()}]})}_emitModelTokensChangedEvent(e){this._isDisposing||this._onDidChangeTokens.fire(e)}resetTokenization(){this._tokenization.reset()}forceTokenization(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");this._tokenization.forceTokenization(e)}isCheapToTokenize(e){return this._tokenization.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){if(e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._getLineTokens(e)}_getLineTokens(e){const t=this.getLineContent(e),i=this._tokens.getTokens(this._languageIdentifier.id,e-1,t);return this._tokens2.addSemanticTokens(e,i)}getLanguageIdentifier(){return this._languageIdentifier}getModeId(){return this._languageIdentifier.language}setMode(e){if(this._languageIdentifier.id===e.id)return;let t={oldLanguage:this._languageIdentifier.language,newLanguage:e.language};this._languageIdentifier=e,this._onDidChangeLanguage.fire(t),this._onDidChangeLanguageConfiguration.fire({})}getLanguageIdAtPosition(e,t){const i=this.validatePosition(new h.a(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}getWordAtPosition(e){this._assertNotDisposed();const t=this.validatePosition(e),i=this.getLineContent(t.lineNumber),n=this._getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[s,r]=Ge._findLanguageBoundaries(n,o),a=Object(Fe.d)(t.column,We.a.getWordDefinition(n.getLanguageId(o)),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(o>0&&s===t.column-1){const[s,r]=Ge._findLanguageBoundaries(n,o-1),a=Object(Fe.d)(t.column,We.a.getWordDefinition(n.getLanguageId(o-1)),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let o=e.getLineContent().length;for(let n=t,s=e.getCount();n=0;e--){const i=t.getEndOffset(e);if(i<=r)break;if(Object(Be.b)(t.getStandardTokenType(e))||t.getLanguageId(e)!==s){r=i;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let e=n+1;e=a)break;if(Object(Be.b)(t.getStandardTokenType(e))||t.getLanguageId(e)!==s){a=i;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e){const t=e.lineNumber,i=this._getLineTokens(t),n=this._buffer.getLineContent(t),o=i.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const s=We.a.getBracketsSupport(i.getLanguageId(o));if(s&&!Object(Be.b)(i.getStandardTokenType(o))){let{searchStartOffset:r,searchEndOffset:a}=this._establishBracketSearchOffsets(e,i,s,o),l=null;for(;;){const i=je.a.findNextBracketInRange(s.forwardRegex,t,n,r,a);if(!i)break;if(i.startColumn<=e.column&&e.column<=i.endColumn){const e=n.substring(i.startColumn-1,i.endColumn-1).toLowerCase(),t=this._matchFoundBracket(i,s.textIsBracket[e],s.textIsOpenBracket[e],null);if(t){if(t instanceof $e)return null;l=t}}r=i.endColumn-1}if(l)return l}if(o>0&&i.getStartOffset(o)===e.column-1){const s=o-1,r=We.a.getBracketsSupport(i.getLanguageId(s));if(r&&!Object(Be.b)(i.getStandardTokenType(s))){let{searchStartOffset:o,searchEndOffset:a}=this._establishBracketSearchOffsets(e,i,r,s);const l=je.a.findPrevBracketInRange(r.reversedRegex,t,n,o,a);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn){const e=n.substring(l.startColumn-1,l.endColumn-1).toLowerCase(),t=this._matchFoundBracket(l,r.textIsBracket[e],r.textIsOpenBracket[e],null);if(t)return t instanceof $e?null:t}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof $e?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageIdentifier.id,o=e.reversedRegex;let s=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return $e.INSTANCE;const h=je.a.findPrevBracketInRange(o,t,n,a,l);if(!h)break;const c=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(c)?s++:e.isClose(c)&&s--,0===s)return h;l=h.startColumn-1}return null};for(let e=t.lineNumber;e>=1;e--){const i=this._getLineTokens(e),o=i.getCount(),s=this._buffer.getLineContent(e);let r=o-1,l=s.length,h=s.length;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1);let c=!0;for(;r>=0;r--){const t=i.getLanguageId(r)===n&&!Object(Be.b)(i.getStandardTokenType(r));if(t)c?l=i.getStartOffset(r):(l=i.getStartOffset(r),h=i.getEndOffset(r));else if(c&&l!==h){const t=a(e,s,l,h);if(t)return t}c=t}if(c&&l!==h){const t=a(e,s,l,h);if(t)return t}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageIdentifier.id,o=e.forwardRegex;let s=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return $e.INSTANCE;const h=je.a.findNextBracketInRange(o,t,n,a,l);if(!h)break;const c=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(c)?s++:e.isClose(c)&&s--,0===s)return h;a=h.endColumn-1}return null},l=this.getLineCount();for(let e=t.lineNumber;e<=l;e++){const i=this._getLineTokens(e),o=i.getCount(),s=this._buffer.getLineContent(e);let r=0,l=0,h=0;e===t.lineNumber&&(r=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1);let c=!0;for(;r=1;e--){const o=this._getLineTokens(e),s=o.getCount(),r=this._buffer.getLineContent(e);let a=s-1,l=r.length,h=r.length;if(e===t.lineNumber){a=o.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1;const e=o.getLanguageId(a);i!==e&&(i=e,n=We.a.getBracketsSupport(i))}let c=!0;for(;a>=0;a--){const t=o.getLanguageId(a);if(i!==t){if(n&&c&&l!==h){const t=je.a.findPrevBracketInRange(n.reversedRegex,e,r,l,h);if(t)return this._toFoundBracket(n,t);c=!1}i=t,n=We.a.getBracketsSupport(i)}const s=!!n&&!Object(Be.b)(o.getStandardTokenType(a));if(s)c?l=o.getStartOffset(a):(l=o.getStartOffset(a),h=o.getEndOffset(a));else if(n&&c&&l!==h){const t=je.a.findPrevBracketInRange(n.reversedRegex,e,r,l,h);if(t)return this._toFoundBracket(n,t)}c=s}if(n&&c&&l!==h){const t=je.a.findPrevBracketInRange(n.reversedRegex,e,r,l,h);if(t)return this._toFoundBracket(n,t)}}return null}findNextBracket(e){const t=this.validatePosition(e),i=this.getLineCount();let n=-1,o=null;for(let e=t.lineNumber;e<=i;e++){const i=this._getLineTokens(e),s=i.getCount(),r=this._buffer.getLineContent(e);let a=0,l=0,h=0;if(e===t.lineNumber){a=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1;const e=i.getLanguageId(a);n!==e&&(n=e,o=We.a.getBracketsSupport(n))}let c=!0;for(;aDate.now()-e<=t}const n=this.validatePosition(e),o=this.getLineCount(),s=new Map;let r=[];const a=(e,t)=>{if(!s.has(e)){let i=[];for(let e=0,n=t?t.brackets.length:0;e{for(;;){if(i&&++l%100==0&&!i())return $e.INSTANCE;const a=je.a.findNextBracketInRange(e.forwardRegex,t,n,o,s);if(!a)break;const h=n.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),c=e.textIsBracket[h];if(c&&(c.isOpen(h)?r[c.index]++:c.isClose(h)&&r[c.index]--,-1===r[c.index]))return this._matchFoundBracket(a,c,!1,i);o=a.endColumn-1}return null};let c=-1,d=null;for(let e=n.lineNumber;e<=o;e++){const t=this._getLineTokens(e),i=t.getCount(),o=this._buffer.getLineContent(e);let s=0,r=0,l=0;if(e===n.lineNumber){s=t.findTokenIndexAtOffset(n.column-1),r=n.column-1,l=n.column-1;const e=t.getLanguageId(s);c!==e&&(c=e,d=We.a.getBracketsSupport(c),a(c,d))}let u=!0;for(;sn)throw new Error("Illegal value for lineNumber");const o=We.a.getFoldingRules(this._languageIdentifier.id),s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,h=-1;const c=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,h=-1;for(let t=e;t=0){l=t,h=e;break}}}};let d=-2,u=-1,g=-2,m=-1;const p=e=>{if(-2===d){d=-1,u=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){d=t,u=e;break}}}if(-1!==g&&(-2===g||g=0){g=t,m=e;break}}}};let f=0,_=!0,b=0,v=!0,C=0,w=0;for(let o=0;_||v;o++){const r=e-o,g=e+o;o>1&&(r<1||r1&&(g>n||g>i)&&(v=!1),o>5e4&&(_=!1,v=!1);let y=-1;if(_){const e=this._computeIndentLevel(r-1);e>=0?(l=r-1,h=e,y=Math.ceil(e/this._options.indentSize)):(c(r),y=this._getIndentLevelForWhitespaceLine(s,a,h))}let S=-1;if(v){const e=this._computeIndentLevel(g-1);e>=0?(d=g-1,u=e,S=Math.ceil(e/this._options.indentSize)):(p(g),S=this._getIndentLevelForWhitespaceLine(s,u,m))}if(0!==o){if(1===o){if(g<=n&&S>=0&&w+1===S){_=!1,f=g,b=g,C=S;continue}if(r>=1&&y>=0&&y-1===w){v=!1,f=r,b=r,C=y;continue}if(f=e,b=e,C=w,0===C)return{startLineNumber:f,endLineNumber:b,indent:C}}_&&(y>=C?f=r:_=!1),v&&(S>=C?b=g:v=!1)}else w=y}return{startLineNumber:f,endLineNumber:b,indent:C}}getLinesIndentGuides(e,t){this._assertNotDisposed();const i=this.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=We.a.getFoldingRules(this._languageIdentifier.id),o=Boolean(n&&n.offSide);let s=new Array(t-e+1),r=-2,a=-1,l=-2,h=-1;for(let n=e;n<=t;n++){let t=n-e;const c=this._computeIndentLevel(n-1);if(c>=0)r=n-1,a=c,s[t]=Math.ceil(c/this._options.indentSize);else{if(-2===r){r=-1,a=-1;for(let e=n-2;e>=0;e--){let t=this._computeIndentLevel(e);if(t>=0){r=e,a=t;break}}}if(-1!==l&&(-2===l||l=0){l=e,h=t;break}}}s[t]=this._getIndentLevelForWhitespaceLine(o,a,h)}}return s}_getIndentLevelForWhitespaceLine(e,t,i){return-1===t||-1===i?0:t0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}},function(e,t,i){"use strict";i.r(t),i.d(t,"i18n",(function(){return j}));var n={};i.r(n),i.d(n,"formats",(function(){return o})),i.d(n,"addTranslation",(function(){return N})),i.d(n,"getTranslation",(function(){return E})),i.d(n,"setLocale",(function(){return O})),i.d(n,"getLocale",(function(){return I})),i.d(n,"setDefaultLocale",(function(){return T})),i.d(n,"getDefaultLocale",(function(){return M})),i.d(n,"setFormats",(function(){return A})),i.d(n,"getFormats",(function(){return R})),i.d(n,"getRegisteredLocales",(function(){return P})),i.d(n,"translate",(function(){return F})),i.d(n,"init",(function(){return W})),i.d(n,"load",(function(){return B})),i.d(n,"isPseudoLocale",(function(){return b})),i.d(n,"translateUsingPseudoLocale",(function(){return v}));const o={number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}},relative:{years:{units:"year"},months:{units:"month"},days:{units:"day"},hours:{units:"hour"},minutes:{units:"minute"},seconds:{units:"second"}}};var s=i(135),r=i.n(s),a=i(106),l=i.n(a),h=i(122),c=i.n(h);const d=e=>"string"==typeof e,u=e=>"object"==typeof e&&null!==e,g=e=>Object.keys(e).length>0,m=(e,t)=>((e=[])=>[...new Set(e)])([...Object.keys(e),...Object.keys(t)]).reduce(((i,n)=>u(e[n])&&u(t[n])&&!Array.isArray(e[n])&&!Array.isArray(t[n])?{...i,[n]:m(e[n],t[n])}:{...i,[n]:void 0===t[n]?e[n]:t[n]}),{}),p=(...e)=>e.filter(u).reduce(((e,t)=>m(e,t))),f=/[A-Za-z]|(\]\([\s\S]*?\))|(<([^"<>]|("[^"]*?"))*?>)|(@I18N@\w*?@I18N@)/g,_="en-xa";function b(e){return e.toLowerCase()===_}function v(e){return e.replace(f,function(){let e=0;return t=>{if(1!==t.length)return t;const i=C[t]||t;return++e%3==0?i.repeat(2):i}}())}const C={a:"à",b:"ƀ",c:"ç",d:"ð",e:"é",f:"ƒ",g:"ĝ",h:"ĥ",i:"î",l:"ļ",k:"ķ",j:"ĵ",m:"ɱ",n:"ñ",o:"ô",p:"þ",q:"ǫ",r:"ŕ",s:"š",t:"ţ",u:"û",v:"ṽ",w:"ŵ",x:"ẋ",y:"ý",z:"ž",A:"À",B:"Ɓ",C:"Ç",D:"Ð",E:"É",F:"Ƒ",G:"Ĝ",H:"Ĥ",I:"Î",L:"Ļ",K:"Ķ",J:"Ĵ",M:"Ṁ",N:"Ñ",O:"Ô",P:"Þ",Q:"Ǫ",R:"Ŕ",S:"Š",T:"Ţ",U:"Û",V:"Ṽ",W:"Ŵ",X:"Ẋ",Y:"Ý",Z:"Ž"};function w(e){l.a.__addLocaleData(e),c.a.__addLocaleData(e)}w({locale:"en",pluralRuleFunction:function(e,t){var i=String(e).split("."),n=!i[1],o=Number(i[0])==e,s=o&&i[0].slice(-1),r=o&&i[0].slice(-2);return t?1==s&&11!=r?"one":2==s&&12!=r?"two":3==s&&13!=r?"few":"other":1==e&&n?"one":"other"},fields:{year:{displayName:"year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},"year-short":{displayName:"yr.",relative:{0:"this yr.",1:"next yr.","-1":"last yr."},relativeTime:{future:{one:"in {0} yr.",other:"in {0} yr."},past:{one:"{0} yr. ago",other:"{0} yr. ago"}}},month:{displayName:"month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},"month-short":{displayName:"mo.",relative:{0:"this mo.",1:"next mo.","-1":"last mo."},relativeTime:{future:{one:"in {0} mo.",other:"in {0} mo."},past:{one:"{0} mo. ago",other:"{0} mo. ago"}}},day:{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},"day-short":{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"hour",relative:{0:"this hour"},relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},"hour-short":{displayName:"hr.",relative:{0:"this hour"},relativeTime:{future:{one:"in {0} hr.",other:"in {0} hr."},past:{one:"{0} hr. ago",other:"{0} hr. ago"}}},minute:{displayName:"minute",relative:{0:"this minute"},relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},"minute-short":{displayName:"min.",relative:{0:"this minute"},relativeTime:{future:{one:"in {0} min.",other:"in {0} min."},past:{one:"{0} min. ago",other:"{0} min. ago"}}},second:{displayName:"second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}},"second-short":{displayName:"sec.",relative:{0:"now"},relativeTime:{future:{one:"in {0} sec.",other:"in {0} sec."},past:{one:"{0} sec. ago",other:"{0} sec. ago"}}}}}),w({locale:"en-US",parentLocale:"en"}),w({locale:"en-xa",pluralRuleFunction:function(e,t){var i=String(e).split("."),n=!i[1],o=Number(i[0])==e,s=o&&i[0].slice(-1),r=o&&i[0].slice(-2);return t?1==s&&11!=r?"one":2==s&&12!=r?"two":3==s&&13!=r?"few":"other":1==e&&n?"one":"other"},fields:{year:{displayName:"ýéààŕ",relative:{0:"ţĥîîš ýééàŕ",1:"ñéẋẋţ ýééàŕ","-1":"ļàššţ ýééàŕ"},relativeTime:{future:{one:"îñ {0} ýýéàŕŕ",other:"îñ {0} ýýéàŕŕš"},past:{one:"{0} ýéààŕ àĝĝô",other:"{0} ýéààŕš ààĝô"}}},"year-short":{displayName:"ýŕ.",relative:{0:"ţĥîîš ýŕŕ.",1:"ñéẋẋţ ýŕŕ.","-1":"ļàššţ ýŕŕ."},relativeTime:{future:{one:"îñ {0} ýýŕ.",other:"îñ {0} ýýŕ."},past:{one:"{0} ýŕ. ààĝô",other:"{0} ýŕ. ààĝô"}}},month:{displayName:"ɱôññţĥ",relative:{0:"ţĥîîš ɱôôñţĥĥ",1:"ñéẋẋţ ɱôôñţĥĥ","-1":"ļàššţ ɱôôñţĥĥ"},relativeTime:{future:{one:"îñ {0} ɱɱôñţţĥ",other:"îñ {0} ɱɱôñţţĥš"},past:{one:"{0} ɱôññţĥ ààĝô",other:"{0} ɱôññţĥšš àĝôô"}}},"month-short":{displayName:"ɱô.",relative:{0:"ţĥîîš ɱôô.",1:"ñéẋẋţ ɱôô.","-1":"ļàššţ ɱôô."},relativeTime:{future:{one:"îñ {0} ɱɱô.",other:"îñ {0} ɱɱô."},past:{one:"{0} ɱô. ààĝô",other:"{0} ɱô. ààĝô"}}},day:{displayName:"ðàýý",relative:{0:"ţôððàý",1:"ţôɱɱôŕŕŕôŵ","-1":"ýéššţéŕŕðàýý"},relativeTime:{future:{one:"îñ {0} ððàý",other:"îñ {0} ððàýšš"},past:{one:"{0} ðàýý àĝôô",other:"{0} ðàýýš àĝĝô"}}},"day-short":{displayName:"ðàýý",relative:{0:"ţôððàý",1:"ţôɱɱôŕŕŕôŵ","-1":"ýéššţéŕŕðàýý"},relativeTime:{future:{one:"îñ {0} ððàý",other:"îñ {0} ððàýšš"},past:{one:"{0} ðàýý àĝôô",other:"{0} ðàýýš àĝĝô"}}},hour:{displayName:"ĥôûûŕ",relative:{0:"ţĥîîš ĥôôûŕ"},relativeTime:{future:{one:"îñ {0} ĥĥôûŕŕ",other:"îñ {0} ĥĥôûŕŕš"},past:{one:"{0} ĥôûûŕ àĝĝô",other:"{0} ĥôûûŕš ààĝô"}}},"hour-short":{displayName:"ĥŕ.",relative:{0:"ţĥîîš ĥôôûŕ"},relativeTime:{future:{one:"îñ {0} ĥĥŕ.",other:"îñ {0} ĥĥŕ."},past:{one:"{0} ĥŕ. ààĝô",other:"{0} ĥŕ. ààĝô"}}},minute:{displayName:"ɱîññûţéé",relative:{0:"ţĥîîš ɱîîñûţţé"},relativeTime:{future:{one:"îñ {0} ɱɱîñûûţé",other:"îñ {0} ɱɱîñûûţéšš"},past:{one:"{0} ɱîññûţéé àĝôô",other:"{0} ɱîññûţééš àĝĝô"}}},"minute-short":{displayName:"ɱîññ.",relative:{0:"ţĥîîš ɱîîñûţţé"},relativeTime:{future:{one:"îñ {0} ɱɱîñ.",other:"îñ {0} ɱɱîñ."},past:{one:"{0} ɱîññ. àĝôô",other:"{0} ɱîññ. àĝôô"}}},second:{displayName:"šéççôñðð",relative:{0:"ñôŵŵ"},relativeTime:{future:{one:"îñ {0} ššéçôôñð",other:"îñ {0} ššéçôôñðšš"},past:{one:"{0} šéççôñðð àĝôô",other:"{0} šéççôñððš àĝĝô"}}},"second-short":{displayName:"šéçç.",relative:{0:"ñôŵŵ"},relativeTime:{future:{one:"îñ {0} ššéç.",other:"îñ {0} ššéç."},past:{one:"{0} šéçç. àĝôô",other:"{0} šéçç. àĝôô"}}}}}),w({locale:"es",pluralRuleFunction:function(e,t){return t?"other":1==e?"one":"other"},fields:{year:{displayName:"año",relative:{0:"este año",1:"el próximo año","-1":"el año pasado"},relativeTime:{future:{one:"dentro de {0} año",other:"dentro de {0} años"},past:{one:"hace {0} año",other:"hace {0} años"}}},"year-short":{displayName:"a",relative:{0:"este año",1:"el próximo año","-1":"el año pasado"},relativeTime:{future:{one:"dentro de {0} a",other:"dentro de {0} a"},past:{one:"hace {0} a",other:"hace {0} a"}}},month:{displayName:"mes",relative:{0:"este mes",1:"el próximo mes","-1":"el mes pasado"},relativeTime:{future:{one:"dentro de {0} mes",other:"dentro de {0} meses"},past:{one:"hace {0} mes",other:"hace {0} meses"}}},"month-short":{displayName:"m",relative:{0:"este mes",1:"el próximo mes","-1":"el mes pasado"},relativeTime:{future:{one:"dentro de {0} m",other:"dentro de {0} m"},past:{one:"hace {0} m",other:"hace {0} m"}}},day:{displayName:"día",relative:{0:"hoy",1:"mañana",2:"pasado mañana","-2":"anteayer","-1":"ayer"},relativeTime:{future:{one:"dentro de {0} día",other:"dentro de {0} días"},past:{one:"hace {0} día",other:"hace {0} días"}}},"day-short":{displayName:"d",relative:{0:"hoy",1:"mañana",2:"pasado mañana","-2":"anteayer","-1":"ayer"},relativeTime:{future:{one:"dentro de {0} día",other:"dentro de {0} días"},past:{one:"hace {0} día",other:"hace {0} días"}}},hour:{displayName:"hora",relative:{0:"esta hora"},relativeTime:{future:{one:"dentro de {0} hora",other:"dentro de {0} horas"},past:{one:"hace {0} hora",other:"hace {0} horas"}}},"hour-short":{displayName:"h",relative:{0:"esta hora"},relativeTime:{future:{one:"dentro de {0} h",other:"dentro de {0} h"},past:{one:"hace {0} h",other:"hace {0} h"}}},minute:{displayName:"minuto",relative:{0:"este minuto"},relativeTime:{future:{one:"dentro de {0} minuto",other:"dentro de {0} minutos"},past:{one:"hace {0} minuto",other:"hace {0} minutos"}}},"minute-short":{displayName:"min",relative:{0:"este minuto"},relativeTime:{future:{one:"dentro de {0} min",other:"dentro de {0} min"},past:{one:"hace {0} min",other:"hace {0} min"}}},second:{displayName:"segundo",relative:{0:"ahora"},relativeTime:{future:{one:"dentro de {0} segundo",other:"dentro de {0} segundos"},past:{one:"hace {0} segundo",other:"hace {0} segundos"}}},"second-short":{displayName:"s",relative:{0:"ahora"},relativeTime:{future:{one:"dentro de {0} s",other:"dentro de {0} s"},past:{one:"hace {0} s",other:"hace {0} s"}}}}}),w({locale:"es-LA",parentLocale:"es"}),w({locale:"fr",pluralRuleFunction:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},fields:{year:{displayName:"année",relative:{0:"cette année",1:"l’année prochaine","-1":"l’année dernière"},relativeTime:{future:{one:"dans {0} an",other:"dans {0} ans"},past:{one:"il y a {0} an",other:"il y a {0} ans"}}},"year-short":{displayName:"an",relative:{0:"cette année",1:"l’année prochaine","-1":"l’année dernière"},relativeTime:{future:{one:"dans {0} a",other:"dans {0} a"},past:{one:"il y a {0} a",other:"il y a {0} a"}}},month:{displayName:"mois",relative:{0:"ce mois-ci",1:"le mois prochain","-1":"le mois dernier"},relativeTime:{future:{one:"dans {0} mois",other:"dans {0} mois"},past:{one:"il y a {0} mois",other:"il y a {0} mois"}}},"month-short":{displayName:"m.",relative:{0:"ce mois-ci",1:"le mois prochain","-1":"le mois dernier"},relativeTime:{future:{one:"dans {0} m.",other:"dans {0} m."},past:{one:"il y a {0} m.",other:"il y a {0} m."}}},day:{displayName:"jour",relative:{0:"aujourd’hui",1:"demain",2:"après-demain","-2":"avant-hier","-1":"hier"},relativeTime:{future:{one:"dans {0} jour",other:"dans {0} jours"},past:{one:"il y a {0} jour",other:"il y a {0} jours"}}},"day-short":{displayName:"j",relative:{0:"aujourd’hui",1:"demain",2:"après-demain","-2":"avant-hier","-1":"hier"},relativeTime:{future:{one:"dans {0} j",other:"dans {0} j"},past:{one:"il y a {0} j",other:"il y a {0} j"}}},hour:{displayName:"heure",relative:{0:"cette heure-ci"},relativeTime:{future:{one:"dans {0} heure",other:"dans {0} heures"},past:{one:"il y a {0} heure",other:"il y a {0} heures"}}},"hour-short":{displayName:"h",relative:{0:"cette heure-ci"},relativeTime:{future:{one:"dans {0} h",other:"dans {0} h"},past:{one:"il y a {0} h",other:"il y a {0} h"}}},minute:{displayName:"minute",relative:{0:"cette minute-ci"},relativeTime:{future:{one:"dans {0} minute",other:"dans {0} minutes"},past:{one:"il y a {0} minute",other:"il y a {0} minutes"}}},"minute-short":{displayName:"min",relative:{0:"cette minute-ci"},relativeTime:{future:{one:"dans {0} min",other:"dans {0} min"},past:{one:"il y a {0} min",other:"il y a {0} min"}}},second:{displayName:"seconde",relative:{0:"maintenant"},relativeTime:{future:{one:"dans {0} seconde",other:"dans {0} secondes"},past:{one:"il y a {0} seconde",other:"il y a {0} secondes"}}},"second-short":{displayName:"s",relative:{0:"maintenant"},relativeTime:{future:{one:"dans {0} s",other:"dans {0} s"},past:{one:"il y a {0} s",other:"il y a {0} s"}}}}}),w({locale:"fr-FR",parentLocale:"fr"}),w({locale:"de",pluralRuleFunction:function(e,t){var i=!String(e).split(".")[1];return t?"other":1==e&&i?"one":"other"},fields:{year:{displayName:"Jahr",relative:{0:"dieses Jahr",1:"nächstes Jahr","-1":"letztes Jahr"},relativeTime:{future:{one:"in {0} Jahr",other:"in {0} Jahren"},past:{one:"vor {0} Jahr",other:"vor {0} Jahren"}}},"year-short":{displayName:"Jahr",relative:{0:"dieses Jahr",1:"nächstes Jahr","-1":"letztes Jahr"},relativeTime:{future:{one:"in {0} Jahr",other:"in {0} Jahren"},past:{one:"vor {0} Jahr",other:"vor {0} Jahren"}}},month:{displayName:"Monat",relative:{0:"diesen Monat",1:"nächsten Monat","-1":"letzten Monat"},relativeTime:{future:{one:"in {0} Monat",other:"in {0} Monaten"},past:{one:"vor {0} Monat",other:"vor {0} Monaten"}}},"month-short":{displayName:"Monat",relative:{0:"diesen Monat",1:"nächsten Monat","-1":"letzten Monat"},relativeTime:{future:{one:"in {0} Monat",other:"in {0} Monaten"},past:{one:"vor {0} Monat",other:"vor {0} Monaten"}}},day:{displayName:"Tag",relative:{0:"heute",1:"morgen",2:"übermorgen","-2":"vorgestern","-1":"gestern"},relativeTime:{future:{one:"in {0} Tag",other:"in {0} Tagen"},past:{one:"vor {0} Tag",other:"vor {0} Tagen"}}},"day-short":{displayName:"Tag",relative:{0:"heute",1:"morgen",2:"übermorgen","-2":"vorgestern","-1":"gestern"},relativeTime:{future:{one:"in {0} Tag",other:"in {0} Tagen"},past:{one:"vor {0} Tag",other:"vor {0} Tagen"}}},hour:{displayName:"Stunde",relative:{0:"in dieser Stunde"},relativeTime:{future:{one:"in {0} Stunde",other:"in {0} Stunden"},past:{one:"vor {0} Stunde",other:"vor {0} Stunden"}}},"hour-short":{displayName:"Std.",relative:{0:"in dieser Stunde"},relativeTime:{future:{one:"in {0} Std.",other:"in {0} Std."},past:{one:"vor {0} Std.",other:"vor {0} Std."}}},minute:{displayName:"Minute",relative:{0:"in dieser Minute"},relativeTime:{future:{one:"in {0} Minute",other:"in {0} Minuten"},past:{one:"vor {0} Minute",other:"vor {0} Minuten"}}},"minute-short":{displayName:"Min.",relative:{0:"in dieser Minute"},relativeTime:{future:{one:"in {0} Min.",other:"in {0} Min."},past:{one:"vor {0} Min.",other:"vor {0} Min."}}},second:{displayName:"Sekunde",relative:{0:"jetzt"},relativeTime:{future:{one:"in {0} Sekunde",other:"in {0} Sekunden"},past:{one:"vor {0} Sekunde",other:"vor {0} Sekunden"}}},"second-short":{displayName:"Sek.",relative:{0:"jetzt"},relativeTime:{future:{one:"in {0} Sek.",other:"in {0} Sek."},past:{one:"vor {0} Sek.",other:"vor {0} Sek."}}}}}),w({locale:"de-DE",parentLocale:"de"}),w({locale:"ja",pluralRuleFunction:function(e,t){return"other"},fields:{year:{displayName:"年",relative:{0:"今年",1:"翌年","-1":"昨年"},relativeTime:{future:{other:"{0} 年後"},past:{other:"{0} 年前"}}},"year-short":{displayName:"年",relative:{0:"今年",1:"翌年","-1":"昨年"},relativeTime:{future:{other:"{0} 年後"},past:{other:"{0} 年前"}}},month:{displayName:"月",relative:{0:"今月",1:"翌月","-1":"先月"},relativeTime:{future:{other:"{0} か月後"},past:{other:"{0} か月前"}}},"month-short":{displayName:"月",relative:{0:"今月",1:"翌月","-1":"先月"},relativeTime:{future:{other:"{0} か月後"},past:{other:"{0} か月前"}}},day:{displayName:"日",relative:{0:"今日",1:"明日",2:"明後日","-2":"一昨日","-1":"昨日"},relativeTime:{future:{other:"{0} 日後"},past:{other:"{0} 日前"}}},"day-short":{displayName:"日",relative:{0:"今日",1:"明日",2:"明後日","-2":"一昨日","-1":"昨日"},relativeTime:{future:{other:"{0} 日後"},past:{other:"{0} 日前"}}},hour:{displayName:"時",relative:{0:"1 時間以内"},relativeTime:{future:{other:"{0} 時間後"},past:{other:"{0} 時間前"}}},"hour-short":{displayName:"時",relative:{0:"1 時間以内"},relativeTime:{future:{other:"{0} 時間後"},past:{other:"{0} 時間前"}}},minute:{displayName:"分",relative:{0:"1 分以内"},relativeTime:{future:{other:"{0} 分後"},past:{other:"{0} 分前"}}},"minute-short":{displayName:"分",relative:{0:"1 分以内"},relativeTime:{future:{other:"{0} 分後"},past:{other:"{0} 分前"}}},second:{displayName:"秒",relative:{0:"今"},relativeTime:{future:{other:"{0} 秒後"},past:{other:"{0} 秒前"}}},"second-short":{displayName:"秒",relative:{0:"今"},relativeTime:{future:{other:"{0} 秒後"},past:{other:"{0} 秒前"}}}}}),w({locale:"ja-JP",parentLocale:"ja"}),w({locale:"ko",pluralRuleFunction:function(e,t){return"other"},fields:{year:{displayName:"년",relative:{0:"올해",1:"내년","-1":"작년"},relativeTime:{future:{other:"{0}년 후"},past:{other:"{0}년 전"}}},"year-short":{displayName:"년",relative:{0:"올해",1:"내년","-1":"작년"},relativeTime:{future:{other:"{0}년 후"},past:{other:"{0}년 전"}}},month:{displayName:"월",relative:{0:"이번 달",1:"다음 달","-1":"지난달"},relativeTime:{future:{other:"{0}개월 후"},past:{other:"{0}개월 전"}}},"month-short":{displayName:"월",relative:{0:"이번 달",1:"다음 달","-1":"지난달"},relativeTime:{future:{other:"{0}개월 후"},past:{other:"{0}개월 전"}}},day:{displayName:"일",relative:{0:"오늘",1:"내일",2:"모레","-2":"그저께","-1":"어제"},relativeTime:{future:{other:"{0}일 후"},past:{other:"{0}일 전"}}},"day-short":{displayName:"일",relative:{0:"오늘",1:"내일",2:"모레","-2":"그저께","-1":"어제"},relativeTime:{future:{other:"{0}일 후"},past:{other:"{0}일 전"}}},hour:{displayName:"시",relative:{0:"현재 시간"},relativeTime:{future:{other:"{0}시간 후"},past:{other:"{0}시간 전"}}},"hour-short":{displayName:"시",relative:{0:"현재 시간"},relativeTime:{future:{other:"{0}시간 후"},past:{other:"{0}시간 전"}}},minute:{displayName:"분",relative:{0:"현재 분"},relativeTime:{future:{other:"{0}분 후"},past:{other:"{0}분 전"}}},"minute-short":{displayName:"분",relative:{0:"현재 분"},relativeTime:{future:{other:"{0}분 후"},past:{other:"{0}분 전"}}},second:{displayName:"초",relative:{0:"지금"},relativeTime:{future:{other:"{0}초 후"},past:{other:"{0}초 전"}}},"second-short":{displayName:"초",relative:{0:"지금"},relativeTime:{future:{other:"{0}초 후"},past:{other:"{0}초 전"}}}}}),w({locale:"ko-KR",parentLocale:"ko"}),w({locale:"pt",pluralRuleFunction:function(e,t){return t?"other":1==e?"one":"other"},fields:{year:{displayName:"ano",relative:{0:"este ano",1:"próximo ano","-1":"ano passado"},relativeTime:{future:{one:"em {0} ano",other:"em {0} anos"},past:{one:"há {0} ano",other:"há {0} anos"}}},"year-short":{displayName:"a",relative:{0:"este ano",1:"próximo ano","-1":"último ano"},relativeTime:{future:{one:"em {0} ano",other:"em {0} anos"},past:{one:"há {0} ano",other:"há {0} anos"}}},month:{displayName:"mês",relative:{0:"este mês",1:"próximo mês","-1":"mês passado"},relativeTime:{future:{one:"em {0} mês",other:"em {0} meses"},past:{one:"há {0} mês",other:"há {0} meses"}}},"month-short":{displayName:"m",relative:{0:"este mês",1:"próximo mês","-1":"último mês"},relativeTime:{future:{one:"em {0} mês",other:"em {0} meses"},past:{one:"há {0} mês",other:"há {0} meses"}}},day:{displayName:"dia",relative:{0:"hoje",1:"amanhã","-1":"ontem"},relativeTime:{future:{one:"em {0} dia",other:"em {0} dias"},past:{one:"há {0} dia",other:"há {0} dias"}}},"day-short":{displayName:"d",relative:{0:"hoje",1:"amanhã","-1":"ontem"},relativeTime:{future:{one:"em {0} dia",other:"em {0} dias"},past:{one:"há {0} dia",other:"há {0} dias"}}},hour:{displayName:"hora",relative:{0:"nesta hora"},relativeTime:{future:{one:"em {0} hora",other:"em {0} horas"},past:{one:"há {0} hora",other:"há {0} horas"}}},"hour-short":{displayName:"h",relative:{0:"nesta hora"},relativeTime:{future:{one:"em {0} h",other:"em {0} h"},past:{one:"há {0} h",other:"há {0} h"}}},minute:{displayName:"minuto",relative:{0:"neste minuto"},relativeTime:{future:{one:"em {0} minuto",other:"em {0} minutos"},past:{one:"há {0} minuto",other:"há {0} minutos"}}},"minute-short":{displayName:"min",relative:{0:"neste minuto"},relativeTime:{future:{one:"em {0} min",other:"em {0} min"},past:{one:"há {0} min",other:"há {0} min"}}},second:{displayName:"segundo",relative:{0:"agora"},relativeTime:{future:{one:"em {0} segundo",other:"em {0} segundos"},past:{one:"há {0} segundo",other:"há {0} segundos"}}},"second-short":{displayName:"s",relative:{0:"agora"},relativeTime:{future:{one:"em {0} s",other:"em {0} s"},past:{one:"há {0} s",other:"há {0} s"}}}}}),w({locale:"pt-BR",parentLocale:"pt"}),w({locale:"zh",pluralRuleFunction:function(e,t){return"other"},fields:{year:{displayName:"年",relative:{0:"今年",1:"明年","-1":"去年"},relativeTime:{future:{other:"{0}年后"},past:{other:"{0}年前"}}},"year-short":{displayName:"年",relative:{0:"今年",1:"明年","-1":"去年"},relativeTime:{future:{other:"{0}年后"},past:{other:"{0}年前"}}},month:{displayName:"月",relative:{0:"本月",1:"下个月","-1":"上个月"},relativeTime:{future:{other:"{0}个月后"},past:{other:"{0}个月前"}}},"month-short":{displayName:"月",relative:{0:"本月",1:"下个月","-1":"上个月"},relativeTime:{future:{other:"{0}个月后"},past:{other:"{0}个月前"}}},day:{displayName:"日",relative:{0:"今天",1:"明天",2:"后天","-2":"前天","-1":"昨天"},relativeTime:{future:{other:"{0}天后"},past:{other:"{0}天前"}}},"day-short":{displayName:"日",relative:{0:"今天",1:"明天",2:"后天","-2":"前天","-1":"昨天"},relativeTime:{future:{other:"{0}天后"},past:{other:"{0}天前"}}},hour:{displayName:"小时",relative:{0:"这一时间 / 此时"},relativeTime:{future:{other:"{0}小时后"},past:{other:"{0}小时前"}}},"hour-short":{displayName:"小时",relative:{0:"这一时间 / 此时"},relativeTime:{future:{other:"{0}小时后"},past:{other:"{0}小时前"}}},minute:{displayName:"分钟",relative:{0:"此刻"},relativeTime:{future:{other:"{0}分钟后"},past:{other:"{0}分钟前"}}},"minute-short":{displayName:"分",relative:{0:"此刻"},relativeTime:{future:{other:"{0}分钟后"},past:{other:"{0}分钟前"}}},second:{displayName:"秒",relative:{0:"现在"},relativeTime:{future:{other:"{0}秒钟后"},past:{other:"{0}秒钟前"}}},"second-short":{displayName:"秒",relative:{0:"现在"},relativeTime:{future:{other:"{0}秒后"},past:{other:"{0}秒前"}}}}}),w({locale:"zh-CN",parentLocale:"zh"});const y={},S=r()(l.a);let x="en",L="en",k=o;function D(e){return e.toLowerCase()}function N(e,t=e.locale){if(!t||!d(t))throw new Error("[I18n] A `locale` must be a non-empty string to add messages.");if(e.locale&&e.locale!==t)throw new Error("[I18n] A `locale` in the translation object is different from the one provided as a second argument.");const i=D(t),n=y[i]||{messages:{}};y[i]={formats:e.formats||n.formats,locale:e.locale||n.locale,messages:{...n.messages,...e.messages}}}function E(){return y[L]||{messages:{}}}function O(e){if(!e||!d(e))throw new Error("[I18n] A `locale` must be a non-empty string.");L=D(e)}function I(){return L}function T(e){if(!e||!d(e))throw new Error("[I18n] A `locale` must be a non-empty string.");x=D(e),l.a.defaultLocale=x,c.a.defaultLocale=x}function M(){return x}function A(e){if(!u(e)||!g(e))throw new Error("[I18n] A `formats` must be a non-empty object.");k=p(k,e)}function R(){return k}function P(){return Object.keys(y)}function F(e,{values:t={},defaultMessage:i}){const n=b(L);if(!e||!d(e))throw new Error("[I18n] An `id` must be a non-empty string to translate a message.");const o=n?i:function(e){const t=E();return t.messages?t.messages[e]:void 0}(e);if(!o&&!i)throw new Error(`[I18n] Cannot format message: "${e}". Default message must be provided.`);if(o)try{const e=S(o,I(),R()).format(t);return n?v(e):e}catch(t){throw new Error(`[I18n] Error formatting message: "${e}" for locale: "${I()}".\n${t}`)}try{return S(i,M(),R()).format(t)}catch(t){throw new Error(`[I18n] Error formatting the default message for: "${e}".\n${t}`)}}function W(e){e&&(N(e),e.locale&&O(e.locale),e.formats&&A(e.formats))}async function B(e){const t=await fetch(e,{credentials:"same-origin"});if(t.status>=300)throw new Error(`Translations request failed with status code: ${t.status}`);W(await t.json())}l.a.defaultLocale=x,c.a.defaultLocale=x;const j=n},function(e,t,i){"use strict";i.d(t,"e",(function(){return h})),i.d(t,"f",(function(){return c})),i.d(t,"c",(function(){return d})),i.d(t,"b",(function(){return u})),i.d(t,"d",(function(){return g})),i.d(t,"g",(function(){return m})),i.d(t,"h",(function(){return p})),i.d(t,"a",(function(){return f}));var n=i(147),o=i(50),s=i(22),r=i(6),a=i(34);function l(e){return Object(s.b)(e,!0)}const h=new class{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:Object(r.f)(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!(!e||!t)&&this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}joinPath(e,...t){return s.a.joinPath(e,...t)}basenameOrAuthority(e){return u(e)||e.authority}basename(e){return o.e.basename(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===a.c.file?t=s.a.file(o.b(l(e))).path:(t=o.e.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===a.c.file?s.a.file(o.d(l(e))).path:o.e.normalize(e.path),e.with({path:t})}resolvePath(e,t){if(e.scheme===a.c.file){const i=s.a.file(o.g(l(e),t));return e.with({authority:i.authority,path:i.path})}return-1===t.indexOf("/")&&(t=n.d(t),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t)),e.with({path:o.e.resolve(e.path,t)})}}((()=>!1)),c=h.isEqual.bind(h),d=h.basenameOrAuthority.bind(h),u=h.basename.bind(h),g=h.dirname.bind(h),m=(h.joinPath.bind(h),h.normalizePath.bind(h)),p=h.resolvePath.bind(h);var f;!function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach((e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)}));const n=t.path.substring(0,t.path.indexOf(";"));return n&&i.set(e.META_DATA_MIME,n),i}}(f||(f={}))},function(e,t,i){"use strict";i.d(t,"b",(function(){return l})),i.d(t,"a",(function(){return h})),i.d(t,"f",(function(){return c})),i.d(t,"e",(function(){return u})),i.d(t,"d",(function(){return m})),i.d(t,"c",(function(){return p}));var n=i(18);class o{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const s=new o,r=new o,a=new o;var l;function h(e,t){return(e|(65535&t)<<16>>>0)>>>0}function c(e,t){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new g(0!==n?[d(i,t),d(n,t)]:[d(i,t)])}function d(e,t){const i=!!(2048&e),n=!!(256&e);return new u(2===t?n:i,!!(1024&e),!!(512&e),2===t?i:n,255&e)}!function(){function e(e,t,i=t,n=i){s.define(e,t),r.define(e,i),a.define(e,n)}e(0,"unknown"),e(1,"Backspace"),e(2,"Tab"),e(3,"Enter"),e(4,"Shift"),e(5,"Ctrl"),e(6,"Alt"),e(7,"PauseBreak"),e(8,"CapsLock"),e(9,"Escape"),e(10,"Space"),e(11,"PageUp"),e(12,"PageDown"),e(13,"End"),e(14,"Home"),e(15,"LeftArrow","Left"),e(16,"UpArrow","Up"),e(17,"RightArrow","Right"),e(18,"DownArrow","Down"),e(19,"Insert"),e(20,"Delete"),e(21,"0"),e(22,"1"),e(23,"2"),e(24,"3"),e(25,"4"),e(26,"5"),e(27,"6"),e(28,"7"),e(29,"8"),e(30,"9"),e(31,"A"),e(32,"B"),e(33,"C"),e(34,"D"),e(35,"E"),e(36,"F"),e(37,"G"),e(38,"H"),e(39,"I"),e(40,"J"),e(41,"K"),e(42,"L"),e(43,"M"),e(44,"N"),e(45,"O"),e(46,"P"),e(47,"Q"),e(48,"R"),e(49,"S"),e(50,"T"),e(51,"U"),e(52,"V"),e(53,"W"),e(54,"X"),e(55,"Y"),e(56,"Z"),e(57,"Meta"),e(58,"ContextMenu"),e(59,"F1"),e(60,"F2"),e(61,"F3"),e(62,"F4"),e(63,"F5"),e(64,"F6"),e(65,"F7"),e(66,"F8"),e(67,"F9"),e(68,"F10"),e(69,"F11"),e(70,"F12"),e(71,"F13"),e(72,"F14"),e(73,"F15"),e(74,"F16"),e(75,"F17"),e(76,"F18"),e(77,"F19"),e(78,"NumLock"),e(79,"ScrollLock"),e(80,";",";","OEM_1"),e(81,"=","=","OEM_PLUS"),e(82,",",",","OEM_COMMA"),e(83,"-","-","OEM_MINUS"),e(84,".",".","OEM_PERIOD"),e(85,"/","/","OEM_2"),e(86,"`","`","OEM_3"),e(110,"ABNT_C1"),e(111,"ABNT_C2"),e(87,"[","[","OEM_4"),e(88,"\\","\\","OEM_5"),e(89,"]","]","OEM_6"),e(90,"'","'","OEM_7"),e(91,"OEM_8"),e(92,"OEM_102"),e(93,"NumPad0"),e(94,"NumPad1"),e(95,"NumPad2"),e(96,"NumPad3"),e(97,"NumPad4"),e(98,"NumPad5"),e(99,"NumPad6"),e(100,"NumPad7"),e(101,"NumPad8"),e(102,"NumPad9"),e(103,"NumPad_Multiply"),e(104,"NumPad_Add"),e(105,"NumPad_Separator"),e(106,"NumPad_Subtract"),e(107,"NumPad_Decimal"),e(108,"NumPad_Divide")}(),function(e){e.toString=function(e){return s.keyCodeToStr(e)},e.fromString=function(e){return s.strToKeyCode(e)},e.toUserSettingsUS=function(e){return r.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return a.keyCodeToStr(e)},e.fromUserSettings=function(e){return r.strToKeyCode(e)||a.strToKeyCode(e)}}(l||(l={}));class u{constructor(e,t,i,n,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=o}equals(e){return this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}toChord(){return new g([this])}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class g{constructor(e){if(0===e.length)throw Object(n.b)("parts");this.parts=e}}class m{constructor(e,t,i,n,o,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=o,this.keyAriaLabel=s}}class p{}},function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"g",(function(){return a})),i.d(t,"b",(function(){return l})),i.d(t,"f",(function(){return h})),i.d(t,"d",(function(){return d})),i.d(t,"c",(function(){return u})),i.d(t,"e",(function(){return g}));var n=i(51),o=i(15),s=i(112);const r=Object(o.c)("configurationService");function a(e,t){const i=Object.create(null);for(let n in e)l(i,n,e[n],t);return i}function l(e,t,i,n){const o=t.split("."),s=o.pop();let r=e;for(let e=0;econsole.error(`Conflict in default settings: ${e}`)));return e}},function(e,t,i){"use strict";i.d(t,"g",(function(){return o})),i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return a})),i.d(t,"d",(function(){return l})),i.d(t,"e",(function(){return h})),i.d(t,"a",(function(){return c})),i.d(t,"f",(function(){return d}));var n=i(6);class o{constructor(e,t,i,n){this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class s{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}}class r{constructor(e,t,i){this.breakOffsets=e,this.breakOffsetsVisibleColumn=t,this.wrappedTextIndentLength=i}static getInputOffsetOfOutputPosition(e,t,i){return 0===t?i:e[t-1]+i}static getOutputPositionOfInputOffset(e,t){let i=0,n=e.length-1,o=0,r=0;for(;i<=n;){o=i+(n-i)/2|0;const s=e[o];if(r=o>0?e[o-1]:0,t=s))break;i=o+1}}return new s(o,t-r)}}class a{constructor(e,t){this.tabSize=e,this.data=t}}class l{constructor(e,t,i,n,o,s){this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=s}}class h{constructor(e,t,i,n,o,s,r,a,l,c){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=h.isBasicASCII(i,s),this.containsRTL=h.containsRTL(i,this.isBasicASCII,o),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=c}static isBasicASCII(e,t){return!t||n.z(e)}static containsRTL(e,t,i){return!(t||!i)&&n.m(e)}}class c{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class d{constructor(e,t){this.range=e,this.options=t}}},function(e,t,i){"use strict";i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){return o})),i.d(t,"b",(function(){return l}));var n,o,s=i(15),r=i(0),a=i(52);!function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(n||(n={})),function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=Object(r.a)("sev.error","Error"),t[e.Warning]=Object(r.a)("sev.warning","Warning"),t[e.Info]=Object(r.a)("sev.info","Info"),e.toString=function(e){return t[e]||""},e.fromSeverity=function(t){switch(t){case a.a.Error:return e.Error;case a.a.Warning:return e.Warning;case a.a.Info:return e.Info;case a.a.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return a.a.Error;case e.Warning:return a.a.Warning;case e.Info:return a.a.Info;case e.Hint:return a.a.Ignore}}}(n||(n={})),function(e){const t="";function i(e,i){let o=[t];return e.source?o.push(e.source.replace("¦","\\¦")):o.push(t),e.code?"string"==typeof e.code?o.push(e.code.replace("¦","\\¦")):o.push(e.code.value.replace("¦","\\¦")):o.push(t),void 0!==e.severity&&null!==e.severity?o.push(n.toString(e.severity)):o.push(t),e.message&&i?o.push(e.message.replace("¦","\\¦")):o.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?o.push(e.startLineNumber.toString()):o.push(t),void 0!==e.startColumn&&null!==e.startColumn?o.push(e.startColumn.toString()):o.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?o.push(e.endLineNumber.toString()):o.push(t),void 0!==e.endColumn&&null!==e.endColumn?o.push(e.endColumn.toString()):o.push(t),o.push(t),o.join("¦")}e.makeKey=function(e){return i(e,!0)},e.makeKeyOptionalMessage=i}(o||(o={}));const l=Object(s.c)("markerService")},function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));var n=i(30),o=i(42),s=i(13);let r=new Array(230),a=new Array(112);!function(){for(let e=0;ethis.onTouchStart(e)),{passive:!1})),this._register(r.i(document,"touchend",(e=>this.onTouchEnd(e)))),this._register(r.i(document,"touchmove",(e=>this.onTouchMove(e)),{passive:!1}))}static addTarget(e){return l.isTouchDevice()?(l.INSTANCE||(l.INSTANCE=new l),l.INSTANCE.targets.push(e),{dispose:()=>{l.INSTANCE.targets=l.INSTANCE.targets.filter((t=>t!==e))}}):s.a.None}static ignoreTarget(e){return l.isTouchDevice()?(l.INSTANCE||(l.INSTANCE=new l),l.INSTANCE.ignoreTargets.push(e),{dispose:()=>{l.INSTANCE.ignoreTargets=l.INSTANCE.ignoreTargets.filter((t=>t!==e))}}):s.a.None}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,o=e.targetTouches.length;i=l.HOLD_DELAY&&Math.abs(a.initialPageX-o.r(a.rollingPageX))<30&&Math.abs(a.initialPageY-o.r(a.rollingPageY))<30){let e=this.newGestureEvent(n.Contextmenu,a.initialTarget);e.pageX=o.r(a.rollingPageX),e.pageY=o.r(a.rollingPageY),this.dispatchEvent(e)}else if(1===i){let e=o.r(a.rollingPageX),i=o.r(a.rollingPageY),n=o.r(a.rollingTimestamps)-a.rollingTimestamps[0],s=e-a.rollingPageX[0],r=i-a.rollingPageY[0];const l=this.targets.filter((e=>a.initialTarget instanceof Node&&e.contains(a.initialTarget)));this.inertia(l,t,Math.abs(s)/n,s>0?1:-1,e,Math.abs(r)/n,r>0?1:-1,i)}this.dispatchEvent(this.newGestureEvent(n.End,a.initialTarget)),delete this.activeTouches[r.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){let i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===n.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>l.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==n.Change&&e.type!==n.Contextmenu||(this._lastSetTapCountTime=0);for(let t=0;t{e.initialTarget instanceof Node&&t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}))}inertia(e,t,i,o,s,a,h,c){this.handle=r.T((()=>{let r=Date.now(),d=r-t,u=0,g=0,m=!0;i+=l.SCROLL_FRICTION*d,a+=l.SCROLL_FRICTION*d,i>0&&(m=!1,u=o*i*d),a>0&&(m=!1,g=h*a*d);let p=this.newGestureEvent(n.Change);p.translationX=u,p.translationY=g,e.forEach((e=>e.dispatchEvent(p))),m||this.inertia(e,r,i,o,s+u,a,h,c+g)}))}onTouchMove(e){let t=Date.now();for(let i=0,s=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(s.pageX),r.rollingPageY.push(s.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}l.SCROLL_FRICTION=-.005,l.HOLD_DELAY=700,l.CLEAR_TAP_COUNT_TIME=400,function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([a.a],l,"isTouchDevice",null)},function(e,t,i){"use strict";i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return l})),i.d(t,"d",(function(){return h})),i.d(t,"e",(function(){return c})),i.d(t,"c",(function(){return d}));var n=i(0),o=i(2),s=i(5),r=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class a extends o.a{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new s.a),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._checked=!1,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return r(this,void 0,void 0,(function*(){this._actionCallback&&(yield this._actionCallback(e))}))}}class l extends o.a{constructor(){super(...arguments),this._onBeforeRun=this._register(new s.a),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new s.a),this.onDidRun=this._onDidRun.event}run(e,t){return r(this,void 0,void 0,(function*(){if(!e.enabled)return;let i;this._onBeforeRun.fire({action:e});try{yield this.runAction(e,t)}catch(e){i=e}this._onDidRun.fire({action:e,error:i})}))}runAction(e,t){return r(this,void 0,void 0,(function*(){yield e.run(t)}))}}class h extends a{constructor(e){super(h.ID,e,e?"separator text":"separator"),this.checked=!1,this.enabled=!1}}h.ID="vs.actions.separator";class c{constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=e,this.label=t,this.class=n,this._actions=i}get actions(){return this._actions}dispose(){}run(){return r(this,void 0,void 0,(function*(){}))}}class d extends a{constructor(){super(d.ID,n.a("submenu.empty","(empty)"),void 0,!1)}}d.ID="vs.actions.empty"},function(e,t,i){"use strict";i.d(t,"h",(function(){return a})),i.d(t,"i",(function(){return l})),i.d(t,"f",(function(){return g})),i.d(t,"e",(function(){return m})),i.d(t,"g",(function(){return f})),i.d(t,"a",(function(){return _})),i.d(t,"j",(function(){return b})),i.d(t,"b",(function(){return C})),i.d(t,"m",(function(){return w})),i.d(t,"c",(function(){return y})),i.d(t,"d",(function(){return S})),i.d(t,"l",(function(){return x})),i.d(t,"k",(function(){return L})),i.d(t,"n",(function(){return D})),i.d(t,"o",(function(){return N})),i.d(t,"p",(function(){return O})),i.d(t,"r",(function(){return I})),i.d(t,"q",(function(){return T}));var n=i(0),o=i(12),s=i(4),r=i(17);const a=Object(s.ac)("editor.lineHighlightBackground",{dark:null,light:null,hc:null},n.a("lineHighlight","Background color for the highlight of line at the cursor position.")),l=Object(s.ac)("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},n.a("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),h=Object(s.ac)("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},n.a("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),c=Object(s.ac)("editor.rangeHighlightBorder",{dark:null,light:null,hc:s.b},n.a("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),d=Object(s.ac)("editor.symbolHighlightBackground",{dark:s.v,light:s.v,hc:null},n.a("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),u=Object(s.ac)("editor.symbolHighlightBorder",{dark:null,light:null,hc:s.b},n.a("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0),g=Object(s.ac)("editorCursor.foreground",{dark:"#AEAFAD",light:o.a.black,hc:o.a.white},n.a("caret","Color of the editor cursor.")),m=Object(s.ac)("editorCursor.background",null,n.a("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),p=Object(s.ac)("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},n.a("editorWhitespaces","Color of whitespace characters in the editor.")),f=Object(s.ac)("editorIndentGuide.background",{dark:p,light:p,hc:p},n.a("editorIndentGuides","Color of the editor indentation guides.")),_=Object(s.ac)("editorIndentGuide.activeBackground",{dark:p,light:p,hc:p},n.a("editorActiveIndentGuide","Color of the active editor indentation guides.")),b=Object(s.ac)("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:o.a.white},n.a("editorLineNumbers","Color of editor line numbers.")),v=Object(s.ac)("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:s.b},n.a("editorActiveLineNumber","Color of editor active line number"),!1,n.a("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),C=Object(s.ac)("editorLineNumber.activeForeground",{dark:v,light:v,hc:v},n.a("editorActiveLineNumber","Color of editor active line number")),w=Object(s.ac)("editorRuler.foreground",{dark:"#5A5A5A",light:o.a.lightgrey,hc:o.a.white},n.a("editorRuler","Color of the editor rulers.")),y=(Object(s.ac)("editorCodeLens.foreground",{dark:"#999999",light:"#999999",hc:"#999999"},n.a("editorCodeLensForeground","Foreground color of editor CodeLens")),Object(s.ac)("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},n.a("editorBracketMatchBackground","Background color behind matching brackets"))),S=Object(s.ac)("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:s.h},n.a("editorBracketMatchBorder","Color for matching brackets boxes")),x=Object(s.ac)("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},n.a("editorOverviewRulerBorder","Color of the overview ruler border.")),L=Object(s.ac)("editorOverviewRuler.background",null,n.a("editorOverviewRulerBackground","Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.")),k=Object(s.ac)("editorGutter.background",{dark:s.r,light:s.r,hc:s.r},n.a("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),D=Object(s.ac)("editorUnnecessaryCode.border",{dark:null,light:null,hc:o.a.fromHex("#fff").transparent(.8)},n.a("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),N=Object(s.ac)("editorUnnecessaryCode.opacity",{dark:o.a.fromHex("#000a"),light:o.a.fromHex("#0007"),hc:null},n.a("unnecessaryCodeOpacity","Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.")),E=new o.a(new o.c(0,122,204,.6)),O=(Object(s.ac)("editorOverviewRuler.rangeHighlightForeground",{dark:E,light:E,hc:E},n.a("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Object(s.ac)("editorOverviewRuler.errorForeground",{dark:new o.a(new o.c(255,18,18,.7)),light:new o.a(new o.c(255,18,18,.7)),hc:new o.a(new o.c(255,50,50,1))},n.a("overviewRuleError","Overview ruler marker color for errors."))),I=Object(s.ac)("editorOverviewRuler.warningForeground",{dark:s.P,light:s.P,hc:s.O},n.a("overviewRuleWarning","Overview ruler marker color for warnings.")),T=Object(s.ac)("editorOverviewRuler.infoForeground",{dark:s.H,light:s.H,hc:s.G},n.a("overviewRuleInfo","Overview ruler marker color for infos."));Object(r.f)(((e,t)=>{const i=e.getColor(s.r);i&&t.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${i}; }`);const n=e.getColor(s.w);n&&t.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${n}; }`);const o=e.getColor(k);o&&t.addRule(`.monaco-editor .margin { background-color: ${o}; }`);const r=e.getColor(h);r&&t.addRule(`.monaco-editor .rangeHighlight { background-color: ${r}; }`);const a=e.getColor(c);a&&t.addRule(`.monaco-editor .rangeHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${a}; }`);const l=e.getColor(d);l&&t.addRule(`.monaco-editor .symbolHighlight { background-color: ${l}; }`);const g=e.getColor(u);g&&t.addRule(`.monaco-editor .symbolHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${g}; }`);const m=e.getColor(p);m&&(t.addRule(`.monaco-editor .mtkw { color: ${m} !important; }`),t.addRule(`.monaco-editor .mtkz { color: ${m} !important; }`))}))},function(e,t,i){"use strict";i.d(t,"i",(function(){return v})),i.d(t,"e",(function(){return C})),i.d(t,"d",(function(){return w})),i.d(t,"g",(function(){return y})),i.d(t,"f",(function(){return S})),i.d(t,"b",(function(){return x})),i.d(t,"a",(function(){return L})),i.d(t,"c",(function(){return k})),i.d(t,"h",(function(){return D}));var n=i(117);const o=65,s=97,r=90,a=122,l=46,h=47,c=92,d=58;class u extends Error{constructor(e,t,i){let n;"string"==typeof t&&0===t.indexOf("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";const o=-1!==e.indexOf(".")?"property":"argument";let s=`The "${e}" ${o} ${n} of type ${t}`;s+=". Received type "+typeof i,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function g(e,t){if("string"!=typeof e)throw new u(t,"string",e)}function m(e){return e===h||e===c}function p(e){return e===h}function f(e){return e>=o&&e<=r||e>=s&&e<=a}function _(e,t,i,n){let o="",s=0,r=-1,a=0,c=0;for(let d=0;d<=e.length;++d){if(d2){const e=o.lastIndexOf(i);-1===e?(o="",s=0):(o=o.slice(0,e),s=o.length-1-o.lastIndexOf(i)),r=d,a=0;continue}if(0!==o.length){o="",s=0,r=d,a=0;continue}}t&&(o+=o.length>0?`${i}..`:"..",s=2)}else o.length>0?o+=`${i}${e.slice(r+1,d)}`:o=e.slice(r+1,d),s=d-r-1;r=d,a=0}else c===l&&-1!==a?++a:a=-1}return o}function b(e,t){if(null===t||"object"!=typeof t)throw new u("pathObject","Object",t);const i=t.dir||t.root,n=t.base||`${t.name||""}${t.ext||""}`;return i?i===t.root?`${i}${n}`:`${i}${e}${n}`:n}const v={resolve(...e){let t="",i="",o=!1;for(let s=e.length-1;s>=-1;s--){let r;if(s>=0){if(r=e[s],g(r,"path"),0===r.length)continue}else 0===t.length?r=n.a():(r=n.b[`=${t}`]||n.a(),(void 0===r||r.slice(0,2).toLowerCase()!==t.toLowerCase()&&r.charCodeAt(2)===c)&&(r=`${t}\\`));const a=r.length;let l=0,h="",u=!1;const p=r.charCodeAt(0);if(1===a)m(p)&&(l=1,u=!0);else if(m(p))if(u=!0,m(r.charCodeAt(1))){let e=2,t=e;for(;e2&&m(r.charCodeAt(2))&&(u=!0,l=3));if(h.length>0)if(t.length>0){if(h.toLowerCase()!==t.toLowerCase())continue}else t=h;if(o){if(t.length>0)break}else if(i=`${r.slice(l)}\\${i}`,o=u,u&&t.length>0)break}return i=_(i,!o,"\\",m),o?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){g(e,"path");const t=e.length;if(0===t)return".";let i,n=0,o=!1;const s=e.charCodeAt(0);if(1===t)return p(s)?"\\":e;if(m(s))if(o=!0,m(e.charCodeAt(1))){let o=2,s=o;for(;o2&&m(e.charCodeAt(2))&&(o=!0,n=3));let r=n0&&m(e.charCodeAt(t-1))&&(r+="\\"),void 0===i?o?`\\${r}`:r:o?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){g(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return m(i)||t>2&&f(i)&&e.charCodeAt(1)===d&&m(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let n=0;n0&&(void 0===t?t=i=o:t+=`\\${o}`)}if(void 0===t)return".";let n=!0,o=0;if("string"==typeof i&&m(i.charCodeAt(0))){++o;const e=i.length;e>1&&m(i.charCodeAt(1))&&(++o,e>2&&(m(i.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(t=`\\${t.slice(o)}`)}return v.normalize(t)},relative(e,t){if(g(e,"from"),g(t,"to"),e===t)return"";const i=v.resolve(e),n=v.resolve(t);if(i===n)return"";if((e=i.toLowerCase())===(t=n.toLowerCase()))return"";let o=0;for(;oo&&e.charCodeAt(s-1)===c;)s--;const r=s-o;let a=0;for(;aa&&t.charCodeAt(l-1)===c;)l--;const h=l-a,d=rd){if(t.charCodeAt(a+m)===c)return n.slice(a+m+1);if(2===m)return n.slice(a+m)}r>d&&(e.charCodeAt(o+m)===c?u=m:2===m&&(u=3)),-1===u&&(u=0)}let p="";for(m=o+u+1;m<=s;++m)m!==s&&e.charCodeAt(m)!==c||(p+=0===p.length?"..":"\\..");return a+=u,p.length>0?`${p}${n.slice(a,l)}`:(n.charCodeAt(a)===c&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e)return e;if(0===e.length)return"";const t=v.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===c){if(t.charCodeAt(1)===c){const e=t.charCodeAt(2);if(63!==e&&e!==l)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(f(t.charCodeAt(0))&&t.charCodeAt(1)===d&&t.charCodeAt(2)===c)return`\\\\?\\${t}`;return e},dirname(e){g(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const o=e.charCodeAt(0);if(1===t)return m(o)?e:".";if(m(o)){if(i=n=1,m(e.charCodeAt(1))){let o=2,s=o;for(;o2&&m(e.charCodeAt(2))?3:2,n=i);let s=-1,r=!0;for(let i=t-1;i>=n;--i)if(m(e.charCodeAt(i))){if(!r){s=i;break}}else r=!1;if(-1===s){if(-1===i)return".";s=i}return e.slice(0,s)},basename(e,t){void 0!==t&&g(t,"ext"),g(e,"path");let i,n=0,o=-1,s=!0;if(e.length>=2&&f(e.charCodeAt(0))&&e.charCodeAt(1)===d&&(n=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=n;--i){const l=e.charCodeAt(i);if(m(l)){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=n;--i)if(m(e.charCodeAt(i))){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){g(e,"path");let t=0,i=-1,n=0,o=-1,s=!0,r=0;e.length>=2&&e.charCodeAt(1)===d&&f(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(m(t)){if(!s){n=a+1;break}}else-1===o&&(s=!1,o=a+1),t===l?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1)}return-1===i||-1===o||0===r||1===r&&i===o-1&&i===n+1?"":e.slice(i,o)},format:b.bind(null,"\\"),parse(e){g(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.length;let n=0,o=e.charCodeAt(0);if(1===i)return m(o)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(m(o)){if(n=1,m(e.charCodeAt(1))){let t=2,o=t;for(;t0&&(t.root=e.slice(0,n));let s=-1,r=n,a=-1,h=!0,c=e.length-1,u=0;for(;c>=n;--c)if(o=e.charCodeAt(c),m(o)){if(!h){r=c+1;break}}else-1===a&&(h=!1,a=c+1),o===l?-1===s?s=c:1!==u&&(u=1):-1!==s&&(u=-1);return-1!==a&&(-1===s||0===u||1===u&&s===a-1&&s===r+1?t.base=t.name=e.slice(r,a):(t.name=e.slice(r,s),t.base=e.slice(r,a),t.ext=e.slice(s,a))),t.dir=r>0&&r!==n?e.slice(0,r-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},C={resolve(...e){let t="",i=!1;for(let o=e.length-1;o>=-1&&!i;o--){const s=o>=0?e[o]:n.a();g(s,"path"),0!==s.length&&(t=`${s}/${t}`,i=s.charCodeAt(0)===h)}return t=_(t,!i,"/",p),i?`/${t}`:t.length>0?t:"."},normalize(e){if(g(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===h,i=e.charCodeAt(e.length-1)===h;return 0===(e=_(e,!t,"/",p)).length?t?"/":i?"./":".":(i&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(g(e,"path"),e.length>0&&e.charCodeAt(0)===h),join(...e){if(0===e.length)return".";let t;for(let i=0;i0&&(void 0===t?t=n:t+=`/${n}`)}return void 0===t?".":C.normalize(t)},relative(e,t){if(g(e,"from"),g(t,"to"),e===t)return"";if((e=C.resolve(e))===(t=C.resolve(t)))return"";const i=e.length,n=i-1,o=t.length-1,s=ns){if(t.charCodeAt(1+a)===h)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else n>s&&(e.charCodeAt(1+a)===h?r=a:0===a&&(r=0));let l="";for(a=1+r+1;a<=i;++a)a!==i&&e.charCodeAt(a)!==h||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+r)}`},toNamespacedPath:e=>e,dirname(e){if(g(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===h;let i=-1,n=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===h){if(!n){i=t;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&g(t,"ext"),g(e,"path");let i,n=0,o=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){const l=e.charCodeAt(i);if(l===h){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===h){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){g(e,"path");let t=-1,i=0,n=-1,o=!0,s=0;for(let r=e.length-1;r>=0;--r){const a=e.charCodeAt(r);if(a!==h)-1===n&&(o=!1,n=r+1),a===l?-1===t?t=r:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){i=r+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===i+1?"":e.slice(t,n)},format:b.bind(null,"/"),parse(e){g(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===h;let n;i?(t.root="/",n=1):n=0;let o=-1,s=0,r=-1,a=!0,c=e.length-1,d=0;for(;c>=n;--c){const t=e.charCodeAt(c);if(t!==h)-1===r&&(a=!1,r=c+1),t===l?-1===o?o=c:1!==d&&(d=1):-1!==o&&(d=-1);else if(!a){s=c+1;break}}if(-1!==r){const n=0===s&&i?1:s;-1===o||0===d||1===d&&o===r-1&&o===s+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,o),t.base=e.slice(n,r),t.ext=e.slice(o,r))}return s>0?t.dir=e.slice(0,s-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};C.win32=v.win32=v,C.posix=v.posix=C;const w="win32"===n.c?v.normalize:C.normalize,y="win32"===n.c?v.resolve:C.resolve,S="win32"===n.c?v.relative:C.relative,x="win32"===n.c?v.dirname:C.dirname,L="win32"===n.c?v.basename:C.basename,k="win32"===n.c?v.extname:C.extname,D="win32"===n.c?v.sep:C.sep},function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i(14),o=i(162);const s=new class{constructor(){this.data=new Map}add(e,t){o.a(n.j(e)),o.a(n.i(t)),o.a(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}}},function(e,t,i){"use strict";var n,o=i(6);!function(e){e[e.Ignore=0]="Ignore",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(n||(n={})),function(e){const t="error",i="warning",n="info";e.fromValue=function(s){return s?o.r(t,s)?e.Error:o.r(i,s)||o.r("warn",s)?e.Warning:o.r(n,s)?e.Info:e.Ignore:e.Ignore},e.toString=function(o){switch(o){case e.Error:return t;case e.Warning:return i;case e.Info:return n;default:return"ignore"}}}(n||(n={})),t.a=n},function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return l})),i.d(t,"e",(function(){return h})),i.d(t,"c",(function(){return c})),i.d(t,"f",(function(){return d})),i.d(t,"d",(function(){return u})),i.d(t,"g",(function(){return g}));var n=i(6);const o=void 0!==e,s="undefined"!=typeof TextDecoder;let r;class a{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}static wrap(t){return o&&!e.isBuffer(t)&&(t=e.from(t.buffer,t.byteOffset,t.byteLength)),new a(t)}toString(){return o?this.buffer.toString():s?(r||(r=new TextDecoder),r.decode(this.buffer)):n.q(this.buffer)}}function l(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0}function h(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function c(e,t){return e[t]*Math.pow(2,24)+e[t+1]*Math.pow(2,16)+e[t+2]*Math.pow(2,8)+e[t+3]}function d(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t}function u(e,t){return e[t]}function g(e,t,i){e[i]=t}}).call(this,i(238).Buffer)},function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return a}));var n=i(30),o=i(166),s=i(13);class r{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=0===e.button,this.middleButton=1===e.button,this.rightButton=2===e.button,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,"dblclick"===e.type&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,"number"==typeof e.pageX?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,this.posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);let t=o.a.getPositionOfChildWindowRelativeToAncestorWindow(self,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class a{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){let t=e,i=e;if(void 0!==t.wheelDeltaY)this.deltaY=t.wheelDeltaY/120;else if(void 0!==i.VERTICAL_AXIS&&i.axis===i.VERTICAL_AXIS)this.deltaY=-i.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?n.g&&!s.f?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)n.h&&s.j?this.deltaX=-t.wheelDeltaX/120:this.deltaX=t.wheelDeltaX/120;else if(void 0!==i.HORIZONTAL_AXIS&&i.axis===i.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?n.g&&!s.f?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation()}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),i.d(t,"b",(function(){return s}));var n=i(15);const o=Object(n.c)("modelService");function s(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(15);const o=Object(n.c)("keybindingService")},function(e,t,i){"use strict";var n;i.d(t,"b",(function(){return n})),i.d(t,"c",(function(){return o})),i.d(t,"a",(function(){return s})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(n||(n={}));class o{constructor(e){if(this.open=e.open,this.close=e.close,this._standardTokenMask=0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t!1)){return new u(new c(e))}static forStrings(){return new u(new a)}static forConfigKeys(){return new u(new l)}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;for(this._root||(this._root=new d,this._root.segment=i.value()),n=this._root;;){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new d,n.left.segment=i.value()),n=n.left;else if(e<0)n.right||(n.right=new d,n.right.segment=i.value()),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new d,n.mid.segment=i.value()),n=n.mid}}const o=n.value;return n.value=t,n.key=e,o}get(e){var t;return null===(t=this._getNode(e))||void 0===t?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),i=i.mid}}return i}has(e){const t=this._getNode(e);return!(void 0===(null==t?void 0:t.value)&&void 0===(null==t?void 0:t.mid))}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),n=[];let o=this._root;for(;o;){const e=i.cmp(o.segment);if(e>0)n.push([1,o]),o=o.left;else if(e<0)n.push([-1,o]),o=o.right;else{if(!i.hasNext()){for(t?(o.left=void 0,o.mid=void 0,o.right=void 0):o.value=void 0;n.length>0&&o.isEmpty();){let[e,t]=n.pop();switch(e){case 1:t.left=void 0;break;case 0:t.mid=void 0;break;case-1:t.right=void 0}o=t}break}i.next(),n.push([0,o]),o=o.mid}}}findSubstr(e){const t=this._iter.reset(e);let i,n=this._root;for(;n;){const e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!t.hasNext())break;t.next(),i=n.value||i,n=n.mid}}return n&&n.value||i}findSuperstr(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())return i.mid?this._entries(i.mid):void 0;t.next(),i=i.mid}}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}*_entries(e){e&&(yield*this._entries(e.left),e.value&&(yield[e.key,e.value]),yield*this._entries(e.mid),yield*this._entries(e.right))}}class g{constructor(e,t){this[n]="ResourceMap",e instanceof g?(this.map=new Map(e.map),this.toKey=null!=t?t:g.defaultToKey):(this.map=new Map,this.toKey=null!=e?e:g.defaultToKey)}set(e,t){return this.map.set(this.toKey(e),t),this}get(e){return this.map.get(this.toKey(e))}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){void 0!==t&&(e=e.bind(t));for(let[t,i]of this.map)e(i,s.a.parse(t),this)}values(){return this.map.values()}*keys(){for(let e of this.map.keys())yield s.a.parse(e)}*entries(){for(let e of this.map.entries())yield[s.a.parse(e[0]),e[1]]}*[(n=Symbol.toStringTag,Symbol.iterator)](){for(let e of this.map)yield[s.a.parse(e[0]),e[1]]}}g.defaultToKey=e=>e.toString();class m{constructor(){this[o]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:case 2:default:this.addItemLast(n);break;case 1:this.addItemFirst(n)}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.key,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.value,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:[i.key,i.value],done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}[(o=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,i)=>{e.push([i,t])})),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class p extends m{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}},function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return r}));var n=i(15),o=i(8);const s=Object(n.c)("accessibilityService"),r=new o.c("accessibilityModeEnabled",!1)},function(e,t,i){"use strict";i.d(t,"a",(function(){return h}));var n=i(16),o=i(10),s=i(3),r=i(6),a=i(170);class l{constructor(e,t,i){this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class h{static leftPosition(e,t,i){return i>e.getLineMinColumn(t)?i-=r.K(e.getLineContent(t),i-1):t>1&&(t-=1,i=e.getLineMaxColumn(t)),new o.a(t,i)}static leftPositionAtomicSoftTabs(e,t,i,n){const s=e.getLineMinColumn(t),r=e.getLineContent(t),l=a.a.atomicPosition(r,i-1,n,0);return-1===l||l+1c?(i=c,o=a?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),o)):o=n.a.columnFromVisibleColumn2(e,t,i,h),s=d?0:h-n.a.visibleColumnFromColumn(t.getLineContent(i),o,e.tabSize),new l(i,o,s)}static moveDown(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.endLineNumber,r=i.selection.endColumn):(s=i.position.lineNumber,r=i.position.column);let a=h.down(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,i){let r=i.selection,a=h.down(e,t,r.selectionStartLineNumber,r.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),l=h.down(e,t,r.positionLineNumber,r.positionColumn,i.leftoverVisibleColumns,1,!1);return new n.f(new s.a(a.lineNumber,a.column,a.lineNumber,a.column),a.leftoverVisibleColumns,new o.a(l.lineNumber,l.column),l.leftoverVisibleColumns)}static up(e,t,i,o,s,r,a){const h=n.a.visibleColumnFromColumn(t.getLineContent(i),o,e.tabSize)+s,c=1===i&&1===o;return(i-=r)<1?(i=1,o=a?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),o)):o=n.a.columnFromVisibleColumn2(e,t,i,h),s=c?0:h-n.a.visibleColumnFromColumn(t.getLineContent(i),o,e.tabSize),new l(i,o,s)}static moveUp(e,t,i,n,o){let s,r;i.hasSelection()&&!n?(s=i.selection.startLineNumber,r=i.selection.startColumn):(s=i.position.lineNumber,r=i.position.column);let a=h.up(e,t,s,r,i.leftoverVisibleColumns,o,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,i){let r=i.selection,a=h.up(e,t,r.selectionStartLineNumber,r.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),l=h.up(e,t,r.positionLineNumber,r.positionColumn,i.leftoverVisibleColumns,1,!1);return new n.f(new s.a(a.lineNumber,a.column,a.lineNumber,a.column),a.leftoverVisibleColumns,new o.a(l.lineNumber,l.column),l.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let s=i.position.lineNumber;for(;s0?[{start:0,end:t.length}]:[]:null}.bind(void 0,!0);function a(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]===t[n]){let o=null;return(o=a(e,t,i+1,n+1))?m({start:n,end:n+1},o):null}return a(e,t,i,n+1)}function l(e){return 97<=e&&e<=122}function h(e){return 65<=e&&e<=90}function c(e){return 48<=e&&e<=57}function d(e){return 32===e||9===e||10===e||13===e}const u=new Set;function g(e){return l(e)||h(e)||c(e)}function m(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function p(e,t){for(let i=t;i0&&!g(e.charCodeAt(i-1)))return i}return e.length}function f(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let o=null,s=n+1;for(o=f(e,t,i+1,n+1);!o&&(s=p(t,s))60)return null;const i=function(e){let t=0,i=0,n=0,o=0,s=0;for(let r=0;r.2&&t<.8&&n>.6&&o<.2}(i)){if(!function(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,o=0;for(e=e.toLowerCase();o/?".split("").forEach((e=>u.add(e.charCodeAt(0))));const b=s(r,_,(function(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]})),v=s(r,_,(function(e,t){return a(e.toLowerCase(),t.toLowerCase(),0,0)})),C=new n.a(1e4);function w(e,t,i=!1){if("string"!=typeof e||"string"!=typeof t)return null;let n=C.get(e);n||(n=new RegExp(o.o(e),"i"),C.set(e,n));const s=n.exec(t);return s?[{start:s.index,end:s.index+s[0].length}]:i?v(e,t):b(e,t)}function y(e,t,i,n,o,s){const r=Math.min(13,e.length);for(;i1;n--){const o=e[n]+i,s=t[t.length-1];s&&s.end===o?s.end=o+1:t.push({start:o,end:o+1})}return t}const x=128;function L(){const e=[],t=[];for(let e=0;e<=x;e++)t[e]=0;for(let i=0;i<=x;i++)e.push(t.slice(0));return e}function k(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const D=k(2*x),N=k(2*x),E=L(),O=L(),I=L(),T=!1;function M(e,t,i,n,o){function s(e,t,i=" "){for(;e.lengths(e,3))).join("|")}\n`;for(let n=0;n<=i;n++)r+=0===n?" |":`${t[n-1]}|`,r+=e[n].slice(0,o+1).map((e=>s(e.toString(),3))).join("|")+"\n";return r}function A(e,t){if(t<0||t>=e.length)return!1;const i=e.codePointAt(t);switch(i){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 40:case 91:return!0;case void 0:return!1;default:return!!o.A(i)}}function R(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function P(e,t,i){return t[e]!==i[e]}var F;function W(e,t,i,n,o,s,r){const a=e.length>x?x:e.length,l=n.length>x?x:n.length;if(i>=a||s>=l||a-i>l-s)return;if(!function(e,t,i,n,o,s,r=!1){for(;t=i&&a>=n;)o[r]===s[a]&&(N[r]=a,r--),a--}(a,l,i,s,t,o);let h=1,c=1,d=i,u=s;const g=[!1];for(h=1,d=i;dr,b=_?O[h][c-1]+(E[h][c-1]>0?-5:0):0,v=u>r+1&&E[h][c-1]>0,C=v?O[h][c-2]+(E[h][c-2]>0?-5:0):0;if(v&&(!_||C>=b)&&(!p||C>=f))O[h][c]=C,I[h][c]=3,E[h][c]=0;else if(_&&(!p||b>=f))O[h][c]=b,I[h][c]=2,E[h][c]=0;else{if(!p)throw new Error("not possible");O[h][c]=f,I[h][c]=1,E[h][c]=E[h-1][c-1]+1}}}if(T&&function(e,t,i,n){e=e.substr(t),i=i.substr(n),console.log(M(O,e,e.length,i,i.length)),console.log(M(I,e,e.length,i,i.length)),console.log(M(E,e,e.length,i,i.length))}(e,i,n,s),!g[0]&&!r)return;h--,c--;const m=[O[h][c],s];let p=0,f=0;for(;h>=1;){let e=c;do{const t=I[h][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);p>1&&t[i+h-1]===o[s+c-1]&&!P(e+s-1,n,o)&&p+1>E[h][e]&&(e=c),e===c?p++:p=1,f||(f=e),h--,c=e-1,m.push(c)}l===a&&(m[0]+=2);const _=f-a;return m[0]-=_,m}function B(e,t,i,n,o,s,r,a,l,h,c){if(t[i]!==s[r])return Number.MIN_SAFE_INTEGER;let d=1,u=!1;return r===i-n?d=e[i]===o[r]?7:5:!P(r,o,s)||0!==r&&P(r-1,o,s)?!A(s,r)||0!==r&&A(s,r-1)?(A(s,r-1)||R(s,r-1))&&(d=5,u=!0):d=5:(d=e[i]===o[r]?7:5,u=!0),d>1&&i===n&&(c[0]=!0),u||(u=P(r,o,s)||A(s,r-1)||R(s,r-1)),i===n?r>l&&(d-=u?3:5):d+=h?u?2:0:u?0:1,r+1===a&&(d-=u?3:5),d}function j(e,t,i,n,o,s,r){return function(e,t,i,n,o,s,r,a){let l=W(e,t,i,n,o,s,a);if(e.length>=3){const t=Math.min(7,e.length-1);for(let r=i+1;rl[0])&&(l=e))}}}return l}(e,t,i,n,o,s,0,r)}function V(e,t){if(t+1>=e.length)return;const i=e[t],n=e[t+1];return i!==n?e.slice(0,t)+n+i+e.slice(t+2):void 0}!function(e){e.Default=[-100,0],e.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]}}(F||(F={}))},function(e,t,i){e.exports=i(33)(1)},function(e,t,i){"use strict";i.d(t,"a",(function(){return l})),i.d(t,"b",(function(){return h})),i.d(t,"c",(function(){return c}));var n=i(2),o=i(6),s=i(22),r=i(15),a=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const l=Object(r.c)("openerService"),h=Object.freeze({_serviceBrand:void 0,registerOpener:()=>n.a.None,registerValidator:()=>n.a.None,registerExternalUriResolver:()=>n.a.None,setDefaultExternalOpener(){},registerExternalOpener:()=>n.a.None,open(){return a(this,void 0,void 0,(function*(){return!1}))},resolveExternalUri(e){return a(this,void 0,void 0,(function*(){return{resolved:e,dispose(){}}}))}});function c(e,t){return s.a.isUri(e)?Object(o.r)(e.scheme,t):Object(o.Q)(e,t+":")}},function(e,t,i){"use strict";i.d(t,"b",(function(){return m})),i.d(t,"a",(function(){return f}));var n=i(30),o=i(5),s=i(2),r=i(13);class a{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class l{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");t.style.fontFamily=this._bareFontInfo.getMassagedFontFamily(),t.style.fontWeight=this._bareFontInfo.fontWeight,t.style.fontSize=this._bareFontInfo.fontSize+"px",t.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,t.style.lineHeight=this._bareFontInfo.lineHeight+"px",t.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",e.appendChild(t);const i=document.createElement("div");i.style.fontFamily=this._bareFontInfo.getMassagedFontFamily(),i.style.fontWeight="bold",i.style.fontSize=this._bareFontInfo.fontSize+"px",i.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,i.style.lineHeight=this._bareFontInfo.lineHeight+"px",i.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",e.appendChild(i);const n=document.createElement("div");n.style.fontFamily=this._bareFontInfo.getMassagedFontFamily(),n.style.fontWeight=this._bareFontInfo.fontWeight,n.style.fontSize=this._bareFontInfo.fontSize+"px",n.style.fontFeatureSettings=this._bareFontInfo.fontFeatureSettings,n.style.lineHeight=this._bareFontInfo.lineHeight+"px",n.style.letterSpacing=this._bareFontInfo.letterSpacing+"px",n.style.fontStyle="italic",e.appendChild(n);const o=[];for(const e of this._requests){let s;0===e.type&&(s=t),2===e.type&&(s=i),1===e.type&&(s=n),s.appendChild(document.createElement("br"));const r=document.createElement("span");l._render(r,e),s.appendChild(r),o.push(r)}this._container=e,this._testElements=o}static _render(e,t){if(" "===t.chr){let t=" ";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;ethis._values[e]))}}function m(){p.INSTANCE.clearCache()}class p extends s.a{constructor(){super(),this._onDidChange=this._register(new o.a),this.onDidChange=this._onDidChange.event,this._cache=new g,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearCache(){this._cache=new g,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),t.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=setTimeout((()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()}),5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readConfiguration(e){if(!this._cache.has(e)){let t=p._actualReadConfiguration(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new u.b({zoomLevel:n.d(),pixelRatio:n.a(),fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}static createRequest(e,t,i,n){const o=new a(e,t);return i.push(o),n&&n.push(o),o}static _actualReadConfiguration(e){const t=[],i=[],o=this.createRequest("n",0,t,i),s=this.createRequest("m",0,t,null),r=this.createRequest(" ",0,t,i),a=this.createRequest("0",0,t,i),h=this.createRequest("1",0,t,i),c=this.createRequest("2",0,t,i),g=this.createRequest("3",0,t,i),m=this.createRequest("4",0,t,i),p=this.createRequest("5",0,t,i),f=this.createRequest("6",0,t,i),_=this.createRequest("7",0,t,i),b=this.createRequest("8",0,t,i),v=this.createRequest("9",0,t,i),C=this.createRequest("→",0,t,i),w=this.createRequest("→",0,t,null),y=this.createRequest("·",0,t,i),S=this.createRequest(String.fromCharCode(11825),0,t,null);this.createRequest("|",0,t,i),this.createRequest("/",0,t,i),this.createRequest("-",0,t,i),this.createRequest("_",0,t,i),this.createRequest("i",0,t,i),this.createRequest("l",0,t,i),this.createRequest("m",0,t,i),this.createRequest("|",1,t,i),this.createRequest("_",1,t,i),this.createRequest("i",1,t,i),this.createRequest("l",1,t,i),this.createRequest("m",1,t,i),this.createRequest("n",1,t,i),this.createRequest("|",2,t,i),this.createRequest("_",2,t,i),this.createRequest("i",2,t,i),this.createRequest("l",2,t,i),this.createRequest("m",2,t,i),this.createRequest("n",2,t,i),function(e,t){new l(e,t).read()}(e,t);const x=Math.max(a.width,h.width,c.width,g.width,m.width,p.width,f.width,_.width,b.width,v.width);let L=e.fontFeatureSettings===d.e.OFF;const k=i[0].width;for(let e=1,t=i.length;L&&e.001){L=!1;break}}let D=!0;L&&w.width!==k&&(D=!1),w.width>C.width&&(D=!1);const N=n.b()>2e3;return new u.b({zoomLevel:n.d(),pixelRatio:n.a(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:L,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:D,spaceWidth:r.width,middotWidth:y.width,wsmiddotWidth:S.width,maxDigitWidth:x},N)}}p.INSTANCE=new p;class f extends c.a{constructor(e,t,i=null,o){super(e,t),this.accessibilityService=o,this._elementSizeObserver=this._register(new h.a(i,t.dimension,(()=>this._recomputeOptions()))),this._register(p.INSTANCE.onDidChange((()=>this._recomputeOptions()))),this._validatedOptions.get(10)&&this._elementSizeObserver.startObserving(),this._register(n.l((e=>this._recomputeOptions()))),this._register(this.accessibilityService.onDidChangeScreenReaderOptimized((()=>this._recomputeOptions()))),this._recomputeOptions()}static applyFontInfoSlow(e,t){e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px"}static applyFontInfo(e,t){e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)}observeReferenceElement(e){this._elementSizeObserver.observe(e)}updatePixelRatio(){this._recomputeOptions()}static _getExtraEditorClassName(){let e="";return n.h||n.k||(e+="no-user-select "),n.h&&(e+="no-minimap-shadow "),r.f&&(e+="mac "),e}_getEnvConfiguration(){return{extraEditorClassName:f._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:n.j||n.g,pixelRatio:n.a(),zoomLevel:n.d(),accessibilitySupport:this.accessibilityService.isScreenReaderOptimized()?2:this.accessibilityService.getAccessibilitySupport()}}readConfiguration(e){return p.INSTANCE.readConfiguration(e)}}},function(e,t,i){"use strict";i.d(t,"b",(function(){return d})),i.d(t,"a",(function(){return u})),i.d(t,"c",(function(){return g}));var n=i(13),o=i(1);const s=2e4;let r,a,l,h,c;function d(e){r=document.createElement("div"),r.className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),r.appendChild(e),e};a=t(),l=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("role","complementary"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),r.appendChild(e),e};h=i(),c=i(),e.appendChild(r)}function u(e){r&&(a.textContent!==e?(o.t(l),m(a,e)):(o.t(a),m(l,e)))}function g(e){r&&(n.f?u(e):h.textContent!==e?(o.t(c),m(h,e)):(o.t(h),m(c,e)))}function m(e,t){o.t(e),t.length>s&&(t=t.substr(0,s)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(3);class o{static insert(e,t){return{range:new n.a(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}},function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return l})),i.d(t,"a",(function(){return h})),i.d(t,"d",(function(){return d})),i.d(t,"e",(function(){return g}));var n=i(6),o=i(109),s=i(123);class r{constructor(e,t,i){this.endIndex=e,this.type=t,this.metadata=i}isWhitespace(){return!!(1&this.metadata)}}class a{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class l{constructor(e,t,i,n,o,r,a,l,h,c,d,u,g,m,p,f,_,b,v){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=h.sort(s.a.compare),this.tabSize=c,this.startVisibleColumn=d,this.spaceWidth=u,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===f?4:"boundary"===f?1:"selection"===f?2:"trailing"===f?3:0,this.renderControlCharacters=_,this.fontLigatures=b,this.selectionsOnLine=v&&v.sort(((e,t)=>e.startOffset>>16}static getCharIndex(e){return(65535&e)>>>0}setPartData(e,t,i,n){let o=(t<<16|i<<0)>>>0;this._data[e]=o,this._absoluteOffsets[e]=n+i}getAbsoluteOffsets(){return this._absoluteOffsets}charOffsetToPartData(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}partDataToCharOffset(e,t,i){if(0===this.length)return 0;let n=(e<<16|i<<0)>>>0,o=0,s=this.length-1;for(;o+1>>1,t=this._data[e];if(t===n)return e;t>n?s=e:o=e}if(o===s)return o;let r=this._data[o],a=this._data[s];if(r===n)return o;if(a===n)return s;let l,c=h.getPartIndex(r),d=h.getCharIndex(r);return l=c!==h.getPartIndex(a)?t:h.getCharIndex(a),i-d<=l-i?o:s}}class c{constructor(e,t,i){this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function d(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendASCIIString("");let i=0,n=0,o=0;for(const s of e.lineDecorations)1!==s.type&&2!==s.type||(t.appendASCIIString(''),1===s.type&&(o|=1,i++),2===s.type&&(o|=2,n++));t.appendASCIIString("");const s=new h(1,i+n);return s.setPartData(0,i,0,0),new c(s,!1,o)}return t.appendASCIIString(""),new c(new h(0,0),!1,0)}return function(e,t){const i=e.fontIsMonospace,o=e.canUseHalfwidthRightwardsArrow,s=e.containsForeignElements,r=e.lineContent,a=e.len,l=e.isOverflowing,d=e.parts,u=e.fauxIndentLength,g=e.tabSize,m=e.startVisibleColumn,p=e.containsRTL,f=e.spaceWidth,_=e.renderSpaceCharCode,b=e.renderWhitespace,v=e.renderControlCharacters,C=new h(a+1,d.length);let w=0,y=m,S=0,x=0,L=0,k=0;p?t.appendASCIIString(''):t.appendASCIIString("");for(let e=0,a=d.length;e=u&&(t+=n)}}for(m&&(t.appendASCIIString(' style="width:'),t.appendASCIIString(String(f*i)),t.appendASCIIString('px"')),t.appendASCII(62);w1?t.write1(8594):t.write1(65515);for(let e=2;e<=i;e++)t.write1(160)}else i=1,t.write1(_);S+=i,w>=u&&(y+=i)}L=i}else{let i=0;for(t.appendASCII(62);w=u&&(y+=a)}L=i}p?x++:x=0,t.appendASCIIString("")}return C.setPartData(a,d.length-1,S,k),l&&t.appendASCIIString(""),t.appendASCIIString(""),new c(C,p,s)}(function(e){const t=e.lineContent;let i,o;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter0&&(n[o++]=new r(t,"",0));for(let s=0,a=e.getCount();s=i){n[o++]=new r(i,l,0);break}n[o++]=new r(a,l,0)}return n}(e.lineTokens,e.fauxIndentLength,o);(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace)&&(a=function(e,t,i,o){const s=e.continuesWithWrappedLine,a=e.fauxIndentLength,l=e.tabSize,h=e.startVisibleColumn,c=e.useMonospaceOptimizations,d=e.selectionsOnLine,u=1===e.renderWhitespace,g=3===e.renderWhitespace,m=e.renderSpaceWidth!==e.spaceWidth;let p=[],f=0,_=0,b=o[_].type,v=o[_].endIndex;const C=o.length;let w,y=!1,S=n.u(t);-1===S?(y=!0,S=i,w=i):w=n.H(t);let x=!1,L=0,k=d&&d[L],D=h%l;for(let e=a;e=k.endOffset&&(L++,k=d&&d[L]),ew)h=!0;else if(9===s)h=!0;else if(32===s)if(u)if(x)h=!0;else{const n=e+1e),h&&g&&(h=y||e>w),x){if(!h||!c&&D>=l){if(m)for(let t=(f>0?p[f-1].endIndex:a)+1;t<=e;t++)p[f++]=new r(t,"mtkw",1);else p[f++]=new r(e,"mtkw",1);D%=l}}else(e===v||h&&e>a)&&(p[f++]=new r(e,b,0),D%=l);for(9===s?D=l:n.C(s)?D+=2:D++,x=h;e===v;)_++,_0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0;32===e&&32!==n&&9!==n||(N=!0)}else N=!0;if(N)if(m)for(let e=(f>0?p[f-1].endIndex:a)+1;e<=i;e++)p[f++]=new r(e,"mtkw",1);else p[f++]=new r(i,"mtkw",1);else p[f++]=new r(i,b,0);return p}(e,t,o,a));let l=0;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;td&&(d=e.startOffset,h[c++]=new r(d,s,u)),!(e.endOffset+1<=n)){d=n,h[c++]=new r(d,s+" "+e.className,u|e.metadata);break}d=e.endOffset+1,h[c++]=new r(d,s+" "+e.className,u|e.metadata),l++}n>d&&(d=n,h[c++]=new r(d,s,u))}const u=i[i.length-1].endIndex;if(l=50&&(o[s++]=new r(h+1,t,i),c=h+1,h=-1);c!==l&&(o[s++]=new r(l,t,i))}else o[s++]=a;n=l}else for(let e=0,i=t.length;e50){const e=i.type,t=i.metadata,h=Math.ceil(l/50);for(let i=1;i{o||(o=!0,this._remove(i))}}shift(){if(this._first!==n.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==n.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==n.Undefined&&e.next!==n.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===n.Undefined&&e.next===n.Undefined?(this._first=n.Undefined,this._last=n.Undefined):e.next===n.Undefined?(this._last=this._last.prev,this._last.next=n.Undefined):e.prev===n.Undefined&&(this._first=this._first.next,this._first.prev=n.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==n.Undefined;)yield e.element,e=e.next}}},function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return a})),i.d(t,"a",(function(){return c})),i.d(t,"d",(function(){return d}));var n=i(15),o=i(2),s=i(5);const r=Object(n.c)("logService");var a;!function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.Off=6]="Off"}(a||(a={}));const l=a.Info;class h extends o.a{constructor(){super(...arguments),this.level=l,this._onDidChangeLogLevel=this._register(new s.a)}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}class c extends h{constructor(e=l){super(),this.setLevel(e)}trace(e,...t){this.getLevel()<=a.Trace&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.getLevel()<=a.Debug&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.getLevel()<=a.Info&&console.log("%c INFO","color: #33f",e,...t)}error(e,...t){this.getLevel()<=a.Error&&console.log("%c ERR","color: #f33",e,...t)}dispose(){}}class d extends o.a{constructor(e){super(),this.logger=e,this._register(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}error(e,...t){this.logger.error(e,...t)}}},function(e,t,i){"use strict";var n;i.d(t,"a",(function(){return n})),function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};const i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){const n=[],o={start:e.start,end:Math.min(t.start,e.end)},s={start:Math.max(t.end,e.start),end:e.end};return i(o)||n.push(o),i(s)||n.push(s),n}}(n||(n={}))},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(15);const o=Object(n.c)("modeService")},function(e,t,i){"use strict";i.d(t,"b",(function(){return N})),i.d(t,"c",(function(){return E})),i.d(t,"a",(function(){return O}));var n=i(1),o=i(29),s=i(54),r=i(82),a=i(103),l=i(21);class h extends a.a{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...e.icon.classNamesArray),this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._mouseMoveMonitor=this._register(new r.a),this.onmousedown(this.bgDomNode,(e=>this._arrowMouseDown(e))),this.onmousedown(this.domNode,(e=>this._arrowMouseDown(e))),this._mousedownRepeatTimer=this._register(new l.c),this._mousedownScheduleRepeatTimer=this._register(new l.g)}_arrowMouseDown(e){this._onActivate(),this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancelAndSet((()=>{this._mousedownRepeatTimer.cancelAndSet((()=>this._onActivate()),1e3/24)}),200),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,r.b,(e=>{}),(()=>{this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancel()})),e.preventDefault()}}var c=i(2);class d extends c.a{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new l.g)}applyVisibilitySetting(e){return 2!==this._visibility&&(3===this._visibility||e)}setShouldBeVisible(e){const t=this.applyVisibilitySetting(e);this._shouldBeVisible!==t&&(this._shouldBeVisible=t,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((()=>{this._domNode&&this._domNode.setClassName(this._visibleClassName)}),0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode&&this._domNode.setClassName(this._invisibleClassName+(e?" fade":"")))}}var u=i(13);class g extends a.a{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new d(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._mouseMoveMonitor=this._register(new r.a),this._shouldRender=!0,this.domNode=Object(o.b)(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this.onmousedown(this.domNode.domNode,(e=>this._domNodeMouseDown(e)))}_createArrow(e){const t=this._register(new h(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=Object(o.b)(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this.onmousedown(this.slider.domNode,(e=>{e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,(()=>{})))})),this.onclick(this.slider.domNode,(e=>{e.leftButton&&e.stopPropagation()}))}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodeMouseDown(e){e.target===this.domNode.domNode&&this._onMouseDown(e)}delegateMouseDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderMousePosition(e);i<=o&&o<=n?e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,(()=>{}))):this._onMouseDown(e)}_onMouseDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.browserEvent.offsetX&&"number"==typeof e.browserEvent.offsetY)t=e.browserEvent.offsetX,i=e.browserEvent.offsetY;else{const o=n.C(this.domNode.domNode);t=e.posx-o.left,i=e.posy-o.top}const o=this._mouseDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(o):this._scrollbarState.getDesiredScrollPositionFromOffset(o)),e.leftButton&&(e.preventDefault(),this._sliderMouseDown(e,(()=>{})))}_sliderMouseDown(e,t){const i=this._sliderMousePosition(e),n=this._sliderOrthogonalMousePosition(e),o=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,r.b,(e=>{const t=this._sliderOrthogonalMousePosition(e),s=Math.abs(t-n);if(u.j&&s>140)return void this._setDesiredScrollPositionNow(o.getScrollPosition());const r=this._sliderMousePosition(e)-i;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(r))}),(()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd(),t()})),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}class m{constructor(e,t,i,n,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new m(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=e}static _computeValues(e,t,i,n,o){const s=Math.max(0,i-e),r=Math.max(0,s-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(r),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(20,Math.floor(i*r/n))),h=(r-l)/(n-i),c=o*h;return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:h,computedSliderPosition:Math.round(c)}}_refreshComputedValues(){const e=m._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new s.b(null,1,0))}),this._createArrow({className:"scra",icon:_,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new s.b(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return e}_sliderMousePosition(e){return e.posx}_sliderOrthogonalMousePosition(e){return e.posy}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}}const v=Object(p.e)("scrollbar-button-up",p.b.triangleUp),C=Object(p.e)("scrollbar-button-down",p.b.triangleDown);class w extends g{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new m(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-11)/2,i=(t.verticalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:v,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new s.b(null,0,1))}),this._createArrow({className:"scra",icon:C,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new s.b(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_mouseDownRelativePosition(e,t){return t}_sliderMousePosition(e){return e.posy}_sliderOrthogonalMousePosition(e){return e.posx}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}}var y=i(5),S=i(139),x=i(30);class L{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class k{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,t=0,i=1,n=this._rear;for(;;){const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}return t<=.5}accept(e,t,i){const n=new L(e,t,i);n.score=this._computeScore(n),-1===this._front&&-1===this._rear?(this._memory[0]=n,this._front=0,this._rear=0):(this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return-1===this._front&&-1===this._rear||this._memory[this._rear],this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}k.INSTANCE=new k;class D extends a.a{constructor(e,t,i){super(),this._onScroll=this._register(new y.a),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new y.a),e.style.overflow="hidden",this._options=function(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,u.f&&(t.className+=" mac"),t}(t),this._scrollable=i,this._register(this._scrollable.onScroll((e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)})));const n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new w(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new b(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Object(o.b)(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Object(o.b)(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Object(o.b)(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,(e=>this._onMouseOver(e))),this.onnonbubblingmouseout(this._listenOnDomNode,(e=>this._onMouseOut(e))),this._hideTimeout=this._register(new l.g),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Object(c.f)(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarMouseDown(e){this._verticalScrollbar.delegateMouseDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,u.f&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontalScrollbarSize&&this._horizontalScrollbar.updateScrollbarSize(e.horizontalScrollbarSize),this._options.lazyRender||this._render()}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Object(c.f)(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new s.b(e))};this._mouseWheelToDispose.push(n.i(this._listenOnDomNode,n.d.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){const t=k.INSTANCE;{const i=window.devicePixelRatio/Object(x.c)();u.j||u.d?t.accept(Date.now(),e.deltaX/i,e.deltaY/i):t.accept(Date.now(),e.deltaX,e.deltaY)}let i=!1;if(e.deltaY||e.deltaX){let n=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(Math.abs(n)>=Math.abs(o)?o=0:n=0),this._options.flipAxes&&([n,o]=[o,n]);const s=!u.f&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!s||o||(o=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,n*=this._options.fastScrollSensitivity);const r=this._scrollable.getFutureScrollPosition();let a={};if(n){const e=r.scrollTop-50*n;this._verticalScrollbar.writeScrollPosition(a,e)}if(o){const e=r.scrollLeft-50*o;this._horizontalScrollbar.writeScrollPosition(a,e)}a=this._scrollable.validateScrollPosition(a),(r.scrollLeft!==a.scrollLeft||r.scrollTop!==a.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",o=t?" top":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseOut(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet((()=>this._hide()),500)}}class N extends D{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new S.a(0,(e=>n.T(e)));super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class E extends D{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class O extends N{constructor(e,t){super(e,t),this._element=e,this.onScroll((e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)})),this.scanDomNode()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}},function(e,t,i){"use strict";i.d(t,"b",(function(){return d})),i.d(t,"a",(function(){return u}));var n=i(51),o=i(17),s=i(5),r=i(0),a=i(156),l=i(21),h=i(19);const c=new class{constructor(){this._onDidChange=new s.a,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:Object(r.a)("iconDefintion.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:Object(r.a)("iconDefintion.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${h.a.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=i),this._onDidChange.fire()}return o}let s={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=s;let r={$ref:"#/definitions/icons"};return n&&(r.deprecationMessage=n),i&&(r.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=r,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map((e=>this.iconsById[e]))}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}getIconFont(e){return this.iconFontsById[e]}toString(){const e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;o.d.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:""}`};let i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map((e=>this.iconsById[e]));for(const s of n.filter((e=>!!e.description)).sort(e))i.push(`||${s.id}|${o.d.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const s of n.filter((e=>!o.d.isThemeIcon(e.defaults))).sort(e))i.push(`||${s.id}|`);return i.join("\n")}};function d(e,t,i,n){return c.registerIcon(e,t,i,n)}function u(){return c}n.a.add("base.contributions.icons",c),function(){for(const e of h.d.all)c.registerIcon(e.id,e.definition,e.description);h.d.onDidRegister((e=>c.registerIcon(e.id,e.definition,e.description)))}();const g="vscode://schemas/icons";let m=n.a.as(a.a.JSONContribution);m.registerSchema(g,c.getIconSchema());const p=new l.e((()=>m.notifySchemaChanged(g)),200);c.onDidChange((()=>{p.isScheduled()||p.schedule()})),d("widget-close",h.b.close,Object(r.a)("widgetClose","Icon for the close action in widgets."))},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));let n=0;function o(e,t,i){return function(){const e="$memoize"+n++;let t;const i=function(i,n,o){let s=null,r=null;if("function"==typeof o.value?(s="value",r=o.value,0!==r.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof o.get&&(s="get",r=o.get),!r)throw new Error("not supported");const a=`${e}:${n}`;o[s]=function(...e){return t=this,this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!0,enumerable:!1,writable:!0,value:r.apply(this,e)}),this[a]}};return i.clear=()=>{void 0!==t&&Object.getOwnPropertyNames(t).forEach((i=>{0===i.indexOf(e)&&delete t[i]}))},i}()(e,t,i)}},function(e,t,i){"use strict";i.d(t,"c",(function(){return s})),i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return a})),i.d(t,"d",(function(){return l})),i.d(t,"e",(function(){return h}));var n=i(98),o=i(11);const s=new class{clone(){return this}equals(e){return this===e}},r="vs.editor.nullMode",a=new o.r(r,0);function l(e,t,i,o){return new n.b([new n.a(o,"",e)],i)}function h(e,t,i,o){let r=new Uint32Array(2);return r[0]=o,r[1]=(16384|e<<0|2<<23)>>>0,new n.c(r,null===i?s:i)}},function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return s}));var n=i(15);const o=Object(n.c)("contextViewService"),s=Object(n.c)("contextMenuService")},function(e,t,i){"use strict";i.d(t,"a",(function(){return l}));var n=i(42),o=i(13),s=i(27),r=i(51);class a{constructor(){this._coreKeybindings=[],this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===o.a){if(e&&e.win)return e.win}else if(2===o.a){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=a.bindToCurrentPlatform(e);if(t&&t.primary){const i=Object(n.f)(t.primary,o.a);i&&this._registerDefaultKeybinding(i,e.id,e.args,e.weight,0,e.when)}if(t&&Array.isArray(t.secondary))for(let i=0,s=t.secondary.length;i=21&&e<=30||e>=31&&e<=56||80===e||81===e||82===e||83===e||84===e||85===e||86===e||110===e||111===e||87===e||88===e||89===e||90===e||91===e||92===e}_assertNoCtrlAlt(e,t){e.ctrlKey&&e.altKey&&!e.metaKey&&a._mightProduceChar(e.keyCode)&&console.warn("Ctrl+Alt+ keybindings should not be used by default under Windows. Offender: ",e," for ",t)}_registerDefaultKeybinding(e,t,i,n,s,r){1===o.a&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:r,weight1:n,weight2:s,extensionId:null,isBuiltinExtension:!1}),this._cachedMergedKeybindings=null}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(h)),this._cachedMergedKeybindings.slice(0)}}const l=new a;function h(e,t){return e.weight1!==t.weight1?e.weight1-t.weight1:e.commandt.command?1:e.weight2-t.weight2}r.a.add("platform.keybindingsRegistry",l)},function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"a",(function(){return l}));var n=i(1),o=i(166),s=i(54),r=i(2);function a(e,t){let i=new s.a(t);return i.preventDefault(),{leftButton:i.leftButton,buttons:i.buttons,posx:i.posx,posy:i.posy}}class l{constructor(){this._hooks=new r.b,this._mouseMoveEventMerger=null,this._mouseMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._mouseMoveEventMerger=null,this._mouseMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._mouseMoveEventMerger}startMonitoring(e,t,i,r,a){if(this.isMonitoring())return;this._mouseMoveEventMerger=i,this._mouseMoveCallback=r,this._onStopCallback=a;const l=o.a.getSameOriginWindowChain(),h=l.map((e=>e.window.document)),c=n.E(e);c&&h.unshift(c);for(const e of h)this._hooks.add(n.l(e,"mousemove",(e=>{e.buttons===t?this._mouseMoveCallback(e):this.stopMonitoring(!0)}),((e,t)=>this._mouseMoveEventMerger(e,t)))),this._hooks.add(n.i(e,"mouseup",(e=>this.stopMonitoring(!0))));if(o.a.hasDifferentOriginAncestor()){let e=l[l.length-1];this._hooks.add(n.i(e.window.document,"mouseout",(e=>{"html"===new s.a(e).target.tagName.toLowerCase()&&this.stopMonitoring(!0)}))),this._hooks.add(n.i(e.window.document,"mouseover",(e=>{"html"===new s.a(e).target.tagName.toLowerCase()&&this.stopMonitoring(!0)}))),this._hooks.add(n.i(e.window.document.body,"mouseleave",(e=>{this.stopMonitoring(!0)})))}}}},function(e,t,i){"use strict";i.d(t,"e",(function(){return E})),i.d(t,"f",(function(){return O})),i.d(t,"a",(function(){return T})),i.d(t,"h",(function(){return R})),i.d(t,"g",(function(){return P})),i.d(t,"d",(function(){return W})),i.d(t,"b",(function(){return B})),i.d(t,"c",(function(){return q})),i(189);var n=i(2),o=i(14),s=i(20),r=i(78),a=i(13),l=i(47),h=i(46),c=i(5),d=i(26);class u extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}var g=i(143),m=i(12),p=i(36);class f{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach((n=>n.splice(e,t,i)))}}var _,b=i(86),v=i(65),C=i(69),w=i(1),y=i(21),S=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},x=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class L{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.trait}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex((e=>e.templateData===i));if(n>=0){const e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else{const e={index:t,templateData:i};this.renderedElements.push(e)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const o of this.renderedElements)o.index=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex((t=>t.templateData===e));t<0||this.renderedElements.splice(t,1)}}class k{constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new c.a,this.onChange=this._onChange.event}get trait(){return this._trait}get renderer(){return new L(this)}splice(e,t,i){const n=i.length-t,o=e+t,s=[...this.sortedIndexes.filter((t=>tt?i+e:-1)).filter((e=>-1!==e)),...this.sortedIndexes.filter((e=>e>=o)).map((e=>e+n))];this.renderer.splice(e,t,i.length),this._set(s,s)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(z),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=H(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return Object(s.c)(this.sortedIndexes,e,z)>=0}dispose(){Object(n.f)(this._onChange)}}S([r.a],k.prototype,"renderer",null);class D extends k{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class N{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,i.map((()=>!1)));const n=this.trait.get().map((e=>this.identityProvider.getId(this.view.element(e)).toString())),o=i.map((e=>n.indexOf(this.identityProvider.getId(e).toString())>-1));this.trait.splice(e,t,o)}}function E(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function O(e){return!!e.classList.contains("monaco-editor")||!e.classList.contains("monaco-list")&&!!e.parentElement&&O(e.parentElement)}class I{constructor(e,t,i){this.list=e,this.view=t,this.disposables=new n.b;const o=!1!==i.multipleSelectionSupport,s=c.b.chain(Object(d.a)(t.domNode,"keydown")).filter((e=>!E(e.target))).map((e=>new h.a(e)));s.filter((e=>3===e.keyCode)).on(this.onEnter,this,this.disposables),s.filter((e=>16===e.keyCode)).on(this.onUpArrow,this,this.disposables),s.filter((e=>18===e.keyCode)).on(this.onDownArrow,this,this.disposables),s.filter((e=>11===e.keyCode)).on(this.onPageUpArrow,this,this.disposables),s.filter((e=>12===e.keyCode)).on(this.onPageDownArrow,this,this.disposables),s.filter((e=>9===e.keyCode)).on(this.onEscape,this,this.disposables),o&&s.filter((e=>(a.f?e.metaKey:e.ctrlKey)&&31===e.keyCode)).on(this.onCtrlA,this,this.disposables)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent),this.list.reveal(this.list.getFocus()[0]),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(Object(s.q)(this.list.length),e.browserEvent),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.view.domNode.focus())}dispose(){this.disposables.dispose()}}!function(e){e[e.Idle=0]="Idle",e[e.Typing=1]="Typing"}(_||(_={}));const T=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=93&&e.keyCode<=102||e.keyCode>=80&&e.keyCode<=90)}};class M{constructor(e,t,i,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.delegate=o,this.enabled=!1,this.state=_.Idle,this.automaticKeyboardNavigation=!0,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new n.b,this.disposables=new n.b,this.updateOptions(e.options)}updateOptions(e){void 0===e.enableKeyboardNavigation||e.enableKeyboardNavigation?this.enable():this.disable(),void 0!==e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation)}enable(){if(this.enabled)return;const e=c.b.chain(Object(d.a)(this.view.domNode,"keydown")).filter((e=>!E(e.target))).filter((()=>this.automaticKeyboardNavigation||this.triggered)).map((e=>new h.a(e))).filter((e=>this.delegate.mightProducePrintableCharacter(e))).forEach((e=>{e.stopPropagation(),e.preventDefault()})).map((e=>e.browserEvent.key)).event,t=c.b.debounce(e,(()=>null),800);c.b.reduce(c.b.any(e,t),((e,t)=>null===t?null:(e||"")+t))(this.onInput,this,this.enabledDisposables),t(this.onClear,this,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=null===(e=this.list.options.accessibilityProvider)||void 0===e?void 0:e.getAriaLabel(this.list.element(t[0]));i&&Object(C.a)(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=_.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===_.Idle?1:0;this.state=_.Typing;for(let t=0;t!E(e.target))).map((e=>new h.a(e))).filter((e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey))).on(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!(n&&n instanceof HTMLElement&&-1!==n.tabIndex))return;const o=window.getComputedStyle(n);"hidden"!==o.visibility&&"none"!==o.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function R(e){return a.f?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function P(e){return e.browserEvent.shiftKey}const F={isSelectionSingleChangeEvent:R,isSelectionRangeChangeEvent:P};class W{constructor(e){this.list=e,this.disposables=new n.b,this._onPointer=new c.a,this.onPointer=this._onPointer.event,this.multipleSelectionSupport=!(!1===e.options.multipleSelectionSupport),this.multipleSelectionSupport&&(this.multipleSelectionController=e.options.multipleSelectionController||F),this.mouseSupport=void 0===e.options.mouseSupport||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(l.b.addTarget(e.getHTMLElement()))),c.b.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):a.f?e.browserEvent.metaKey:e.browserEvent.ctrlKey}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):e.browserEvent.shiftKey}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){O(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(O(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(E(e.browserEvent.target)||O(e.browserEvent.target))return;const t=e.index;return void 0===t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.multipleSelectionSupport&&this.isSelectionRangeChangeEvent(e)||this.multipleSelectionSupport&&this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),(i=e.browserEvent)instanceof MouseEvent&&2===i.button||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e));var i}onDoubleClick(e){if(E(e.browserEvent.target)||O(e.browserEvent.target))return;if(this.multipleSelectionSupport&&this.isSelectionChangeEvent(e))return;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index,i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)&&"number"==typeof i){const n=Math.min(i,t),o=Math.max(i,t),r=Object(s.q)(n,o+1),a=this.list.getSelection(),l=function(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let o=i-1;for(;o>=0&&e[o]===t-(i-o);)n.push(e[o--]);for(n.reverse(),o=i;o=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){n++,o++;continue}e[n]e!==t));this.list.setFocus([t]),this.list.setAnchor(t),i.length===n.length?this.list.setSelection([...n,t],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class B{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&(e.listBackground.isOpaque()?i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`):a.f||console.warn(`List with id '${this.selectorSuffix}' was styled with a non-opaque background color. This will break sub-pixel antialiasing.`)),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listFocusAndSelectionBackground&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listFocusOutline&&i.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&i.push(`\n\t\t\t\t.monaco-list${t}.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }\n\t\t\t`),e.listFilterWidgetBackground&&i.push(`.monaco-list-type-filter { background-color: ${e.listFilterWidgetBackground} }`),e.listFilterWidgetOutline&&i.push(`.monaco-list-type-filter { border: 1px solid ${e.listFilterWidgetOutline}; }`),e.listFilterWidgetNoMatchesOutline&&i.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${e.listFilterWidgetNoMatchesOutline}; }`),e.listMatchesShadow&&i.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${e.listMatchesShadow}; }`),e.tableColumnsBorder&&i.push(`\n\t\t\t\t.monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t}`),this.styleElement.textContent=i.join("\n")}}const j={listFocusBackground:m.a.fromHex("#7FB0D0"),listActiveSelectionBackground:m.a.fromHex("#0E639C"),listActiveSelectionForeground:m.a.fromHex("#FFFFFF"),listFocusAndSelectionBackground:m.a.fromHex("#094771"),listFocusAndSelectionForeground:m.a.fromHex("#FFFFFF"),listInactiveSelectionBackground:m.a.fromHex("#3F3F46"),listHoverBackground:m.a.fromHex("#2A2D2E"),listDropBackground:m.a.fromHex("#383B3D"),treeIndentGuidesStroke:m.a.fromHex("#a9a9a9"),tableColumnsBorder:m.a.fromHex("#cccccc").transparent(.2)},V={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}}};function H(e,t){const i=[];let n=0,o=0;for(;n=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){i.push(e[n]),n++,o++;continue}e[n]e-t;class U{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map((t=>t.renderTemplate(e)))}renderElement(e,t,i,n){let o=0;for(const s of this.renderers)s.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){let o=0;for(const s of this.renderers)s.disposeElement&&s.disposeElement(e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class K{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof o?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class ${constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}}class q{constructor(e,t,i,o,s=V){var r;this.user=e,this._options=s,this.focus=new k("focused"),this.anchor=new k("anchor"),this.eventBufferer=new c.c,this._ariaLabel="",this.disposables=new n.b,this._onDidDispose=new c.a,this.onDidDispose=this._onDidDispose.event;const a=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(r=this._options.accessibilityProvider)||void 0===r?void 0:r.getWidgetRole():"list";this.selection=new D("listbox"!==a),Object(p.f)(s,j,!1);const l=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(l.push(new K(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),o=o.map((e=>new U(e.templateId,[...l,e])));const h=Object.assign(Object.assign({},s),{dnd:s.dnd&&new $(this,s.dnd)});if(this.view=new g.b(t,i,o,h),this.view.domNode.setAttribute("role",a),s.styleController)this.styleController=s.styleController(this.view.domId);else{const e=Object(w.w)(this.view.domNode);this.styleController=new B(e,this.view.domId)}if(this.spliceable=new f([new N(this.focus,this.view,s.identityProvider),new N(this.selection,this.view,s.identityProvider),new N(this.anchor,this.view,s.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.onDidFocus=c.b.map(Object(d.a)(this.view.domNode,"focus",!0),(()=>null)),this.onDidBlur=c.b.map(Object(d.a)(this.view.domNode,"blur",!0),(()=>null)),this.disposables.add(new A(this,this.view)),"boolean"!=typeof s.keyboardSupport||s.keyboardSupport){const e=new I(this,this.view,s);this.disposables.add(e)}if(s.keyboardNavigationLabelProvider){const e=s.keyboardNavigationDelegate||T;this.typeLabelController=new M(this,this.view,s.keyboardNavigationLabelProvider,e),this.disposables.add(this.typeLabelController)}this.mouseController=this.createMouseController(s),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),s.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}get onDidChangeFocus(){return c.b.map(this.eventBufferer.wrapEvent(this.focus.onChange),(e=>this.toListEvent(e)))}get onDidChangeSelection(){return c.b.map(this.eventBufferer.wrapEvent(this.selection.onChange),(e=>this.toListEvent(e)))}get domId(){return this.view.domId}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=c.b.chain(Object(d.a)(this.view.domNode,"keydown")).map((e=>new h.a(e))).filter((t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode)).map(d.c).filter((()=>!1)).event,i=c.b.chain(Object(d.a)(this.view.domNode,"keyup")).forEach((()=>e=!1)).map((e=>new h.a(e))).filter((e=>58===e.keyCode||e.shiftKey&&68===e.keyCode)).map(d.c).map((({browserEvent:e})=>{const t=this.getFocus(),i=t.length?t[0]:void 0;return{index:i,element:void 0!==i?this.view.element(i):void 0,anchor:void 0!==i?this.view.domElement(i):this.view.domNode,browserEvent:e}})).event,n=c.b.chain(this.view.onContextMenu).filter((t=>!e)).map((({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:{x:i.clientX+1,y:i.clientY},browserEvent:i}))).event;return c.b.any(t,i,n)}get onKeyDown(){return Object(d.a)(this.view.domNode,"keydown")}createMouseController(e){return new W(this)}updateOptions(e={}){this._options=Object.assign(Object.assign({},this._options),e),this.typeLabelController&&this.typeLabelController.updateOptions(this._options),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new u(this.user,`Invalid start index: ${e}`);if(t<0)throw new u(this.user,`Invalid delete count: ${t}`);0===t&&0===i.length||this.eventBufferer.bufferEvents((()=>this.spliceable.splice(e,t,i)))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const t of e)if(t<0||t>=this.length)throw new u(this.user,`Invalid index ${t}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map((e=>this.view.element(e)))}setAnchor(e){if(void 0!==e){if(e<0||e>=this.length)throw new u(this.user,`Invalid index ${e}`);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return Object(s.i)(this.anchor.get(),void 0)}setFocus(e,t){for(const t of e)if(t<0||t>=this.length)throw new u(this.user,`Invalid index ${t}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,n);s>-1&&this.setFocus([s],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);s>-1&&this.setFocus([s],i)}focusNextPage(e,t){return x(this,void 0,void 0,(function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.view.element(i),o=this.getFocusedElements()[0];if(o!==n){const n=this.findPreviousIndex(i,!1,t);n>-1&&o!==this.view.element(n)?this.setFocus([n],e):this.setFocus([i],e)}else{const n=this.view.getScrollTop();this.view.setScrollTop(n+this.view.renderHeight-this.view.elementHeight(i)),this.view.getScrollTop()!==n&&(this.setFocus([]),yield Object(y.l)(0),yield this.focusNextPage(e,t))}}))}focusPreviousPage(e,t){return x(this,void 0,void 0,(function*(){let i;const n=this.view.getScrollTop();i=0===n?this.view.indexAt(n):this.view.indexAfter(n-1);const o=this.view.element(i),s=this.getFocusedElements()[0];if(s!==o){const n=this.findNextIndex(i,!1,t);n>-1&&s!==this.view.element(n)?this.setFocus([n],e):this.setFocus([i],e)}else{const i=n;this.view.setScrollTop(n-this.view.renderHeight),this.view.getScrollTop()!==i&&(this.setFocus([]),yield Object(y.l)(0),yield this.focusPreviousPage(e,t))}}))}focusLast(e,t){if(0===this.length)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(0===this.length)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n=this.length&&!t)return-1;if(e%=this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;nthis.view.element(e)))}reveal(e,t){if(e<0||e>=this.length)throw new u(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),s=this.view.elementHeight(e);if(Object(o.h)(t)){const e=s-this.view.renderHeight;this.view.setScrollTop(e*Object(b.b)(t,0,1)+n)}else{const e=n+s,t=i+this.view.renderHeight;n=t||(n=t&&s>=this.view.renderHeight?this.view.setScrollTop(n):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e){if(e<0||e>=this.length)throw new u(this.user,`Invalid index ${e}`);const t=this.view.getScrollTop(),i=this.view.elementTop(e),n=this.view.elementHeight(e);if(it+this.view.renderHeight)return null;const o=n-this.view.renderHeight;return Math.abs((t-i)/o)}getHTMLElement(){return this.view.domNode}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map((e=>this.view.element(e))),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;(null===(e=this.accessibilityProvider)||void 0===e?void 0:e.getActiveDescendantId)&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}S([r.a],q.prototype,"onDidChangeFocus",null),S([r.a],q.prototype,"onDidChangeSelection",null),S([r.a],q.prototype,"onContextMenu",null)},function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return s}));var n=i(15);class o{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}o.None=Object.freeze({report(){}});const s=Object(n.c)("editorProgressService")},function(e,t,i){e.exports=i(33)(3837)},function(e,t,i){"use strict";function n(e,t,i){return Math.min(Math.max(e,t),i)}i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o}));class o{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this}get value(){return this._val}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i(110);class o extends n.a{constructor(e){super(0);for(let t=0,i=e.length;t(t.hasOwnProperty(e)||(t[e]=(e=>new o(e))(e)),t[e])}()},function(e,t,i){"use strict";i.d(t,"b",(function(){return E})),i.d(t,"a",(function(){return A}));var n=i(0),o=i(30),s=i(14),r=i(69),a=i(7),l=i(38),h=i(16),c=i(10),d=i(3);class u{static columnSelect(e,t,i,n,o,s){let r=Math.abs(o-i)+1,a=i>o,l=n>s,u=ns)continue;if(_n)continue;if(f0&&n--,u.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),s=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let i=o;i<=s;i++){const o=t.getLineMaxColumn(i),s=h.a.visibleColumnFromColumn2(e,t,new c.a(i,o));n=Math.max(n,s)}let r=i.toViewVisualColumn;return rt&&(i=t,n=e.model.getLineMaxColumn(i)),h.d.fromModelState(new h.f(new d.a(s.lineNumber,1,i,n),0,new c.a(i,n),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumbera){const i=e.getLineCount();let n=r.lineNumber+1,o=1;return n>i&&(n=i,o=e.getLineMaxColumn(n)),h.d.fromViewState(t.viewState.move(t.modelState.hasSelection(),n,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return h.d.fromModelState(t.modelState.move(t.modelState.hasSelection(),e.lineNumber,e.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return h.d.fromModelState(_.a.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new h.d(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return h.d.fromViewState(new h.f(new d.a(i,n,i,n),0,new c.a(i,n),0))}static moveTo(e,t,i,n,o){const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new c.a(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return h.d.fromViewState(t.viewState.move(i,r.lineNumber,r.column,0))}static simpleMove(e,t,i,n,o,s){switch(i){case 0:return 4===s?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return 4===s?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return 2===s?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return 2===s?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return 2===s?t.map((t=>h.d.fromViewState(f.a.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>h.d.fromModelState(f.a.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 5:return 2===s?t.map((t=>h.d.fromViewState(f.a.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>h.d.fromModelState(f.a.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const s=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 14:{let i=[];for(let o=0,r=t.length;oi.endLineNumber-1&&(o=i.endLineNumber-1),o1;let s=[];for(let r=0,a=t.length;r1;let s=[];for(let r=0,a=t.length;r{const i=e.get(l.a).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)})),e.addImplementation(1e3,"generic-dom-input-textarea",((e,t)=>{const i=document.activeElement;return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(),!0)})),e.addImplementation(0,"generic-dom",((e,t)=>{const i=e.get(l.a).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))}))}_runEditorCommand(e,t,i){return this.runEditorCommand(e,t,i)||!0}}!function(e){class t extends x{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[b.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),e.revealPrimaryCursor(t.source,!0)}}e.MoveTo=Object(a.i)(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=Object(a.i)(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends x{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);e.setCursorStates(t.source,3,i.viewStates.map((e=>h.d.fromViewState(e)))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source)}}e.ColumnSelect=Object(a.i)(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){const o=e.model.validatePosition(n.position),s=e.coordinatesConverter.validateViewPosition(new c.a(n.viewPosition.lineNumber,n.viewPosition.column),o);let r=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return u.columnSelect(e.cursorConfig,e,r,a,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=Object(a.i)(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return u.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=Object(a.i)(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return u.columnSelectRight(e.cursorConfig,e,i)}});class s extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return u.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=Object(a.i)(new s({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=Object(a.i)(new s({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:3595,linux:{primary:0}}}));class l extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return u.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=Object(a.i)(new l({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=Object(a.i)(new l({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:3596,linux:{primary:0}}}));class m extends x{constructor(){super({id:"cursorMove",precondition:void 0,description:g.description})}runCoreEditorCommand(e,t){const i=g.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,m._move(e,e.getCursorStates(),i)),e.revealPrimaryCursor(t,!0)}static _move(e,t,i){const n=i.select,o=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return b.simpleMove(e,t,i.direction,n,o,i.unit);case 11:case 13:case 12:case 14:return b.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=m,e.CursorMove=Object(a.i)(new m);class p extends x{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,b.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=Object(a.i)(new p({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=Object(a.i)(new p({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:1039}})),e.CursorRight=Object(a.i)(new p({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=Object(a.i)(new p({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:1041}})),e.CursorUp=Object(a.i)(new p({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=Object(a.i)(new p({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=Object(a.i)(new p({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:11}})),e.CursorPageUpSelect=Object(a.i)(new p({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:1035}})),e.CursorDown=Object(a.i)(new p({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=Object(a.i)(new p({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=Object(a.i)(new p({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:12}})),e.CursorPageDownSelect=Object(a.i)(new p({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:1036}})),e.CreateCursor=Object(a.i)(new class extends x{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){let i;i=t.wholeLine?b.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):b.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const o=i.modelState?i.modelState.position:null,s=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;is&&(o=s);const r=new d.a(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(i.at)switch(i.at){case D.RawAtArgument.Top:a=3;break;case D.RawAtArgument.Center:a=1;break;case D.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends O{constructor(){super(a.f)}runDOMCommand(){o.g&&(document.activeElement.focus(),document.activeElement.select()),document.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[b.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=Object(a.i)(new class extends x{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[h.d.fromModelSelection(t.selection)])}})}(E||(E={}));const I=w.a.and(C.a.textInputFocus,C.a.columnSelection);function T(e,t){y.a.registerKeybindingRule({id:e,primary:t,when:I,weight:S+1})}function M(e){return e.register(),e}var A;T(E.CursorColumnSelectLeft.id,1039),T(E.CursorColumnSelectRight.id,1041),T(E.CursorColumnSelectUp.id,1040),T(E.CursorColumnSelectPageUp.id,1035),T(E.CursorColumnSelectDown.id,1042),T(E.CursorColumnSelectPageDown.id,1036),function(e){class t extends a.c{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=Object(a.i)(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:C.a.writable,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,v.a.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection))))}}),e.Outdent=Object(a.i)(new class extends t{constructor(){super({id:"outdent",precondition:C.a.writable,kbOpts:{weight:S,kbExpr:w.a.and(C.a.editorTextFocus,C.a.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,v.a.outdent(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.Tab=Object(a.i)(new class extends t{constructor(){super({id:"tab",precondition:C.a.writable,kbOpts:{weight:S,kbExpr:w.a.and(C.a.editorTextFocus,C.a.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,v.a.tab(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.DeleteLeft=Object(a.i)(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=p.a.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=Object(a.i)(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:S,kbExpr:C.a.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,o]=p.a.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)}}),e.Undo=new class extends O{constructor(){super(a.g)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(77))return t.getModel().undo()}},e.Redo=new class extends O{constructor(){super(a.e)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(77))return t.getModel().redo()}}}(A||(A={}));class R extends a.a{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(l.a).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function P(e,t){M(new R("default:"+e,e)),M(new R(e,e,t))}P("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),P("replacePreviousChar"),P("compositionType"),P("compositionStart"),P("compositionEnd"),P("paste"),P("cut")},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(11);class o{constructor(e,t){this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t}equals(e){return e instanceof o&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let t=n;t0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)];return n.A.getLanguageId(t)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return n.A.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return n.A.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return n.A.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return n.A.getInlineStyleFromMetadata(i,t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return o.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new s(this,e,t,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let t=0;t>>1)-1;for(;it&&(n=o)}return i}}class s{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let t=this._firstTokenIndex,n=e.getCount();t=i);t++)this._tokensCount++}equals(e){return e instanceof s&&this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount)}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}},function(e,t,i){"use strict";function n(e,t){let i=e.getCount(),n=e.findTokenIndexAtOffset(t),s=e.getLanguageId(n),r=n;for(;r+10&&e.getLanguageId(a-1)===s;)a--;return new o(e,s,a,r+1,e.getStartOffset(a),e.getEndOffset(r))}i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return s}));class o{constructor(e,t,i,n,o,s){this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=s}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function s(e){return 0!=(7&e)}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(15);const o=Object(n.c)("textModelService")},function(e,t,i){"use strict";i.d(t,"a",(function(){return c})),i(188);var n=i(2),o=i(48),s=i(1),r=i(14),a=i(46),l=i(5),h=i(114);class c extends n.a{constructor(e,t={}){var i,n,r,c,d,u;let g,m;switch(super(),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new l.a),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new l.a({onFirstListenerAdd:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new l.a),this.onDidRun=this._onDidRun.event,this._onBeforeRun=this._register(new l.a),this.onBeforeRun=this._onBeforeRun.event,this.options=t,this._context=null!==(i=t.context)&&void 0!==i?i:null,this._orientation=null!==(n=this.options.orientation)&&void 0!==n?n:0,this._triggerKeys={keyDown:null!==(c=null===(r=this.options.triggerKeys)||void 0===r?void 0:r.keyDown)&&void 0!==c&&c,keys:null!==(u=null===(d=this.options.triggerKeys)||void 0===d?void 0:d.keys)&&void 0!==u?u:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new o.b,this._register(this._actionRunner)),this._register(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._register(this._actionRunner.onBeforeRun((e=>this._onBeforeRun.fire(e)))),this._actionIds=[],this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",!1!==t.animated&&this.domNode.classList.add("animated"),this._orientation){case 0:g=[15],m=[17];break;case 1:g=[16],m=[18],this.domNode.className+=" vertical"}this._register(s.i(this.domNode,s.d.KEY_DOWN,(e=>{const t=new a.a(e);let i=!0;const n="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;g&&(t.equals(g[0])||t.equals(g[1]))?i=this.focusPrevious():m&&(t.equals(m[0])||t.equals(m[1]))?i=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?i=this.focusFirst():t.equals(13)?i=this.focusLast():t.equals(2)&&n instanceof h.b&&n.trapsArrowNavigation?i=this.focusNext():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:i=!1,i&&(t.preventDefault(),t.stopPropagation())}))),this._register(s.i(this.domNode,s.d.KEY_UP,(e=>{const t=new a.a(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&this.updateFocusedItem()}))),this.focusTracker=this._register(s.W(this.domNode)),this._register(this.focusTracker.onDidBlur((()=>{s.y()!==this.domNode&&s.K(s.y(),this.domNode)||(this._onDidBlur.fire(),this.focusedItem=void 0,this.triggerKeyDown=!1)}))),this._register(this.focusTracker.onDidFocus((()=>this.updateFocusedItem()))),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.actionsList.setAttribute("role","toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach((i=>{t=t||e.equals(i)})),t}updateFocusedItem(){for(let e=0;et.setActionContext(e)))}get actionRunner(){return this._actionRunner}set actionRunner(e){e&&(this._actionRunner=e,this.viewItems.forEach((t=>t.actionRunner=e)))}getContainer(){return this.domNode}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=r.h(t.index)?t.index:null;i.forEach((e=>{const i=document.createElement("li");let o;i.className="action-item",i.setAttribute("role","presentation"),this.options.allowContextMenu||this._register(s.i(i,s.d.CONTEXT_MENU,(e=>{s.c.stop(e,!0)}))),this.options.actionViewItemProvider&&(o=this.options.actionViewItemProvider(e)),o||(o=new h.a(this.context,e,t)),o.actionRunner=this._actionRunner,o.setActionContext(this.context),o.render(i),this.focusable&&o instanceof h.b&&0===this.viewItems.length&&o.setFocusable(!0),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(o),this._actionIds.push(e.id)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,o),this._actionIds.splice(n,0,e.id),n++)})),"number"==typeof this.focusedItem&&this.focus(this.focusedItem)}clear(){Object(n.f)(this.viewItems),this.viewItems=[],this._actionIds=[],s.t(this.actionsList)}length(){return this.viewItems.length}focus(e){let t,i=!1;if(void 0===e?i=!0:"number"==typeof e?t=e:"boolean"==typeof e&&(i=e),i&&void 0===this.focusedItem){const e=this.viewItems.findIndex((e=>e.isEnabled()));this.focusedItem=-1===e?void 0:e,this.updateFocus()}else void 0!==t&&(this.focusedItem=t),this.updateFocus()}focusFirst(){return this.focusedItem=this.length()>1?1:0,this.focusPrevious()}focusLast(){return this.focusedItem=this.length()<2?0:this.length()-2,this.focusNext()}focusNext(){if(void 0===this.focusedItem)this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const e=this.focusedItem;let t;do{if(this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=e,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&this.options.focusOnlyEnabledItems&&!t.isEnabled());return this.updateFocus(),!0}focusPrevious(){if(void 0===this.focusedItem)this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const e=this.focusedItem;let t;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(this.options.preventLoopNavigation)return this.focusedItem=e,!1;this.focusedItem=this.viewItems.length-1}t=this.viewItems[this.focusedItem]}while(this.focusedItem!==e&&this.options.focusOnlyEnabledItems&&!t.isEnabled());return this.updateFocus(!0),!0}updateFocus(e,t){void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t});for(let i=0;i({key:m.bindTo(e.get(l.b)),tokens:new h.a}))),this._tokens.set(e,n)),n.key.set(!0),i=n.tokens.push(t),()=>{i&&(i(),n.key.set(!n.tokens.isEmpty()),i=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},!0);class p extends s.b{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext((t=>t.get(g).add(e,this)))}dispose(){this._unregister(),super.dispose()}}Object(a.i)(new class extends a.c{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:m})}runEditorCommand(e,t){e.get(g).cancel(t)}});class f{constructor(e,t){if(this.flags=t,0!=(1&this.flags)){const t=e.getModel();this.modelVersionId=t?n.v("{0}#{1}",t.uri.toString(),t.getVersionId()):null}else this.modelVersionId=null;0!=(4&this.flags)?this.position=e.getPosition():this.position=null,0!=(2&this.flags)?this.selection=e.getSelection():this.selection=null,0!=(8&this.flags)?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof f))return!1;const t=e;return this.modelVersionId===t.modelVersionId&&this.scrollLeft===t.scrollLeft&&this.scrollTop===t.scrollTop&&!(!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position))&&!(!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new f(e,this.flags))}}class _ extends p{constructor(e,t,i,n){super(e,n),this._listener=new r.b,4&t&&this._listener.add(e.onDidChangeCursorPosition((e=>{i&&o.a.containsPosition(i,e.position)||this.cancel()}))),2&t&&this._listener.add(e.onDidChangeCursorSelection((e=>{i&&o.a.containsRange(i,e.selection)||this.cancel()}))),8&t&&this._listener.add(e.onDidScrollChange((e=>this.cancel()))),1&t&&(this._listener.add(e.onDidChangeModel((e=>this.cancel()))),this._listener.add(e.onDidChangeModelContent((e=>this.cancel()))))}dispose(){this._listener.dispose(),super.dispose()}}class b extends s.b{constructor(e,t){super(t),this._listener=e.onDidChangeContent((()=>this.cancel()))}dispose(){this._listener.dispose(),super.dispose()}}class v{constructor(e,t,i){this._visiblePosition=e,this._visiblePositionScrollDelta=t,this._cursorPosition=i}static capture(e){let t=null,i=0;if(0!==e.getScrollTop()){const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}}return new v(t,i,e.getPosition())}restore(e){if(this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),i.d(t,"b",(function(){return s})),i.d(t,"c",(function(){return r})),i.d(t,"d",(function(){return a}));var n=i(15);const o=Object(n.c)("undoRedoService");class s{constructor(e,t){this.resource=e,this.elements=t}}class r{constructor(){this.id=r._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}r._ID=0,r.None=new r;class a{constructor(){this.id=a._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}a._ID=0,a.None=new a},function(e,t,i){"use strict";i.d(t,"b",(function(){return a})),i.d(t,"a",(function(){return m}));var n=i(6),o=i(109),s=i(3);class r{constructor(e,t,i,n,o,s){this.languageIdentifier=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=o,this.reversedRegex=s,this._openSet=r._toSet(this.open),this._closeSet=r._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}class a{constructor(e,t){const i=function(e){const t=e.length;e=e.map((e=>[e[0].toLowerCase(),e[1].toLowerCase()]));const i=[];for(let e=0;e{const[i,n]=e,[o,s]=t;return i===o||i===s||n===o||n===s},o=(e,n)=>{const o=Math.min(e,n),s=Math.max(e,n);for(let e=0;e0&&s.push({open:o,close:r})}return s}(t);this.brackets=i.map(((t,n)=>new r(e,n,t.open,t.close,function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let e=0,t=o.length;e=0&&n.push(t);for(const t of s.close)t.indexOf(e)>=0&&n.push(t)}}function h(e,t){return e.length-t.length}function c(e){if(e.length<=1)return e;const t=[],i=new Set;for(const n of e)i.has(n)||(t.push(n),i.add(n));return t}function d(e){const t=/^[\w ]+$/.test(e);return e=n.t(e),t?`\\b${e}\\b`:e}function u(e){let t=`(${e.map(d).join(")|(")})`;return n.p(t,!0)}const g=function(){let e=null,t=null;return function(i){return e!==i&&(e=i,t=function(e){if(o.d){const t=new Uint16Array(e.length);let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return o.c().decode(t)}{let t=[],i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charAt(n);return t.join("")}}(e)),t}}();class m{static _findPrevBracketInText(e,t,i,n){let o=i.match(e);if(!o)return null;let r=i.length-(o.index||0),a=o[0].length,l=n+r;return new s.a(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,n,o){const s=g(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,s,n)}static findNextBracketInText(e,t,i,n){let o=i.match(e);if(!o)return null;let r=o.index||0,a=o[0].length;if(0===a)return null;let l=n+r;return new s.a(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,n,o){const s=i.substring(n,o);return this.findNextBracketInText(e,t,s,n)}}},function(e,t,i){"use strict";var n;i.d(t,"a",(function(){return n})),function(e){e.DARK="dark",e.LIGHT="light",e.HIGH_CONTRAST="hc"}(n||(n={}))},function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return s}));class n{constructor(e,t,i){this.offset=0|e,this.type=t,this.language=i}toString(){return"("+this.offset+", "+this.type+")"}}class o{constructor(e,t){this.tokens=e,this.endState=t}}class s{constructor(e,t){this.tokens=e,this.endState=t}}},function(e,t,i){"use strict";i.d(t,"f",(function(){return l})),i.d(t,"b",(function(){return d})),i.d(t,"c",(function(){return u})),i.d(t,"a",(function(){return m})),i.d(t,"e",(function(){return _})),i.d(t,"d",(function(){return b}));var n=i(20),o=i(89),s=i(10),r=i(3),a=i(11);function l(e){let t=0,i=0,n=0,o=0;for(let s=0,r=e.length;s>>0}const c=new Uint32Array(0).buffer;class d{constructor(){this.tokens=[]}add(e,t){if(this.tokens.length>0){const i=this.tokens[this.tokens.length-1];if(i.startLineNumber+i.tokens.length-1+1===e)return void i.tokens.push(t)}this.tokens.push(new p(e,[t]))}}class u{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){let t=[];for(let i=0;ie)){let o=n;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let s=n;for(;se||c===e&&u>=t)&&(ce||d===e&&g>=t){if(do?m-=o-i:m=i;else if(u===t&&g===i){if(!(u===n&&m>o)){h=!0;continue}m-=o-i}else if(uo)){h=!0;continue}u===t?(g=i,m=g+(m-o)):(g=0,m=g+(m-o))}else if(u>n){if(0===a&&!h){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,m+=e),u-=a,g-=o-i,m-=o-i}const f=4*l;s[f]=u,s[f+1]=g,s[f+2]=m,s[f+3]=p,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,s){const r=0===i&&1===n&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),a=this._tokens,l=this._tokenCount;for(let s=0;s0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new s.a(e.startLineNumber,e.startColumn),t,i,n,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this.startLineNumber,i=e.endLineNumber-this.startLineNumber;if(i<0){const e=i-t;return void(this.startLineNumber-=e)}const n=this.tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this.startLineNumber=0,void this.tokens.clear();if(t<0){const n=-t;this.startLineNumber-=n,this.tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this.tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,o){if(0===t&&0===i)return;const s=e.lineNumber-this.startLineNumber;s<0?this.startLineNumber+=t:s>=this.tokens.getMaxDeltaLine()+1||this.tokens.acceptInsertText(s,e.column-1,t,i,n,o)}}class p{constructor(e,t){this.startLineNumber=e,this.tokens=t}}function f(e){return e instanceof Uint32Array?e:new Uint32Array(e)}class _{constructor(){this._pieces=[],this._isComplete=!1}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const n=t[0].getRange(),o=t[t.length-1].getRange();if(!n||!o)return e;i=e.plusRange(n).plusRange(o)}let o=null;for(let e=0,t=this._pieces.length;ei.endLineNumber){o=o||{index:e};break}if(n.removeTokens(i),n.isEmpty()){this._pieces.splice(e,1),e--,t--;continue}if(n.endLineNumberi.endLineNumber){o=o||{index:e};continue}const[s,r]=n.split(i);s.isEmpty()?o=o||{index:e}:r.isEmpty()||(this._pieces.splice(e,1,s,r),e++,t++,o=o||{index:e})}return o=o||{index:this._pieces.length},t.length>0&&(this._pieces=n.a(this._pieces,o.index,t)),i}isComplete(){return this._isComplete}addSemanticTokens(e,t){const i=this._pieces;if(0===i.length)return t;const n=i[_._findFirstPieceWithLine(i,e)].getLineTokens(e);if(!n)return t;const s=t.getCount(),r=n.getCount();let a=0,l=[],h=0,c=0;const d=(e,t)=>{e!==c&&(c=e,l[h++]=e,l[h++]=t)};for(let e=0;e>>0,h=~l>>>0;for(;at)){for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}n=o-1}}return i}acceptEdit(e,t,i,n,o){for(const s of this._pieces)s.acceptEdit(e,t,i,n,o)}}class b{constructor(){this._lineTokens=[],this._len=0}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let n=null;if(t1&&(t=a.A.getLanguageId(n[1])!==e),!t)return c}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=h(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;let i=[];for(let e=0;e=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=b._delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=b._deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len||(0!==t?(this._lineTokens[n]=b._deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=b._insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=b._insert(this._lineTokens[n],e.column-1,i))}static _deleteBeginning(e,t){return null===e||e===c?e:b._delete(e,0,t)}static _deleteEnding(e,t){if(null===e||e===c)return e;const i=f(e),n=i[i.length-2];return b._delete(e,t,n)}static _delete(e,t,i){if(null===e||e===c||t===i)return e;const n=f(e),s=n.length>>>1;if(0===t&&n[n.length-2]===i)return c;const r=o.a.findIndexInTokensArray(n,t),a=r>0?n[r-1<<1]:0;if(ih&&(n[l++]=t,n[l++]=n[1+(e<<1)],h=t)}if(l===n.length)return e;let u=new Uint32Array(l);return u.set(n.subarray(0,l),0),u.buffer}static _append(e,t){if(t===c)return e;if(e===c)return t;if(null===e)return e;if(null===t)return null;const i=f(e),n=f(t),o=n.length>>>1;let s=new Uint32Array(i.length+n.length);s.set(i,0);let r=i.length;const a=i[i.length-2];for(let e=0;e>>1;let r=o.a.findIndexInTokensArray(n,t);r>0&&n[r-1<<1]===t&&r--;for(let e=r;et?e:`\\${e}`))}const c=new RegExp(`\\\\${a.source}`,"g");function d(e){return e.replace(c,(e=>`\\${e}`))}const u=new RegExp(`(\\s)?(\\\\)?${a.source}(\\s)?`,"g");function g(e){return-1===e.indexOf(r)?e:e.replace(u,((e,t,i,n)=>i?e:t||n||""))}function m(e){const t=e.indexOf(r);return-1===t?{text:e}:function(e,t){const i=[];let n="";function o(e){if(e){n+=e;for(const t of e)i.push(c)}}let s,a,l=-1,h="",c=0,d=t;const u=e.length;for(o(e.substr(0,t));d1){let n;for(n=i-1;n>=1;n--){const e=t.getLineContent(n);if(o.H(e)>=0)break}if(n<1)return null;const r=t.getLineMaxColumn(n),l=g.a.getEnterAction(e.autoIndent,t,new a.a(n,r,n,r));l&&(s=l.indentation+l.appendText)}return n&&(n===u.b.Indent&&(s=m.shiftIndent(e,s)),n===u.b.Outdent&&(s=m.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let o="",r=i.getStartPosition();if(e.insertSpaces){let i=c.a.visibleColumnFromColumn2(e,t,r),n=e.indentSize,s=n-i%n;for(let e=0;ethis._compositionType(i,e,o,s,r,a)));return new c.e(1,l,{shouldPushStackElementBefore:1!==e,shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,r){if(!t.isEmpty())return null;const l=t.getPosition(),h=Math.max(1,l.column-n),c=Math.min(e.getLineMaxColumn(l.lineNumber),l.column+o),d=new a.a(l.lineNumber,h,l.lineNumber,c);return e.getValueInRange(d)===i&&0===r?null:new s.d(d,i,0,r)}static _typeCommand(e,t,i){return i?new s.e(e,t,!0):new s.a(e,t,!0)}static _enter(e,t,i,n){if(0===e.autoIndent)return m._typeCommand(n,"\n",i);if(!t.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){let s=t.getLineContent(n.startLineNumber),r=o.x(s).substring(0,n.startColumn-1);return m._typeCommand(n,"\n"+e.normalizeIndentation(r),i)}const r=g.a.getEnterAction(e.autoIndent,t,n);if(r){if(r.indentAction===u.b.None)return m._typeCommand(n,"\n"+e.normalizeIndentation(r.indentation+r.appendText),i);if(r.indentAction===u.b.Indent)return m._typeCommand(n,"\n"+e.normalizeIndentation(r.indentation+r.appendText),i);if(r.indentAction===u.b.IndentOutdent){const t=e.normalizeIndentation(r.indentation),o=e.normalizeIndentation(r.indentation+r.appendText),a="\n"+o+"\n"+t;return i?new s.e(n,a,!0):new s.d(n,a,-1,o.length-t.length,!0)}if(r.indentAction===u.b.Outdent){const t=m.unshiftIndent(e,r.indentation);return m._typeCommand(n,"\n"+e.normalizeIndentation(t+r.appendText),i)}}const a=t.getLineContent(n.startLineNumber),l=o.x(a).substring(0,n.startColumn-1);if(e.autoIndent>=4){const r=g.a.getIndentForEnter(e.autoIndent,t,n,{unshiftIndent:t=>m.unshiftIndent(e,t),shiftIndent:t=>m.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)});if(r){let a=c.a.visibleColumnFromColumn2(e,t,n.getEndPosition());const l=n.endColumn,h=t.getLineContent(n.endLineNumber),d=o.u(h);if(n=d>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,d+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new s.e(n,"\n"+e.normalizeIndentation(r.afterEnter),!0);{let t=0;return l<=d+1&&(e.insertSpaces||(a=Math.ceil(a/e.indentSize)),t=Math.min(a+1-e.normalizeIndentation(r.afterEnter).length-1,0)),new s.d(n,"\n"+e.normalizeIndentation(r.afterEnter),0,t,!0)}}}return m._typeCommand(n,"\n"+e.normalizeIndentation(l),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let e=0,n=i.length;em.shiftIndent(e,t),unshiftIndent:t=>m.unshiftIndent(e,t)});if(null===s)return null;if(s!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===o?m._typeCommand(new a.a(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+n,!1):m._typeCommand(new a.a(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+t.getLineContent(i.startLineNumber).substring(o-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,r=i.length;s2?l.charCodeAt(a.column-2):0)&&h)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;tt.startsWith(e.open))),r=o.some((e=>t.startsWith(e.close)));return!s&&r}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let s=null;for(const e of o)if(null===s||e.open.length>s.open.length){let o=!0;for(const s of i)if(t.getValueInRange(new a.a(s.lineNumber,s.column-e.open.length+1,s.lineNumber,s.column))+n!==e.open){o=!1;break}o&&(s=e)}return s}static _findSubAutoClosingPairClose(e,t){if(t.open.length<=1)return"";const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const e of n)e.open!==t.open&&t.open.includes(e.open)&&t.close.endsWith(e.close)&&(!o||e.open.length>o.open.length)&&(o=e);return o?o.close:""}static _getAutoClosingPairClose(e,t,i,o,s){const r=Object(c.g)(o),a=r?e.autoClosingQuotes:e.autoClosingBrackets;if("never"===a)return null;const l=this._findAutoClosingPairOpen(e,t,i.map((e=>e.getPosition())),o);if(!l)return null;const h=this._findSubAutoClosingPairClose(e,l);let u=!0;const p=r?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;for(let o=0,c=i.length;of.column-1){const t=_.charAt(f.column-1);if(!m._isBeforeClosingBrace(e,b)&&!p(t))return null}if(!t.isCheapToTokenize(f.lineNumber))return null;if(1===l.open.length&&r&&"always"!==a){const t=Object(d.a)(e.wordSeparators);if(s&&f.column>1&&0===t.get(_.charCodeAt(f.column-2)))return null;if(!s&&f.column>2&&0===t.get(_.charCodeAt(f.column-3)))return null}t.forceTokenization(f.lineNumber);const v=t.getLineTokens(f.lineNumber);let C=!1;try{C=g.a.shouldAutoClosePair(l,v,s?f.column:f.column-1)}catch(e){Object(n.e)(e)}if(!C)return null}return u?l.close.substring(0,l.close.length-h.length):l.close}static _runAutoClosingOpenCharType(e,t,i,n,o,s,r){let a=[];for(let e=0,t=n.length;enew s.a(new a.a(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1)));return new c.e(1,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,i,o,h,!1);return null!==d?this._runAutoClosingOpenCharType(e,t,i,o,h,!1,d):null}static typeWithInterceptors(e,t,i,n,o,r,a){if(!e&&"\n"===a){let e=[];for(let t=0,s=o.length;tt(new s.a(e)))))}onmousedown(e,t){this._register(n.i(e,n.d.MOUSE_DOWN,(e=>t(new s.a(e)))))}onmouseover(e,t){this._register(n.i(e,n.d.MOUSE_OVER,(e=>t(new s.a(e)))))}onnonbubblingmouseout(e,t){this._register(n.j(e,(e=>t(new s.a(e)))))}onkeydown(e,t){this._register(n.i(e,n.d.KEY_DOWN,(e=>t(new o.a(e)))))}onkeyup(e,t){this._register(n.i(e,n.d.KEY_UP,(e=>t(new o.a(e)))))}oninput(e,t){this._register(n.i(e,n.d.INPUT,t))}onblur(e,t){this._register(n.i(e,n.d.BLUR,t))}onfocus(e,t){this._register(n.i(e,n.d.FOCUS,t))}ignoreGesture(e){a.b.ignoreTarget(e)}}},function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return r}));var n=i(130);const o=[];function s(e,t,i){t instanceof n.a||(t=new n.a(t,[],i)),o.push([e,t])}function r(){return o}},function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i(13);const o=n.b.performance&&"function"==typeof n.b.performance.now;class s{constructor(e){this._highResolution=o&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new s(e)}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?n.b.performance.now():Date.now()}}},function(e,t,i){"use strict";var n=i(213).default;i(220),(t=e.exports=n).default=t},function(e,t,i){"use strict";function n(e){return e<0?0:e>255?255:0|e}function o(e){return e<0?0:e>4294967295?4294967295:0|e}i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o}))},function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return p}));var n,o=i(2),s=i(13),r=i(14),a=i(47),l=i(54),h=i(5),c=i(1),d=i(26),u=i(21);!function(e){e.North="north",e.South="south",e.East="east",e.West="west"}(n||(n={}));const g=new h.a,m=new h.a;class p extends o.a{constructor(e,t,i){super(),this.hoverDelay=300,this.hoverDelayer=this._register(new u.a(this.hoverDelay)),this._state=3,this._onDidEnablementChange=this._register(new h.a),this.onDidEnablementChange=this._onDidEnablementChange.event,this._onDidStart=this._register(new h.a),this.onDidStart=this._onDidStart.event,this._onDidChange=this._register(new h.a),this.onDidChange=this._onDidChange.event,this._onDidReset=this._register(new h.a),this.onDidReset=this._onDidReset.event,this._onDidEnd=this._register(new h.a),this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.orthogonalStartSashDisposables=this._register(new o.b),this.orthogonalStartDragHandleDisposables=this._register(new o.b),this.orthogonalEndSashDisposables=this._register(new o.b),this.orthogonalEndDragHandleDisposables=this._register(new o.b),this.el=Object(c.q)(e,Object(c.a)(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),s.f&&this.el.classList.add("mac"),this._register(Object(d.a)(this.el,"mousedown")(this.onMouseDown,this)),this._register(Object(d.a)(this.el,"dblclick")(this.onMouseDoubleClick,this)),this._register(Object(d.a)(this.el,"mouseenter")((()=>p.onMouseEnter(this)))),this._register(Object(d.a)(this.el,"mouseleave")((()=>p.onMouseLeave(this)))),this._register(a.b.addTarget(this.el)),this._register(Object(d.a)(this.el,a.a.Start)((e=>this.onTouchStart(e)),this)),"number"==typeof i.size?(this.size=i.size,0===i.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=4,this._register(g.event((e=>{this.size=e,this.layout()})))),this._register(m.event((e=>this.hoverDelay=e))),this.hidden=!1,this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,1===this.orientation?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",!1),this.layout()}get state(){return this._state}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this._onDidEnablementChange.fire(e))}get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=Object(c.q)(this.el,Object(c.a)(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Object(o.h)((()=>this._orthogonalStartDragHandle.remove()))),Object(d.a)(this._orthogonalStartDragHandle,"mouseenter")((()=>p.onMouseEnter(e)),void 0,this.orthogonalStartDragHandleDisposables),Object(d.a)(this._orthogonalStartDragHandle,"mouseleave")((()=>p.onMouseLeave(e)),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange(t,this)),t(e.state)}this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=Object(c.q)(this.el,Object(c.a)(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Object(o.h)((()=>this._orthogonalEndDragHandle.remove()))),Object(d.a)(this._orthogonalEndDragHandle,"mouseenter")((()=>p.onMouseEnter(e)),void 0,this.orthogonalEndDragHandleDisposables),Object(d.a)(this._orthogonalEndDragHandle,"mouseleave")((()=>p.onMouseLeave(e)),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(t,this)),t(e.state)}this._orthogonalEndSash=e}onMouseDown(e){c.c.stop(e,!1);let t=!1;if(!e.__orthogonalSashEvent){const i=this.getOrthogonalSash(e);i&&(t=!0,e.__orthogonalSashEvent=!0,i.onMouseDown(e))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onMouseDown(e)),!this.state)return;const i=[...Object(c.D)("iframe"),...Object(c.D)("webview")];for(const e of i)e.style.pointerEvents="none";const n=new l.a(e),r=n.posx,a=n.posy,h=n.altKey,u={startX:r,currentX:r,startY:a,currentY:a,altKey:h};this.el.classList.add("active"),this._onDidStart.fire(u);const g=Object(c.w)(this.el),m=()=>{let e="";e=t?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":s.f?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":s.f?"col-resize":"ew-resize",g.textContent=`* { cursor: ${e} !important; }`},p=new o.b;m(),t||this.onDidEnablementChange(m,null,p),Object(d.a)(window,"mousemove")((e=>{c.c.stop(e,!1);const t=new l.a(e),i={startX:r,currentX:t.posx,startY:a,currentY:t.posy,altKey:h};this._onDidChange.fire(i)}),null,p),Object(d.a)(window,"mouseup")((e=>{c.c.stop(e,!1),this.el.removeChild(g),this.el.classList.remove("active"),this._onDidEnd.fire(),p.dispose();for(const e of i)e.style.pointerEvents="auto"}),null,p)}onMouseDoubleClick(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}onTouchStart(e){c.c.stop(e);const t=[],i=e.pageX,n=e.pageY,s=e.altKey;this._onDidStart.fire({startX:i,currentX:i,startY:n,currentY:n,altKey:s}),t.push(Object(c.i)(this.el,a.a.Change,(e=>{r.h(e.pageX)&&r.h(e.pageY)&&this._onDidChange.fire({startX:i,currentX:e.pageX,startY:n,currentY:e.pageY,altKey:s})}))),t.push(Object(c.i)(this.el,a.a.End,(()=>{this._onDidEnd.fire(),Object(o.f)(t)})))}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger((()=>e.el.classList.add("hover")),e.hoverDelay).then(void 0,(()=>{})),!t&&e.linkedSash&&p.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&p.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){p.onMouseLeave(this)}layout(){if(0===this.orientation){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}hide(){this.hidden=!0,this.el.style.display="none",this.el.setAttribute("aria-hidden","true")}getOrthogonalSash(e){if(e.target&&e.target instanceof HTMLElement)return e.target.classList.contains("orthogonal-drag-handle")?e.target.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}}},function(e,t,i){"use strict";i.d(t,"c",(function(){return c})),i.d(t,"d",(function(){return d})),i.d(t,"a",(function(){return u})),i.d(t,"b",(function(){return g}));var n=i(6),o=i(13),s=i(53);let r,a,l;function h(){return r||(r=new TextDecoder("UTF-16LE")),r}function c(){return l||(l=o.e()?h():(a||(a=new TextDecoder("UTF-16BE")),a)),l}const d="undefined"!=typeof TextDecoder;let u,g;function m(e,t,i){let n=[],o=0;for(let r=0;rnew p(e),g=function(e,t,i){const n=new Uint16Array(e.buffer,t,i);return i>0&&(65279===n[0]||65534===n[0])?m(e,t,i):h().decode(n)}):(u=e=>new f,g=m);class p{constructor(e){this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(0===this._bufferLength)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return c().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}write1(e){const t=this._capacity-this._bufferLength;t<=1&&(0===t||n.D(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCII(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIIString(e){const t=e.length;if(this._bufferLength+t>=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let i=0;i=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}}class s{constructor(){this._actual=new o(0)}add(e){this._actual.set(e,1)}has(e){return 1===this._actual.get(e)}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return $e})),i.d(t,"b",(function(){return qe})),i.d(t,"e",(function(){return Ze})),i.d(t,"d",(function(){return bt})),i.d(t,"c",(function(){return Et}));var n=i(1),o=(i(189),i(2)),s=i(20),r=i(83),a=i(5),l=i(31);class h{constructor(e,t){this.renderer=e,this.modelProvider=t}get templateId(){return this.renderer.templateId}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:o.a.None}}renderElement(e,t,i,n){if(i.disposable&&i.disposable.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,n);const s=new l.b,r=o.resolve(e,s.token);i.disposable={dispose:()=>s.cancel()},this.renderer.renderPlaceholder(e,i.data),r.then((t=>this.renderer.renderElement(t,e,i.data,n)))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class c{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}class d{constructor(e,t,i,n,o={}){const s=()=>this.model,a=n.map((e=>new h(e,s)));this.list=new r.c(e,t,i,a,function(e,t){return Object.assign(Object.assign({},t),{accessibilityProvider:t.accessibilityProvider&&new c(e,t.accessibilityProvider)})}(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return a.b.map(this.list.onMouseDblClick,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onPointer(){return a.b.map(this.list.onPointer,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onDidChangeSelection(){return a.b.map(this.list.onDidChangeSelection,(({elements:e,indexes:t,browserEvent:i})=>({elements:e.map((e=>this._model.get(e))),indexes:t,browserEvent:i})))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Object(s.q)(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map((e=>this.model.get(e)))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var u,g=i(0),m=i(43),p=i(112),f=i(8),_=i(15),b=i(56),v=i(51),C=i(64),w=i(17),y=i(154),S=i(35),x=i(46);!function(e){e[e.Unknown=0]="Unknown",e[e.Twistie=1]="Twistie",e[e.Element=2]="Element"}(u||(u={}));class L extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class k{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}var D=i(101),N=i(143),E=i(26),O=i(65),I=i(161);function T(e){return"object"==typeof e&&"visibility"in e&&"data"in e}function M(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function A(e){return"boolean"==typeof e.collapsible}class R{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new a.c,this._onDidChangeCollapseState=new a.a,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new a.a,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new a.a,this.onDidSplice=this._onDidSplice.event,this.collapseByDefault=void 0!==n.collapseByDefault&&n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren=void 0!==n.autoExpandSingleChildren&&n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=S.a.empty(),n={}){if(0===e.length)throw new L(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n,o,s){var r;void 0===n&&(n=S.a.empty()),void 0===s&&(s=null!==(r=o.diffDepth)&&void 0!==r?r:0);const{parentNode:a}=this.getParentNodeWithListIndex(t),l=[...n],h=t[t.length-1],c=new I.a({getElements:()=>a.children.map((t=>e.getId(t.element).toString()))},{getElements:()=>[...a.children.slice(0,h),...l,...a.children.slice(h+i)].map((t=>e.getId(t.element).toString()))}).ComputeDiff(!1);if(c.quitEarly)return this.spliceSimple(t,i,l,o);const d=t.slice(0,-1),u=(t,i,n)=>{if(s>0)for(let r=0;rt.originalStart-e.originalStart)))u(g,m,g-(e.originalStart+e.originalLength)),g=e.originalStart,m=e.modifiedStart-h,this.spliceSimple([...d,g],e.originalLength,S.a.slice(l,m,m+e.modifiedLength),o);u(g,m,g)}spliceSimple(e,t,i=S.a.empty(),{onDidCreateNode:n,onDidDeleteNode:o}){const{parentNode:s,listIndex:r,revealed:a,visible:l}=this.getParentNodeWithListIndex(e),h=[],c=S.a.map(i,(e=>this.createTreeNode(e,s,s.visible?1:0,a,h,n))),d=e[e.length-1],u=s.children.length>0;let g=0;for(let e=d;e>=0&&ee+(t.visible?t.renderNodeCount:0)),0);this._updateAncestorsRenderNodeCount(s,f-e),this.list.splice(r,e,h)}if(_.length>0&&o){const e=t=>{o(t),t.children.forEach(e)};_.forEach(e)}const v=s.children.length>0;u!==v&&this.setCollapsible(e.slice(0,-1),v),this._onDidSplice.fire({insertedNodes:m,deletedNodes:_});let C=s;for(;C;){if(2===C.visibility){this.refilter();break}C=C.parent}}rerender(e){if(0===e.length)throw new L(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);void 0===t&&(t=!i.collapsible);const n={collapsible:t};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,n)))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);void 0===t&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,o)))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&s&&!A(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e-1){n=-1;break}n=e}n>-1&&this._setCollapseState([...e,n],t)}return s}_setListNodeCollapseState(e,t,i,n){const o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const s=e.renderNodeCount,r=this.updateNodeAfterCollapseChange(e),a=s-(-1===t?0:1);return this.list.splice(t+1,a,r.slice(1)),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(A(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!A(t)&&t.recursive)for(const i of e.children)n=this._setNodeCollapseState(i,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents((()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})}))}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t)}createTreeNode(e,t,i,n,o,s){const r={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(r,i);r.visibility=a,n&&o.push(r);const l=e.children||S.a.empty(),h=n&&0!==a&&!r.collapsed,c=S.a.map(l,(e=>this.createTreeNode(e,r,a,h,o,s)));let d=0,u=1;for(const e of c)r.children.push(e),u+=e.renderNodeCount,e.visible&&(e.visibleChildIndex=d++);return r.collapsible=r.collapsible||r.children.length>0,r.visibleChildrenCount=d,r.visible=2===a?d>0:1===a,r.visible?r.collapsed||(r.renderNodeCount=u):(r.renderNodeCount=0,n&&o.pop()),s&&s(r),r}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),0===o)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const s=i.length;e.renderNodeCount=e===this.root?0:1;let r=!1;if(e.collapsed&&0===o)e.visibleChildrenCount=0;else{let t=0;for(const s of e.children)r=this._updateNodeAfterFilterChange(s,o,i,n&&!e.collapsed)||r,s.visible&&(s.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===o?r:1===o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-s):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return"boolean"==typeof i?(e.filterData=void 0,i?1:0):T(i)?(e.filterData=i.data,M(i.visibility)):(e.filterData=void 0,M(i))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;const[i,...n]=e;return!(i<0||i>t.children.length)&&this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new L(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new L(this.user,"Invalid tree location");const r=t.children[s];return{node:r,listIndex:i,revealed:n,visible:o&&r.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[s,...r]=e;if(s<0||s>t.children.length)throw new L(this.user,"Invalid tree location");for(let e=0;ee.element))),this.data=e}}function q(e){return e instanceof N.a?new $(e):e}class G{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=o.a.None}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(q(e),t)}onDragOver(e,t,i,n,o=!0){const r=this.dnd.onDragOver(q(e),t&&t.element,i,n),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return r;if(a&&"boolean"!=typeof r&&r.autoExpand&&(this.autoExpandDisposable=Object(P.i)((()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0}),500)),"boolean"==typeof r||!r.accept||void 0===r.bubble||r.feedback)return o?r:{accept:"boolean"==typeof r?r:r.accept,effect:"boolean"==typeof r?void 0:r.effect,feedback:[i]};if(1===r.bubble){const i=this.modelProvider(),o=i.getNodeLocation(t),s=i.getParentNodeLocation(o),r=i.getNode(s),a=s&&i.getListIndex(s);return this.onDragOver(e,r,a,n,!1)}const l=this.modelProvider(),h=l.getNodeLocation(t),c=l.getListIndex(h),d=l.getListRenderCount(h);return Object.assign(Object.assign({},r),{feedback:Object(s.q)(c,c+d)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(q(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}class Y{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight&&this.delegate.setDynamicHeight(e.element,t)}}var Z;!function(e){e.None="none",e.OnHover="onHover",e.Always="always"}(Z||(Z={}));class Q{constructor(e,t=[]){this._elements=t,this.onDidChange=a.b.forEach(e,(e=>this._elements=e))}get elements(){return this._elements}}class X{constructor(e,t,i,n,s={}){this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=X.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new B.a,this.activeIndentNodes=new Set,this.indentGuidesDisposable=o.a.None,this.disposables=new o.b,this.templateId=e.templateId,this.updateOptions(s),a.b.map(i,(e=>e.node))(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState&&e.onDidChangeTwistieState(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent&&(this.indent=Object(W.b)(e.indent,0,40)),void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==Z.None;if(t!==this.shouldRenderIndentGuides&&(this.shouldRenderIndentGuides=t,this.indentGuidesDisposable.dispose(),t)){const e=new o.b;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Object(n.q)(e,Object(n.a)(".monaco-tl-row")),i=Object(n.q)(t,Object(n.a)(".monaco-tl-indent")),s=Object(n.q)(t,Object(n.a)(".monaco-tl-twistie")),r=Object(n.q)(t,Object(n.a)(".monaco-tl-contents")),a=this.renderer.renderTemplate(r);return{container:e,indent:i,twistie:s,indentGuidesDisposable:o.a.None,templateData:a}}renderElement(e,t,i,n){"number"==typeof n&&(this.renderedNodes.set(e,{templateData:i,height:n}),this.renderedElements.set(e.element,e));const o=X.DefaultIndent+(e.depth-1)*this.indent;i.twistie.style.paddingLeft=`${o}px`,i.indent.style.width=o+this.indent-16+"px",this.renderTwistie(e,i),"number"==typeof n&&this.renderIndentGuides(e,i),this.renderer.renderElement(e,t,i.templateData,n)}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.templateData,n),"number"==typeof n&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this.renderTwistie(e,t.templateData),this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderIndentGuides(e,t.templateData))}renderTwistie(e,t){t.twistie.classList.remove(...V.classNamesArray);let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...V.classNamesArray),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded")}renderIndentGuides(e,t){if(Object(n.t)(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new o.b,s=this.modelProvider();let r=e;for(;;){const e=s.getNodeLocation(r),a=s.getParentNodeLocation(e);if(!a)break;const l=s.getNode(a),h=Object(n.a)(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(l)&&h.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(h):t.indent.insertBefore(h,t.indent.firstElementChild),this.renderedIndentGuides.add(l,h),i.add(Object(o.h)((()=>this.renderedIndentGuides.delete(l,h)))),r=l}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach((e=>{const n=i.getNodeLocation(e);try{const o=i.getParentNodeLocation(n);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):o&&t.add(i.getNode(o))}catch(e){}})),this.activeIndentNodes.forEach((e=>{t.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.remove("active")))})),t.forEach((e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.add("active")))})),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Object(o.f)(this.disposables)}}X.DefaultIndent=8;class J{constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new o.b,e.onWillRefilter(this.reset,this,this.disposables)}get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set pattern(e){this._pattern=e,this._lowercasePattern=e.toLowerCase()}filter(e,t){if(this._filter){const i=this._filter.filter(e,t);if(this.tree.options.simpleKeyboardNavigation)return i;let n;if(n="boolean"==typeof i?i?1:0:T(i)?M(i.visibility):i,0===n)return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:O.a.Default,visibility:!0};const i=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),n=Array.isArray(i)?i:[i];for(const e of n){const t=e&&e.toString();if(void 0===t)return{data:O.a.Default,visibility:!0};const i=Object(O.d)(this._pattern,this._lowercasePattern,0,t,t.toLowerCase(),0,!0);if(i)return this._matchCount++,1===n.length?{data:i,visibility:!0}:{data:{label:t,score:i},visibility:!0}}return this.tree.options.filterOnType?2:{data:O.a.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Object(o.f)(this.disposables)}}class ee{constructor(e,t,i,s,r){this.tree=e,this.view=i,this.filter=s,this.keyboardNavigationDelegate=r,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new a.a,this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new a.a,this.enabledDisposables=new o.b,this.disposables=new o.b,this.domNode=Object(n.a)(`.monaco-list-type-filter.${this.positionClassName}`),this.domNode.draggable=!0,Object(E.a)(this.domNode,"dragstart")(this.onDragStart,this,this.disposables),this.messageDomNode=Object(n.q)(i.getHTMLElement(),Object(n.a)(".monaco-list-type-filter-message")),this.labelDomNode=Object(n.q)(this.domNode,Object(n.a)("span.label"));const l=Object(n.q)(this.domNode,Object(n.a)(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=Object(n.q)(l,Object(n.a)("input.filter")),this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),Object(E.a)(this.filterOnTypeDomNode,"input")(this.onDidChangeFilterOnType,this,this.disposables),this.clearDomNode=Object(n.q)(l,Object(n.a)("button.clear"+U.cssSelector)),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=Object(g.a)("clear","Clear"),this.keyboardNavigationEventFilter=e.options.keyboardNavigationEventFilter,t.onDidSplice(this.onDidSpliceModel,this,this.disposables),this.updateOptions(e.options)}get enabled(){return this._enabled}get pattern(){return this._pattern}get filterOnType(){return this._filterOnType}updateOptions(e){e.simpleKeyboardNavigation?this.disable():this.enable(),void 0!==e.filterOnType&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType,this.updateFilterOnTypeTitleAndIcon()),void 0!==e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(),this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")}enable(){if(this._enabled)return;const e=a.b.chain(Object(E.a)(this.view.getHTMLElement(),"keydown")).filter((e=>!Object(r.e)(e.target)||e.target===this.filterOnTypeDomNode)).filter((e=>"Dead"!==e.key&&!/^Media/.test(e.key))).map((e=>new x.a(e))).filter(this.keyboardNavigationEventFilter||(()=>!0)).filter((()=>this.automaticKeyboardNavigation||this.triggered)).filter((e=>this.keyboardNavigationDelegate.mightProducePrintableCharacter(e)&&!(18===e.keyCode||16===e.keyCode||15===e.keyCode||17===e.keyCode)||(this.pattern.length>0||this.triggered)&&(9===e.keyCode||1===e.keyCode)&&!e.altKey&&!e.ctrlKey&&!e.metaKey||1===e.keyCode&&(F.f?e.altKey&&!e.metaKey:e.ctrlKey)&&!e.shiftKey)).forEach((e=>{e.stopPropagation(),e.preventDefault()})).event,t=Object(E.a)(this.clearDomNode,"click");a.b.chain(a.b.any(e,t)).event(this.onEventOrInput,this,this.enabledDisposables),this.filter.pattern="",this.tree.refilter(),this.render(),this._enabled=!0,this.triggered=!1}disable(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.clear(),this.tree.refilter(),this.render(),this._enabled=!1,this.triggered=!1)}onEventOrInput(e){"string"==typeof e?this.onInput(e):e instanceof MouseEvent||9===e.keyCode||1===e.keyCode&&(F.f?e.altKey:e.ctrlKey)?this.onInput(""):1===e.keyCode?this.onInput(0===this.pattern.length?"":this.pattern.substr(0,this.pattern.length-1)):this.onInput(this.pattern+e.browserEvent.key)}onInput(e){const t=this.view.getHTMLElement();e&&!this.domNode.parentElement?t.append(this.domNode):!e&&this.domNode.parentElement&&(this.domNode.remove(),this.tree.domFocus()),this._pattern=e,this._onDidChangePattern.fire(e),this.filter.pattern=e,this.tree.refilter(),e&&this.tree.focusNext(0,!0,void 0,(e=>!O.a.isDefault(e.filterData)));const i=this.tree.getFocus();if(i.length>0){const e=i[0];null===this.tree.getRelativeTop(e)&&this.tree.reveal(e,.5)}this.render(),e||(this.triggered=!1)}onDragStart(){const e=this.view.getHTMLElement(),{left:t}=Object(n.C)(e),i=e.clientWidth,s=i/2,r=this.domNode.clientWidth,a=new o.b;let l=this.positionClassName;const h=()=>{switch(l){case"nw":this.domNode.style.top="4px",this.domNode.style.left="4px";break;case"ne":this.domNode.style.top="4px",this.domNode.style.left=i-r-6+"px"}};h(),this.domNode.classList.remove(l),this.domNode.classList.add("dragging"),a.add(Object(o.h)((()=>this.domNode.classList.remove("dragging")))),Object(E.a)(document,"dragover")((e=>{e.preventDefault();const i=e.clientX-t;e.dataTransfer&&(e.dataTransfer.dropEffect="none"),l=i{this.positionClassName=l,this.domNode.className=`monaco-list-type-filter ${this.positionClassName}`,this.domNode.style.top="",this.domNode.style.left="",Object(o.f)(a)}),null,a),D.c.CurrentDragAndDropData=new D.b("vscode-ui"),a.add(Object(o.h)((()=>D.c.CurrentDragAndDropData=void 0)))}onDidSpliceModel(){this._enabled&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}onDidChangeFilterOnType(){this.tree.updateOptions({filterOnType:this.filterOnTypeDomNode.checked}),this.tree.refilter(),this.tree.domFocus(),this.render(),this.updateFilterOnTypeTitleAndIcon()}updateFilterOnTypeTitleAndIcon(){this.filterOnType?(this.filterOnTypeDomNode.classList.remove(...z.classNamesArray),this.filterOnTypeDomNode.classList.add(...H.classNamesArray),this.filterOnTypeDomNode.title=Object(g.a)("disable filter on type","Disable Filter on Type")):(this.filterOnTypeDomNode.classList.remove(...H.classNamesArray),this.filterOnTypeDomNode.classList.add(...z.classNamesArray),this.filterOnTypeDomNode.title=Object(g.a)("enable filter on type","Enable Filter on Type"))}render(){const e=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&this.tree.options.filterOnType&&e?(this.messageDomNode.textContent=Object(g.a)("empty","No elements found"),this._empty=!0):(this.messageDomNode.innerText="",this._empty=!1),this.domNode.classList.toggle("no-matches",e),this.domNode.title=Object(g.a)("found","Matched {0} out of {1} elements",this.filter.matchCount,this.filter.totalCount),this.labelDomNode.textContent=this.pattern.length>16?"…"+this.pattern.substr(this.pattern.length-16):this.pattern,this._onDidChangeEmptyState.fire(this._empty)}shouldAllowFocus(e){return!(this.enabled&&this.pattern&&!this.filterOnType)||this.filter.totalCount>0&&this.filter.matchCount<=1||!O.a.isDefault(e.filterData)}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),Object(o.f)(this.disposables)}}function te(e){let t=u.Unknown;return Object(n.I)(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=u.Twistie:Object(n.I)(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(t=u.Element),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function ie(e,t){t(e),e.children.forEach((e=>ie(e,t)))}class ne{constructor(e){this.identityProvider=e,this.nodes=[],this._onDidChange=new a.a,this.onDidChange=this._onDidChange.event}get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}set(e,t){var i;!(null===(i=t)||void 0===i?void 0:i.__forceEvent)&&Object(s.g)(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map((e=>e.element))),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach((e=>ie(e,i))),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach((e=>ie(e,n)));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach((e=>ie(e,s)));const r=[];for(const e of this.nodes){const t=this.identityProvider.getId(e.element).toString();if(i.has(t)){const e=o.get(t);e&&r.push(e)}else r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class oe extends r.d{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(Object(r.e)(e.browserEvent.target)||Object(r.f)(e.browserEvent.target))return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(o="function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick,o&&!n&&2!==e.browserEvent.detail)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e);if(t.collapsible){const i=this.tree.model,s=i.getNodeLocation(t),r=e.browserEvent.altKey;if(this.tree.setFocus([s]),i.setCollapsed(s,void 0,r),o&&n)return}super.onViewPointer(e)}onDoubleClick(e){!e.browserEvent.target.classList.contains("monaco-tl-twistie")&&this.tree.expandOnDoubleClick&&super.onDoubleClick(e)}}class se extends r.c{constructor(e,t,i,n,o,s,r,a){super(e,t,i,n,a),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=r}createMouseController(e){return new oe(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];let r;i.forEach(((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i),this.anchorTrait.has(t)&&(r=e+i)})),n.length>0&&super.setFocus(Object(s.f)([...super.getFocus(),...n])),o.length>0&&super.setSelection(Object(s.f)([...super.getSelection(),...o])),"number"==typeof r&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map((e=>this.element(e))),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map((e=>this.element(e))),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class re{constructor(e,t,i,s,l={}){this._options=l,this.eventBufferer=new a.c,this.disposables=new o.b,this._onWillRefilter=new a.a,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new a.a;const h=new Y(i),c=new a.e,d=new a.e,u=new Q(d.event);this.renderers=s.map((e=>new X(e,(()=>this.model),c.event,u,l)));for(let e of this.renderers)this.disposables.add(e);let g;var m,p;l.keyboardNavigationLabelProvider&&(g=new J(this,l.keyboardNavigationLabelProvider,l.filter),l=Object.assign(Object.assign({},l),{filter:g}),this.disposables.add(g)),this.focus=new ne(l.identityProvider),this.selection=new ne(l.identityProvider),this.anchor=new ne(l.identityProvider),this.view=new se(e,t,h,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},(m=()=>this.model,(p=l)&&Object.assign(Object.assign({},p),{identityProvider:p.identityProvider&&{getId:e=>p.identityProvider.getId(e.element)},dnd:p.dnd&&new G(m,p.dnd),multipleSelectionController:p.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>p.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element})),isSelectionRangeChangeEvent:e=>p.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},accessibilityProvider:p.accessibilityProvider&&Object.assign(Object.assign({},p.accessibilityProvider),{getSetSize(e){const t=m(),i=t.getNodeLocation(e),n=t.getParentNodeLocation(i);return t.getNode(n).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:p.accessibilityProvider&&p.accessibilityProvider.isChecked?e=>p.accessibilityProvider.isChecked(e.element):void 0,getRole:p.accessibilityProvider&&p.accessibilityProvider.getRole?e=>p.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>p.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>p.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:p.accessibilityProvider&&p.accessibilityProvider.getWidgetRole?()=>p.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:p.accessibilityProvider&&p.accessibilityProvider.getAriaLevel?e=>p.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:p.accessibilityProvider.getActiveDescendantId&&(e=>p.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:p.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},p.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:e=>p.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}),enableKeyboardNavigation:p.simpleKeyboardNavigation}))),{tree:this})),this.model=this.createModel(e,this.view,l),c.input=this.model.onDidChangeCollapseState;const f=a.b.forEach(this.model.onDidSplice,(e=>{this.eventBufferer.bufferEvents((()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)}))}));if(f((()=>null),null,this.disposables),d.input=a.b.chain(a.b.any(f,this.focus.onDidChange,this.selection.onDidChange)).debounce((()=>null),0).map((()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);return[...e.values()]})).event,!1!==l.keyboardSupport){const e=a.b.chain(this.view.onKeyDown).filter((e=>!Object(r.e)(e.target))).map((e=>new x.a(e)));e.filter((e=>15===e.keyCode)).on(this.onLeftArrow,this,this.disposables),e.filter((e=>17===e.keyCode)).on(this.onRightArrow,this,this.disposables),e.filter((e=>10===e.keyCode)).on(this.onSpace,this,this.disposables)}if(l.keyboardNavigationLabelProvider){const e=l.keyboardNavigationDelegate||r.a;this.typeFilterController=new ee(this,this.model,this.view,g,e),this.focusNavigationFilter=e=>this.typeFilterController.shouldAllowFocus(e),this.disposables.add(this.typeFilterController)}this.styleElement=Object(n.w)(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Z.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return a.b.map(this.view.onMouseDblClick,te)}get onPointer(){return a.b.map(this.view.onPointer,te)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}updateOptions(e={}){this._options=Object.assign(Object.assign({},this._options),e);for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions({enableKeyboardNavigation:this._options.simpleKeyboardNavigation,automaticKeyboardNavigation:this._options.automaticKeyboardNavigation,smoothScrolling:this._options.smoothScrolling,horizontalScrolling:this._options.horizontalScrolling}),this.typeFilterController&&this.typeFilterController.updateOptions(this._options),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Z.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}domFocus(){this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeIndentGuidesStroke.transparent(.4)}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join("\n"),this.view.style(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map((e=>this.model.getNode(e)));this.selection.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map((e=>this.model.getNode(e)));this.focus.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setFocus(n,t,!0)}focusNext(e=1,t=!1,i,n=this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);-1!==i&&this.view.reveal(i,t)}getRelativeTop(e){const t=this.model.getListIndex(e);return-1===t?null:this.view.getRelativeTop(t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some((e=>e.visible)))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){Object(o.f)(this.disposables),this.view.dispose()}}class ae{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new R(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare:(e,t)=>i.sorter.compare(e.element,t.element)}),this.identityProvider=i.identityProvider}setChildren(e,t=S.a.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=S.a.empty(),i){const n=new Set,o=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{var t;if(null===e.element)return;const s=e;if(n.add(s.element),this.nodes.set(s.element,s),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.add(e),this.nodesByIdentity.set(e,s)}null===(t=i.onDidCreateNode)||void 0===t||t.call(i,s)},onDidDeleteNode:e=>{var t;if(null===e.element)return;const s=e;if(n.has(s.element)||this.nodes.delete(s.element),this.identityProvider){const e=this.identityProvider.getId(s.element).toString();o.has(e)||this.nodesByIdentity.delete(e)}null===(t=i.onDidDeleteNode)||void 0===t||t.call(i,s)}}))}preserveCollapseState(e=S.a.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),S.a.map(e,(e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){const i=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(i)}if(!t)return Object.assign(Object.assign({},e),{children:this.preserveCollapseState(e.children)});const i="boolean"==typeof e.collapsible?e.collapsible:t.collapsible,n=void 0!==e.collapsed?e.collapsed:t.collapsed;return Object.assign(Object.assign({},e),{collapsible:i,collapsed:n,children:this.preserveCollapseState(e.children)})}))}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(null===e)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new L(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new L(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new L(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(null===e)return[];const t=this.nodes.get(e);if(!t)throw new L(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function le(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:S.a.map(S.a.from(e.children),le),collapsible:e.collapsible,collapsed:e.collapsed}}function he(e){const t=[e.element],i=e.incompressible||!1;let n,o;for(;[o,n]=S.a.consume(S.a.from(e.children),2),1===o.length&&!o[0].incompressible;)e=o[0],t.push(e.element);return{element:{elements:t,incompressible:i},children:S.a.map(S.a.concat(o,n),he),collapsible:e.collapsible,collapsed:e.collapsed}}function ce(e,t=0){let i;return i=tce(e,0))),0===t&&e.element.incompressible?{element:e.element.elements[t],children:i,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:i,collapsible:e.collapsible,collapsed:e.collapsed}}function de(e){return ce(e,0)}function ue(e,t,i){return e.element===t?Object.assign(Object.assign({},e),{children:i}):Object.assign(Object.assign({},e),{children:S.a.map(S.a.from(e.children),(e=>ue(e,t,i)))})}class ge{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new ae(e,t,i),this.enabled=void 0===i.compressionEnabled||i.compressionEnabled,this.identityProvider=i.identityProvider}get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}setChildren(e,t=S.a.empty(),i){const n=i.diffIdentityProvider&&(o=i.diffIdentityProvider,{getId:e=>e.elements.map((e=>o.getId(e).toString())).join("\0")});var o;if(null===e){const e=S.a.map(t,this.enabled?he:le);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const s=this.nodes.get(e);if(!s)throw new Error("Unknown compressed tree node");const r=this.model.getNode(s),a=this.model.getParentNodeLocation(s),l=this.model.getNode(a),h=ue(de(r),e,t),c=(this.enabled?he:le)(h),d=l.children.map((e=>e===r?c:e));this._setChildren(l.element,d,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode().children,i=S.a.map(t,de),n=S.a.map(i,e?he:le);this._setChildren(null,n,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set;this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)}}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(void 0===e)return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return null===i?null:i.elements[i.elements.length-1]}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(null===e)return null;const t=this.nodes.get(e);if(!t)throw new L(this.user,`Tree element not found: ${e}`);return t}}const me=e=>e[e.length-1];class pe{constructor(e,t){this.unwrapper=e,this.node=t}get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map((e=>new pe(this.unwrapper,e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class fe{constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||me;const n=e=>this.elementMapper(e.elements);this.nodeMapper=new k((e=>new pe(n,e))),this.model=new ge(e,function(e,t){return{splice(i,n,o){t.splice(i,n,o.map((t=>e.map(t))))},updateElementHeight(e,i){t.updateElementHeight(e,i)}}}(this.nodeMapper,t),function(e,t){return Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:i=>t.identityProvider.getId(e(i))},sorter:t.sorter&&{compare:(e,i)=>t.sorter.compare(e.elements[0],i.elements[0])},filter:t.filter&&{filter:(i,n)=>t.filter.filter(e(i),n)}})}(n,i))}get onDidSplice(){return a.b.map(this.model.onDidSplice,(({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map((e=>this.nodeMapper.map(e))),deletedNodes:t.map((e=>this.nodeMapper.map(e)))})))}get onDidChangeCollapseState(){return a.b.map(this.model.onDidChangeCollapseState,(({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t})))}get onDidChangeRenderNodeCount(){return a.b.map(this.model.onDidChangeRenderNodeCount,(e=>this.nodeMapper.map(e)))}setChildren(e,t=S.a.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var _e=i(78);class be extends re{constructor(e,t,i,n,o={}){super(e,t,i,n,o)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=S.a.empty(),i){this.model.setChildren(e,t,i)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new ae(e,t,i)}}class ve{constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);1===o.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement&&this.renderer.disposeElement(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return!!this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}!function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);s>3&&r&&Object.defineProperty(t,i,r)}([_e.a],ve.prototype,"compressedTreeNodeProvider",null);class Ce extends be{constructor(e,t,i,n,o={}){const s=()=>this;super(e,t,i,n.map((e=>new ve(s,e))),function(e,t){return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(e){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}(s,o))}setChildren(e,t=S.a.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new fe(e,t,i)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var we=i(18),ye=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Se(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function xe(e,t){return!!t.parent&&(t.parent===e||xe(e,t.parent))}class Le{constructor(e){this.node=e}get element(){return this.node.element.element}get children(){return this.node.children.map((e=>new Le(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class ke{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...K.classNamesArray),!0):(t.classList.remove(...K.classNamesArray),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function De(e){return{browserEvent:e.browserEvent,elements:e.elements.map((e=>e.element))}}function Ne(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class Ee extends N.a{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function Oe(e){return e instanceof N.a?new Ee(e):e}class Ie{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){this.dnd.onDragStart&&this.dnd.onDragStart(Oe(e),t)}onDragOver(e,t,i,n,o=!0){return this.dnd.onDragOver(Oe(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(Oe(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function Te(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new Ie(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element})),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var i;return!!(null===(i=e.accessibilityProvider)||void 0===i?void 0:i.isChecked(t.element))}:void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}),sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),additionalScrollHeight:e.additionalScrollHeight})}function Me(e,t){t(e),e.children.forEach((e=>Me(e,t)))}class Ae{constructor(e,t,i,n,s,r={}){this.user=e,this.dataSource=s,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new a.a,this._onDidChangeNodeSlowState=new a.a,this.nodeMapper=new k((e=>new Le(e))),this.disposables=new o.b,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=void 0!==r.autoExpandSingleChildren&&r.autoExpandSingleChildren,this.sorter=r.sorter,this.collapseByDefault=r.collapseByDefault,this.tree=this.createTree(e,t,i,n,r),this.root=Se({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}get onDidChangeFocus(){return a.b.map(this.tree.onDidChangeFocus,De)}get onDidChangeSelection(){return a.b.map(this.tree.onDidChangeSelection,De)}get onMouseDblClick(){return a.b.map(this.tree.onMouseDblClick,Ne)}get onPointer(){return a.b.map(this.tree.onPointer,Ne)}get onDidFocus(){return this.tree.onDidFocus}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,i,n,o){const s=new Y(i),r=n.map((e=>new ke(e,this.nodeMapper,this._onDidChangeNodeSlowState.event))),a=Te(o)||{};return new be(e,t,s,r,a)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return ye(this,void 0,void 0,(function*(){this.refreshPromises.forEach((e=>e.cancel())),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}))}_updateChildren(e=this.root.element,t=!0,i=!1,n,o){return ye(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new L(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield a.b.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,n,o),i)try{this.tree.rerender(s)}catch(e){}}))}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(t)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return ye(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new L(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield a.b.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(yield this.root.refreshPromise,yield a.b.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield a.b.toPromise(this._onDidRender.event)),n}))}setSelection(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map((e=>e.element))}setFocus(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map((e=>e.element))}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new L(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,n){return ye(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,i),this.render(e,i,n)}))}refreshNode(e,t,i){return ye(this,void 0,void 0,(function*(){let n;return this.subTreeRefreshPromises.forEach(((o,s)=>{!n&&function(e,t){return e===t||xe(e,t)||xe(t,e)}(s,e)&&(n=o.then((()=>this.refreshNode(e,t,i))))})),n||this.doRefreshSubTree(e,t,i)}))}doRefreshSubTree(e,t,i){return ye(this,void 0,void 0,(function*(){let n;e.refreshPromise=new Promise((e=>n=e)),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally((()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}));try{const n=yield this.doRefreshNode(e,t,i);e.stale=!1,yield P.d.settled(n.map((e=>this.doRefreshSubTree(e,t,i))))}finally{n()}}))}doRefreshNode(e,t,i){return ye(this,void 0,void 0,(function*(){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=Object(P.l)(800);t.then((()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)}),(e=>null)),n=this.doGetChildren(e).finally((()=>t.cancel()))}else n=Promise.resolve(S.a.empty());try{const o=yield n;return this.setChildren(e,o,t,i)}catch(t){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Object(we.d)(t))return[];throw t}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}))}doGetChildren(e){let t=this.refreshPromises.get(e);return t||(t=Object(P.h)((()=>ye(this,void 0,void 0,(function*(){const t=yield this.dataSource.getChildren(e.element);return this.processChildren(t)})))),this.refreshPromises.set(e,t),t.finally((()=>{this.refreshPromises.delete(e)})))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(we.e))}setChildren(e,t,i,n){const o=[...t];if(0===e.children.length&&0===o.length)return[];const s=new Map,r=new Map;for(const t of e.children)if(s.set(t.element,t),this.identityProvider){const e=this.tree.isCollapsed(t);r.set(t.id,{node:t,collapsed:e})}const a=[],l=o.map((t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=Se({element:t,parent:e,hasChildren:o});return o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(i.collapsedByDefault=!1,a.push(i)),i}const l=this.identityProvider.getId(t).toString(),h=r.get(l);if(h){const e=h.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?h.collapsed?(e.children.forEach((e=>Me(e,(e=>this.nodes.delete(e.element))))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(e.collapsedByDefault=!1,a.push(e)),e}const c=Se({element:t,parent:e,id:l,hasChildren:o});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(c),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(c),n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1?a.push(c):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(c.collapsedByDefault=!1,a.push(c)),c}));for(const e of s.values())Me(e,(e=>this.nodes.delete(e.element)));for(const e of l)this.nodes.set(e.element,e);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].collapsedByDefault=!1,a.push(l[0])),a}render(e,t,i){const n=e.children.map((e=>this.asTreeElement(e,t))),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId:e=>i.diffIdentityProvider.getId(e.element)}});this.tree.setChildren(e===this.root?null:e,n,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return i=!(t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1)&&e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?S.a.map(e.children,(e=>this.asTreeElement(e,t))):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose()}}class Re{constructor(e){this.node=e}get element(){return{elements:this.node.element.elements.map((e=>e.element)),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map((e=>new Re(e)))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}}class Pe{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...K.classNamesArray),!0):(t.classList.remove(...K.classNamesArray),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement&&this.renderer.disposeElement(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements&&this.renderer.disposeCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Object(o.f)(this.disposables)}}class Fe extends Ae{constructor(e,t,i,n,o,s,r={}){super(e,t,i,o,s,r),this.compressionDelegate=n,this.compressibleNodeMapper=new k((e=>new Re(e))),this.filter=r.filter}createTree(e,t,i,n,o){const s=new Y(i),r=n.map((e=>new Pe(e,this.nodeMapper,(()=>this.compressibleNodeMapper),this._onDidChangeNodeSlowState.event))),a=function(e){const t=e&&Te(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map((e=>e.element)))})})}(o)||{};return new Ce(e,t,s,r,a)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=e=>this.identityProvider.getId(e).toString(),n=e=>{const t=new Set;for(const n of e){const e=this.tree.getCompressedTreeNode(n===this.root?null:n);if(e.element)for(const n of e.element.elements)t.add(i(n.element))}return t},o=n(this.tree.getSelection()),s=n(this.tree.getFocus());super.render(e,t);const r=this.getSelection();let a=!1;const l=this.getFocus();let h=!1;const c=e=>{const t=e.element;if(t)for(let e=0;e{const t="boolean"==typeof(i=this.filter.filter(e,1))?i?1:0:T(i)?M(i.visibility):M(i);var i;if(2===t)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===t}))),super.processChildren(e)}}class We extends re{constructor(e,t,i,n,o,s={}){super(e,t,i,n,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,i){return new ae(e,t,i)}}var Be=i(62),je=i(163);class Ve{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=Ve.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map((e=>[e.templateId,e])));this.renderers=[];for(const t of e){const e=n.get(t.templateId);if(!e)throw new Error(`Table cell renderer for template id ${t.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){const t=Object(n.q)(e,Object(n.a)(".monaco-table-tr")),i=[],o=[];for(let e=0;enew He(e,t))),c={size:h.reduce(((e,t)=>e+t.column.weight),0),views:h.map((e=>({size:e.column.weight,view:e})))};this.splitview=new je.b(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:c}),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const d=new Ve(o,s,(e=>this.splitview.getViewSize(e)));var u;this.list=new r.c(e,this.domNode,(u=i,{getHeight:e=>u.getHeight(e),getTemplateId:()=>Ve.TemplateId}),[d],l),this.columnLayoutDisposable=a.b.any(...h.map((e=>e.onDidLayout)))((([e,t])=>d.layoutColumn(e,t))),this.styleElement=Object(n.w)(this.domNode),this.style({})}get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get onDidDispose(){return this.list.onDidDispose}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight+1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.splitview.dispose(),this.list.dispose(),this.columnLayoutDisposable.dispose()}}ze.InstanceCount=0;var Ue=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ke=function(e,t){return function(i,n){t(i,n,e)}};const $e=Object(_.c)("listService");let qe=class{constructor(e){this._themeService=e,this.disposables=new o.b,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}get lastFocusedList(){return this._lastFocusedWidget}register(e,t){if(!this._hasCreatedStyleController){this._hasCreatedStyleController=!0;const e=new r.b(Object(n.w)(),"");this.disposables.add(Object(C.b)(e,this._themeService))}if(this.lists.some((t=>t.widget===e)))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&(this._lastFocusedWidget=e),Object(o.e)(e.onDidFocus((()=>this._lastFocusedWidget=e)),Object(o.h)((()=>this.lists.splice(this.lists.indexOf(i),1))),e.onDidDispose((()=>{this.lists=this.lists.filter((e=>e!==i)),this._lastFocusedWidget===e&&(this._lastFocusedWidget=void 0)})))}dispose(){this.disposables.dispose()}};qe=Ue([Ke(0,w.b)],qe);const Ge=new f.c("listFocus",!0),Ye=new f.c("listSupportsMultiselect",!0),Ze=f.a.and(Ge,f.a.not(y.a)),Qe=new f.c("listHasSelectionOrFocus",!1),Xe=new f.c("listDoubleSelection",!1),Je=new f.c("listMultiSelection",!1),et=new f.c("listSelectionNavigation",!1),tt=new f.c("listSupportsKeyboardNavigation",!0),it="listAutomaticKeyboardNavigation",nt=new f.c(it,!0);let ot=!1;function st(e,t){const i=e.createScoped(t.getHTMLElement());return Ge.bindTo(i),i}const rt="workbench.list.multiSelectModifier",at="workbench.list.openMode",lt="workbench.list.horizontalScrolling",ht="workbench.list.keyboardNavigation",ct="workbench.list.automaticKeyboardNavigation",dt="workbench.tree.indent",ut="workbench.tree.renderIndentGuides",gt="workbench.list.smoothScrolling",mt="workbench.tree.expandMode";function pt(e){return"alt"===e.getValue(rt)}class ft extends o.a{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=pt(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(rt)&&(this.useAltAsMultipleSelectionModifier=pt(this.configurationService))})))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Object(r.h)(e)}isSelectionRangeChangeEvent(e){return Object(r.g)(e)}}function _t(e,t,i){const n=new o.b,s=Object.assign({},e);if(!1!==e.multipleSelectionSupport&&!e.multipleSelectionController){const e=new ft(t);s.multipleSelectionController=e,n.add(e)}return s.keyboardNavigationDelegate={mightProducePrintableCharacter:e=>i.mightProducePrintableCharacter(e)},s.smoothScrolling=t.getValue(gt),[s,n]}let bt=class extends r.c{constructor(e,t,i,n,o,s,r,a,l,h){const c=void 0!==o.horizontalScrolling?o.horizontalScrolling:l.getValue(lt),[d,u]=_t(o,l,h);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Object(C.d)(a.getColorTheme(),C.e)),d),{horizontalScrolling:c})),this.disposables.add(u),this.contextKeyService=st(s,this),this.themeService=a,Ye.bindTo(this.contextKeyService).set(!(!1===o.multipleSelectionSupport)),et.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=Qe.bindTo(this.contextKeyService),this.listDoubleSelection=Xe.bindTo(this.contextKeyService),this.listMultiSelection=Je.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=pt(l),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),o.overrideStyles&&this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(l.onDidChangeConfiguration((e=>{e.affectsConfiguration(rt)&&(this._useAltAsMultipleSelectionModifier=pt(l));let t={};if(e.affectsConfiguration(lt)&&void 0===this.horizontalScrolling){const e=l.getValue(lt);t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(gt)){const e=l.getValue(gt);t=Object.assign(Object.assign({},t),{smoothScrolling:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new yt(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=Object(C.b)(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),super.dispose()}};bt=Ue([Ke(5,f.b),Ke(6,$e),Ke(7,w.b),Ke(8,m.a),Ke(9,b.a)],bt);let vt=class extends d{constructor(e,t,i,n,s,r,a,l,h,c){const d=void 0!==s.horizontalScrolling?s.horizontalScrolling:h.getValue(lt),[u,g]=_t(s,h,c);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Object(C.d)(l.getColorTheme(),C.e)),u),{horizontalScrolling:d})),this.disposables=new o.b,this.disposables.add(g),this.contextKeyService=st(r,this),this.themeService=l,this.horizontalScrolling=s.horizontalScrolling,Ye.bindTo(this.contextKeyService).set(!(!1===s.multipleSelectionSupport)),et.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this._useAltAsMultipleSelectionModifier=pt(h),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),s.overrideStyles&&this.updateStyles(s.overrideStyles),s.overrideStyles&&this.disposables.add(Object(C.b)(this,l,s.overrideStyles)),this.disposables.add(h.onDidChangeConfiguration((e=>{e.affectsConfiguration(rt)&&(this._useAltAsMultipleSelectionModifier=pt(h));let t={};if(e.affectsConfiguration(lt)&&void 0===this.horizontalScrolling){const e=h.getValue(lt);t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(gt)){const e=h.getValue(gt);t=Object.assign(Object.assign({},t),{smoothScrolling:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new yt(this,Object.assign({configurationService:h},s)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=Object(C.b)(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),this.disposables.dispose(),super.dispose()}};vt=Ue([Ke(5,f.b),Ke(6,$e),Ke(7,w.b),Ke(8,m.a),Ke(9,b.a)],vt);let Ct=class extends ze{constructor(e,t,i,n,s,r,a,l,h,c,d){const u=void 0!==r.horizontalScrolling?r.horizontalScrolling:c.getValue(lt),[g,m]=_t(r,c,d);super(e,t,i,n,s,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},Object(C.d)(h.getColorTheme(),C.e)),g),{horizontalScrolling:u})),this.disposables=new o.b,this.disposables.add(m),this.contextKeyService=st(a,this),this.themeService=h,Ye.bindTo(this.contextKeyService).set(!(!1===r.multipleSelectionSupport)),et.bindTo(this.contextKeyService).set(Boolean(r.selectionNavigation)),this.listHasSelectionOrFocus=Qe.bindTo(this.contextKeyService),this.listDoubleSelection=Xe.bindTo(this.contextKeyService),this.listMultiSelection=Je.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=pt(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),r.overrideStyles&&this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(c.onDidChangeConfiguration((e=>{e.affectsConfiguration(rt)&&(this._useAltAsMultipleSelectionModifier=pt(c));let t={};if(e.affectsConfiguration(lt)&&void 0===this.horizontalScrolling){const e=c.getValue(lt);t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(gt)){const e=c.getValue(gt);t=Object.assign(Object.assign({},t),{smoothScrolling:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new St(this,Object.assign({configurationService:c},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles)}updateStyles(e){var t;null===(t=this._styler)||void 0===t||t.dispose(),this._styler=Object(C.b)(this,this.themeService,e)}dispose(){var e;null===(e=this._styler)||void 0===e||e.dispose(),this.disposables.dispose(),super.dispose()}};Ct=Ue([Ke(6,f.b),Ke(7,$e),Ke(8,w.b),Ke(9,m.a),Ke(10,b.a)],Ct);class wt extends o.a{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new a.a),this.onDidOpen=this._onDidOpen.event,this._register(a.b.filter(this.widget.onDidChangeSelection,(e=>e.browserEvent instanceof KeyboardEvent))((e=>this.onSelectionFromKeyboard(e)))),this._register(this.widget.onPointer((e=>this.onPointer(e.element,e.browserEvent)))),this._register(this.widget.onMouseDblClick((e=>this.onMouseDblClick(e.element,e.browserEvent)))),"boolean"!=typeof(null==t?void 0:t.openOnSingleClick)&&(null==t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(at)),this._register(null==t?void 0:t.configurationService.onDidChangeConfiguration((()=>{this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(at))})))):this.openOnSingleClick=null===(i=null==t?void 0:t.openOnSingleClick)||void 0===i||i}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t=e.browserEvent,i="boolean"!=typeof t.preserveFocus||t.preserveFocus,n="boolean"==typeof t.pinned?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;if(2===t.detail)return;const i=1===t.button,n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,i,n,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,n,t)}_open(e,t,i,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}}class yt extends wt{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class St extends wt{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class xt extends wt{constructor(e,t){super(e,t)}getSelectedElement(){var e;return null!==(e=this.widget.getSelection()[0])&&void 0!==e?e:void 0}}function Lt(e,t){let i=!1;return n=>{if(i)return i=!1,!1;const o=t.softDispatch(n,e);return o&&o.enterChord?(i=!0,!1):(i=!1,!0)}}let kt=class extends be{constructor(e,t,i,n,o,s,r,a,l,h,c){const{options:d,getAutomaticKeyboardNavigation:u,disposable:g}=It(t,o,s,l,h,c);super(e,t,i,n,d),this.disposables.add(g),this.internals=new Tt(this,o,u,o.overrideStyles,s,r,a,l,c),this.disposables.add(this.internals)}};kt=Ue([Ke(5,f.b),Ke(6,$e),Ke(7,w.b),Ke(8,m.a),Ke(9,b.a),Ke(10,Be.b)],kt);let Dt=class extends Ce{constructor(e,t,i,n,o,s,r,a,l,h,c){const{options:d,getAutomaticKeyboardNavigation:u,disposable:g}=It(t,o,s,l,h,c);super(e,t,i,n,d),this.disposables.add(g),this.internals=new Tt(this,o,u,o.overrideStyles,s,r,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}};Dt=Ue([Ke(5,f.b),Ke(6,$e),Ke(7,w.b),Ke(8,m.a),Ke(9,b.a),Ke(10,Be.b)],Dt);let Nt=class extends We{constructor(e,t,i,n,o,s,r,a,l,h,c,d){const{options:u,getAutomaticKeyboardNavigation:g,disposable:m}=It(t,s,r,h,c,d);super(e,t,i,n,o,u),this.disposables.add(m),this.internals=new Tt(this,s,g,s.overrideStyles,r,a,l,h,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}};Nt=Ue([Ke(6,f.b),Ke(7,$e),Ke(8,w.b),Ke(9,m.a),Ke(10,b.a),Ke(11,Be.b)],Nt);let Et=class extends Ae{constructor(e,t,i,n,o,s,r,a,l,h,c,d){const{options:u,getAutomaticKeyboardNavigation:g,disposable:m}=It(t,s,r,h,c,d);super(e,t,i,n,o,u),this.disposables.add(m),this.internals=new Tt(this,s,g,s.overrideStyles,r,a,l,h,d),this.disposables.add(this.internals)}get onDidOpen(){return this.internals.onDidOpen}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}};Et=Ue([Ke(6,f.b),Ke(7,$e),Ke(8,w.b),Ke(9,m.a),Ke(10,b.a),Ke(11,Be.b)],Et);let Ot=class extends Fe{constructor(e,t,i,n,o,s,r,a,l,h,c,d,u){const{options:g,getAutomaticKeyboardNavigation:m,disposable:p}=It(t,r,a,c,d,u);super(e,t,i,n,o,s,g),this.disposables.add(p),this.internals=new Tt(this,r,m,r.overrideStyles,a,l,h,c,u),this.disposables.add(this.internals)}};function It(e,t,i,n,o,s){var r;tt.bindTo(i),ot||(nt.bindTo(i),ot=!0);const a=()=>{let e=i.getContextKeyValue(it);return e&&(e=n.getValue(ct)),e},l=s.isScreenReaderOptimized(),h=t.simpleKeyboardNavigation||l?"simple":n.getValue(ht),c=void 0!==t.horizontalScrolling?t.horizontalScrolling:n.getValue(lt),[d,u]=_t(t,n,o),g=t.additionalScrollHeight;return{getAutomaticKeyboardNavigation:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},d),{indent:n.getValue(dt),renderIndentGuides:n.getValue(ut),smoothScrolling:n.getValue(gt),automaticKeyboardNavigation:a(),simpleKeyboardNavigation:"simple"===h,filterOnType:"filter"===h,horizontalScrolling:c,keyboardNavigationEventFilter:Lt(e,o),additionalScrollHeight:g,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:null!==(r=t.expandOnlyOnTwistieClick)&&void 0!==r?r:"doubleClick"===n.getValue(mt)})}}Ot=Ue([Ke(7,f.b),Ke(8,$e),Ke(9,w.b),Ke(10,m.a),Ke(11,b.a),Ke(12,Be.b)],Ot);let Tt=class{constructor(e,t,i,n,o,s,r,a,l){this.tree=e,this.themeService=r,this.disposables=[],this.contextKeyService=st(o,e),Ye.bindTo(this.contextKeyService).set(!(!1===t.multipleSelectionSupport)),et.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.hasSelectionOrFocus=Qe.bindTo(this.contextKeyService),this.hasDoubleSelection=Xe.bindTo(this.contextKeyService),this.hasMultiSelection=Je.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=pt(a);const h=new Set;h.add(it);const c=()=>{const t=l.isScreenReaderOptimized()?"simple":a.getValue(ht);e.updateOptions({simpleKeyboardNavigation:"simple"===t,filterOnType:"filter"===t})};this.updateStyleOverrides(n),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection((()=>{const t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)}))})),e.onDidChangeFocus((()=>{const t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0)})),a.onDidChangeConfiguration((n=>{let o={};if(n.affectsConfiguration(rt)&&(this._useAltAsMultipleSelectionModifier=pt(a)),n.affectsConfiguration(dt)){const e=a.getValue(dt);o=Object.assign(Object.assign({},o),{indent:e})}if(n.affectsConfiguration(ut)){const e=a.getValue(ut);o=Object.assign(Object.assign({},o),{renderIndentGuides:e})}if(n.affectsConfiguration(gt)){const e=a.getValue(gt);o=Object.assign(Object.assign({},o),{smoothScrolling:e})}if(n.affectsConfiguration(ht)&&c(),n.affectsConfiguration(ct)&&(o=Object.assign(Object.assign({},o),{automaticKeyboardNavigation:i()})),n.affectsConfiguration(lt)&&void 0===t.horizontalScrolling){const e=a.getValue(lt);o=Object.assign(Object.assign({},o),{horizontalScrolling:e})}n.affectsConfiguration(mt)&&void 0===t.expandOnlyOnTwistieClick&&(o=Object.assign(Object.assign({},o),{expandOnlyOnTwistieClick:"doubleClick"===a.getValue(mt)})),Object.keys(o).length>0&&e.updateOptions(o)})),this.contextKeyService.onDidChangeContext((t=>{t.affectsSome(h)&&e.updateOptions({automaticKeyboardNavigation:i()})})),l.onDidChangeScreenReaderOptimized((()=>c()))),this.navigator=new xt(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}get onDidOpen(){return this.navigator.onDidOpen}updateStyleOverrides(e){Object(o.f)(this.styler),this.styler=e?Object(C.b)(this.tree,this.themeService,e):o.a.None}dispose(){this.disposables=Object(o.f)(this.disposables),Object(o.f)(this.styler),this.styler=void 0}};Tt=Ue([Ke(4,f.b),Ke(5,$e),Ke(6,w.b),Ke(7,m.a),Ke(8,Be.b)],Tt),v.a.as(p.a.Configuration).registerConfiguration({id:"workbench",order:7,title:Object(g.a)("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[rt]:{type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[Object(g.a)("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),Object(g.a)("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:Object(g.a)({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[at]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:Object(g.a)({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[lt]:{type:"boolean",default:!1,description:Object(g.a)("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[dt]:{type:"number",default:8,minimum:0,maximum:40,description:Object(g.a)("tree indent setting","Controls tree indentation in pixels.")},[ut]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:Object(g.a)("render tree indent guides","Controls whether the tree should render indent guides.")},[gt]:{type:"boolean",default:!1,description:Object(g.a)("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[ht]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[Object(g.a)("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),Object(g.a)("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),Object(g.a)("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:Object(g.a)("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.")},[ct]:{type:"boolean",default:!0,markdownDescription:Object(g.a)("automatic keyboard navigation setting","Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to `false`, keyboard navigation is only triggered when executing the `list.toggleKeyboardNavigation` command, for which you can assign a keyboard shortcut.")},[mt]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:Object(g.a)("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")}}})},function(e,t,i){"use strict";i.d(t,"a",(function(){return l})),i.d(t,"b",(function(){return _})),i.d(t,"c",(function(){return b}));var n=i(0),o=i(5),s=i(51),r=i(14),a=i(156);const l={Configuration:"base.contributions.configuration"},h={properties:{},patternProperties:{}},c={properties:{},patternProperties:{}},d={properties:{},patternProperties:{}},u={properties:{},patternProperties:{}},g={properties:{},patternProperties:{}},m={properties:{},patternProperties:{}},p="vscode://schemas/settings/resourceLanguage",f=s.a.as(a.a.JSONContribution),_=new RegExp("\\[.*\\]$");function b(e){return e.substring(1,e.length-1)}const v=new class{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new o.a,this._onDidUpdateConfiguration=new o.a,this.defaultValues={},this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:n.a("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!1,errorMessage:"Unknown editor configuration setting",allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.excludedConfigurationProperties={},f.registerSchema(p,this.resourceLanguageSettingsSchema)}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=[];e.forEach((e=>{i.push(...this.validateAndRegisterProperties(e,t,e.extensionInfo)),this.configurationContributors.push(e),this.registerJSONConfiguration(e)})),f.registerSchema(p,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire(i)}registerOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}validateAndRegisterProperties(e,t=!0,i,n=3){var o;n=r.l(e.scope)?n:e.scope;let s=[],a=e.properties;if(a)for(let e in a){if(t&&C(e)){delete a[e];continue}const l=a[e];this.updatePropertyDefaultValue(e,l),_.test(e)?l.scope=void 0:(l.scope=r.l(l.scope)?n:l.scope,l.restricted=r.l(l.restricted)?!!(null===(o=null==i?void 0:i.restrictedConfigurations)||void 0===o?void 0:o.includes(e)):l.restricted),!a[e].hasOwnProperty("included")||a[e].included?(this.configurationProperties[e]=a[e],!a[e].deprecationMessage&&a[e].markdownDeprecationMessage&&(a[e].deprecationMessage=a[e].markdownDeprecationMessage),s.push(e)):(this.excludedConfigurationProperties[e]=a[e],delete a[e])}let l=e.allOf;if(l)for(let e of l)s.push(...this.validateAndRegisterProperties(e,t,i,n));return s}getConfigurationProperties(){return this.configurationProperties}registerJSONConfiguration(e){const t=e=>{let i=e.properties;if(i)for(const e in i)this.updateSchema(e,i[e]);let n=e.allOf;n&&n.forEach(t)};t(e)}updateSchema(e,t){switch(h.properties[e]=t,t.scope){case 1:c.properties[e]=t;break;case 2:d.properties[e]=t;break;case 6:u.properties[e]=t;break;case 3:g.properties[e]=t;break;case 4:m.properties[e]=t;break;case 5:m.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:n.a("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:n.a("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:p};this.updatePropertyDefaultValue(t,i),h.properties[t]=i,c.properties[t]=i,d.properties[t]=i,u.properties[t]=i,g.properties[t]=i,m.properties[t]=i}this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.defaultValues[e];r.k(i)&&(i=t.default),r.k(i)&&(i=function(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}(t.type)),t.default=i}};function C(e){return e.trim()?_.test(e)?n.a("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==v.getConfigurationProperties()[e]?n.a("config.property.duplicate","Cannot register '{0}'. This property is already registered.",e):null:n.a("config.property.empty","Cannot register an empty property")}s.a.add(l.Configuration,v)},function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o})),i.d(t,"c",(function(){return s})),i.d(t,"d",(function(){return a}));const n="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",o=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of n)e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}();function s(e){let t=o;if(e&&e instanceof RegExp)if(e.global)t=e;else{let i="g";e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.unicode&&(i+="u"),t=new RegExp(e.source,i)}return t.lastIndex=0,t}const r={maxLen:1e3,windowSize:15,timeBudget:150};function a(e,t,i,n,o=r){if(i.length>o.maxLen){let s=e-o.maxLen/2;return s<0?s=0:n+=s,a(e,t,i=i.substring(s,e+o.maxLen/2),n,o)}const s=Date.now(),h=e-1-n;let c=-1,d=null;for(let e=1;!(Date.now()-s>=o.timeBudget);e++){const n=h-o.windowSize*e;t.lastIndex=Math.max(0,n);const s=l(t,i,h,c);if(!s&&d)break;if(d=s,n<=0)break;c=n}if(d){let e={word:d[0],startColumn:n+1+d.index,endColumn:n+1+d.index+d[0].length};return t.lastIndex=0,e}return null}function l(e,t,i,n){let o;for(;o=e.exec(t);){const t=o.index||0;if(t<=i&&e.lastIndex>=i)return o;if(n>0&&t>n)return null}return null}},function(e,t,i){"use strict";i.d(t,"b",(function(){return u})),i.d(t,"a",(function(){return g})),i(188);var n=i(13),o=i(0),s=i(2),r=i(48),a=i(14),l=i(47),h=i(101),c=i(30),d=i(1);class u extends s.a{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof r.a&&this._register(t.onDidChange((e=>{this.element&&this.handleActionChangeEvent(e)})))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new r.b)),this._actionRunner}set actionRunner(e){this._actionRunner=e}getAction(){return this._action}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(l.b.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,c.g&&this._register(Object(d.i)(e,d.d.DRAG_START,(e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(h.a.TEXT,this._action.label)})))),this._register(Object(d.i)(t,l.a.Tap,(e=>this.onClick(e)))),this._register(Object(d.i)(t,d.d.MOUSE_DOWN,(e=>{i||d.c.stop(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")}))),n.f&&this._register(Object(d.i)(t,d.d.CONTEXT_MENU,(e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)}))),this._register(Object(d.i)(t,d.d.CLICK,(e=>{d.c.stop(e,!0),this.options&&this.options.isMenu||n.k((()=>this.onClick(e)))}))),this._register(Object(d.i)(t,d.d.DBLCLICK,(e=>{d.c.stop(e,!0)}))),[d.d.MOUSE_UP,d.d.MOUSE_OUT].forEach((e=>{this._register(Object(d.i)(t,e,(e=>{d.c.stop(e),t.classList.remove("active")})))}))}onClick(e){var t;d.c.stop(e,!0);const i=a.l(this._context)?(null===(t=this.options)||void 0===t?void 0:t.useEventAsContext)?e:void 0:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}updateTooltip(){}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),super.dispose()}}class g extends u{constructor(e,t,i={}){super(e,t,i),this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=Object(d.q)(this.element,Object(d.a)("a.action-label"))),this.label&&(this._action.id===r.d.ID?this.label.setAttribute("role","presentation"):this.options.isMenu?this.label.setAttribute("role","menuitem"):this.label.setAttribute("role","button")),this.options.label&&this.options.keybinding&&this.element&&(Object(d.q)(this.element,Object(d.a)("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.getAction().label)}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=o.a({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&this.label&&(this.label.title=e)}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getAction().class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label&&this.label.classList.remove("codicon")}updateEnabled(){this.getAction().enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element&&this.element.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element&&this.element.classList.add("disabled"))}updateChecked(){this.label&&(this.getAction().checked?this.label.classList.add("checked"):this.label.classList.remove("checked"))}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(118);function o(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===n.a.ICodeEditor}},function(e,t,i){e.exports=i(33)(8)},function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return a}));var n=i(13);let o;if(void 0!==n.b.vscode&&void 0!==n.b.vscode.process){const e=n.b.vscode.process;o={get platform(){return e.platform},get env(){return e.env},cwd:()=>e.cwd(),nextTick:e=>Object(n.k)(e)}}else o=void 0!==e?{get platform(){return e.platform},get env(){return e.env},cwd:()=>e.env.VSCODE_CWD||e.cwd(),nextTick:t=>e.nextTick(t)}:{get platform(){return n.j?"win32":n.f?"darwin":"linux"},nextTick:e=>Object(n.k)(e),get env(){return Object.create(null)},cwd:()=>"/"};const s=o.cwd,r=o.env,a=o.platform}).call(this,i(186))},function(e,t,i){"use strict";function n(e){return e&&"string"==typeof e.id}i.d(t,"b",(function(){return n})),i.d(t,"a",(function(){return o}));const o={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(15);const o=Object(n.c)("telemetryService")},function(e,t,i){"use strict";i.d(t,"a",(function(){return l})),i.d(t,"c",(function(){return h})),i.d(t,"b",(function(){return c}));var n=i(0),o=i(5),s=i(11),r=i(32),a=i(51);const l=new class{constructor(){this._onDidChangeLanguages=new o.a,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[],this._dynamicLanguages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],folding:{offSide:!0}},0)},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));const n="monaco-mouse-cursor-text"},function(e,t,i){"use strict";var n=i(221).default;i(226),(t=e.exports=n).default=t},function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),i.d(t,"b",(function(){return a}));var n=i(6);class o{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length;if(i!==t.length)return!1;for(let n=0;n=s||(a[l++]=new o(Math.max(1,t.startColumn-n+1),Math.min(r+1,t.endColumn-n+1),t.className,t.type));return a}static filter(e,t,i,n){if(0===e.length)return[];let s=[],r=0;for(let a=0,l=e.length;at)continue;if(h.isEmpty()&&(0===l.type||3===l.type))continue;const c=h.startLineNumber===t?h.startColumn:i,d=h.endLineNumber===t?h.endColumn:n;s[r++]=new o(c,d,l.inlineClassName,l.type)}return s}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn===t.startColumn){if(e.endColumn===t.endColumn){const i=o._typeCompare(e.type,t.type);return 0===i?e.classNamet.className?1:0:i}return e.endColumn-t.endColumn}return e.startColumn-t.startColumn}}class s{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class r{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,n=e.length;i0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class a{static normalize(e,t){if(0===t.length)return[];let i=[];const o=new r;let s=0;for(let r=0,a=t.length;r1){const t=e.charCodeAt(l-2);n.D(t)&&l--}if(h>1){const t=e.charCodeAt(h-2);n.D(t)&&h--}const u=l-1,g=h-2;s=o.consumeLowerThan(u,s,i),0===o.count&&(s=u),o.insert(g,c,d)}return o.consumeLowerThan(1073741824,s,i),i}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return s}));const n="esql",o="esqlTheme",s=".esql"},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(15);const o=Object(n.c)("clipboardService")},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(15);const o=Object(n.c)("labelService")},function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i(1),o=i(19);const s=new RegExp(`(\\\\)?\\$\\((${o.a.iconNameExpression}(?:${o.a.iconModifierExpression})?)\\)`,"g");function r(e){const t=new Array;let i,n=0,o=0;for(;null!==(i=s.exec(e));){o=i.index||0,t.push(e.substring(n,o)),n=(i.index||0)+i[0].length;const[,s,r]=i;t.push(s?`$(${r})`:a({id:r}))}return nthis.onDidChangeItemsExternal(e))))}onDidChangeItemsExternal(e){var t,i;null===(t=e.changed)||void 0===t||t.forEach(((e,t)=>this.accept(t,e))),null===(i=e.deleted)||void 0===i||i.forEach((e=>this.accept(e,void 0)))}accept(e,t){if(this.state===n.Closed)return;let i=!1;Object(a.l)(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire(e)}get(e,t){const i=this.cache.get(e);return Object(a.l)(i)?t:i}getBoolean(e,t){const i=this.get(e);return Object(a.l)(i)?t:"true"===i}getNumber(e,t){const i=this.get(e);return Object(a.l)(i)?t:parseInt(i,10)}set(e,t){return h(this,void 0,void 0,(function*(){if(this.state===n.Closed)return;if(Object(a.l)(t))return this.delete(e);const i=String(t);return this.cache.get(e)!==i?(this.cache.set(e,i),this.pendingInserts.set(e,i),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire(e),this.flushDelayer.trigger((()=>this.flushPending()))):void 0}))}delete(e){return h(this,void 0,void 0,(function*(){if(this.state!==n.Closed)return this.cache.delete(e)?(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire(e),this.flushDelayer.trigger((()=>this.flushPending()))):void 0}))}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return h(this,void 0,void 0,(function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally((()=>{var e;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)null===(e=this.whenFlushedCallbacks.pop())||void 0===e||e()}))}))}dispose(){this.flushDelayer.cancel(),this.flushDelayer.dispose(),super.dispose()}}c.DEFAULT_FLUSH_DELAY=100;class d{constructor(){this.onDidChangeItemsExternal=s.b.None,this.items=new Map}updateItems(e){return h(this,void 0,void 0,(function*(){e.insert&&e.insert.forEach(((e,t)=>this.items.set(t,e))),e.delete&&e.delete.forEach((e=>this.items.delete(e)))}))}}const u="__$__targetStorageMarker",g=Object(o.c)("storageService");var m;!function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(m||(m={}));class p extends r.a{constructor(e={flushInterval:p.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new s.d),this._onDidChangeTarget=this._register(new s.d),this._onWillSaveState=this._register(new s.a),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._globalKeyTargets=void 0}emitDidChangeValue(e,t){t===u?(0===e?this._globalKeyTargets=void 0:1===e&&(this._workspaceKeyTargets=void 0),this._onDidChangeTarget.fire({scope:e})):this._onDidChangeValue.fire({scope:e,key:t,target:this.getKeyTargets(e)[t]})}get(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.get(e,i)}getBoolean(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getBoolean(e,i)}getNumber(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getNumber(e,i)}store(e,t,i,n){Object(a.l)(t)?this.remove(e,i):this.withPausedEmitters((()=>{var o;this.updateKeyTarget(e,i,n),null===(o=this.getStorage(i))||void 0===o||o.set(e,t)}))}remove(e,t){this.withPausedEmitters((()=>{var i;this.updateKeyTarget(e,t,void 0),null===(i=this.getStorage(t))||void 0===i||i.delete(e)}))}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i){var n,o;const s=this.getKeyTargets(t);"number"==typeof i?s[e]!==i&&(s[e]=i,null===(n=this.getStorage(t))||void 0===n||n.set(u,JSON.stringify(s))):"number"==typeof s[e]&&(delete s[e],null===(o=this.getStorage(t))||void 0===o||o.set(u,JSON.stringify(s)))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get globalKeyTargets(){return this._globalKeyTargets||(this._globalKeyTargets=this.loadKeyTargets(0)),this._globalKeyTargets}getKeyTargets(e){return 0===e?this.globalKeyTargets:this.workspaceKeyTargets}loadKeyTargets(e){const t=this.get(u,e);if(t)try{return JSON.parse(t)}catch(e){}return Object.create(null)}}p.DEFAULT_FLUSH_INTERVAL=6e4;class f extends p{constructor(){super(),this.globalStorage=new c(new d),this.workspaceStorage=new c(new d),this._register(this.workspaceStorage.onDidChangeStorage((e=>this.emitDidChangeValue(1,e)))),this._register(this.globalStorage.onDidChangeStorage((e=>this.emitDidChangeValue(0,e))))}getStorage(e){return 0===e?this.globalStorage:this.workspaceStorage}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return h}));var n=i(6),o=i(16),s=i(152),r=i(87),a=i(10),l=i(3);class h{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){let n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;for(let o=i.column-2;o>=0;o--){let i=e.charCodeAt(o),s=t.get(i);if(0===s){if(2===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=1}else if(2===s){if(1===n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1));n=2}else if(1===s&&0!==n)return this._createWord(e,n,s,o+1,this._findEndOfWord(e,t,n,o+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){let o=e.length;for(let s=n;s=0;o--){let n=e.charCodeAt(o),s=t.get(n);if(1===s)return o+1;if(1===i&&2===s)return o+1;if(2===i&&0===s)return o+1}return 0}static moveWordLeft(e,t,i,n){let o=i.lineNumber,s=i.column;1===s&&o>1&&(o-=1,s=t.getLineMaxColumn(o));let r=h._findPreviousWordOnLine(e,t,new a.a(o,s));if(0===n)return new a.a(o,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start==1&&0===r.nextCharClass&&(r=h._findPreviousWordOnLine(e,t,new a.a(o,r.start+1))),new a.a(o,r?r.start+1:1);if(3===n){for(;r&&2===r.wordType;)r=h._findPreviousWordOnLine(e,t,new a.a(o,r.start+1));return new a.a(o,r?r.start+1:1)}return r&&s<=r.end+1&&(r=h._findPreviousWordOnLine(e,t,new a.a(o,r.start+1))),new a.a(o,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,o=e.getLineMaxColumn(i);if(1===t.column)return i>1?new a.a(i-1,e.getLineMaxColumn(i-1)):t;const s=e.getLineContent(i);for(let e=t.column-1;e>1;e--){const t=s.charCodeAt(e-2),r=s.charCodeAt(e-1);if(95===t&&95!==r)return new a.a(i,e);if(n.F(t)&&n.G(r))return new a.a(i,e);if(n.G(t)&&n.G(r)&&e+1=l.start+1&&(l=h._findNextWordOnLine(e,t,new a.a(o,l.end+1))),s=l?l.start+1:t.getLineMaxColumn(o);return new a.a(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,o=e.getLineMaxColumn(i);if(t.column===o)return i1?u=1:(d--,u=n.getLineMaxColumn(d)):(g&&u<=g.end+1&&(g=h._findPreviousWordOnLine(i,n,new a.a(d,g.start+1))),g?u=g.end+1:u>1?u=1:(d--,u=n.getLineMaxColumn(d))),new l.a(d,u,c.lineNumber,c.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new a.a(i.positionLineNumber,i.positionColumn);return this._deleteInsideWordWhitespace(t,n)||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return 32===i||9===i}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let s=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,s))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;s+11?new l.a(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumbere.start+1<=i.column&&i.column<=e.end+1,r=(e,t)=>(e=Math.min(e,i.column),t=Math.max(t,i.column),new l.a(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,s=!1;for(;i-11&&this._charAtIsWhitespace(n,t-2);)t--;return r(t,i)},c=h._findPreviousWordOnLine(e,t,i);if(c&&s(c))return a(c);const d=h._findNextWordOnLine(e,t,i);return d&&s(d)?a(d):c&&d?r(c.end+1,d.start+1):c?r(c.start+1,c.end+1):d?r(d.start+1,d.end+1):r(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=h._moveWordPartLeft(e,i);return new l.a(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let n=t;n=m.start+1&&(m=h._findNextWordOnLine(i,n,new a.a(c,m.end+1))),m?d=m.start+1:d=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},se=function(e,t){return function(i,n){t(i,n,e)}},re=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let ae=class{constructor(e){this._commandService=e}open(e,t){return re(this,void 0,void 0,(function*(){if(!Object(ne.c)(e,ee.c.command))return!1;if(!(null==t?void 0:t.allowCommands))return!0;"string"==typeof e&&(e=V.a.parse(e));let i=[];try{i=Object(J.a)(decodeURIComponent(e.query))}catch(t){try{i=Object(J.a)(e.query)}catch(e){}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0}))}};ae=oe([se(0,ie.b)],ae);let le=class{constructor(e){this._editorService=e}open(e,t){return re(this,void 0,void 0,(function*(){let i;"string"==typeof e&&(e=V.a.parse(e));const n=/^L?(\d+)(?:,(\d+))?/.exec(e.fragment);return n&&(i={startLineNumber:parseInt(n[1]),startColumn:n[2]?parseInt(n[2]):1},e=e.with({fragment:""})),e.scheme===ee.c.file&&(e=Object(te.g)(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,context:(null==t?void 0:t.fromUserGesture)?G.USER:G.API},null==t?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),null==t?void 0:t.openToSide),!0}))}};le=oe([se(0,Y.a)],le);let he=class{constructor(e,t){this._openers=new Q.a,this._validators=new Q.a,this._resolvers=new Q.a,this._resolvedUriTargets=new X.b((e=>e.with({path:null,fragment:null,query:null}).toString())),this._externalOpeners=new Q.a,this._defaultExternalOpener={openExternal:e=>re(this,void 0,void 0,(function*(){return Object(ne.c)(e,ee.c.http)||Object(ne.c)(e,ee.c.https)?Z.X(e):window.location.href=e,!0}))},this._openers.push({open:(e,t)=>re(this,void 0,void 0,(function*(){return!!((null==t?void 0:t.openExternal)||Object(ne.c)(e,ee.c.mailto)||Object(ne.c)(e,ee.c.http)||Object(ne.c)(e,ee.c.https))&&(yield this._doOpenExternal(e,t),!0)}))}),this._openers.push(new ae(t)),this._openers.push(new le(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}registerValidator(e){return{dispose:this._validators.push(e)}}registerExternalUriResolver(e){return{dispose:this._resolvers.push(e)}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){return{dispose:this._externalOpeners.push(e)}}open(e,t){var i;return re(this,void 0,void 0,(function*(){const n="string"==typeof e?V.a.parse(e):e,o=null!==(i=this._resolvedUriTargets.get(n))&&void 0!==i?i:e;for(const e of this._validators)if(!(yield e.shouldOpen(o)))return!1;for(const i of this._openers)if(yield i.open(e,t))return!0;return!1}))}resolveExternalUri(e,t){return re(this,void 0,void 0,(function*(){for(const i of this._resolvers){const n=yield i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}return{resolved:e,dispose:()=>{}}}))}_doOpenExternal(e,t){return re(this,void 0,void 0,(function*(){const i="string"==typeof e?V.a.parse(e):e,{resolved:n}=yield this.resolveExternalUri(i,t);let o;if(o="string"==typeof e&&i.toString()===n.toString()?e:encodeURI(n.toString(!0)),null==t?void 0:t.allowContributedOpeners){const e="string"==typeof(null==t?void 0:t.allowContributedOpeners)?null==t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners)if(yield t.openExternal(o,{sourceUri:i,preferredOpenerId:e},W.a.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},W.a.None)}))}dispose(){this._validators.clear()}};he=oe([se(0,Y.a),se(1,ie.b)],he);var ce=i(162),de=i(2),ue=i(36);const ge={followsCaret:!0,ignoreCharChanges:!0,alwaysRevealFirst:!0};class me extends de.a{constructor(e,t={}){super(),this._onDidUpdate=this._register(new B.a),this._editor=e,this._options=ue.f(t,ge,!1),this.disposed=!1,this.nextIdx=-1,this.ranges=[],this.ignoreSelectionChange=!1,this.revealFirst=Boolean(this._options.alwaysRevealFirst),this._register(this._editor.onDidDispose((()=>this.dispose()))),this._register(this._editor.onDidUpdateDiff((()=>this._onDiffUpdated()))),this._options.followsCaret&&this._register(this._editor.getModifiedEditor().onDidChangeCursorPosition((e=>{this.ignoreSelectionChange||(this.nextIdx=-1)}))),this._options.alwaysRevealFirst&&this._register(this._editor.getModifiedEditor().onDidChangeModel((e=>{this.revealFirst=!0}))),this._init()}_init(){this._editor.getLineChanges()}_onDiffUpdated(){this._init(),this._compute(this._editor.getLineChanges()),this.revealFirst&&null!==this._editor.getLineChanges()&&(this.revealFirst=!1,this.nextIdx=-1,this.next(1))}_compute(e){this.ranges=[],e&&e.forEach((e=>{!this._options.ignoreCharChanges&&e.charChanges?e.charChanges.forEach((e=>{this.ranges.push({rhs:!0,range:new z.a(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)})})):this.ranges.push({rhs:!0,range:new z.a(e.modifiedStartLineNumber,1,e.modifiedStartLineNumber,1)})})),this.ranges.sort(((e,t)=>e.range.getStartPosition().isBeforeOrEqual(t.range.getStartPosition())?-1:t.range.getStartPosition().isBeforeOrEqual(e.range.getStartPosition())?1:0)),this._onDidUpdate.fire(this)}_initIdx(e){let t=!1,i=this._editor.getPosition();if(i){for(let n=0,o=this.ranges.length;n=this.ranges.length&&(this.nextIdx=0)):(this.nextIdx-=1,this.nextIdx<0&&(this.nextIdx=this.ranges.length-1));let i=this.ranges[this.nextIdx];this.ignoreSelectionChange=!0;try{let e=i.range.getStartPosition();this._editor.setPosition(e),this._editor.revealPositionInCenter(e,t)}finally{this.ignoreSelectionChange=!1}}canNavigate(){return this.ranges&&this.ranges.length>0}next(e=0){this._move(!0,e)}previous(e=0){this._move(!1,e)}dispose(){super.dispose(),this.ranges=[],this.disposed=!0}}var pe=i(142),fe=i(118),_e=i(60),be=i(11),ve=i(79),Ce=i(93),we=i(75),ye=i(91),Se=i(21),xe=i(149),Le=i(184),ke=i(32),De=i(161),Ne=i(13),Ee=i(6);function Oe(e,t,i,n){return new De.a(e,t,i).ComputeDiff(n)}class Ie{constructor(e){const t=[],i=[];for(let n=0,o=e.length;n0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const s=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);let l=Oe(s,a,o,!0).changes;r&&(l=function(e){if(e.length<=1)return e;const t=[e[0]];let i=t[0];for(let n=1,o=e.length;n1&&r>1&&e.charCodeAt(i-2)===t.charCodeAt(r-2);)i--,r--;(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,i,s+1,1,r)}{let i=Fe(e,1),r=Fe(t,1);const a=e.length+1,l=t.length+1;for(;i!0;const t=Date.now();return()=>Date.now()-tt&&(t=s),o>i&&(i=o),r>i&&(i=r)}t++,i++;let n=new ze(i,t,0);for(let t=0,i=e.length;t=this._maxCharCode?0:this._states.get(e,t)}}let Ke=null,$e=null;class qe{static _createLink(e,t,i,n,o){let s=o-1;do{const i=t.charCodeAt(s);if(2!==e.get(i))break;s--}while(s>n);if(n>0){const e=t.charCodeAt(n-1),i=t.charCodeAt(s);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&s--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:s+2},url:t.substring(n,s+1)}}static computeLinks(e,t=function(){return null===Ke&&(Ke=new Ue([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),Ke}()){const i=function(){if(null===$e){$e=new He.a(0);const e=" \t<>'\"、。。、,.:;‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…";for(let t=0;t=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}Ge.INSTANCE=new Ge;var Ye=i(14),Ze=i(105),Qe=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Xe extends je{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){let i=Object(Ve.d)(e.column,Object(Ve.c)(t),this._lines[e.lineNumber-1],0);return i?new z.a(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let n=0,o="",s=0,r=[];return{*[Symbol.iterator](){for(;;)if(sthis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{let e=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>e&&(i=e,n=!0)}return n?{lineNumber:t,column:i}:e}}class Je{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){let e=[];return Object.keys(this._models).forEach((t=>e.push(this._models[t]))),e}acceptNewModel(e){this._models[e.url]=new Xe(V.a.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){this._models[e]&&this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeDiff(e,t,i,n){return Qe(this,void 0,void 0,(function*(){const o=this._getModel(e),s=this._getModel(t);if(!o||!s)return null;const r=o.getLinesContent(),a=s.getLinesContent(),l=new Re(r,a,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:n}).computeDiff(),h=!(l.changes.length>0)&&this._modelsAreIdentical(o,s);return{quitEarly:l.quitEarly,identical:h,changes:l.changes}}))}_modelsAreIdentical(e,t){const i=e.getLineCount();if(i!==t.getLineCount())return!1;for(let n=1;n<=i;n++)if(e.getLineContent(n)!==t.getLineContent(n))return!1;return!0}computeMoreMinimalEdits(e,t){return Qe(this,void 0,void 0,(function*(){const i=this._getModel(e);if(!i)return t;const n=[];let o;t=t.slice(0).sort(((e,t)=>e.range&&t.range?z.a.compareRangesUsingStarts(e.range,t.range):(e.range?0:1)-(t.range?0:1)));for(let{range:e,text:s,eol:r}of t){if("number"==typeof r&&(o=r),z.a.isEmpty(e)&&!s)continue;const t=i.getValueInRange(e);if(s=s.replace(/\r\n|\n|\r/g,i.eol),t===s)continue;if(Math.max(s.length,t.length)>Je._diffLimit){n.push({range:e,text:s});continue}const a=Object(De.b)(t,s,!1),l=i.offsetAt(z.a.lift(e).getStartPosition());for(const e of a){const t=i.positionAt(l+e.originalStart),o=i.positionAt(l+e.originalStart+e.originalLength),r={text:s.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:o.lineNumber,endColumn:o.column}};i.getValueInRange(r.range)!==r.text&&n.push(r)}}return"number"==typeof o&&n.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),n}))}computeLinks(e){return Qe(this,void 0,void 0,(function*(){let t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?qe.computeLinks(e):[]}(t):null}))}textualSuggest(e,t,i,n){return Qe(this,void 0,void 0,(function*(){const o=new Ze.a(!0),s=new RegExp(i,n),r=new Set;e:for(let i of e){const e=this._getModel(i);if(e)for(let i of e.words(s))if(i!==t&&isNaN(Number(i))&&(r.add(i),r.size>Je._suggestionsLimit))break e}return{words:Array.from(r),duration:o.elapsed()}}))}computeWordRanges(e,t,i,n){return Qe(this,void 0,void 0,(function*(){let o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(i,n),r=Object.create(null);for(let e=t.startLineNumber;ethis._host.fhr(e,t))),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(n,t),Promise.resolve(Ye.d(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e){return Promise.reject(e)}}}Je._diffLimit=1e5,Je._suggestionsLimit=1e4,"function"==typeof importScripts&&(Ne.b.monaco=q());var et=i(55),tt=i(15);const it=Object(tt.c)("textResourceConfigurationService"),nt=Object(tt.c)("textResourcePropertiesService");var ot=i(20),st=i(73),rt=i(18),at=function(e,t){return function(i,n){t(i,n,e)}},lt=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ht(e,t){let i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let ct=class extends de.a{constructor(e,t,i){super(),this._modelService=e,this._workerManager=this._register(new ut(this._modelService)),this._logService=i,this._register(be.s.register("*",{provideLinks:(e,t)=>ht(this._modelService,e.uri)?this._workerManager.withWorker().then((t=>t.computeLinks(e.uri))).then((e=>e&&{links:e})):Promise.resolve({links:[]})})),this._register(be.d.register("*",new dt(this._workerManager,t,this._modelService)))}dispose(){super.dispose()}canComputeDiff(e,t){return ht(this._modelService,e)&&ht(this._modelService,t)}computeDiff(e,t,i,n){return this._workerManager.withWorker().then((o=>o.computeDiff(e,t,i,n)))}computeMoreMinimalEdits(e,t){if(Object(ot.m)(t)){if(!ht(this._modelService,e))return Promise.resolve(t);const i=Ze.a.create(!0),n=this._workerManager.withWorker().then((i=>i.computeMoreMinimalEdits(e,t)));return n.finally((()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),i.elapsed()))),Promise.race([n,Object(Se.l)(1e3).then((()=>t))])}return Promise.resolve(void 0)}canNavigateValueSet(e){return ht(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then((n=>n.navigateValueSet(e,t,i)))}canComputeWordRanges(e){return ht(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then((i=>i.computeWordRanges(e,t)))}};ct=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([at(0,et.a),at(1,it),at(2,st.b)],ct);class dt{constructor(e,t,i){this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return lt(this,void 0,void 0,(function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const n=[];if("currentDocument"===i.wordBasedSuggestionsMode)ht(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())ht(this._modelService,t.uri)&&(t===e?n.unshift(t.uri):"allDocuments"!==i.wordBasedSuggestionsMode&&t.getLanguageIdentifier().id!==e.getLanguageIdentifier().id||n.push(t.uri));if(0===n.length)return;const o=ke.a.getWordDefinition(e.getLanguageIdentifier().id),s=e.getWordAtPosition(t),r=s?new z.a(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):z.a.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column),l=yield this._workerManager.withWorker(),h=yield l.textualSuggest(n,null==s?void 0:s.word,o);return h?{duration:h.duration,suggestions:h.words.map((e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}})))}:void 0}))}}class ut extends de.a{constructor(e){super(),this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime(),this._register(new Se.c).cancelAndSet((()=>this._checkStopIdleWorker()),Math.round(15e4)),this._register(this._modelService.onModelRemoved((e=>this._checkStopEmptyWorker())))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){this._editorWorkerClient&&0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){this._editorWorkerClient&&(new Date).getTime()-this._lastWorkerUsedTime>3e5&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new ft(this._modelService,!1,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)}}class gt extends de.a{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){let e=new Se.c;e.cancelAndSet((()=>this._checkStopModelSync()),Math.round(3e4)),this._register(e)}}dispose(){for(let e in this._syncedModels)Object(de.f)(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e){for(const t of e){let e=t.toString();this._syncedModels[e]||this._beginModelSync(t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){let e=(new Date).getTime(),t=[];for(let i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>6e4&&t.push(i);for(const e of t)this._stopModelSync(e)}_beginModelSync(e){let t=this._modelService.getModel(e);if(!t)return;if(t.isTooLargeForSyncing())return;let i=e.toString();this._proxy.acceptNewModel({url:t.uri.toString(),lines:t.getLinesContent(),EOL:t.getEOL(),versionId:t.getVersionId()});const n=new de.b;n.add(t.onDidChangeContent((e=>{this._proxy.acceptModelChanged(i.toString(),e)}))),n.add(t.onWillDispose((()=>{this._stopModelSync(i)}))),n.add(Object(de.h)((()=>{this._proxy.acceptRemovedModel(i)}))),this._syncedModels[i]=n}_stopModelSync(e){let t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Object(de.f)(t)}}class mt{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class pt{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class ft extends de.a{constructor(e,t,i){super(),this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new Le.a(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new xe.a(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new pt(this)))}catch(e){Object(xe.b)(e),this._worker=new mt(new Je(new pt(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,(e=>(Object(xe.b)(e),this._worker=new mt(new Je(new pt(this),null)),this._getOrCreateWorker().getProxyObject())))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new gt(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e){return this._disposed?Promise.reject(Object(rt.a)()):this._getProxy().then((t=>(this._getOrCreateModelManager(t).ensureSyncedResources(e),t)))}computeDiff(e,t,i,n){return this._withSyncedResources([e,t]).then((o=>o.computeDiff(e.toString(),t.toString(),i,n)))}computeMoreMinimalEdits(e,t){return this._withSyncedResources([e]).then((i=>i.computeMoreMinimalEdits(e.toString(),t)))}computeLinks(e){return this._withSyncedResources([e]).then((t=>t.computeLinks(e.toString())))}textualSuggest(e,t,i){return lt(this,void 0,void 0,(function*(){const n=yield this._withSyncedResources(e),o=i.source,s=Object(Ee.L)(i);return n.textualSuggest(e.map((e=>e.toString())),t,o,s)}))}computeWordRanges(e,t){return this._withSyncedResources([e]).then((i=>{let n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);let o=ke.a.getWordDefinition(n.getLanguageIdentifier().id),s=o.source,r=Object(Ee.L)(o);return i.computeWordRanges(e.toString(),t,s,r)}))}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then((n=>{let o=this._modelService.getModel(e);if(!o)return null;let s=ke.a.getWordDefinition(o.getLanguageIdentifier().id),r=s.source,a=Object(Ee.L)(s);return n.navigateValueSet(e.toString(),t,i,r,a)}))}dispose(){super.dispose(),this._disposed=!0}}class _t extends ft{constructor(e,t){super(e,t.keepIdleModels||!1,t.label),this._foreignModuleId=t.moduleId,this._foreignModuleCreateData=t.createData||null,this._foreignModuleHost=t.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||"function"!=typeof this._foreignModuleHost[e])return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(e){return Promise.reject(e)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then((e=>{const t=this._foreignModuleHost?Ye.d(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then((t=>{this._foreignModuleCreateData=null;const i=(t,i)=>e.fmr(t,i),n=(e,t)=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)};let o={};for(const e of t)o[e]=n(e,i);return o}))}))),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then((e=>this.getProxy()))}}var bt,vt=i(89),Ct=i(71),wt=i(44);function yt(e){return"string"==typeof e}function St(e){return!yt(e)}function xt(e){return!e}function Lt(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function kt(e){return e.replace(/[&<>'"_]/g,"-")}function Dt(e,t){return new Error(`${e.languageId}: ${t}`)}function Nt(e,t,i,n,o){let s=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,r,a,l,h,c,d,u,g){return xt(a)?xt(l)?!xt(h)&&h0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}class Ot{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new It(e,t);let i=It.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new It(e,t),this._entries[i]=n,n)}}Ot._INSTANCE=new Ot(5);class It{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return It._equals(this,e)}push(e){return Ot.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return Ot.create(this.parent,e)}}class Tt{constructor(e,t){this.modeId=e,this.state=t}equals(e){return this.modeId===e.modeId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new Tt(this.modeId,this.state)}}class Mt{constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}static create(e,t){return this._INSTANCE.create(e,t)}create(e,t){if(null!==t)return new At(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new At(e,t);let i=It.getStackElementId(e),n=this._entries[i];return n||(n=new At(e,null),this._entries[i]=n,n)}}Mt._INSTANCE=new Mt(5);class At{constructor(e,t){this.stack=e,this.embeddedModeData=t}clone(){return(this.embeddedModeData?this.embeddedModeData.clone():null)===this.embeddedModeData?this:Mt.create(this.stack,this.embeddedModeData)}equals(e){return e instanceof At&&!!this.stack.equals(e.stack)&&(null===this.embeddedModeData&&null===e.embeddedModeData||null!==this.embeddedModeData&&null!==e.embeddedModeData&&this.embeddedModeData.equals(e.embeddedModeData))}}class Rt{constructor(){this._tokens=[],this._language=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterMode(e,t){this._language=t}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._language||(this._lastTokenType=t,this._lastTokenLanguage=this._language,this._tokens.push(new K.a(e,t,this._language)))}nestedModeTokenize(e,t,i,n){const o=i.modeId,s=i.state,r=be.B.get(o);if(!r)return this.enterMode(n,o),this.emit(n,""),s;let a=r.tokenize(e,t,s,n);return this._tokens=this._tokens.concat(a.tokens),this._lastTokenType=null,this._lastTokenLanguage=null,this._language=null,a.endState}finalize(e){return new K.b(this._tokens,e)}}class Pt{constructor(e,t){this._modeService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterMode(e,t){this._currentLanguageId=this._modeService.getLanguageIdentifier(t).id}emit(e,t){let i=this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){let n=null!==e?e.length:0,o=t.length,s=null!==i?i.length:0;if(0===n&&0===o&&0===s)return new Uint32Array(0);if(0===n&&0===o)return i;if(0===o&&0===s)return e;let r=new Uint32Array(n+o+s);null!==e&&r.set(e);for(let e=0;e{if(o)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i{}))}}getInitialState(){let e=Ot.create(null,this._lexer.start);return Mt.create(e,null)}tokenize(e,t,i,n){let o=new Rt,s=this._tokenize(e,t,i,n,o);return o.finalize(s)}tokenize2(e,t,i,n){let o=new Pt(this._modeService,this._standaloneThemeService.getColorTheme().tokenTheme),s=this._tokenize(e,t,i,n,o);return o.finalize(s)}_tokenize(e,t,i,n,o){return i.embeddedModeData?this._nestedTokenize(e,t,i,n,o):this._myTokenize(e,t,i,n,o)}_findLeavingNestedModeOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=Et(this._lexer,t.stack.state),!i))throw Dt(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const t of i){if(!St(t.action)||"@pop"!==t.action.nextEmbedded)continue;o=!0;let i=t.regex,s=t.regex.source;if("^(?:"===s.substr(0,4)&&")"===s.substr(s.length-1,1)){let e=(i.ignoreCase?"i":"")+(i.unicode?"u":"");i=new RegExp(s.substr(4,s.length-5),e)}let r=e.search(i);-1===r||0!==r&&t.matchOnlyAtLineStart||(-1===n||r0&&o.nestedModeTokenize(r,!1,i.embeddedModeData,n);let a=e.substring(s);return this._myTokenize(a,t,i,n+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterMode(n,this._modeId);const s=e.length,r=t&&this._lexer.includeLF?e+"\n":e,a=r.length;let l=i.embeddedModeData,h=i.stack,c=0,d=null,u=!0;for(;u||c=a)break;u=!1;let e=this._lexer.tokenizer[_];if(!e&&(e=Et(this._lexer,_),!e))throw Dt(this._lexer,"tokenizer state is not defined: "+_);let t=r.substr(c);for(const i of e)if((0===c||!i.matchOnlyAtLineStart)&&(b=t.match(i.regex),b)){v=b[0],C=i.action;break}}if(b||(b=[""],v=""),C||(c=this._lexer.maxStack)throw Dt(this._lexer,"maximum tokenizer stack size reached: ["+h.state+","+h.parent.state+",...]");h=h.push(_)}else if("@pop"===C.next){if(h.depth<=1)throw Dt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(w));h=h.pop()}else if("@popall"===C.next)h=h.popall();else{let e=Nt(this._lexer,C.next,v,b,_);if("@"===e[0]&&(e=e.substr(1)),!Et(this._lexer,e))throw Dt(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(w));h=h.push(e)}}C.log&&"string"==typeof C.log&&(g=this._lexer,m=this._lexer.languageId+": "+Nt(this._lexer,C.log,v,b,_),console.log(`${g.languageId}: ${m}`))}if(null===S)throw Dt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(w));const x=i=>{let s=this._modeService.getModeIdForLanguageName(i);s&&(i=s);const r=this._getNestedEmbeddedModeData(i);if(c0)throw Dt(this._lexer,"groups cannot be nested: "+this._safeRuleName(w));if(b.length!==S.length+1)throw Dt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(w));let e=0;for(let t=1;te});class jt{static colorizeElement(e,t,i,n){let o=(n=n||{}).theme||"vs",s=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();e.setTheme(o);let r=i.firstChild?i.firstChild.nodeValue:"";return i.className+=" "+o,this.colorize(t,r||"",s,n).then((e=>{var t;const n=null!==(t=null==Bt?void 0:Bt.createHTML(e))&&void 0!==t?t:e;i.innerHTML=n}),(e=>console.error(e)))}static colorize(e,t,i,n){let o=4;n&&"number"==typeof n.tabSize&&(o=n.tabSize),Ee.R(t)&&(t=t.substr(1));let s=Ee.P(t),r=e.getModeId(i);if(!r)return Promise.resolve(Ht(s,o));e.triggerMode(r);const a=be.B.get(r);if(a)return Vt(s,o,a);const l=be.B.getPromise(r);return new Promise(l?(e,t)=>{l.then((i=>{Vt(s,o,i).then(e,t)}),t)}:(e,t)=>{let i=null,n=null;const a=()=>{i&&(i.dispose(),i=null),n&&(n.dispose(),n=null);const a=be.B.get(r);a?Vt(s,o,a).then(e,t):e(Ht(s,o))};n=new Se.g,n.cancelAndSet(a,500),i=be.B.onDidChange((e=>{e.changedLanguages.indexOf(r)>=0&&a()}))})}static colorizeLine(e,t,i,n,o=4){const s=wt.e.isBasicASCII(e,t),r=wt.e.containsRTL(e,s,i);return Object(Ct.e)(new Ct.c(!1,!0,e,!1,s,r,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){let n=e.getLineContent(t);e.forceTokenization(t);let o=e.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}}function Vt(e,t,i){return new Promise(((n,o)=>{const s=()=>{const r=function(e,t,i){let n=[],o=i.getInitialState();for(let s=0,r=e.length;s"),o=a.endState}return n.join("")}(e,t,i);if(i instanceof Ft){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(s,o)}n(r)};s()}))}function Ht(e,t){let i=[];const n=new Uint32Array(2);n[0]=0,n[1]=16793600;for(let o=0,s=e.length;o")}return i.join("")}var zt=i(46),Ut=i(52),Kt=i(115),$t=i(150),qt=i(168),Gt=i(70),Yt=i(43),Zt=i(112);class Qt{constructor(e={},t=[],i=[]){this._contents=e,this._keys=t,this._overrides=i,this.isFrozen=!1}get contents(){return this.checkAndFreeze(this._contents)}get overrides(){return this.checkAndFreeze(this._overrides)}get keys(){return this.checkAndFreeze(this._keys)}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?Object(Yt.d)(this.contents,e):this.contents}override(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;let i={};for(const e of ot.e([...Object.keys(this.contents),...Object.keys(t)])){let n=this.contents[e],o=t[e];o&&("object"==typeof n&&"object"==typeof o?(n=ue.b(n),this.mergeContents(n,o)):n=o),i[e]=n}return new Qt(i,this.keys,this.overrides)}merge(...e){const t=ue.b(this.contents),i=ue.b(this.overrides),n=[...this.keys];for(const o of e){this.mergeContents(t,o.contents);for(const e of o.overrides){const[t]=i.filter((t=>ot.g(t.identifiers,e.identifiers)));t?this.mergeContents(t.contents,e.contents):i.push(ue.b(e))}for(const e of o.keys)-1===n.indexOf(e)&&n.push(e)}return new Qt(t,n,i)}freeze(){return this.isFrozen=!0,this}mergeContents(e,t){for(const i of Object.keys(t))i in e&&Ye.i(e[i])&&Ye.i(t[i])?this.mergeContents(e[i],t[i]):e[i]=ue.b(t[i])}checkAndFreeze(e){return this.isFrozen&&!Object.isFrozen(e)?ue.c(e):e}getContentsForOverrideIdentifer(e){for(const t of this.overrides)if(-1!==t.identifiers.indexOf(e))return t.contents;return null}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.addKey(e),Object(Yt.b)(this.contents,e,t,(e=>{throw new Error(e)}))}removeValue(e){this.removeKey(e)&&Object(Yt.f)(this.contents,e)}addKey(e){let t=this.keys.length;for(let i=0;iconsole.error(`Conflict in default settings file: ${e}`)))});super(e,t,i)}}class Jt{constructor(e,t,i=new Qt,n=new Qt,o=new X.b,s=new Qt,r=new X.b,a=!0){this._defaultConfiguration=e,this._localUserConfiguration=t,this._remoteUserConfiguration=i,this._workspaceConfiguration=n,this._folderConfigurations=o,this._memoryConfiguration=s,this._memoryConfigurationByResource=r,this._freeze=a,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new X.b,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidateConfigurationModel(t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=new Qt,this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration),this._freeze&&this._userConfiguration.freeze()),this._userConfiguration}getConsolidateConfigurationModel(e,t){let i=this.getConsolidatedConfigurationModelForResource(e,t);return e.overrideIdentifier?i.override(e.overrideIdentifier):i}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration),this._freeze&&(this._workspaceConfiguration=this._workspaceConfiguration.freeze())),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._freeze&&(t=t.freeze()),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce(((e,t)=>{const{contents:i,overrides:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:o}]),e}),[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.user),n=this.parseConfigurationModel(e.workspace),o=e.folders.reduce(((e,t)=>(e.set(V.a.revive(t[0]),this.parseConfigurationModel(t[1])),e)),new X.b);return new Jt(t,i,new Qt,n,o,new Qt,new X.b,!1)}static parseConfigurationModel(e){return new Qt(e.contents,e.keys,e.overrides).freeze()}}class ei{constructor(e,t,i,n){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this._previousConfiguration=void 0;const o=new Set;e.keys.forEach((e=>o.add(e))),e.overrides.forEach((([,e])=>e.forEach((e=>o.add(e))))),this.affectedKeys=[...o.values()];const s=new Qt;this.affectedKeys.forEach((e=>s.setValue(e,{}))),this.affectedKeysTree=s.contents}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Jt.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;if(this.doesAffectedKeysTreeContains(this.affectedKeysTree,e)){if(t){const n=this.previousConfiguration?this.previousConfiguration.getValue(e,t,null===(i=this.previous)||void 0===i?void 0:i.workspace):void 0,o=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!ue.d(n,o)}return!0}return!1}doesAffectedKeysTreeContains(e,t){let i,n=Object(Yt.g)({[t]:!0},(()=>{}));for(;"object"==typeof n&&(i=Object.keys(n)[0]);){if(!(e=e[i]))return!1;n=n[i]}return!0}}var ti=i(0);class ii extends de.a{constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new B.a),this._currentChord=null,this._currentChordChecker=new Se.c,this._currentChordStatusMessage=null,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Se.g,this._logging=!1}get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:B.b.None}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e){const t=this._getResolver().lookupPrimaryKeybinding(e);if(t)return t.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){const i=this.resolveKeyboardEvent(e);if(i.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),null;const[n]=i.getDispatchParts();if(null===n)return null;const o=this._contextKeyService.getContext(t),s=this._currentChord?this._currentChord.keypress:null;return this._getResolver().resolve(o,s,n)}_enterChordMode(e,t){this._currentChord={keypress:e,label:t},this._currentChordStatusMessage=this._notificationService.status(ti.a("first.chord","({0}) was pressed. Waiting for second key of chord...",t));const i=Date.now();this._currentChordChecker.cancelAndSet((()=>{this._documentHasFocus()?Date.now()-i>5e3&&this._leaveChordMode():this._leaveChordMode()}),500)}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChord=null}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchParts();return null!==n&&null===this._currentSingleModifier?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet((()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null}),300),!1):null!==n&&n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1)}_doDispatch(e,t,i=!1){let n=!1;if(e.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),!1;let o=null,s=null;if(i){const[t]=e.getSingleModifierDispatchParts();o=t,s=t}else[o]=e.getDispatchParts(),s=this._currentChord?this._currentChord.keypress:null;if(null===o)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;const r=this._contextKeyService.getContext(t),a=e.getLabel(),l=this._getResolver().resolve(r,s,o);return this._logService.trace("KeybindingService#dispatch",a,null==l?void 0:l.commandId),l&&l.enterChord?(n=!0,this._enterChordMode(o,a),n):(this._currentChord&&(l&&l.commandId||(this._notificationService.status(ti.a("missing.chord","The key combination ({0}, {1}) is not a command.",this._currentChord.label,a),{hideAfter:1e4}),n=!0)),this._leaveChordMode(),l&&l.commandId&&(l.bubble||(n=!0),void 0===l.commandArgs?this._commandService.executeCommand(l.commandId).then(void 0,(e=>this._notificationService.warn(e))):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,(e=>this._notificationService.warn(e))),this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding"})),n)}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class ni{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(let t=0,i=e.length;t=0;i--)this._isTargetedForRemoval(e[i],o,s,t,r)&&e.splice(i,1)}return e.concat(i)}_addKeyPress(e,t){const i=this._map.get(e);if(void 0===i)return this._map.set(e,[t]),void this._addToLookupMap(t);for(let e=i.length-1;e>=0;e--){let n=i[e];if(n.command===t.command)continue;const o=n.keypressParts.length>1,s=t.keypressParts.length>1;o&&s&&n.keypressParts[1]!==t.keypressParts[1]||ni.whenIsEntirelyIncluded(n.when,t.when)&&this._removeFromLookupMap(n)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);if(void 0!==t)for(let i=0,n=t.length;i9===e.type?e.expr:[e];let n=i(e.negate()).concat(i(t));for(let e=0;e1&&null!==o.keypressParts[1]?(this._log(`\\ From ${n.length} keybinding entries, matched chord, when: ${oi(o.when)}, source: ${si(o)}.`),{enterChord:!0,leaveChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${n.length} keybinding entries, matched ${o.command}, when: ${oi(o.when)}, source: ${si(o)}.`),{enterChord:!1,leaveChord:o.keypressParts.length>1,commandId:o.command,commandArgs:o.commandArgs,bubble:o.bubble}):(this._log(`\\ From ${n.length} keybinding entries, no when clauses matched the context.`),null)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){let n=t[i];if(ni.contextMatchesRules(e,n.when))return n}return null}static contextMatchesRules(e,t){return!t||t.evaluate(e)}}function oi(e){return e?`${e.serialize()}`:"no when condition"}function si(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}var ri=i(81);class ai{constructor(e,t,i,n,o,s,r){this.resolvedKeybinding=e,this.keypressParts=e?li(e.getDispatchParts()):[],e&&0===this.keypressParts.length&&(this.keypressParts=li(e.getSingleModifierDispatchParts())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=r}}function li(e){let t=[];for(let i=0,n=e.length;ithis._getLabel(e)))}getAriaLabel(){return hi.a.toLabel(this._os,this._parts,(e=>this._getAriaLabel(e)))}isChord(){return this._parts.length>1}getParts(){return this._parts.map((e=>this._getPart(e)))}_getPart(e){return new j.d(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchParts(){return this._parts.map((e=>this._getDispatchPart(e)))}getSingleModifierDispatchParts(){return this._parts.map((e=>this._getSingleModifierDispatchPart(e)))}}class di extends ci{constructor(e,t){super(t,e.parts)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return j.b.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":j.b.toString(e.keyCode)}_getDispatchPart(e){return di.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=j.b.toString(e.keyCode),t}_getSingleModifierDispatchPart(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.keyCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}}var ui,gi,mi,pi,fi,_i,bi,vi,Ci,wi,yi,Si,xi,Li=i(59),ki=i(157);(gi=ui||(ui={})).noSelection=ti.a("noSelection","No selection"),gi.singleSelectionRange=ti.a("singleSelectionRange","Line {0}, Column {1} ({2} selected)"),gi.singleSelection=ti.a("singleSelection","Line {0}, Column {1}"),gi.multiSelectionRange=ti.a("multiSelectionRange","{0} selections ({1} characters selected)"),gi.multiSelection=ti.a("multiSelection","{0} selections"),gi.emergencyConfOn=ti.a("emergencyConfOn","Now changing the setting `accessibilitySupport` to 'on'."),gi.openingDocs=ti.a("openingDocs","Now opening the Editor Accessibility documentation page."),gi.readonlyDiffEditor=ti.a("readonlyDiffEditor"," in a read-only pane of a diff editor."),gi.editableDiffEditor=ti.a("editableDiffEditor"," in a pane of a diff editor."),gi.readonlyEditor=ti.a("readonlyEditor"," in a read-only code editor"),gi.editableEditor=ti.a("editableEditor"," in a code editor"),gi.changeConfigToOnMac=ti.a("changeConfigToOnMac","To configure the editor to be optimized for usage with a Screen Reader press Command+E now."),gi.changeConfigToOnWinLinux=ti.a("changeConfigToOnWinLinux","To configure the editor to be optimized for usage with a Screen Reader press Control+E now."),gi.auto_on=ti.a("auto_on","The editor is configured to be optimized for usage with a Screen Reader."),gi.auto_off=ti.a("auto_off","The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."),gi.tabFocusModeOnMsg=ti.a("tabFocusModeOnMsg","Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."),gi.tabFocusModeOnMsgNoKb=ti.a("tabFocusModeOnMsgNoKb","Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding."),gi.tabFocusModeOffMsg=ti.a("tabFocusModeOffMsg","Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."),gi.tabFocusModeOffMsgNoKb=ti.a("tabFocusModeOffMsgNoKb","Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."),gi.openDocMac=ti.a("openDocMac","Press Command+H now to open a browser window with more information related to editor accessibility."),gi.openDocWinLinux=ti.a("openDocWinLinux","Press Control+H now to open a browser window with more information related to editor accessibility."),gi.outroMsg=ti.a("outroMsg","You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."),gi.showAccessibilityHelpAction=ti.a("showAccessibilityHelpAction","Show Accessibility Help"),(mi||(mi={})).inspectTokensAction=ti.a("inspectTokens","Developer: Inspect Tokens"),(pi||(pi={})).gotoLineActionLabel=ti.a("gotoLineActionLabel","Go to Line/Column..."),(fi||(fi={})).helpQuickAccessActionLabel=ti.a("helpQuickAccess","Show all Quick Access Providers"),(bi=_i||(_i={})).quickCommandActionLabel=ti.a("quickCommandActionLabel","Command Palette"),bi.quickCommandHelp=ti.a("quickCommandActionHelp","Show And Run Commands"),(Ci=vi||(vi={})).quickOutlineActionLabel=ti.a("quickOutlineActionLabel","Go to Symbol..."),Ci.quickOutlineByCategoryActionLabel=ti.a("quickOutlineByCategoryActionLabel","Go to Symbol by Category..."),(yi=wi||(wi={})).editorViewAccessibleLabel=ti.a("editorViewAccessibleLabel","Editor content"),yi.accessibilityHelpMessage=ti.a("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options."),(Si||(Si={})).toggleHighContrast=ti.a("toggleHighContrast","Toggle High Contrast Theme"),(xi||(xi={})).bulkEditServiceSummary=ti.a("bulkEditServiceSummary","Made {0} edits in {1} files");var Di=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Ni=function(e,t){return function(i,n){t(i,n,e)}},Ei=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Oi{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new B.a}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let Ii=class{constructor(e){this.modelService=e}setEditor(e){this.editor=e}createModelReference(e){let t=null;var i,n,o;return this.editor&&(i=this.editor,n=t=>this.findModel(t,e),o=t=>this.findModel(t.getOriginalEditor(),e)||this.findModel(t.getModifiedEditor(),e),t=Object(Kt.a)(i)?n(i):o(i)),t?Promise.resolve(new de.c(new Oi(t))):Promise.reject(new Error("Model not found"))}findModel(e,t){let i=this.modelService.getModel(t);return i&&i.uri.toString()!==t.toString()?null:i}};Ii=Di([Ni(0,et.a)],Ii);class Ti{show(){return Ti.NULL_PROGRESS_RUNNER}showWhile(e,t){return Ei(this,void 0,void 0,(function*(){yield e}))}}Ti.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class Mi{confirm(e){return this.doConfirm(e).then((e=>({confirmed:e,checkboxChecked:!1})))}doConfirm(e){let t=e.message;return e.detail&&(t=t+"\n\n"+e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,n){return Promise.resolve({choice:0})}}class Ai{info(e){return this.notify({severity:Ut.a.Info,message:e})}warn(e){return this.notify({severity:Ut.a.Warning,message:e})}error(e){return this.notify({severity:Ut.a.Error,message:e})}notify(e){switch(e.severity){case Ut.a.Error:console.error(e.message);break;case Ut.a.Warning:console.warn(e.message);break;default:console.log(e.message)}return Ai.NO_OP}status(e,t){return de.a.None}}Ai.NO_OP=new Li.b;class Ri{constructor(e){this._onWillExecuteCommand=new B.a,this._onDidExecuteCommand=new B.a,this._instantiationService=e}executeCommand(e,...t){const i=ie.a.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(e){return Promise.reject(e)}}}class Pi extends ii{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._register(Z.i(s,Z.d.KEY_DOWN,(e=>{const t=new zt.a(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())}))),this._register(Z.i(window,Z.d.KEY_UP,(e=>{const t=new zt.a(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()})))}addDynamicKeybinding(e,t,i,n){const o=Object(j.f)(t,Ne.a),s=new de.b;return o&&(this._dynamicKeybindings.push({keybinding:o,command:e,when:n,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}),s.add(Object(de.h)((()=>{for(let t=0;tthis._log(e)))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){let i=[],n=0;for(const o of e){const e=o.when||void 0,s=o.keybinding;if(s){const r=this.resolveKeybinding(s);for(const s of r)i[n++]=new ai(s,o.command,o.commandArgs,e,t,null,!1)}else i[n++]=new ai(void 0,o.command,o.commandArgs,e,t,null,!1)}return i}resolveKeybinding(e){return[new di(e,Ne.a)]}resolveKeyboardEvent(e){let t=new j.e(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new di(t,Ne.a)}}function Fi(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof V.a)}class Wi{constructor(){this._onDidChangeConfiguration=new B.a,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new Jt(new Xt,new Qt)}getValue(e,t){const i="string"==typeof e?e:void 0,n=Fi(e)?e:Fi(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()};let i=[];for(const t of e){const[e,n]=t;this.getValue(e)!==n&&(this._configuration.updateValue(e,n),i.push(e))}if(i.length>0){const e=new ei({keys:i,overrides:[]},t,this._configuration);e.source=7,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}}class Bi{constructor(e){this.configurationService=e,this._onDidChangeConfiguration=new B.a,this.configurationService.onDidChangeConfiguration((e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})}))}getValue(e,t,i){const n=H.a.isIPosition(t)&&t?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0;return void 0===n?this.configurationService.getValue():this.configurationService.getValue(n)}}let ji=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"auto"!==i?i:Ne.d||Ne.f?"\n":"\r\n"}};ji=Di([Ni(0,Yt.a)],ji);class Vi{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}class Hi{constructor(){const e=V.a.from({scheme:Hi.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new ki.b({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}}function zi(e,t,i){if(!t)return;if(!(e instanceof Wi))return;let n=[];Object.keys(t).forEach((e=>{Object(qt.c)(e)&&n.push([`editor.${e}`,t[e]]),i&&Object(qt.b)(e)&&n.push([`diffEditor.${e}`,t[e]])})),n.length>0&&e.updateValues(n)}Hi.SCHEME="inmemory";class Ui{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return Ei(this,void 0,void 0,(function*(){const t=new Map;for(let i of e){if(!(i instanceof $t.c))throw new Error("bad edit - only text edits are supported");const e=this._modelService.getModel(i.resource);if(!e)throw new Error("bad edit - model not found");if("number"==typeof i.versionId&&e.getVersionId()!==i.versionId)throw new Error("bad state - model changed in the meantime");let n=t.get(e);n||(n=[],t.set(e,n)),n.push(Gt.a.replaceMove(z.a.lift(i.textEdit.range),i.textEdit.text))}let i=0,n=0;for(const[e,o]of t)e.pushStackElement(),e.pushEditOperations([],o,(()=>[])),e.pushStackElement(),n+=1,i+=o.length;return{ariaSummary:Ee.v(xi.bulkEditServiceSummary,i,n)}}))}}class Ki{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}}class $i{constructor(e,t){this._codeEditorService=e,this._container=t,this.onDidLayout=B.b.None}get dimension(){return this._dimension||(this._dimension=Z.z(window.document.body)),this._dimension}get container(){return this._container}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}}var qi,Gi=i(69),Yi=i(145),Zi=i(29),Qi=i(108),Xi=i(68),Ji=i(94),en=i(92),tn=i(76),nn=i(48),on=i(7),sn=i(49),rn=i(8),an=i(4),ln=i(17),hn=i(19),cn=i(77);class dn{constructor(e,t,i,n){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=i,this.modifiedLineEnd=n}getType(){return 0===this.originalLineStart?1:0===this.modifiedLineStart?2:0}}class un{constructor(e){this.entries=e}}const gn=Object(cn.b)("diff-review-insert",hn.b.add,ti.a("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),mn=Object(cn.b)("diff-review-remove",hn.b.remove,ti.a("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),pn=Object(cn.b)("diff-review-close",hn.b.close,ti.a("diffReviewCloseIcon","Icon for 'Close' in diff review."));class fn extends de.a{constructor(e){super(),this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=Object(Zi.b)(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=Object(Zi.b)(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new en.a(this.actionBarContainer.domNode)),this._actionBar.push(new nn.a("diffreview.close",ti.a("label.close","Close"),"close-diff-review "+ln.d.asClassName(pn),!0,(()=>{return e=this,t=void 0,n=function*(){return this.hide()},new((i=void 0)||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}));var e,t,i,n})),{label:!1,icon:!0}),this.domNode=Object(Zi.b)(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=Object(Zi.b)(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new tn.a(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff((()=>{this._isVisible&&(this._diffs=this._compute(),this._render())}))),this._register(e.getModifiedEditor().onDidChangeCursorPosition((()=>{this._isVisible&&this._render()}))),this._register(Z.o(this.domNode.domNode,"click",(e=>{e.preventDefault();let t=Z.x(e.target,"diff-review-row");t&&this._goToRow(t)}))),this._register(Z.o(this.domNode.domNode,"keydown",(e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._goToRow(this._getNextRow())),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._goToRow(this._getPrevRow())),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this.hide()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this.accept())}))),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let t=-1;for(let e=0,i=this._diffs.length;e0){const t=e[s-1];n=0===t.originalEndLineNumber?t.originalStartLineNumber+1:t.originalEndLineNumber+1,o=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber+1:t.modifiedEndLineNumber+1}let r=t-3+1,a=i-3+1;if(ra){const e=a-p;p+=e,f+=e}if(f>m){const e=m-f;p+=e,f+=e}u[g++]=new dn(n,p,o,f)}n[o++]=new un(u)}let s=n[0].entries,r=[],a=0;for(let e=1,t=n.length;ec)&&(c=n),0!==o&&(0===d||ou)&&(u=s)}let g=document.createElement("div");g.className="diff-review-row";let m=document.createElement("div");m.className="diff-review-cell diff-review-summary";const p=c-h+1,f=u-d+1;m.appendChild(document.createTextNode(`${r+1}/${this._diffs.length}: @@ -${h},${p} +${d},${f} @@`)),g.setAttribute("data-line",String(d));const _=e=>0===e?ti.a("no_lines_changed","no lines changed"):1===e?ti.a("one_line_changed","1 line changed"):ti.a("more_lines_changed","{0} lines changed",e),b=_(p),v=_(f);g.setAttribute("aria-label",ti.a({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",r+1,this._diffs.length,h,b,d,v)),g.appendChild(m),g.setAttribute("role","listitem"),l.appendChild(g);const C=t.get(55);let w=d;for(let r=0,h=a.length;re}),Object(ln.f)(((e,t)=>{const i=e.getColor(sn.j);i&&t.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${i}; }`);const n=e.getColor(an.cc);n&&t.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${n} 0 -6px 6px -6px inset; }`)}));class _n extends on.b{constructor(){super({id:"editor.action.diffReview.next",label:ti.a("editor.action.diffReview.next","Go to Next Difference"),alias:"Go to Next Difference",precondition:rn.a.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const i=vn(e);i&&i.diffReviewNext()}}class bn extends on.b{constructor(){super({id:"editor.action.diffReview.prev",label:ti.a("editor.action.diffReview.prev","Go to Previous Difference"),alias:"Go to Previous Difference",precondition:rn.a.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const i=vn(e);i&&i.diffReviewPrev()}}function vn(e){const t=e.get(Y.a),i=t.listDiffEditors(),n=t.getActiveCodeEditor();if(!n)return null;for(let e=0,t=i.length;en.modifiedStartLineNumber?ti.a("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):ti.a("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"),void 0,!0,(()=>kn(this,void 0,void 0,(function*(){const e=new z.a(n.originalStartLineNumber,1,n.originalEndLineNumber+1,1),t=n.originalModel.getValueInRange(e);yield this._clipboardService.writeText(t)})))));let h,c=0;n.originalEndLineNumber>n.modifiedStartLineNumber&&(h=new nn.a("diff.clipboard.copyDeletedLineContent",ti.a("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber),void 0,!0,(()=>kn(this,void 0,void 0,(function*(){const e=n.originalModel.getLineContent(n.originalStartLineNumber+c);yield this._clipboardService.writeText(e)})))),l.push(h)),i.getOption(77)||l.push(new nn.a("diff.inline.revertChange",ti.a("diff.inline.revertChange.label","Revert this change"),void 0,!0,(()=>kn(this,void 0,void 0,(function*(){const e=new z.a(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),t=n.originalModel.getValueInRange(e);if(0===n.modifiedEndLineNumber){const e=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new z.a(n.modifiedStartLineNumber,e,n.modifiedStartLineNumber,e),text:a+t}])}else{const e=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new z.a(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,e),text:t}])}})))));const d=(e,t)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:e,y:t}),getActions:()=>(h&&(h.label=ti.a("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber+c)),l),autoSelectFirstItem:!0})};this._register(Z.o(this._diffActions,"mousedown",(e=>{const{top:t,height:i}=Z.C(this._diffActions);let n=Math.floor(r/3);e.preventDefault(),d(e.posx,t+i+n)}))),this._register(i.onMouseMove((e=>{(8===e.target.type||5===e.target.type)&&e.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,c=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,r)):this.visibility=!1}))),this._register(i.onMouseDown((e=>{!e.event.rightButton||8!==e.target.type&&5!==e.target.type||e.target.detail.viewZoneId===this._viewZoneId&&(e.event.preventDefault(),c=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,r),d(e.event.posx,e.event.posy+r))})))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}_updateLightBulbPosition(e,t,i){const{top:n}=Z.C(e),o=t-n,s=Math.floor(o/i),r=s*i;if(this._diffActions.style.top=`${r}px`,this.diff.viewLineCounts){let e=0;for(let t=0;t!this._zonesMap[String(e.id)]))}clean(e){this._zones.length>0&&e.changeViewZones((e=>{for(const t of this._zones)e.removeZone(t)})),this._zones=[],this._zonesMap={},this._decorations=e.deltaDecorations(this._decorations,[])}apply(e,t,i,n){const o=n?Ji.c.capture(e):null;e.changeViewZones((t=>{for(const e of this._zones)t.removeZone(e);for(const e of this._inlineDiffMargins)e.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let n=0,o=i.zones.length;ne});let Bn=class e extends de.a{constructor(t,i,n,o,s,r,a,l,h,c,d,u){super(),this._editorProgressService=u,this._onDidDispose=this._register(new B.a),this.onDidDispose=this._onDidDispose.event,this._onDidUpdateDiff=this._register(new B.a),this.onDidUpdateDiff=this._onDidUpdateDiff.event,this._onDidContentSizeChange=this._register(new B.a),this._lastOriginalWarning=null,this._lastModifiedWarning=null,this._editorWorkerService=s,this._codeEditorService=l,this._contextKeyService=this._register(r.createScoped(t)),this._instantiationService=a.createChild(new xn.a([rn.b,this._contextKeyService])),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=h,this._notificationService=c,this._id=++Rn,this._state=0,this._updatingDiffProgress=null,this._domElement=t,i=i||{},this._renderSideBySide=!0,void 0!==i.renderSideBySide&&(this._renderSideBySide=i.renderSideBySide),this._maxComputationTime=5e3,void 0!==i.maxComputationTime&&(this._maxComputationTime=i.maxComputationTime),this._ignoreTrimWhitespace=!0,void 0!==i.ignoreTrimWhitespace&&(this._ignoreTrimWhitespace=i.ignoreTrimWhitespace),this._renderIndicators=!0,void 0!==i.renderIndicators&&(this._renderIndicators=i.renderIndicators),this._originalIsEditable=Object(F.k)(i.originalEditable,!1),this._diffCodeLens=Object(F.k)(i.diffCodeLens,!1),this._diffWordWrap=Yn(i.diffWordWrap,"inherit"),void 0!==i.isInEmbeddedEditor?this._contextKeyService.createKey("isInEmbeddedDiffEditor",i.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._renderOverviewRuler=!0,void 0!==i.renderOverviewRuler&&(this._renderOverviewRuler=Boolean(i.renderOverviewRuler)),this._updateDecorationsRunner=this._register(new Se.e((()=>this._updateDecorations()),0)),this._containerDomElement=document.createElement("div"),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._renderSideBySide),this._containerDomElement.style.position="relative",this._containerDomElement.style.height="100%",this._domElement.appendChild(this._containerDomElement),this._overviewViewportDomElement=Object(Zi.b)(document.createElement("div")),this._overviewViewportDomElement.setClassName("diffViewport"),this._overviewViewportDomElement.setPosition("absolute"),this._overviewDomElement=document.createElement("div"),this._overviewDomElement.className="diffOverview",this._overviewDomElement.style.position="absolute",this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode),this._register(Z.o(this._overviewDomElement,"mousedown",(e=>{this._modifiedEditor.delegateVerticalScrollbarMouseDown(e)}))),this._renderOverviewRuler&&this._containerDomElement.appendChild(this._overviewDomElement),this._originalDomNode=document.createElement("div"),this._originalDomNode.className="editor original",this._originalDomNode.style.position="absolute",this._originalDomNode.style.height="100%",this._containerDomElement.appendChild(this._originalDomNode),this._modifiedDomNode=document.createElement("div"),this._modifiedDomNode.className="editor modified",this._modifiedDomNode.style.position="absolute",this._modifiedDomNode.style.height="100%",this._containerDomElement.appendChild(this._modifiedDomNode),this._beginUpdateDecorationsTimeout=-1,this._currentlyChangingViewZones=!1,this._diffComputationToken=0,this._originalEditorState=new An(d,o),this._modifiedEditorState=new An(d,o),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new In.a(this._containerDomElement,i.dimension,(()=>this._onDidContainerSizeChanged()))),i.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null,this._originalEditor=this._createLeftHandSideEditor(i,n.originalEditor||{}),this._modifiedEditor=this._createRightHandSideEditor(i,n.modifiedEditor||{}),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=new fn(this),this._containerDomElement.appendChild(this._reviewPane.domNode.domNode),this._containerDomElement.appendChild(this._reviewPane.shadow.domNode),this._containerDomElement.appendChild(this._reviewPane.actionBarContainer.domNode),this._enableSplitViewResizing=!0,void 0!==i.enableSplitViewResizing&&(this._enableSplitViewResizing=i.enableSplitViewResizing),this._renderSideBySide?this._setStrategy(new Kn(this._createDataSource(),this._enableSplitViewResizing)):this._setStrategy(new qn(this._createDataSource(),this._enableSplitViewResizing)),this._register(h.onDidColorThemeChange((t=>{this._strategy&&this._strategy.applyColors(t)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._renderSideBySide)})));const g=on.d.getDiffEditorContributions();for(const e of g)try{this._register(a.createInstance(e.ctor,this))}catch(e){Object(rt.e)(e)}this._codeEditorService.addDiffEditor(this)}_setState(e){this._state!==e&&(this._state=e,this._updatingDiffProgress&&(this._updatingDiffProgress.done(),this._updatingDiffProgress=null),1===this._state&&(this._updatingDiffProgress=this._editorProgressService.show(!0,1e3)))}diffReviewNext(){this._reviewPane.next()}diffReviewPrev(){this._reviewPane.prev()}static _getClassName(e,t){let i="monaco-diff-editor monaco-editor-background ";return t&&(i+="side-by-side "),i+=Object(ln.e)(e.type),i}_recreateOverviewRulers(){this._renderOverviewRuler&&(this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._originalEditor.hasModel()&&(this._originalOverviewRuler=this._originalEditor.createOverviewRuler("original diffOverviewRuler"),this._overviewDomElement.appendChild(this._originalOverviewRuler.getDomNode())),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._modifiedEditor.hasModel()&&(this._modifiedOverviewRuler=this._modifiedEditor.createOverviewRuler("modified diffOverviewRuler"),this._overviewDomElement.appendChild(this._modifiedOverviewRuler.getDomNode())),this._layoutOverviewRulers())}_createLeftHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._originalDomNode,this._adjustOptionsForLeftHandSide(t),i);this._register(n.onDidScrollChange((e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._modifiedEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())}))),this._register(n.onDidChangeViewZones((()=>{this._onViewZonesChanged()}))),this._register(n.onDidChangeConfiguration((e=>{n.getModel()&&(e.hasChanged(40)&&this._updateDecorationsRunner.schedule(),e.hasChanged(128)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))}))),this._register(n.onDidChangeModelContent((()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})));const o=this._contextKeyService.createKey("isInDiffLeftEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(n.onDidBlurEditorWidget((()=>o.set(!1)))),this._register(n.onDidContentSizeChange((t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})}))),n}_createRightHandSideEditor(t,i){const n=this._createInnerEditor(this._instantiationService,this._modifiedDomNode,this._adjustOptionsForRightHandSide(t),i);this._register(n.onDidScrollChange((e=>{this._isHandlingScrollEvent||(e.scrollTopChanged||e.scrollLeftChanged||e.scrollHeightChanged)&&(this._isHandlingScrollEvent=!0,this._originalEditor.setScrollPosition({scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}),this._isHandlingScrollEvent=!1,this._layoutOverviewViewport())}))),this._register(n.onDidChangeViewZones((()=>{this._onViewZonesChanged()}))),this._register(n.onDidChangeConfiguration((e=>{n.getModel()&&(e.hasChanged(40)&&this._updateDecorationsRunner.schedule(),e.hasChanged(128)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))}))),this._register(n.onDidChangeModelContent((()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}))),this._register(n.onDidChangeModelOptions((e=>{e.tabSize&&this._updateDecorationsRunner.schedule()})));const o=this._contextKeyService.createKey("isInDiffRightEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget((()=>o.set(!0)))),this._register(n.onDidBlurEditorWidget((()=>o.set(!1)))),this._register(n.onDidContentSizeChange((t=>{const i=this._originalEditor.getContentWidth()+this._modifiedEditor.getContentWidth()+e.ONE_OVERVIEW_WIDTH,n=Math.max(this._modifiedEditor.getContentHeight(),this._originalEditor.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:n,contentWidth:i,contentHeightChanged:t.contentHeightChanged,contentWidthChanged:t.contentWidthChanged})}))),n}_createInnerEditor(e,t,i,n){return e.createInstance(Yi.a,t,i,n)}dispose(){this._codeEditorService.removeDiffEditor(this),-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._cleanViewZonesAndDecorations(),this._originalOverviewRuler&&(this._overviewDomElement.removeChild(this._originalOverviewRuler.getDomNode()),this._originalOverviewRuler.dispose()),this._modifiedOverviewRuler&&(this._overviewDomElement.removeChild(this._modifiedOverviewRuler.getDomNode()),this._modifiedOverviewRuler.dispose()),this._overviewDomElement.removeChild(this._overviewViewportDomElement.domNode),this._renderOverviewRuler&&this._containerDomElement.removeChild(this._overviewDomElement),this._containerDomElement.removeChild(this._originalDomNode),this._originalEditor.dispose(),this._containerDomElement.removeChild(this._modifiedDomNode),this._modifiedEditor.dispose(),this._strategy.dispose(),this._containerDomElement.removeChild(this._reviewPane.domNode.domNode),this._containerDomElement.removeChild(this._reviewPane.shadow.domNode),this._containerDomElement.removeChild(this._reviewPane.actionBarContainer.domNode),this._reviewPane.dispose(),this._domElement.removeChild(this._containerDomElement),this._onDidDispose.fire(),super.dispose()}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return fe.a.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(t){let i=!1;void 0!==t.renderSideBySide&&this._renderSideBySide!==t.renderSideBySide&&(this._renderSideBySide=t.renderSideBySide,i=!0),void 0!==t.maxComputationTime&&(this._maxComputationTime=t.maxComputationTime,this._isVisible&&this._beginUpdateDecorationsSoon());let n=!1;void 0!==t.ignoreTrimWhitespace&&this._ignoreTrimWhitespace!==t.ignoreTrimWhitespace&&(this._ignoreTrimWhitespace=t.ignoreTrimWhitespace,n=!0),void 0!==t.renderIndicators&&this._renderIndicators!==t.renderIndicators&&(this._renderIndicators=t.renderIndicators,n=!0),n&&this._beginUpdateDecorations(),this._originalIsEditable=Object(F.k)(t.originalEditable,this._originalIsEditable),this._diffCodeLens=Object(F.k)(t.diffCodeLens,this._diffCodeLens),this._diffWordWrap=Yn(t.diffWordWrap,this._diffWordWrap),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(t)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(t)),void 0!==t.enableSplitViewResizing&&(this._enableSplitViewResizing=t.enableSplitViewResizing),this._strategy.setEnableSplitViewResizing(this._enableSplitViewResizing),i&&(this._renderSideBySide?this._setStrategy(new Kn(this._createDataSource(),this._enableSplitViewResizing)):this._setStrategy(new qn(this._createDataSource(),this._enableSplitViewResizing)),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._renderSideBySide)),void 0!==t.renderOverviewRuler&&this._renderOverviewRuler!==t.renderOverviewRuler&&(this._renderOverviewRuler=t.renderOverviewRuler,this._renderOverviewRuler?this._containerDomElement.appendChild(this._overviewDomElement):this._containerDomElement.removeChild(this._overviewDomElement))}getModel(){return{original:this._originalEditor.getModel(),modified:this._modifiedEditor.getModel()}}setModel(e){if(e&&(!e.original||!e.modified))throw new Error(e.original?"DiffEditorWidget.setModel: Modified model is null":"DiffEditorWidget.setModel: Original model is null");this._cleanViewZonesAndDecorations(),this._originalEditor.setModel(e?e.original:null),this._modifiedEditor.setModel(e?e.modified:null),this._updateDecorationsRunner.cancel(),e&&(this._originalEditor.setScrollTop(0),this._modifiedEditor.setScrollTop(0)),this._diffComputationResult=null,this._diffComputationToken++,this._setState(0),e&&(this._recreateOverviewRulers(),this._beginUpdateDecorations()),this._layoutOverviewViewport()}getDomNode(){return this._domElement}getVisibleColumnFromPosition(e){return this._modifiedEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._modifiedEditor.getPosition()}setPosition(e){this._modifiedEditor.setPosition(e)}revealLine(e,t=0){this._modifiedEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._modifiedEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._modifiedEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._modifiedEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._modifiedEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._modifiedEditor.revealPositionNearTop(e,t)}getSelection(){return this._modifiedEditor.getSelection()}getSelections(){return this._modifiedEditor.getSelections()}setSelection(e){this._modifiedEditor.setSelection(e)}setSelections(e){this._modifiedEditor.setSelections(e)}revealLines(e,t,i=0){this._modifiedEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._modifiedEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._modifiedEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._modifiedEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._modifiedEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._modifiedEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._modifiedEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._modifiedEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._modifiedEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._modifiedEditor.getSupportedActions()}saveViewState(){return{original:this._originalEditor.saveViewState(),modified:this._modifiedEditor.saveViewState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._originalEditor.restoreViewState(t.original),this._modifiedEditor.restoreViewState(t.modified)}}layout(e){this._elementSizeObserver.observe(e)}focus(){this._modifiedEditor.focus()}hasTextFocus(){return this._originalEditor.hasTextFocus()||this._modifiedEditor.hasTextFocus()}trigger(e,t,i){this._modifiedEditor.trigger(e,t,i)}changeDecorations(e){return this._modifiedEditor.changeDecorations(e)}_onDidContainerSizeChanged(){this._doLayout()}_getReviewHeight(){return this._reviewPane.isVisible()?this._elementSizeObserver.getHeight():0}_layoutOverviewRulers(){if(!this._renderOverviewRuler)return;if(!this._originalOverviewRuler||!this._modifiedOverviewRuler)return;const t=this._elementSizeObserver.getHeight(),i=this._getReviewHeight(),n=e.ENTIRE_DIFF_OVERVIEW_WIDTH-2*e.ONE_OVERVIEW_WIDTH;this._modifiedEditor.getLayoutInfo()&&(this._originalOverviewRuler.setLayout({top:0,width:e.ONE_OVERVIEW_WIDTH,right:n+e.ONE_OVERVIEW_WIDTH,height:t-i}),this._modifiedOverviewRuler.setLayout({top:0,right:0,width:e.ONE_OVERVIEW_WIDTH,height:t-i}))}_onViewZonesChanged(){this._currentlyChangingViewZones||this._updateDecorationsRunner.schedule()}_beginUpdateDecorationsSoon(){-1!==this._beginUpdateDecorationsTimeout&&(window.clearTimeout(this._beginUpdateDecorationsTimeout),this._beginUpdateDecorationsTimeout=-1),this._beginUpdateDecorationsTimeout=window.setTimeout((()=>this._beginUpdateDecorations()),e.UPDATE_DIFF_DECORATIONS_DELAY)}static _equals(e,t){return!e&&!t||!(!e||!t)&&e.toString()===t.toString()}_beginUpdateDecorations(){this._beginUpdateDecorationsTimeout=-1;const t=this._originalEditor.getModel(),i=this._modifiedEditor.getModel();if(!t||!i)return;this._diffComputationToken++;const n=this._diffComputationToken;this._setState(1),this._editorWorkerService.canComputeDiff(t.uri,i.uri)?this._editorWorkerService.computeDiff(t.uri,i.uri,this._ignoreTrimWhitespace,this._maxComputationTime).then((e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=e,this._updateDecorationsRunner.schedule(),this._onDidUpdateDiff.fire())}),(e=>{n===this._diffComputationToken&&t===this._originalEditor.getModel()&&i===this._modifiedEditor.getModel()&&(this._setState(2),this._diffComputationResult=null,this._updateDecorationsRunner.schedule())})):e._equals(t.uri,this._lastOriginalWarning)&&e._equals(i.uri,this._lastModifiedWarning)||(this._lastOriginalWarning=t.uri,this._lastModifiedWarning=i.uri,this._notificationService.warn(ti.a("diff.tooLarge","Cannot compare files because one file is too large.")))}_cleanViewZonesAndDecorations(){this._originalEditorState.clean(this._originalEditor),this._modifiedEditorState.clean(this._modifiedEditor)}_updateDecorations(){if(!this._originalEditor.getModel()||!this._modifiedEditor.getModel())return;const e=this._diffComputationResult?this._diffComputationResult.changes:[],t=this._originalEditorState.getForeignViewZones(this._originalEditor.getWhitespaces()),i=this._modifiedEditorState.getForeignViewZones(this._modifiedEditor.getWhitespaces()),n=this._strategy.getEditorsDiffDecorations(e,this._ignoreTrimWhitespace,this._renderIndicators,t,i);try{this._currentlyChangingViewZones=!0,this._originalEditorState.apply(this._originalEditor,this._originalOverviewRuler,n.original,!1),this._modifiedEditorState.apply(this._modifiedEditor,this._modifiedOverviewRuler,n.modified,!0)}finally{this._currentlyChangingViewZones=!1}}_adjustOptionsForSubEditor(e){const t=Object.assign({},e);return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._renderSideBySide?t.wordWrapOverride1=this._diffWordWrap:t.wordWrapOverride1="off",e.originalAriaLabel&&(t.ariaLabel=e.originalAriaLabel),t.readOnly=!this._originalIsEditable,t.extraEditorClassName="original-in-monaco-diff-editor",Object.assign(Object.assign({},t),{dimension:{height:0,width:0}})}_adjustOptionsForRightHandSide(t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.wordWrapOverride1=this._diffWordWrap,i.revealHorizontalRightPadding=F.g.revealHorizontalRightPadding.defaultValue+e.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",Object.assign(Object.assign({},i),{dimension:{height:0,width:0}})}doLayout(){this._elementSizeObserver.observe(),this._doLayout()}_doLayout(){const t=this._elementSizeObserver.getWidth(),i=this._elementSizeObserver.getHeight(),n=this._getReviewHeight(),o=this._strategy.layout();this._originalDomNode.style.width=o+"px",this._originalDomNode.style.left="0px",this._modifiedDomNode.style.width=t-o+"px",this._modifiedDomNode.style.left=o+"px",this._overviewDomElement.style.top="0px",this._overviewDomElement.style.height=i-n+"px",this._overviewDomElement.style.width=e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewDomElement.style.left=t-e.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",this._overviewViewportDomElement.setWidth(e.ENTIRE_DIFF_OVERVIEW_WIDTH),this._overviewViewportDomElement.setHeight(30),this._originalEditor.layout({width:o,height:i-n}),this._modifiedEditor.layout({width:t-o-(this._renderOverviewRuler?e.ENTIRE_DIFF_OVERVIEW_WIDTH:0),height:i-n}),(this._originalOverviewRuler||this._modifiedOverviewRuler)&&this._layoutOverviewRulers(),this._reviewPane.layout(i-n,t,n),this._layoutOverviewViewport()}_layoutOverviewViewport(){const e=this._computeOverviewViewport();e?(this._overviewViewportDomElement.setTop(e.top),this._overviewViewportDomElement.setHeight(e.height)):(this._overviewViewportDomElement.setTop(0),this._overviewViewportDomElement.setHeight(0))}_computeOverviewViewport(){const e=this._modifiedEditor.getLayoutInfo();if(!e)return null;const t=this._modifiedEditor.getScrollTop(),i=this._modifiedEditor.getScrollHeight(),n=Math.max(0,e.height),o=Math.max(0,n-0),s=i>0?o/i:0;return{height:Math.max(0,Math.floor(e.height*s)),top:Math.floor(t*s)}}_createDataSource(){return{getWidth:()=>this._elementSizeObserver.getWidth(),getHeight:()=>this._elementSizeObserver.getHeight()-this._getReviewHeight(),getOptions:()=>({renderOverviewRuler:this._renderOverviewRuler}),getContainerDomNode:()=>this._containerDomElement,relayoutEditors:()=>{this._doLayout()},getOriginalEditor:()=>this._originalEditor,getModifiedEditor:()=>this._modifiedEditor}}_setStrategy(e){this._strategy&&this._strategy.dispose(),this._strategy=e,e.applyColors(this._themeService.getColorTheme()),this._diffComputationResult&&this._updateDecorations(),this._doLayout()}_getLineChangeAtOrBeforeLineNumber(e,t){const i=this._diffComputationResult?this._diffComputationResult.changes:[];if(0===i.length||e=a?n=s+1:(n=s,o=s)}return i[n]}_getEquivalentLineForOriginalLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,(e=>e.originalStartLineNumber));if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-i;return r<=o?n+Math.min(r,s):n+s-o+r}_getEquivalentLineForModifiedLineNumber(e){const t=this._getLineChangeAtOrBeforeLineNumber(e,(e=>e.modifiedStartLineNumber));if(!t)return e;const i=t.originalStartLineNumber+(t.originalEndLineNumber>0?-1:0),n=t.modifiedStartLineNumber+(t.modifiedEndLineNumber>0?-1:0),o=t.originalEndLineNumber>0?t.originalEndLineNumber-t.originalStartLineNumber+1:0,s=t.modifiedEndLineNumber>0?t.modifiedEndLineNumber-t.modifiedStartLineNumber+1:0,r=e-n;return r<=s?i+Math.min(r,o):i+o-s+r}getDiffLineInformationForOriginal(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForOriginalLineNumber(e)}:null}getDiffLineInformationForModified(e){return this._diffComputationResult?{equivalentLineNumber:this._getEquivalentLineForModifiedLineNumber(e)}:null}};Bn.ONE_OVERVIEW_WIDTH=15,Bn.ENTIRE_DIFF_OVERVIEW_WIDTH=30,Bn.UPDATE_DIFF_DECORATIONS_DELAY=200,Bn=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Mn(3,En.a),Mn(4,Ce.a),Mn(5,rn.b),Mn(6,tt.a),Mn(7,Y.a),Mn(8,ln.b),Mn(9,Li.a),Mn(10,Ln.a),Mn(11,On.a)],Bn);class jn extends de.a{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=(e.getColor(an.m)||an.i).transparent(2),i=(e.getColor(an.o)||an.j).transparent(2),n=!t.equals(this._insertColor)||!i.equals(this._removeColor);return this._insertColor=t,this._removeColor=i,n}getEditorsDiffDecorations(e,t,i,n,o){o=o.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber)),n=n.sort(((e,t)=>e.afterLineNumber-t.afterLineNumber));const s=this._getViewZones(e,n,o,i),r=this._getOriginalEditorDecorations(e,t,i),a=this._getModifiedEditorDecorations(e,t,i);return{original:{decorations:r.decorations,overviewZones:r.overviewZones,zones:s.original},modified:{decorations:a.decorations,overviewZones:a.overviewZones,zones:s.modified}}}}class Vn{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._indexe.afterLineNumber-t.afterLineNumber,_=(e,t)=>{if(null===t.domNode&&e.length>0){const i=e[e.length-1];if(i.afterLineNumber===t.afterLineNumber&&null===i.domNode)return void(i.heightInLines+=t.heightInLines)}e.push(t)},b=new Vn(this._modifiedForeignVZ),v=new Vn(this._originalForeignVZ);let C=1,w=1;for(let i=0,n=this._lineChanges.length;i<=n;i++){const y=i0?-1:0),g=y.modifiedStartLineNumber+(y.modifiedEndLineNumber>0?-1:0),d=y.originalEndLineNumber>0?Hn._getViewLineCount(this._originalEditor,y.originalStartLineNumber,y.originalEndLineNumber):0,c=y.modifiedEndLineNumber>0?Hn._getViewLineCount(this._modifiedEditor,y.modifiedStartLineNumber,y.modifiedEndLineNumber):0,m=Math.max(y.originalStartLineNumber,y.originalEndLineNumber),p=Math.max(y.modifiedStartLineNumber,y.modifiedEndLineNumber)):(u+=1e7+d,g+=1e7+c,m=u,p=g);let S=[],x=[];if(o){let e;e=y?y.originalEndLineNumber>0?y.originalStartLineNumber-C:y.modifiedStartLineNumber-w:s.getLineCount()-C;for(let t=0;to&&x.push({afterLineNumber:i,heightInLines:n-o,domNode:null,marginDomNode:null})}y&&(C=(y.originalEndLineNumber>0?y.originalEndLineNumber:y.originalStartLineNumber)+1,w=(y.modifiedEndLineNumber>0?y.modifiedEndLineNumber:y.modifiedStartLineNumber)+1)}for(;b.current&&b.current.afterLineNumber<=p;){let e;e=b.current.afterLineNumber<=g?u-g+b.current.afterLineNumber:m;let i=null;y&&y.modifiedStartLineNumber<=b.current.afterLineNumber&&b.current.afterLineNumber<=y.modifiedEndLineNumber&&(i=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),S.push({afterLineNumber:e,heightInLines:b.current.height/t,domNode:null,marginDomNode:i}),b.advance()}for(;v.current&&v.current.afterLineNumber<=m;){let t;t=v.current.afterLineNumber<=u?g-u+v.current.afterLineNumber:p,x.push({afterLineNumber:t,heightInLines:v.current.height/e,domNode:null}),v.advance()}if(null!==y&&Zn(y)){const e=this._produceOriginalFromDiff(y,d,c);e&&S.push(e)}if(null!==y&&Qn(y)){const e=this._produceModifiedFromDiff(y,d,c);e&&x.push(e)}let L=0,k=0;for(S=S.sort(f),x=x.sort(f);L=t.heightInLines?(e.heightInLines-=t.heightInLines,k++):(t.heightInLines-=e.heightInLines,L++)}for(;L(e.domNode||(e.domNode=Xn()),e)))}}function zn(e,t,i,n,o){return{range:new z.a(e,t,i,n),options:o}}const Un={charDelete:wn.a.register({className:"char-delete"}),charDeleteWholeLine:wn.a.register({className:"char-delete",isWholeLine:!0}),charInsert:wn.a.register({className:"char-insert"}),charInsertWholeLine:wn.a.register({className:"char-insert",isWholeLine:!0}),lineInsert:wn.a.register({className:"line-insert",marginClassName:"line-insert",isWholeLine:!0}),lineInsertWithSign:wn.a.register({className:"line-insert",linesDecorationsClassName:"insert-sign "+ln.d.asClassName(Pn),marginClassName:"line-insert",isWholeLine:!0}),lineDelete:wn.a.register({className:"line-delete",marginClassName:"line-delete",isWholeLine:!0}),lineDeleteWithSign:wn.a.register({className:"line-delete",linesDecorationsClassName:"delete-sign "+ln.d.asClassName(Fn),marginClassName:"line-delete",isWholeLine:!0}),lineDeleteMargin:wn.a.register({marginClassName:"line-delete"})};class Kn extends jn{constructor(e,t){super(e),this._disableSash=!1===t,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new Qi.b(this._dataSource.getContainerDomNode(),this,{orientation:0})),this._disableSash&&(this._sash.state=0),this._sash.onDidStart((()=>this._onSashDragStart())),this._sash.onDidChange((e=>this._onSashDrag(e))),this._sash.onDidEnd((()=>this._onSashDragEnd())),this._sash.onDidReset((()=>this._onSashReset()))}setEnableSplitViewResizing(e){const t=!1===e;this._disableSash!==t&&(this._disableSash=t,this._sash.state=this._disableSash?0:3)}layout(e=this._sashRatio){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?Bn.ENTIRE_DIFF_OVERVIEW_WIDTH:0);let i=Math.floor((e||.5)*t);const n=Math.floor(.5*t);return i=this._disableSash?n:i||n,t>2*Kn.MINIMUM_EDITOR_WIDTH?(it-Kn.MINIMUM_EDITOR_WIDTH&&(i=t-Kn.MINIMUM_EDITOR_WIDTH)):i=n,this._sashPosition!==i&&(this._sashPosition=i,this._sash.layout()),this._sashPosition}_onSashDragStart(){this._startSashPosition=this._sashPosition}_onSashDrag(e){const t=this._dataSource.getWidth()-(this._dataSource.getOptions().renderOverviewRuler?Bn.ENTIRE_DIFF_OVERVIEW_WIDTH:0),i=this.layout((this._startSashPosition+(e.currentX-e.startX))/t);this._sashRatio=i/t,this._dataSource.relayoutEditors()}_onSashDragEnd(){this._sash.layout()}_onSashReset(){this._sashRatio=.5,this._dataSource.relayoutEditors(),this._sash.layout()}getVerticalSashTop(e){return 0}getVerticalSashLeft(e){return this._sashPosition}getVerticalSashHeight(e){return this._dataSource.getHeight()}_getViewZones(e,t,i){const n=this._dataSource.getOriginalEditor(),o=this._dataSource.getModifiedEditor();return new $n(e,t,i,n,o).getViewZones()}_getOriginalEditorDecorations(e,t,i){const n=this._dataSource.getOriginalEditor(),o=String(this._removeColor),s={decorations:[],overviewZones:[]},r=n.getModel(),a=n._getViewModel();for(const n of e)if(Qn(n)){s.decorations.push({range:new z.a(n.originalStartLineNumber,1,n.originalEndLineNumber,1073741824),options:i?Un.lineDeleteWithSign:Un.lineDelete}),Zn(n)&&n.charChanges||s.decorations.push(zn(n.originalStartLineNumber,1,n.originalEndLineNumber,1073741824,Un.charDeleteWholeLine));const e=Jn(r,a,n.originalStartLineNumber,n.originalEndLineNumber);if(s.overviewZones.push(new yn.a(e.startLineNumber,e.endLineNumber,o)),n.charChanges)for(const e of n.charChanges)if(Qn(e))if(t)for(let t=e.originalStartLineNumber;t<=e.originalEndLineNumber;t++){let i,n;i=t===e.originalStartLineNumber?e.originalStartColumn:r.getLineFirstNonWhitespaceColumn(t),n=t===e.originalEndLineNumber?e.originalEndColumn:r.getLineLastNonWhitespaceColumn(t),s.decorations.push(zn(t,i,t,n,Un.charDelete))}else s.decorations.push(zn(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn,Un.charDelete))}return s}_getModifiedEditorDecorations(e,t,i){const n=this._dataSource.getModifiedEditor(),o=String(this._insertColor),s={decorations:[],overviewZones:[]},r=n.getModel(),a=n._getViewModel();for(const n of e)if(Zn(n)){s.decorations.push({range:new z.a(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,1073741824),options:i?Un.lineInsertWithSign:Un.lineInsert}),Qn(n)&&n.charChanges||s.decorations.push(zn(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,1073741824,Un.charInsertWholeLine));const e=Jn(r,a,n.modifiedStartLineNumber,n.modifiedEndLineNumber);if(s.overviewZones.push(new yn.a(e.startLineNumber,e.endLineNumber,o)),n.charChanges)for(const e of n.charChanges)if(Zn(e))if(t)for(let t=e.modifiedStartLineNumber;t<=e.modifiedEndLineNumber;t++){let i,n;i=t===e.modifiedStartLineNumber?e.modifiedStartColumn:r.getLineFirstNonWhitespaceColumn(t),n=t===e.modifiedEndLineNumber?e.modifiedEndColumn:r.getLineLastNonWhitespaceColumn(t),s.decorations.push(zn(t,i,t,n,Un.charInsert))}else s.decorations.push(zn(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn,Un.charInsert))}return s}}Kn.MINIMUM_EDITOR_WIDTH=100;class $n extends Hn{constructor(e,t,i,n,o){super(e,t,i,n,o)}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){return null}_produceOriginalFromDiff(e,t,i){return i>t?{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i-t,domNode:null}:null}_produceModifiedFromDiff(e,t,i){return t>i?{afterLineNumber:Math.max(e.modifiedStartLineNumber,e.modifiedEndLineNumber),heightInLines:t-i,domNode:null}:null}}class qn extends jn{constructor(e,t){super(e),this._decorationsLeft=e.getOriginalEditor().getLayoutInfo().decorationsLeft,this._register(e.getOriginalEditor().onDidLayoutChange((t=>{this._decorationsLeft!==t.decorationsLeft&&(this._decorationsLeft=t.decorationsLeft,e.relayoutEditors())})))}setEnableSplitViewResizing(e){}_getViewZones(e,t,i,n){const o=this._dataSource.getOriginalEditor(),s=this._dataSource.getModifiedEditor();return new Gn(e,t,i,o,s,n).getViewZones()}_getOriginalEditorDecorations(e,t,i){const n=String(this._removeColor),o={decorations:[],overviewZones:[]},s=this._dataSource.getOriginalEditor(),r=s.getModel(),a=s._getViewModel();for(const t of e)if(Qn(t)){o.decorations.push({range:new z.a(t.originalStartLineNumber,1,t.originalEndLineNumber,1073741824),options:Un.lineDeleteMargin});const e=Jn(r,a,t.originalStartLineNumber,t.originalEndLineNumber);o.overviewZones.push(new yn.a(e.startLineNumber,e.endLineNumber,n))}return o}_getModifiedEditorDecorations(e,t,i){const n=this._dataSource.getModifiedEditor(),o=String(this._insertColor),s={decorations:[],overviewZones:[]},r=n.getModel(),a=n._getViewModel();for(const n of e)if(Zn(n)){s.decorations.push({range:new z.a(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,1073741824),options:i?Un.lineInsertWithSign:Un.lineInsert});const e=Jn(r,a,n.modifiedStartLineNumber,n.modifiedEndLineNumber);if(s.overviewZones.push(new yn.a(e.startLineNumber,e.endLineNumber,o)),n.charChanges){for(const e of n.charChanges)if(Zn(e))if(t)for(let t=e.modifiedStartLineNumber;t<=e.modifiedEndLineNumber;t++){let i,n;i=t===e.modifiedStartLineNumber?e.modifiedStartColumn:r.getLineFirstNonWhitespaceColumn(t),n=t===e.modifiedEndLineNumber?e.modifiedEndColumn:r.getLineLastNonWhitespaceColumn(t),s.decorations.push(zn(t,i,t,n,Un.charInsert))}else s.decorations.push(zn(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn,Un.charInsert))}else s.decorations.push(zn(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,1073741824,Un.charInsertWholeLine))}return s}layout(){return Math.max(5,this._decorationsLeft)}}class Gn extends Hn{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._originalModel=n.getModel(),this._renderIndicators=s,this._pendingLineChange=[],this._pendingViewZones=[],this._lineBreaksComputer=this._modifiedEditor._getViewModel().createLineBreaksComputer()}getViewZones(){const e=super.getViewZones();return this._finalize(e),e}_createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion(){const e=document.createElement("div");return e.className="inline-added-margin-view-zone",e}_produceOriginalFromDiff(e,t,i){const n=document.createElement("div");return n.className="inline-added-margin-view-zone",{afterLineNumber:Math.max(e.originalStartLineNumber,e.originalEndLineNumber),heightInLines:i,domNode:document.createElement("div"),marginDomNode:n}}_produceModifiedFromDiff(e,t,i){const n=document.createElement("div");n.className=`view-lines line-delete ${Tn.a}`;const o=document.createElement("div");o.className="inline-deleted-margin-view-zone";const s={shouldNotShrink:!0,afterLineNumber:0===e.modifiedEndLineNumber?e.modifiedStartLineNumber:e.modifiedStartLineNumber-1,heightInLines:t,minWidthInPx:0,domNode:n,marginDomNode:o,diff:{originalStartLineNumber:e.originalStartLineNumber,originalEndLineNumber:e.originalEndLineNumber,modifiedStartLineNumber:e.modifiedStartLineNumber,modifiedEndLineNumber:e.modifiedEndLineNumber,originalModel:this._originalModel,viewLineCounts:null}};for(let t=e.originalStartLineNumber;t<=e.originalEndLineNumber;t++)this._lineBreaksComputer.addRequest(this._originalModel.getLineContent(t),null);return this._pendingLineChange.push(e),this._pendingViewZones.push(s),s}_finalize(e){const t=this._modifiedEditor.getOptions(),i=this._modifiedEditor.getModel().getOptions().tabSize,n=t.get(40),o=t.get(27),s=n.typicalHalfwidthCharacterWidth,r=t.get(90),a=this._originalModel.mightContainNonBasicASCII(),l=this._originalModel.mightContainRTL(),h=t.get(55),c=t.get(127).decorationsWidth,d=t.get(102),u=t.get(85),g=t.get(79),m=t.get(41),p=this._lineBreaksComputer.finalize();let f=0;for(let t=0;t0,S=Object(Cn.a)(1e4);let x=0,L=0,k=null;for(let t=_.originalStartLineNumber;t<=_.originalEndLineNumber;t++){const s=t-_.originalStartLineNumber,r=this._originalModel.getLineTokens(t),v=r.getLineContent(),D=p[f++],N=Sn.a.filter(w,t,1,v.length+1);if(D){let p=0;for(const e of D.breakOffsets){const t=r.sliceAndInflate(p,e,0),s=v.substring(p,e);x=Math.max(x,this._renderOriginalLine(L++,s,t,Sn.a.extractWrapped(N,p,e),y,a,l,n,o,h,c,d,u,g,m,i,S,C)),p=e}for(k||(k=[]);k.lengthe.afterLineNumber-t.afterLineNumber))}_renderOriginalLine(e,t,i,n,o,s,r,a,l,h,c,d,u,g,m,p,f,_){f.appendASCIIString('
');const b=wt.e.isBasicASCII(t,s),v=wt.e.containsRTL(t,b,r),C=Object(Ct.d)(new Ct.c(a.isMonospace&&!l,a.canUseHalfwidthRightwardsArrow,t,!1,b,v,0,i,n,p,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,d,u,g,m!==F.e.OFF,null),f);if(f.appendASCIIString("
"),this._renderIndicators){const t=document.createElement("div");t.className=`delete-sign ${ln.d.asClassName(Fn)}`,t.setAttribute("style",`position:absolute;top:${e*h}px;width:${c}px;height:${h}px;right:0;`),_.appendChild(t)}const w=C.characterMapping.getAbsoluteOffsets();return w.length>0?w[w.length-1]:0}}function Yn(e,t){return Object(F.n)(e,t,["off","on","inherit"])}function Zn(e){return e.modifiedEndLineNumber>0}function Qn(e){return e.originalEndLineNumber>0}function Xn(){const e=document.createElement("div");return e.className="diagonal-fill",e}function Jn(e,t,i,n){const o=e.getLineCount();return i=Math.min(o,Math.max(1,i)),n=Math.min(o,Math.max(1,n)),t.coordinatesConverter.convertModelRangeToViewRange(new z.a(i,e.getLineMinColumn(i),n,e.getLineMaxColumn(n)))}Object(ln.f)(((e,t)=>{const i=e.getColor(an.m);i&&(t.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { background-color: ${i}; }`),t.addRule(`.monaco-diff-editor .line-insert, .monaco-diff-editor .char-insert { background-color: ${i}; }`),t.addRule(`.monaco-editor .inline-added-margin-view-zone { background-color: ${i}; }`));const n=e.getColor(an.o);n&&(t.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { background-color: ${n}; }`),t.addRule(`.monaco-diff-editor .line-delete, .monaco-diff-editor .char-delete { background-color: ${n}; }`),t.addRule(`.monaco-editor .inline-deleted-margin-view-zone { background-color: ${n}; }`));const o=e.getColor(an.n);o&&t.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${"hc"===e.type?"dashed":"solid"} ${o}; }`);const s=e.getColor(an.p);s&&t.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${"hc"===e.type?"dashed":"solid"} ${s}; }`);const r=e.getColor(an.cc);r&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${r}; }`);const a=e.getColor(an.k);a&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${a}; }`);const l=e.getColor(an.ec);l&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport {\n\t\t\t\tbackground: ${l};\n\t\t\t}\n\t\t`);const h=e.getColor(an.fc);h&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:hover {\n\t\t\t\tbackground: ${h};\n\t\t\t}\n\t\t`);const c=e.getColor(an.dc);c&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:active {\n\t\t\t\tbackground: ${c};\n\t\t\t}\n\t\t`);const d=e.getColor(an.l);t.addRule(`\n\t.monaco-editor .diagonal-fill {\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t${d} 12.5%,\n\t\t\t#0000 12.5%, #0000 50%,\n\t\t\t${d} 50%, ${d} 62.5%,\n\t\t\t#0000 62.5%, #0000 100%\n\t\t);\n\t\tbackground-size: 8px 8px;\n\t}\n\t`)}));var eo=i(182);const to=Object(tt.c)("themeService");var io=i(28),no=i(56),oo=i(62);class so extends de.a{constructor(){super(),this._onCodeEditorAdd=this._register(new B.a),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new B.a),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new B.a),this._onDiffEditorRemove=this._register(new B.a),this._onDecorationTypeRegistered=this._register(new B.a),this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null)}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map((e=>this._codeEditors[e]))}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map((e=>this._diffEditors[e]))}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}setModelProperty(e,t,i){const n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}}class ro{constructor(e,t,i){this._parent=e,this._editorId=t,this._styleSheet=i,this._refCount=0}ref(){this._refCount++}unref(){var e;this._refCount--,0===this._refCount&&(null===(e=this._styleSheet.parentNode)||void 0===e||e.removeChild(this._styleSheet),this._parent._removeEditorStyleSheets(this._editorId))}insertRule(e,t){this._styleSheet.sheet.insertRule(e,t)}removeRulesContainingSelector(e){Z.O(e,this._styleSheet)}}class ao{constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){this._styleSheet.sheet.insertRule(e,t)}removeRulesContainingSelector(e){Z.O(e,this._styleSheet)}}let lo=class extends so{constructor(e,t){super(),this._decorationOptionProviders=new Map,this._editorStyleSheets=new Map,this._globalStyleSheet=e||null,this._themeService=t}_getOrCreateGlobalStyleSheet(){return this._globalStyleSheet||(this._globalStyleSheet=new ao(Z.w())),this._globalStyleSheet}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!Z.N(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const e=new ro(this,i,Z.w(t));this._editorStyleSheets.set(i,e)}return this._editorStyleSheets.get(i)}_removeEditorStyleSheets(e){this._editorStyleSheets.delete(e)}registerDecorationType(e,t,i,n){let o=this._decorationOptionProviders.get(e);if(!o){const s=this._getOrCreateStyleSheet(n),r={styleSheet:s,key:e,parentTypeKey:i,options:t||Object.create(null)};o=i?new uo(this._themeService,s,r):new go(this._themeService,s,r),this._decorationOptionProviders.set(e,o),this._onDecorationTypeRegistered.fire(e)}o.refCount++}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach((t=>t.removeDecorations(e)))))}resolveDecorationOptions(e,t){const i=this._decorationOptionProviders.get(e);if(!i)throw new Error("Unknown decoration type key: "+e);return i.getOptions(this,t)}};var ho,co;lo=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([(ho=1,co=ln.b,function(e,t){co(e,t,ho)})],lo);class uo{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new po(3,i,e),this._afterContentRules=new po(4,i,e)}getOptions(e,t){const i=e.resolveDecorationOptions(this._parentTypeKey,!0);return this._beforeContentRules&&(i.beforeContentClassName=this._beforeContentRules.className),this._afterContentRules&&(i.afterContentClassName=this._afterContentRules.className),i}dispose(){this._beforeContentRules&&(this._beforeContentRules.dispose(),this._beforeContentRules=null),this._afterContentRules&&(this._afterContentRules.dispose(),this._afterContentRules=null),this._styleSheet.unref()}}class go{constructor(e,t,i){this._disposables=new de.b,this._styleSheet=t,this._styleSheet.ref(),this.refCount=0;const n=t=>{const n=new po(t,i,e);if(this._disposables.add(n),n.hasContent)return n.className};this.className=n(0);const o=(t=>{const n=new po(1,i,e);return this._disposables.add(n),n.hasContent?{className:n.className,hasLetterSpacing:n.hasLetterSpacing}:null})();o&&(this.inlineClassName=o.className,this.inlineClassNameAffectsLetterSpacing=o.hasLetterSpacing),this.beforeContentClassName=n(3),this.afterContentClassName=n(4),this.glyphMarginClassName=n(2);const s=i.options;this.isWholeLine=Boolean(s.isWholeLine),this.stickiness=s.rangeBehavior;const r=s.light&&s.light.overviewRulerColor||s.overviewRulerColor,a=s.dark&&s.dark.overviewRulerColor||s.overviewRulerColor;void 0===r&&void 0===a||(this.overviewRuler={color:r||a,darkColor:a||r,position:s.overviewRulerLane||_e.d.Center})}getOptions(e,t){return t?{inlineClassName:this.inlineClassName,beforeContentClassName:this.beforeContentClassName,afterContentClassName:this.afterContentClassName,className:this.className,glyphMarginClassName:this.glyphMarginClassName,isWholeLine:this.isWholeLine,overviewRuler:this.overviewRuler,stickiness:this.stickiness}:this}dispose(){this._disposables.dispose(),this._styleSheet.unref()}}const mo={color:"color:{0} !important;",opacity:"opacity:{0};",backgroundColor:"background-color:{0};",outline:"outline:{0};",outlineColor:"outline-color:{0};",outlineStyle:"outline-style:{0};",outlineWidth:"outline-width:{0};",border:"border:{0};",borderColor:"border-color:{0};",borderRadius:"border-radius:{0};",borderSpacing:"border-spacing:{0};",borderStyle:"border-style:{0};",borderWidth:"border-width:{0};",fontStyle:"font-style:{0};",fontWeight:"font-weight:{0};",fontSize:"font-size:{0};",fontFamily:"font-family:{0};",textDecoration:"text-decoration:{0};",cursor:"cursor:{0};",letterSpacing:"letter-spacing:{0};",gutterIconPath:"background:{0} center center no-repeat;",gutterIconSize:"background-size:{0};",contentText:"content:'{0}';",contentIconPath:"content:{0};",margin:"margin:{0};",padding:"padding:{0};",width:"width:{0};",height:"height:{0};"};class po{constructor(e,t,i){this._theme=i.getColorTheme(),this._ruleType=e,this._providerArgs=t,this._usesThemeColors=!1,this._hasContent=!1,this._hasLetterSpacing=!1;let n=fo.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+fo.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=fo.getSelector(this._providerArgs.key,this._providerArgs.parentTypeKey,e),this._buildCSS(),this._usesThemeColors?this._themeListener=i.onDidColorThemeChange((e=>{this._theme=i.getColorTheme(),this._removeCSS(),this._buildCSS()})):this._themeListener=null}dispose(){this._hasContent&&(this._removeCSS(),this._hasContent=!1),this._themeListener&&(this._themeListener.dispose(),this._themeListener=null)}get hasContent(){return this._hasContent}get hasLetterSpacing(){return this._hasLetterSpacing}get className(){return this._className}_buildCSS(){const e=this._providerArgs.options;let t,i,n;switch(this._ruleType){case 0:t=this.getCSSTextForModelDecorationClassName(e),i=this.getCSSTextForModelDecorationClassName(e.light),n=this.getCSSTextForModelDecorationClassName(e.dark);break;case 1:t=this.getCSSTextForModelDecorationInlineClassName(e),i=this.getCSSTextForModelDecorationInlineClassName(e.light),n=this.getCSSTextForModelDecorationInlineClassName(e.dark);break;case 2:t=this.getCSSTextForModelDecorationGlyphMarginClassName(e),i=this.getCSSTextForModelDecorationGlyphMarginClassName(e.light),n=this.getCSSTextForModelDecorationGlyphMarginClassName(e.dark);break;case 3:t=this.getCSSTextForModelDecorationContentClassName(e.before),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.before),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.before);break;case 4:t=this.getCSSTextForModelDecorationContentClassName(e.after),i=this.getCSSTextForModelDecorationContentClassName(e.light&&e.light.after),n=this.getCSSTextForModelDecorationContentClassName(e.dark&&e.dark.after);break;default:throw new Error("Unknown rule type: "+this._ruleType)}const o=this._providerArgs.styleSheet;let s=!1;t.length>0&&(o.insertRule(`${this._unThemedSelector} {${t}}`,0),s=!0),i.length>0&&(o.insertRule(`.vs${this._unThemedSelector} {${i}}`,0),s=!0),n.length>0&&(o.insertRule(`.vs-dark${this._unThemedSelector}, .hc-black${this._unThemedSelector} {${n}}`,0),s=!0),this._hasContent=s}_removeCSS(){this._providerArgs.styleSheet.removeRulesContainingSelector(this._unThemedSelector)}getCSSTextForModelDecorationClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["backgroundColor"],t),this.collectCSSText(e,["outline","outlineColor","outlineStyle","outlineWidth"],t),this.collectBorderSettingsCSSText(e,t),t.join("")}getCSSTextForModelDecorationInlineClassName(e){if(!e)return"";const t=[];return this.collectCSSText(e,["fontStyle","fontWeight","textDecoration","cursor","color","opacity","letterSpacing"],t),e.letterSpacing&&(this._hasLetterSpacing=!0),t.join("")}getCSSTextForModelDecorationContentClassName(e){if(!e)return"";const t=[];if(void 0!==e){if(this.collectBorderSettingsCSSText(e,t),void 0!==e.contentIconPath&&t.push(Ee.v(mo.contentIconPath,Z.s(V.a.revive(e.contentIconPath)))),"string"==typeof e.contentText){const i=e.contentText.match(/^.*$/m)[0].replace(/['\\]/g,"\\$&");t.push(Ee.v(mo.contentText,i))}this.collectCSSText(e,["fontStyle","fontWeight","fontSize","fontFamily","textDecoration","color","opacity","backgroundColor","margin","padding"],t),this.collectCSSText(e,["width","height"],t)&&t.push("display:inline-block;")}return t.join("")}getCSSTextForModelDecorationGlyphMarginClassName(e){if(!e)return"";const t=[];return void 0!==e.gutterIconPath&&(t.push(Ee.v(mo.gutterIconPath,Z.s(V.a.revive(e.gutterIconPath)))),void 0!==e.gutterIconSize&&t.push(Ee.v(mo.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return!!this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)&&(t.push(Ee.v("box-sizing: border-box;")),!0)}collectCSSText(e,t,i){const n=i.length;for(let n of t){const t=this.resolveValue(e[n]);"string"==typeof t&&i.push(Ee.v(mo[n],t))}return i.length!==n}resolveValue(e){if(Object(fe.b)(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}class fo{static getClassName(e,t){return"ced-"+e+"-"+t}static getSelector(e,t,i){let n=".monaco-editor ."+this.getClassName(e,i);return t&&(n=n+"."+this.getClassName(t,i)),3===i?n+="::before":4===i&&(n+="::after"),n}}var _o=function(e,t){return function(i,n){t(i,n,e)}};let bo=class extends lo{constructor(e,t,i){super(e,i),this.onCodeEditorAdd((()=>this._checkContextKey())),this.onCodeEditorRemove((()=>this._checkContextKey())),this._editorIsOpen=t.createKey("editorIsOpen",!1),this._activeCodeEditor=null}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}openCodeEditor(e,t,i){return t?Promise.resolve(this.doOpenEditor(t,e)):Promise.resolve(null)}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const i=t.resource.scheme;if(i===ee.c.http||i===ee.c.https)return Object(Z.X)(t.resource.toString()),e}return null}const i=t.options?t.options.selection:null;if(i)if("number"==typeof i.endLineNumber&&"number"==typeof i.endColumn)e.setSelection(i),e.revealRangeInCenter(i,1);else{const t={lineNumber:i.startLineNumber,column:i.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};bo=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([_o(1,rn.b),_o(2,ln.b)],bo);var vo=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Co=function(e,t){return function(i,n){t(i,n,e)}};let wo=0,yo=!1,So=class extends Yi.a{constructor(e,t,i,n,o,s,r,a,l,h){const c=Object.assign({},t);c.ariaLabel=c.ariaLabel||wi.editorViewAccessibleLabel,c.ariaLabel=c.ariaLabel+";"+wi.accessibilityHelpMessage,super(e,c,{},i,n,o,s,a,l,h),this._standaloneKeybindingService=r instanceof Pi?r:null,yo||(yo=!0,Gi.b(document.body))}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;let n="DYNAMIC_"+ ++wo,o=rn.a.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),de.a.None;const t=e.id,i=e.label,n=rn.a.and(rn.a.equals("editorId",this.getId()),rn.a.deserialize(e.precondition)),o=e.keybindings,s=rn.a.and(n,rn.a.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),h=new de.b,c=this.getId()+":"+t;if(h.add(ie.a.registerCommand(c,l)),r){let e={command:{id:c,title:i},when:n,group:r,order:a};h.add(io.d.appendMenuItem(io.b.EditorContext,e))}if(Array.isArray(o))for(const e of o)h.add(this._standaloneKeybindingService.addDynamicKeybinding(c,e,l,s));let d=new eo.a(c,i,i,n,l,this._contextKeyService);return this._actions[t]=d,h.add(Object(de.h)((()=>{delete this._actions[t]}))),h}_triggerCommand(e,t){if(this._codeEditorService instanceof bo)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};So=vo([Co(2,tt.a),Co(3,Y.a),Co(4,ie.b),Co(5,rn.b),Co(6,no.a),Co(7,ln.b),Co(8,Li.a),Co(9,oo.b)],So);let xo=class extends So{constructor(e,t,i,n,o,s,r,a,l,h,c,d,u,g,m){const p=Object.assign({},t);zi(d,p,!1);const f=h.registerEditorContainer(e);"string"==typeof p.theme&&h.setTheme(p.theme),void 0!==p.autoDetectHighContrast&&h.setAutoDetectHighContrast(Boolean(p.autoDetectHighContrast));let _,b=p.model;if(delete p.model,super(e,p,n,o,s,r,a,h,c,u),this._contextViewService=l,this._configurationService=d,this._standaloneThemeService=h,this._register(i),this._register(f),void 0===b?(_=ko(g,m,p.value||"",p.language||"text/plain",void 0),this._ownsModel=!0):(_=b,this._ownsModel=!1),this._attachModel(_),_){let e={oldModelUrl:null,newModelUrl:_.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){zi(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_attachModel(e){super._attachModel(e),this._modelData&&this._contextViewService.setContainer(this._modelData.view.domNode.domNode)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};xo=vo([Co(3,tt.a),Co(4,Y.a),Co(5,ie.b),Co(6,rn.b),Co(7,no.a),Co(8,Ln.b),Co(9,to),Co(10,Li.a),Co(11,Yt.a),Co(12,oo.b),Co(13,et.a),Co(14,we.a)],xo);let Lo=class extends Bn{constructor(e,t,i,n,o,s,r,a,l,h,c,d,u,g,m){const p=Object.assign({},t);zi(d,p,!0);const f=h.registerEditorContainer(e);"string"==typeof p.theme&&h.setTheme(p.theme),void 0!==p.autoDetectHighContrast&&h.setAutoDetectHighContrast(Boolean(p.autoDetectHighContrast)),super(e,p,{},m,a,o,n,l,h,c,u,g),this._contextViewService=r,this._configurationService=d,this._standaloneThemeService=h,this._register(i),this._register(f),this._contextViewService.setContainer(this._containerDomElement)}dispose(){super.dispose()}updateOptions(e){zi(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(So,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};function ko(e,t,i,n,o){if(i=i||"",!n){const n=i.indexOf("\n");let s=i;return-1!==n&&(s=i.substring(0,n)),Do(e,i,t.createByFilepathOrFirstLine(o||null,s),o)}return Do(e,i,t.create(n),o)}function Do(e,t,i,n){return e.createModel(t,i,n)}Lo=vo([Co(3,tt.a),Co(4,rn.b),Co(5,no.a),Co(6,Ln.b),Co(7,Ce.a),Co(8,Y.a),Co(9,to),Co(10,Li.a),Co(11,Yt.a),Co(12,Ln.a),Co(13,On.a),Co(14,En.a)],Lo);class No{constructor(e){this._languageIdentifier=e}getId(){return this._languageIdentifier.language}}var Eo=i(50),Oo=i(178);const Io="text/plain",To="application/unknown";let Mo=[],Ao=[],Ro=[];function Po(e,t=!1){const i=function(e){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:e.userConfigured,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?e.filepattern.toLowerCase():void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(Eo.e.sep)>=0}}(e);Mo.push(i),i.userConfigured?Ro.push(i):Ao.push(i),t&&!i.userConfigured&&Mo.forEach((e=>{e.mime===i.mime||e.userConfigured||(i.extension&&e.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&e.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&e.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&e.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))}))}function Fo(e,t,i){let n=null,o=null,s=null;for(let r=i.length-1;r>=0;r--){const a=i[r];if(t===a.filenameLowercase){n=a;break}if(a.filepattern&&(!o||a.filepattern.length>o.filepattern.length)){const i=a.filepatternOnPath?e:t;Object(Oo.a)(a.filepatternLowercase,i)&&(o=a)}a.extension&&(!s||a.extension.length>s.extension.length)&&t.endsWith(a.extensionLowercase)&&(s=a)}return n?n.mime:o?o.mime:s?s.mime:null}var Wo=i(120),Bo=i(51);const jo=Object.prototype.hasOwnProperty;class Vo extends de.a{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new B.a),this.onDidChange=this._onDidChange.event,this._warnOnOverwrite=t,this._nextLanguageId2=1,this._languageIdToLanguage=[],this._languageToLanguageId=Object.create(null),this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Wo.a.onDidChangeLanguages((e=>this._initializeFromRegistry()))))}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={};const e=Wo.a.getLanguages();this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach((e=>{let t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach((e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier})),t.mimetypes.forEach((e=>{this._mimeTypesMap[e]=t.identifier}))})),Bo.a.as(Zt.a.Configuration).registerOverrideIdentifiers(Wo.a.getLanguages().map((e=>e.id))),this._onDidChange.fire()}_getLanguageId(e){if(this._languageToLanguageId[e])return this._languageToLanguageId[e];const t=this._nextLanguageId2++;return this._languageIdToLanguage[t]=e,this._languageToLanguageId[e]=t,t}_registerLanguage(e){const t=e.id;let i;if(jo.call(this._languages,t))i=this._languages[t];else{const e=this._getLanguageId(t);i={identifier:new be.r(t,e),name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[]},this._languages[t]=i}this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(let e of t.extensions)Po({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(let o of t.filenames)Po({id:i,mime:n,filename:o},this._warnOnOverwrite),e.filenames.push(o);if(Array.isArray(t.filenamePatterns))for(let e of t.filenamePatterns)Po({id:i,mime:n,filepattern:e},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{let t=new RegExp(e);Ee.M(t)||Po({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(e){Object(rt.e)(e)}}e.aliases.push(i);let o=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(o=0===t.aliases.length?[null]:t.aliases),null!==o)for(const t of o)t&&0!==t.length&&e.aliases.push(t);let s=null!==o&&o.length>0;if(s&&null===o[0]);else{let t=(s?o[0]:null)||i;!s&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration)}isRegisteredMode(e){return!!jo.call(this._mimeTypesMap,e)||jo.call(this._languages,e)}getModeIdForLanguageNameLowercase(e){return jo.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e].language:null}extractModeIds(e){return e?e.split(",").map((e=>e.trim())).map((e=>jo.call(this._mimeTypesMap,e)?this._mimeTypesMap[e].language:e)).filter((e=>jo.call(this._languages,e))):[]}getLanguageIdentifier(e){if(e===ve.b||0===e)return ve.a;let t;if("string"==typeof e)t=e;else if(t=this._languageIdToLanguage[e],!t)return null;return jo.call(this._languages,t)?this._languages[t].identifier:null}getModeIdsFromFilepathOrFirstLine(e,t){if(!e&&!t)return[];let i=function(e,t){let i;if(e)switch(e.scheme){case ee.c.file:i=e.fsPath;break;case ee.c.data:i=te.a.parseMetaData(e).get(te.a.META_DATA_LABEL);break;default:i=e.path}if(!i)return[To];i=i.toLowerCase();const n=Object(Eo.a)(i),o=Fo(i,n,Ro);if(o)return[o,Io];const s=Fo(i,n,Ao);if(s)return[s,Io];if(t){const e=function(e){if(Object(Ee.R)(e)&&(e=e.substr(1)),e.length>0)for(let t=Mo.length-1;t>=0;t--){const i=Mo[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i.mime}return null}(t);if(e)return[e,Io]}return[To]}(e,t);return this.extractModeIds(i.join(","))}}class Ho{constructor(e,t){let i;this._selector=t,this.languageIdentifier=this._selector(),this._onDidChange=new B.a({onFirstListenerAdd:()=>{i=e((()=>this._evaluate()))},onLastListenerRemove:()=>{i.dispose()}}),this.onDidChange=this._onDidChange.event}_evaluate(){let e=this._selector();e.id!==this.languageIdentifier.id&&(this.languageIdentifier=e,this._onDidChange.fire(this.languageIdentifier))}}class zo extends de.a{constructor(e=!1){super(),this._onDidCreateMode=this._register(new B.a),this.onDidCreateMode=this._onDidCreateMode.event,this._onLanguagesMaybeChanged=this._register(new B.a({leakWarningThreshold:200})),this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event,this._instantiatedModes={},this._registry=this._register(new Vo(!0,e)),this._register(this._registry.onDidChange((()=>this._onLanguagesMaybeChanged.fire())))}isRegisteredMode(e){return this._registry.isRegisteredMode(e)}getModeIdForLanguageName(e){return this._registry.getModeIdForLanguageNameLowercase(e)}getModeIdByFilepathOrFirstLine(e,t){const i=this._registry.getModeIdsFromFilepathOrFirstLine(e,t);return Object(ot.i)(i,null)}getModeId(e){const t=this._registry.extractModeIds(e);return Object(ot.i)(t,null)}getLanguageIdentifier(e){return this._registry.getLanguageIdentifier(e)}create(e){return new Ho(this.onLanguagesMaybeChanged,(()=>{const t=this.getModeId(e);return this._createModeAndGetLanguageIdentifier(t)}))}createByFilepathOrFirstLine(e,t){return new Ho(this.onLanguagesMaybeChanged,(()=>{const i=this.getModeIdByFilepathOrFirstLine(e,t);return this._createModeAndGetLanguageIdentifier(i)}))}_createModeAndGetLanguageIdentifier(e){const t=this.getLanguageIdentifier(e||"plaintext")||ve.a;return this._getOrCreateMode(t.language),t}triggerMode(e){const t=this.getModeId(e);this._getOrCreateMode(t||"plaintext")}_getOrCreateMode(e){if(!this._instantiatedModes.hasOwnProperty(e)){let t=this.getLanguageIdentifier(e)||ve.a;this._instantiatedModes[e]=new No(t),this._onDidCreateMode.fire(this._instantiatedModes[e])}return this._instantiatedModes[e]}}var Uo=i(95),Ko=i(138),$o=i(136),qo=i(99);class Go{constructor(e,t,i){this._legend=e,this._themeService=t,this._logService=i,this._hashTable=new Zo,this._hasWarnedOverlappingTokens=!1}getMetadata(e,t,i){const n=this._hashTable.get(e,t,i.id);let o;if(n)o=n.metadata,this._logService.getLevel()===st.c.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${be.A.getForeground(o)}, fontStyle ${be.A.getFontStyle(o).toString(2)}`);else{let n=this._legend.tokenTypes[e];const s=[];if(n){let e=t;for(let t=0;e>0&&t>=1;e>0&&this._logService.getLevel()===st.c.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),s.push("not-in-legend"));const r=this._themeService.getColorTheme().getTokenStyleMetadata(n,s,i.language);void 0===r?o=2147483647:(o=0,void 0!==r.italic&&(o|=1|(r.italic?1:0)<<11),void 0!==r.bold&&(o|=2|(r.bold?2:0)<<11),void 0!==r.underline&&(o|=4|(r.underline?4:0)<<11),r.foreground&&(o|=8|r.foreground<<14),0===o&&(o=2147483647))}else this._logService.getLevel()===st.c.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),o=2147483647,n="not-in-legend";this._hashTable.add(e,t,i.id,o),this._logService.getLevel()===st.c.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${n}) / ${t} (${s.join(" ")}): foreground ${be.A.getForeground(o)}, fontStyle ${be.A.getFontStyle(o).toString(2)}`)}return o}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}}class Yo{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class Zo{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Zo._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=Zo._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+10?t[0]:null}function ns(e){const t=be.j.ordered(e);return t.length>0?t[0]:null}ie.a.registerCommand("_provideDocumentSemanticTokensLegend",((e,...t)=>Jo(void 0,void 0,void 0,(function*(){const[i]=t;Object(Ye.b)(i instanceof V.a);const n=e.get(et.a).getModel(i);if(!n)return;const o=is(n);return o?o.getLegend():e.get(ie.b).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)})))),ie.a.registerCommand("_provideDocumentSemanticTokens",((e,...t)=>Jo(void 0,void 0,void 0,(function*(){const[i]=t;Object(Ye.b)(i instanceof V.a);const n=e.get(et.a).getModel(i);if(!n)return;const o=ts(n,null,W.a.None);if(!o)return e.get(ie.b).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const{provider:s,request:r}=o;let a;try{a=yield r}catch(e){return void Object(rt.f)(e)}if(!a||!es(a))return;const l=Xo({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l})))),ie.a.registerCommand("_provideDocumentRangeSemanticTokensLegend",((e,...t)=>Jo(void 0,void 0,void 0,(function*(){const[i]=t;Object(Ye.b)(i instanceof V.a);const n=e.get(et.a).getModel(i);if(!n)return;const o=ns(n);return o?o.getLegend():void 0})))),ie.a.registerCommand("_provideDocumentRangeSemanticTokens",((e,...t)=>Jo(void 0,void 0,void 0,(function*(){const[i,n]=t;Object(Ye.b)(i instanceof V.a),Object(Ye.b)(z.a.isIRange(n));const o=e.get(et.a).getModel(i);if(!o)return;const s=ns(o);if(!s)return;let r;try{r=yield s.provideDocumentRangeSemanticTokens(o,z.a.lift(n),W.a.None)}catch(e){return void Object(rt.f)(e)}return r&&es(r)?Xo({id:0,type:"full",data:r.data}):void 0}))));var os=function(e,t){return function(i,n){t(i,n,e)}};function ss(e){return e.toString()}function rs(e){const t=new Ko.a,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}class as{constructor(e,t,i){this._modelEventListeners=new de.b,this.model=e,this._languageSelection=null,this._languageSelectionListener=null,this._modelEventListeners.add(e.onWillDispose((()=>t(e)))),this._modelEventListeners.add(e.onDidChangeLanguage((t=>i(e,t))))}_disposeLanguageSelection(){this._languageSelectionListener&&(this._languageSelectionListener.dispose(),this._languageSelectionListener=null)}dispose(){this._modelEventListeners.dispose(),this._disposeLanguageSelection()}setLanguage(e){this._disposeLanguageSelection(),this._languageSelection=e,this._languageSelectionListener=this._languageSelection.onDidChange((()=>this.model.setMode(e.languageIdentifier))),this.model.setMode(e.languageIdentifier)}}const ls=Ne.d||Ne.f?1:2;class hs{constructor(e,t,i,n,o,s,r,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=s,this.versionId=r,this.alternativeVersionId=a}}let cs=class e extends de.a{constructor(e,t,i,n,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._themeService=i,this._logService=n,this._undoRedoService=o,this._onModelAdded=this._register(new B.a),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new B.a),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new B.a),this.onModelModeChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._semanticStyling=this._register(new ms(this._themeService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration((()=>this._updateModelOptions()))),this._updateModelOptions(),this._register(new gs(this,this._themeService,this._configurationService,this._semanticStyling))}static _readModelOptions(e,t){let i=F.d.tabSize;if(e.editor&&void 0!==e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(i=t),i<1&&(i=1)}let n=i;if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let o=F.d.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(o="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let s=ls;const r=e.eol;"\r\n"===r?s=2:"\n"===r&&(s=1);let a=F.d.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(a="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let l=F.d.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(l="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let h=F.d.largeFileOptimizations;return e.editor&&void 0!==e.editor.largeFileOptimizations&&(h="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations)),{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:o,detectIndentation:l,defaultEOL:s,trimAutoWhitespace:a,largeFileOptimizations:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"auto"!==i?i:3===Ne.a||2===Ne.a?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(t,i,n){let o=this._modelCreationOptionsByLanguageAndResource[t+i];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:t,resource:i}),r=this._getEOL(i,t);o=e._readModelOptions({editor:s,eol:r},n),this._modelCreationOptionsByLanguageAndResource[t+i]=o}return o}_updateModelOptions(){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,o=i.length;ne){const t=[];for(this._disposedModels.forEach((e=>{e.sharesUndoRedoStack||t.push(e)})),t.sort(((e,t)=>e.time-t.time));t.length>0&&this._disposedModelsHeapSize>e;){const e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const o=this.getCreationOptions(t.language,i,n),s=new wn.b(e,o,t,i,this._undoRedoService);if(i&&this._disposedModels.has(ss(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=rs(s)===e.sha1;if(n||e.sharesUndoRedoStack){for(const e of t.past)Object($o.b)(e)&&e.matchesResource(i)&&e.setModel(s);for(const e of t.future)Object($o.b)(e)&&e.matchesResource(i)&&e.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,(e=>Object($o.b)(e)&&e.matchesResource(i))),n&&(s._overwriteVersionId(e.versionId),s._overwriteAlternativeVersionId(e.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=ss(s.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new as(s,(e=>this._onWillDispose(e)),((e,t)=>this._onDidChangeLanguage(e,t)));return this._models[r]=a,a}createModel(e,t,i,n=!1){let o;return t?(o=this._createModelData(e,t.languageIdentifier,i,n),this.setMode(o.model,t)):o=this._createModelData(e,Wo.b,i,n),this._onModelAdded.fire(o.model),o.model}setMode(e,t){if(!t)return;const i=this._models[ss(e.uri)];i&&i.setLanguage(t)}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i0||e.future.length>0){for(const i of e.past)Object($o.b)(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri));for(const i of e.future)Object($o.b)(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri))}}var a;const l=e.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK;if(s)if(!o&&r>l){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else this._ensureDisposedModelsHeapSize(l-r),this._undoRedoService.setElementsValidFlag(t.uri,!1,(e=>Object($o.b)(e)&&e.matchesResource(t.uri))),this._insertDisposedModel(new hs(t.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),o,r,rs(t),t.getVersionId(),t.getAlternativeVersionId()));else if(!o){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}delete this._models[i],n.dispose(),delete this._modelCreationOptionsByLanguageAndResource[t.getLanguageIdentifier().language+t.uri],this._onModelRemoved.fire(t)}_onDidChangeLanguage(t,i){const n=i.oldLanguage,o=t.getLanguageIdentifier().language,s=this.getCreationOptions(n,t.uri,t.isForSimpleWidget),r=this.getCreationOptions(o,t.uri,t.isForSimpleWidget);e._setModelOptionsForModel(t,r,s),this._onModelModeChanged.fire({model:t,oldModeId:n})}};cs.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,cs=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([os(0,Yt.a),os(1,nt),os(2,ln.b),os(3,st.b),os(4,Uo.a)],cs);const ds="editor.semanticHighlighting";function us(e,t,i){var n;const o=null===(n=i.getValue(ds,{overrideIdentifier:e.getLanguageIdentifier().language,resource:e.uri}))||void 0===n?void 0:n.enabled;return"boolean"==typeof o?o:t.getColorTheme().semanticHighlighting}class gs extends de.a{constructor(e,t,i,n){super(),this._watchers=Object.create(null),this._semanticStyling=n;const o=e=>{this._watchers[e.uri.toString()]=new fs(e,t,this._semanticStyling)},s=(e,t)=>{t.dispose(),delete this._watchers[e.uri.toString()]},r=()=>{for(let n of e.getModels()){const e=this._watchers[n.uri.toString()];us(n,t,i)?e||o(n):e&&s(n,e)}};this._register(e.onModelAdded((e=>{us(e,t,i)&&o(e)}))),this._register(e.onModelRemoved((e=>{const t=this._watchers[e.uri.toString()];t&&s(e,t)}))),this._register(i.onDidChangeConfiguration((e=>{e.affectsConfiguration(ds)&&r()}))),this._register(t.onDidColorThemeChange(r))}}class ms extends de.a{constructor(e,t){super(),this._themeService=e,this._logService=t,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange((()=>{this._caches=new WeakMap})))}get(e){return this._caches.has(e)||this._caches.set(e,new Go(e.getLegend(),this._themeService,this._logService)),this._caches.get(e)}}class ps{constructor(e,t,i){this._provider=e,this.resultId=t,this.data=i}dispose(){this._provider.releaseDocumentSemanticTokens(this.resultId)}}class fs extends de.a{constructor(e,t,i){super(),this._isDisposed=!1,this._model=e,this._semanticStyling=i,this._fetchDocumentSemanticTokens=this._register(new Se.e((()=>this._fetchDocumentSemanticTokensNow()),fs.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._register(this._model.onDidChangeContent((()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule()}))),this._register(this._model.onDidChangeLanguage((()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)})));const n=()=>{Object(de.f)(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const t of be.k.all(e))"function"==typeof t.onDidChange&&this._documentProvidersChangeListeners.push(t.onDidChange((()=>this._fetchDocumentSemanticTokens.schedule(0))))};n(),this._register(be.k.onDidChange((()=>{n(),this._fetchDocumentSemanticTokens.schedule()}))),this._register(t.onDidColorThemeChange((e=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule()}))),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;const e=new W.b,t=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,i=ts(this._model,t,e.token);if(!i)return void(this._currentDocumentResponse&&this._model.setSemanticTokens(null,!1));const{provider:n,request:o}=i;this._currentDocumentRequestCancellationTokenSource=e;const s=[],r=this._model.onDidChangeContent((e=>{s.push(e)})),a=this._semanticStyling.get(n);o.then((e=>{this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),this._setDocumentSemanticTokens(n,e||null,a,s)}),(e=>{e&&(rt.d(e)||"string"==typeof e.message&&-1!==e.message.indexOf("busy"))||rt.e(e),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),s.length>0&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule())}))}static _copy(e,t,i,n,o){for(let s=0;s{n.length>0&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule()};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed)e&&t&&e.releaseDocumentSemanticTokens(t.resultId);else if(e&&i){if(!t)return this._model.setSemanticTokens(null,!0),void s();if((r=t)&&Array.isArray(r.edits)){if(!o)return void this._model.setSemanticTokens(null,!0);if(0===t.edits.length)t={resultId:t.resultId,data:o.data};else{let e=0;for(const i of t.edits)e+=(i.data?i.data.length:0)-i.deleteCount;const i=o.data,n=new Uint32Array(i.length+e);let s=i.length,r=n.length;for(let e=t.edits.length-1;e>=0;e--){const o=t.edits[e],a=s-(o.start+o.deleteCount);a>0&&(fs._copy(i,s-a,n,r-a,a),r-=a),o.data&&(fs._copy(o.data,0,n,r-o.data.length,o.data.length),r-=o.data.length),s=o.start}s>0&&fs._copy(i,0,n,0,s),t={resultId:t.resultId,data:n}}}var r;if(es(t)){this._currentDocumentResponse=new ps(e,t.resultId,t.data);const o=function(e,t,i){const n=e.data,o=e.data.length/5|0,s=Math.max(Math.ceil(o/1024),400),r=[];let a=0,l=1,h=0;for(;ae&&0===n[5*t];)t--;if(t-1===e){let e=c;for(;e+1c&&(t.warnOverlappingSemanticTokens(r,c+1),p0)for(const e of n)for(const t of o)for(const i of e.changes)t.applyEdit(i.range,i.text);this._model.setSemanticTokens(o,!0)}else this._model.setSemanticTokens(null,!0);s()}else this._model.setSemanticTokens(null,!1)}}fs.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY=300;var _s=i(12);class bs{constructor(e,t,i,n,o){this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}const vs=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class Cs{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(vs);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=_s.a.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class ws{constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(function(e){if(!e||!Array.isArray(e))return[];let t=[],i=0;for(let n=0,o=e.length;n{let i=function(e,t){return et?1:0}(e.token,t.token);return 0!==i?i:e.index-t.index}));let i=0,n="000000",o="ffffff";for(;e.length>=1&&""===e[0].token;){let t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(o=t.background)}let s=new Cs;for(let e of t)s.getId(e);let r=s.getId(n),a=s.getId(o),l=new Ss(i,r,a),h=new xs(l);for(let t=0,i=e.length;t>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const ys=/\b(comment|string|regex|regexp)\b/;class Ss{constructor(e,t,i){this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}clone(){return new Ss(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<14|this._background<<23)>>>0}}class xs{constructor(e){this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;let t,i,n=e.indexOf(".");-1===n?(t=e,i=""):(t=e.substring(0,n),i=e.substring(n+1));let o=this._children.get(t);return void 0!==o?o.match(i):this._mainRule}insert(e,t,i,n){if(""===e)return void this._mainRule.acceptOverwrite(t,i,n);let o,s,r=e.indexOf(".");-1===r?(o=e,s=""):(o=e.substring(0,r),s=e.substring(r+1));let a=this._children.get(o);void 0===a&&(a=new xs(this._mainRule.clone()),this._children.set(o,a)),a.insert(s,t,i,n)}}const Ls={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[an.r]:"#FFFFFE",[an.w]:"#000000",[an.E]:"#E5EBF1",[sn.g]:"#D3D3D3",[sn.a]:"#939393",[an.M]:"#ADD6FF4D"}},ks={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[an.r]:"#1E1E1E",[an.w]:"#D4D4D4",[an.E]:"#3A3D41",[sn.g]:"#404040",[sn.a]:"#707070",[an.M]:"#ADD6FF26"}},Ds={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[an.r]:"#000000",[an.w]:"#FFFFFF",[sn.g]:"#FFFFFF",[sn.a]:"#FFFFFF"}};var Ns=i(97);const Es="vs",Os="vs-dark",Is="hc-black",Ts=Bo.a.as(an.a.ColorContribution),Ms=Bo.a.as(ln.a.ThemingContribution);class As{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;let i=t.base;e.length>0?(Rs(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(let t in this.themeData.colors)e.set(t,_s.a.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){let t=Ps(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,_s.a.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){return this.getColors().get(e)||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=Ts.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case Es:return Ns.a.LIGHT;case Is:return Ns.a.HIGH_CONTRAST;default:return Ns.a.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){let i=Ps(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=ws.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=be.A.getForeground(n),s=be.A.getFontStyle(n);return{foreground:o,italic:Boolean(1&s),bold:Boolean(2&s),underline:Boolean(4&s)}}}function Rs(e){return e===Es||e===Os||e===Is}function Ps(e){switch(e){case Es:return Ls;case Os:return ks;case Is:return Ds}}function Fs(e){let t=Ps(e);return new As(e,t)}class Ws extends de.a{constructor(){super(),this._onColorThemeChange=this._register(new B.a),this.onDidColorThemeChange=this._onColorThemeChange.event,this._environment=Object.create(null),this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Es,Fs(Es)),this._knownThemes.set(Os,Fs(Os)),this._knownThemes.set(Is,Fs(Is));const e=function(){const e=new B.a,t=Object(cn.a)();return t.onDidChange((()=>e.fire())),{onDidChange:e.event,getCSS(){const e={},i=i=>{let n=i.defaults;for(;ln.d.isThemeIcon(n);){const e=t.getIcon(n.id);if(!e)return;n=e.defaults}const o=n.fontId;if(o){const s=t.getIconFont(o);if(s)return e[o]=s,`.codicon-${i.id}:before { content: '${n.fontCharacter}'; font-family: ${Object(Z.r)(o)}; }`}return`.codicon-${i.id}:before { content: '${n.fontCharacter}'; }`},n=[];for(let e of t.getIcons()){const t=i(e);t&&n.push(t)}for(let t in e){const i=e[t].definition.src.map((e=>`${Object(Z.s)(e.location)} format('${e.format}')`)).join(", ");n.push(`@font-face { src: ${i}; font-family: ${Object(Z.r)(t)}; }`)}return n.join("\n")}}}();this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Es),e.onDidChange((()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Z.m("(forced-colors: active)",(()=>{this._updateActualTheme()}))}registerEditorContainer(e){return Z.N(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Z.w(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),de.a.None}_registerShadowDomContainer(e){const t=Z.w(e);return t.className="monaco-colors",t.textContent=this._allCSS,this._styleElements.push(t),{dispose:()=>{for(let e=0;e{t.base===e&&t.notifyBaseUpdated()})),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(Es),this._desiredTheme=t,this._updateActualTheme()}_updateActualTheme(){const e=this._autoDetectHighContrast&&window.matchMedia("(forced-colors: active)").matches?this._knownThemes.get(Is):this._desiredTheme;this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._updateActualTheme()}_updateThemeOrColorMap(){let e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};Ms.getThemingParticipants().forEach((e=>e(this._theme,i,this._environment)));const n=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(function(e){let t=[];for(let i=1,n=e.length;ie.textContent=this._allCSS))}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}}var Bs=i(35);const js="data-keybinding-context";class Vs{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}}class Hs extends Vs{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}Hs.INSTANCE=new Hs;class zs extends Vs{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=X.c.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration((e=>{if(6===e.source){const e=Array.from(Bs.a.map(this._values,(([e])=>e)));this._values.clear(),i.fire(new $s(e))}else{const t=[];for(const i of e.affectedKeys){const e=`config.${i}`,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...Bs.a.map(n,(([e])=>e))),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new $s(t))}}))}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(zs._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(zs._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:n=Array.isArray(i)?JSON.stringify(i):i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}zs._keyPrefix="config.";class Us{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class Ks{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}}class $s{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}}class qs{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}}class Gs{constructor(e){this._onDidChangeContext=new B.d({merge:e=>new qs(e)}),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new Us(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new Zs(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return ni.contextMatchesRules(t,e)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new Ks(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new Ks(e))}getContext(e){return this._isDisposed?Hs.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute(js)){const t=e.getAttribute(js);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}(e))}}let Ys=class extends Gs{constructor(e){super(0),this._contexts=new Map,this._toDispose=new de.b,this._lastContextId=0;const t=new zs(this._myContextId,e,this._onDidChangeContext);this._contexts.set(this._myContextId,t),this._toDispose.add(t)}dispose(){this._onDidChangeContext.dispose(),this._isDisposed=!0,this._toDispose.dispose()}getContextValuesContainer(e){return this._isDisposed?Hs.INSTANCE:this._contexts.get(e)||Hs.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");let t=++this._lastContextId;return this._contexts.set(t,new Vs(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};Ys=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,Yt.a)],Ys);class Zs extends Gs{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=new de.d,this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(js)){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", ")),console.error("Element already has context attribute"+(e?": "+e:""))}this._domNode.setAttribute(js,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(this._onDidChangeContext.fire,this._onDidChangeContext)}dispose(){this._isDisposed||(this._onDidChangeContext.dispose(),this._parent.disposeContext(this._myContextId),this._parentChangeListener.dispose(),this._domNode.removeAttribute(js),this._isDisposed=!0)}getContextValuesContainer(e){return this._isDisposed?Hs.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}ie.a.registerCommand(rn.d,(function(e,t,i){e.get(rn.b).createKey(String(t),i)})),ie.a.registerCommand({id:"getContextKeyInfo",handler:()=>[...rn.c.all()].sort(((e,t)=>e.key.localeCompare(t.key))),description:{description:Object(ti.a)("getContextKeyInfo","A command that returns information about context keys"),args:[]}}),ie.a.registerCommand("_generateContextKeyInfo",(function(){const e=[],t=new Set;for(let i of rn.c.all())t.has(i.key)||(t.add(i.key),e.push(i));e.sort(((e,t)=>e.key.localeCompare(t.key))),console.log(JSON.stringify(e,void 0,2))}));var Qs,Xs=i(74),Js=i(146);function er(e,t,i){const n=i.mode===Qs.ALIGN?i.offset:i.offset+i.size,o=i.mode===Qs.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=o?o-t:Math.max(e-t,0):t<=o?o-t:t<=e-n?n:0}!function(e){e[e.AVOID=0]="AVOID",e[e.ALIGN=1]="ALIGN"}(Qs||(Qs={}));class tr extends de.a{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=de.a.None,this.toDisposeOnSetContainer=de.a.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Z.a(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Z.J(this.view),this.setContainer(e,t),this._register(Object(de.h)((()=>this.setContainer(null,1))))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,null===(i=this.shadowRootHostElement)||void 0===i||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=1!==t,this.useShadowDOM=3===t,this.useShadowDOM){this.shadowRootHostElement=Z.a(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=ir,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Z.a("slot"))}else this.container.appendChild(this.view);const i=new de.b;tr.BUBBLE_UP_EVENTS.forEach((e=>{i.add(Z.o(this.container,e,(e=>{this.onDOMEvent(e,!1)})))})),tr.BUBBLE_DOWN_EVENTS.forEach((e=>{i.add(Z.o(this.container,e,(e=>{this.onDOMEvent(e,!0)}),!0))})),this.toDisposeOnSetContainer=i}}show(e){this.isVisible()&&this.hide(),Z.t(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2500",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Z.U(this.view),this.toDisposeOnClean=e.render(this.view)||de.a.None,this.delegate=e,this.doLayout(),this.delegate.focus&&this.delegate.focus()}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||Ne.c&&Js.a.pointerEvents?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;let e,t=this.delegate.getAnchor();if(Z.L(t)){let i=Z.C(t);e={top:i.top,left:i.left,width:i.width,height:i.height}}else e={top:t.y,left:t.x,width:t.width||1,height:t.height||2};const i=Z.H(this.view),n=Z.G(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0;let r,a;if(0===(this.delegate.anchorAxisAlignment||0)){const t={offset:e.top-window.pageYOffset,size:e.height,position:0===o?0:1},l={offset:e.left,size:e.width,position:0===s?0:1,mode:Qs.ALIGN};r=er(window.innerHeight,n,t)+window.pageYOffset,Xs.a.intersects({start:r,end:r+n},{start:t.offset,end:t.offset+t.size})&&(l.mode=Qs.AVOID),a=er(window.innerWidth,i,l)}else{const t={offset:e.left,size:e.width,position:0===s?0:1},l={offset:e.top,size:e.height,position:0===o?0:1,mode:Qs.ALIGN};a=er(window.innerWidth,i,t),Xs.a.intersects({start:a,end:a+i},{start:t.offset,end:t.offset+t.size})&&(l.mode=Qs.AVOID),r=er(window.innerHeight,n,l)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===o?"bottom":"top"),this.view.classList.add(0===s?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const l=Z.C(this.container);this.view.style.top=r-(this.useFixedPosition?Z.C(this.view).top:l.top)+"px",this.view.style.left=a-(this.useFixedPosition?Z.C(this.view).left:l.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null==t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),Z.J(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Z.K(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}tr.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],tr.BUBBLE_DOWN_EVENTS=["click"];let ir='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t@font-face {\n\t\tfont-family: "codicon";\n\t\tsrc: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }\n';var nr=i(114),or=i(183),sr=i(30),rr=i(54),ar=i(100);const lr=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,hr=/(&)?(&)([^\s&])/g,cr=Object(hn.e)("menu-selection",hn.b.check),dr=Object(hn.e)("menu-submenu",hn.b.chevronRight);var ur;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(ur||(ur={}));class gr extends en.a{constructor(e,t,i={}){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const n=document.createElement("div");n.classList.add("monaco-menu"),n.setAttribute("role","presentation"),super(n,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Ne.f||Ne.d?[10]:[]],keyDown:!0}}),this.menuElement=n,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new de.b),this.initializeStyleSheet(e),Object(Z.i)(n,Z.d.KEY_DOWN,(e=>{new zt.a(e).equals(2)&&e.preventDefault()})),i.enableMnemonics&&this.menuDisposables.add(Object(Z.i)(n,Z.d.KEY_DOWN,(e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){Z.c.stop(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof pr&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}}))),Ne.d&&this._register(Object(Z.i)(n,Z.d.KEY_DOWN,(e=>{const t=new zt.a(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Z.c.stop(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Z.c.stop(e,!0))}))),this._register(Object(Z.i)(this.domNode,Z.d.MOUSE_OUT,(e=>{let t=e.relatedTarget;Object(Z.K)(t,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())}))),this._register(Object(Z.i)(this.actionsList,Z.d.MOUSE_OVER,(e=>{let t=e.target;if(t&&Object(Z.K)(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})));let o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new tn.a(n,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const s=this.scrollableElement.getDomNode();s.style.position="",this._register(Object(Z.i)(s,Z.d.MOUSE_UP,(e=>{e.preventDefault()}))),n.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((e=>{var t;return!(null===(t=i.submenuIds)||void 0===t?void 0:t.has(e.id))||(console.warn(`Found submenu cycle: ${e.id}`),!1)})),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter((e=>!(e instanceof fr))).forEach(((e,t,i)=>{e.updatePositionInSet(t+1,i.length)}))}initializeStyleSheet(e){Object(Z.N)(e)?(this.styleSheet=Object(Z.w)(e),this.styleSheet.textContent=_r):(gr.globalStyleSheet||(gr.globalStyleSheet=Object(Z.w)(),gr.globalStyleSheet.textContent=_r),this.styleSheet=gr.globalStyleSheet)}style(e){const t=this.getContainer(),i=e.foregroundColor?`${e.foregroundColor}`:"",n=e.backgroundColor?`${e.backgroundColor}`:"",o=e.borderColor?`1px solid ${e.borderColor}`:"",s=e.shadowColor?`0 2px 4px ${e.shadowColor}`:"";t.style.border=o,this.domNode.style.color=i,this.domNode.style.backgroundColor=n,t.style.boxShadow=s,this.viewItems&&this.viewItems.forEach((t=>{(t instanceof mr||t instanceof fr)&&t.style(e)}))}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(Object(Z.i)(this.element,Z.d.MOUSE_UP,(e=>{if(Z.c.stop(e,!0),sr.g){if(new rr.a(e).rightButton)return;this.onClick(e)}else setTimeout((()=>{this.onClick(e)}),0)}))),this._register(Object(Z.i)(this.element,Z.d.CONTEXT_MENU,(e=>{Z.c.stop(e,!0)}))))}),100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Object(Z.q)(this.element,Object(Z.a)("a.action-menu-item")),this._action.id===nn.d.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Object(Z.q)(this.item,Object(Z.a)("span.menu-item-check"+cr.cssSelector)),this.check.setAttribute("role","none"),this.label=Object(Z.q)(this.item,Object(Z.a)("span.action-label")),this.options.label&&this.options.keybinding&&(Object(Z.q)(this.item,Object(Z.a)("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item&&this.item.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){Object(Z.t)(this.label);let e=Object(ar.e)(this.getAction().label);if(e){const t=function(e){const t=lr,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=lr.exec(e);if(i){e=Ee.s(e),hr.lastIndex=0;let t=hr.exec(e);for(;t&&t[1];)t=hr.exec(e);const n=e=>e.replace(/&&/g,"&");t?this.label.append(Ee.I(n(e.substr(0,t.index))," "),Object(Z.a)("u",{"aria-hidden":"true"},t[3]),Ee.N(n(e.substr(t.index+t[0].length))," ")):this.label.innerText=n(e).trim(),this.item&&this.item.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.innerText=e.replace(/&&/g,"&").trim()}}}updateTooltip(){let e=null;this.getAction().tooltip?e=this.getAction().tooltip:!this.options.label&&this.getAction().label&&this.options.icon&&(e=this.getAction().label,this.options.keybinding&&(e=ti.a({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e&&this.item&&(this.item.title=e)}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.getAction().class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.getAction().enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){this.item&&(this.getAction().checked?(this.item.classList.add("checked"),this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked","true")):(this.item.classList.remove("checked"),this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked","false")))}getMnemonic(){return this.mnemonic}applyStyle(){if(!this.menuStyle)return;const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`thin solid ${this.menuStyle.selectionBorderColor}`:"";this.item&&(this.item.style.color=t?t.toString():"",this.item.style.backgroundColor=i?i.toString():""),this.check&&(this.check.style.color=t?t.toString():""),this.container&&(this.container.style.border=n)}style(e){this.menuStyle=e,this.applyStyle()}}class pr extends mr{constructor(e,t,i,n){super(e,e,n),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new de.b),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:ur.Right,this.showScheduler=new Se.e((()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))}),250),this.hideScheduler=new Se.e((()=>{this.element&&!Object(Z.K)(Object(Z.y)(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))}),750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=Object(Z.q)(this.item,Object(Z.a)("span.submenu-indicator"+dr.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(Object(Z.i)(this.element,Z.d.KEY_UP,(e=>{let t=new zt.a(e);(t.equals(17)||t.equals(3))&&(Z.c.stop(e,!0),this.createSubmenu(!0))}))),this._register(Object(Z.i)(this.element,Z.d.KEY_DOWN,(e=>{let t=new zt.a(e);Object(Z.y)()===this.item&&(t.equals(17)||t.equals(3))&&Z.c.stop(e,!0)}))),this._register(Object(Z.i)(this.element,Z.d.MOUSE_OVER,(e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())}))),this._register(Object(Z.i)(this.element,Z.d.MOUSE_LEAVE,(e=>{this.mouseOver=!1}))),this._register(Object(Z.i)(this.element,Z.d.FOCUS_OUT,(e=>{this.element&&!Object(Z.K)(Object(Z.y)(),this.element)&&this.hideScheduler.schedule()}))),this._register(this.parentData.parent.onScroll((()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)}))))}updateEnabled(){}onClick(e){Z.c.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch(e){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0};return o.left=er(e.width,t.width,{position:n===ur.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new zt.a(e).equals(15)&&(Z.c.stop(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))}))),this.submenuDisposables.add(Object(Z.i)(this.submenuContainer,Z.d.KEY_DOWN,(e=>{new zt.a(e).equals(15)&&Z.c.stop(e,!0)}))),this.submenuDisposables.add(this.parentData.submenu.onDidCancel((()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)}))),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){if(super.applyStyle(),!this.menuStyle)return;const e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=e?`${e}`:""),this.parentData.submenu&&this.parentData.submenu.style(this.menuStyle)}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class fr extends nr.a{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?`${e.separatorColor}`:"")}}let _r=`\n.monaco-menu {\n\tfont-size: 13px;\n\n}\n\n${Object(or.a)(cr)}\n${Object(or.a)(dr)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\topacity: 0.4;\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid #bbb;\n\tpadding-top: 1px;\n\tmargin-left: .8em;\n\tmargin-right: .8em;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tpadding: 0.5em 0 0 0;\n\tmargin-bottom: 0.5em;\n\twidth: 100%;\n\theight: 0px !important;\n\tmargin-left: .8em !important;\n\tmargin-right: .8em !important;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tborder: thin solid transparent; /* prevents jumping behaviour on hover or focus */\n}\n\n\n/* High Contrast Theming */\n:host-context(.hc-black) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: .5em 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 1.8em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tpadding: 0.2em 0 0 0;\n\tmargin-bottom: 0.2em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}\n\n/* Arrows */\n.monaco-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.monaco-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n}\n.monaco-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.monaco-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.monaco-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.monaco-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: #DDD 0 6px 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: #DDD 6px 0 6px -6px inset;\n}\n.monaco-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.monaco-scrollable-element > .shadow.top.left {\n\tbox-shadow: #DDD 6px 6px 6px -6px inset;\n}\n\n/* ---------- Default Style ---------- */\n\n:host-context(.vs) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(100, 100, 100, .4);\n}\n:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(121, 121, 121, .4);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider {\n\tbackground: rgba(111, 195, 223, .6);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: rgba(100, 100, 100, .7);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider:hover {\n\tbackground: rgba(111, 195, 223, .8);\n}\n\n.monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(0, 0, 0, .6);\n}\n:host-context(.vs-dark) .monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(191, 191, 191, .4);\n}\n:host-context(.hc-black) .monaco-scrollable-element > .scrollbar > .slider.active {\n\tbackground: rgba(111, 195, 223, 1);\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.top {\n\tbox-shadow: none;\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.left {\n\tbox-shadow: #000 6px 0 6px -6px inset;\n}\n\n:host-context(.vs-dark) .monaco-scrollable-element .shadow.top.left {\n\tbox-shadow: #000 6px 6px 6px -6px inset;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.top {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.left {\n\tbox-shadow: none;\n}\n\n:host-context(.hc-black) .monaco-scrollable-element .shadow.top.left {\n\tbox-shadow: none;\n}\n`;var br=i(64),vr=i(26);class Cr{constructor(e,t,i,n,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.themeService=o,this.focusToReturn=null,this.block=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let i;this.focusToReturn=document.activeElement;let n=Object(Z.L)(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:n=>{let o=e.getMenuClassName?e.getMenuClassName():"";o&&(n.className+=" "+o),this.options.blockMouse&&(this.block=n.appendChild(Object(Z.a)(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",Object(vr.a)(this.block,Z.d.MOUSE_DOWN)((e=>e.stopPropagation())));const s=new de.b,r=e.actionRunner||new nn.b;return r.onBeforeRun(this.onActionRun,this,s),r.onDidRun(this.onDidActionRun,this,s),i=new gr(n,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:r,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)}),s.add(Object(br.c)(i,this.themeService)),i.onDidCancel((()=>this.contextViewService.hideContextView(!0)),null,s),i.onDidBlur((()=>this.contextViewService.hideContextView(!0)),null,s),Object(vr.a)(window,Z.d.BLUR)((()=>{this.contextViewService.hideContextView(!0)}),null,s),Object(vr.a)(window,Z.d.MOUSE_DOWN)((e=>{if(e.defaultPrevented)return;let t=new rr.a(e),i=t.target;if(!t.rightButton){for(;i;){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}}),null,s),Object(de.e)(s,i)},focus:()=>{i&&i.focus(!!e.autoSelectFirstItem)},onHide:t=>{e.onHide&&e.onHide(!!t),this.block&&(this.block.remove(),this.block=null),this.focusToReturn&&this.focusToReturn.focus()}},n,!!n)}onActionRun(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&!Object(rt.d)(e.error)&&this.notificationService.error(e.error)}}var wr=i(119),yr=function(e,t){return function(i,n){t(i,n,e)}};let Sr=class extends de.a{constructor(e,t,i,n,o){super(),this.contextMenuHandler=new Cr(i,e,t,n,o)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(e),Z.e.getInstance().resetKeyStatus()}};Sr=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([yr(0,wr.a),yr(1,Li.a),yr(2,Ln.b),yr(3,no.a),yr(4,ln.b)],Sr);const xr=Object(tt.c)("layoutService");let Lr=class extends de.a{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=de.a.None,this.container=e.container,this.contextView=this._register(new tr(this.container,1)),this.layout(),this._register(e.onDidLayout((()=>this.layout())))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?t!==this.container&&(this.container=t,this.setContainer(t,i?3:2)):this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.contextView.show(e);const n=Object(de.h)((()=>{this.currentViewDisposable===n&&this.hideContextView()}));return this.currentViewDisposable=n,n}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};Lr=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(0,xr)],Lr);const kr=Object(tt.c)("dialogService");class Dr{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}}class Nr{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(let t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(this._hashFn(t),n),n.incoming.set(this._hashFn(e),i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(let e of this._nodes.values())e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new Dr(e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){let e=[];for(let[t,i]of this._nodes)e.push(`${t}, (incoming)[${[...i.incoming.keys()].join(", ")}], (outgoing)[${[...i.outgoing.keys()].join(",")}]`);return e.join("\n")}findCycleSlow(){for(let[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(let[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const e=this._findCycle(n,t);if(e)return e;t.delete(i)}}}var Er=i(130);class Or extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=null!==(t=e.findCycleSlow())&&void 0!==t?t:`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}}class Ir{constructor(e=new xn.a,t=!1,i){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=i,this._services.set(tt.a,this)}createChild(e){return new Ir(e,this._strict,this)}invokeFunction(e,...t){let i=Tr.traceInvocation(e),n=!1;try{return e({get:(e,t)=>{if(n)throw Object(rt.c)("service accessor is only valid during the invocation of its target method");const o=this._getOrCreateServiceInstance(e,i);if(!o&&t!==tt.d)throw new Error(`[invokeFunction] unknown service '${e}'`);return o}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof Er.a?(i=Tr.traceCreation(e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Tr.traceCreation(e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){let n=tt.b.getServiceDependencies(e).sort(((e,t)=>e.index-t.index)),o=[];for(const t of n){let n=this._getOrCreateServiceInstance(t.id,i);if(!n&&this._strict&&!t.optional)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);o.push(n)}let s=n.length>0?n[0].index:t.length;if(t.length!==s){console.warn(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);let i=s-t.length;t=i>0?t.concat(new Array(i)):t.slice(0,s)}return new e(...[...t,...o])}_setServiceInstance(e,t){if(this._services.get(e)instanceof Er.a)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){let i=this._getServiceInstanceOrDescriptor(e);return i instanceof Er.a?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const n=new Nr((e=>e.id.toString()));let o=0;const s=[{id:e,desc:t,_trace:i}];for(;s.length;){const t=s.pop();if(n.lookupOrInsertNode(t),o++>1e3)throw new Or(n);for(let i of tt.b.getServiceDependencies(t.desc.ctor)){let o=this._getServiceInstanceOrDescriptor(i.id);if(o||i.optional||console.warn(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`),o instanceof Er.a){const e={id:i.id,desc:o,_trace:t._trace.branch(i.id,!0)};n.insertEdge(t,e),s.push(e)}}}for(;;){const e=n.roots();if(0===e.length){if(!n.isEmpty())throw new Or(n);break}for(const{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof Er.a){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e)}n.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof Er.a)return this._createServiceInstance(t,i,n,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t=[],i,n){if(i){const i=new Se.b((()=>this._createInstance(e,t,n)));return new Proxy(Object.create(null),{get(e,t){if(t in e)return e[t];let n=i.value,o=n[t];return"function"!=typeof o||(o=o.bind(n),e[t]=o),o},set:(e,t,n)=>(i.value[t]=n,!0)})}return this._createInstance(e,t,n)}}class Tr{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return Tr._None}static traceCreation(e){return Tr._None}branch(e,t){let i=new Tr(2,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;Tr._totals+=e;let t=!1,i=[`${0===this.type?"CREATE":"CALL"} ${this.name}`,`${function e(i,n){let o=[],s=new Array(i+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,o.push(`${s}CREATES -> ${r}`);let n=e(i+1,l);n&&o.push(n)}else o.push(`${s}uses -> ${r}`);return o.join("\n")}(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Tr._totals.toFixed(2)}ms)`];(e>2||t)&&console.log(i.join("\n"))}}Tr._None=new class extends Tr{constructor(){super(-1,null)}stop(){}branch(){return this}},Tr._totals=0;var Mr=i(126),Ar=i(111),Rr=i(45);class Pr{constructor(){this._byResource=new X.b,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let o=this._byOwner.get(t);o||(o=new X.b,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){let i=this._byResource.get(e);return null==i?void 0:i.get(t)}delete(e,t){let i=!1,n=!1,o=this._byResource.get(e);o&&(i=o.delete(t));let s=this._byOwner.get(t);if(s&&(n=s.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,o;return"string"==typeof e?null!==(i=null===(t=this._byOwner.get(e))||void 0===t?void 0:t.values())&&void 0!==i?i:Bs.a.empty():V.a.isUri(e)?null!==(o=null===(n=this._byResource.get(e))||void 0===n?void 0:n.values())&&void 0!==o?o:Bs.a.empty():Bs.a.map(Bs.a.concat(...this._byOwner.values()),(e=>e[1]))}}class Fr{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new X.b,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(e.scheme===ee.c.inMemory||e.scheme===ee.c.walkThrough||e.scheme===ee.c.walkThroughSnippet)return t;for(const{severity:i}of this._service.read({resource:e}))i===Rr.c.Error?t.errors+=1:i===Rr.c.Warning?t.warnings+=1:i===Rr.c.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class Wr{constructor(){this._onMarkerChanged=new B.a,this.onMarkerChanged=B.b.debounce(this._onMarkerChanged.event,Wr._debouncer,0),this._data=new Pr,this._stats=new Fr(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(Object(ot.l)(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const i=Wr._toMarker(e,t,o);i&&n.push(i)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:c,relatedInformation:d,tags:u}=i;if(s)return a=a>0?a:1,l=l>0?l:1,h=h>=a?h:a,c=c>0?c:l,{resource:t,owner:e,code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:c,relatedInformation:d,tags:u}}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const e=this._data.get(i,t);if(e){const t=[];for(const i of e)if(Wr._accept(i,n)){const e=t.push(i);if(o>0&&e===o)break}return t}return[]}if(t||i){const e=this._data.values(null!=i?i:t),s=[];for(const t of e)for(const e of t)if(Wr._accept(e,n)){const t=s.push(e);if(o>0&&t===o)return s}return s}{const e=[];for(let t of this._data.values())for(let i of t)if(Wr._accept(i,n)){const t=e.push(i);if(o>0&&t===o)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _debouncer(e,t){e||(Wr._dedupeMap=new X.b,e=[]);for(const i of t)Wr._dedupeMap.has(i)||(Wr._dedupeMap.set(i,!0),e.push(i));return e}}var Br=i(128),jr=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Vr=function(e,t){return function(i,n){t(i,n,e)}};let Hr=class{constructor(e){this._commandService=e}createMenu(e,t,i=!1){return new zr(e,i,this._commandService,t,this)}};Hr=jr([Vr(0,ie.b)],Hr);let zr=class e{constructor(e,t,i,n,o){this._id=e,this._fireEventsForSubmenuChanges=t,this._commandService=i,this._contextKeyService=n,this._menuService=o,this._dispoables=new de.b,this._onDidChange=new B.a,this.onDidChange=this._onDidChange.event,this._menuGroups=[],this._contextKeys=new Set,this._build();const s=new Se.e((()=>this._build()),50);this._dispoables.add(s),this._dispoables.add(io.d.onDidChangeMenu((t=>{t.has(e)&&s.schedule()})));const r=new Se.e((()=>this._onDidChange.fire(this)),50);this._dispoables.add(r),this._dispoables.add(n.onDidChangeContext((e=>{e.affectsSome(this._contextKeys)&&r.schedule()})))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}_build(){this._menuGroups.length=0,this._contextKeys.clear();const t=io.d.getMenuItems(this._id);let i;t.sort(e._compareMenuItems);for(let e of t){const t=e.group||"";i&&i[0]===t||(i=[t,[]],this._menuGroups.push(i)),i[1].push(e),this._collectContextKeys(e)}this._onDidChange.fire(this)}_collectContextKeys(t){if(e._fillInKbExprKeys(t.when,this._contextKeys),Object(io.f)(t)){if(t.command.precondition&&e._fillInKbExprKeys(t.command.precondition,this._contextKeys),t.command.toggled){const i=t.command.toggled.condition||t.command.toggled;e._fillInKbExprKeys(i,this._contextKeys)}}else this._fireEventsForSubmenuChanges&&io.d.getMenuItems(t.submenu).forEach(this._collectContextKeys,this)}getActions(e){const t=[];for(let i of this._menuGroups){const[n,o]=i,s=[];for(const t of o)if(this._contextKeyService.contextMatchesRules(t.when)){const i=Object(io.f)(t)?new io.c(t.command,t.alt,e,this._contextKeyService,this._commandService):new io.e(t,this._menuService,this._contextKeyService,e);s.push(i)}s.length>0&&t.push([n,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(let i of e.keys())t.add(i)}static _compareMenuItems(t,i){let n=t.group,o=i.group;if(n!==o){if(!n)return 1;if(!o)return-1;if("navigation"===n)return-1;if("navigation"===o)return 1;let e=n.localeCompare(o);if(0!==e)return e}let s=t.order||0,r=i.order||0;return sr?1:e._compareTitles(Object(io.f)(t)?t.command.title:t.title,Object(io.f)(i)?i.command.title:i.title)}static _compareTitles(e,t){const i="string"==typeof e?e:e.original,n="string"==typeof t?t:t.original;return i.localeCompare(n)}};zr=jr([Vr(2,ie.b),Vr(3,rn.b),Vr(4,io.a)],zr);var Ur=i(158),Kr=function(e,t){return function(i,n){t(i,n,e)}};function $r(e){return e.toString()}class qr extends de.a{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(Object(de.h)((()=>{this.model.deltaDecorations([...this._markersData.keys()],[]),this._markersData.clear()})))}update(e,t){const i=[...this._markersData.keys()];this._markersData.clear();const n=this.model.deltaDecorations(i,t);for(let t=0;tthis._onModelAdded(e))),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach((e=>e.dispose())),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get($r(e));return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach((e=>{const t=this._markerDecorations.get($r(e));t&&this._updateDecorations(t)}))}_onModelAdded(e){const t=new qr(e);this._markerDecorations.set($r(e.uri),t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get($r(e.uri));t&&(t.dispose(),this._markerDecorations.delete($r(e.uri))),e.uri.scheme!==ee.c.inMemory&&e.uri.scheme!==ee.c.internal&&e.uri.scheme!==ee.c.vscode||this._markerService&&this._markerService.read({resource:e.uri}).map((e=>e.owner)).forEach((t=>this._markerService.remove(t,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});let i=t.map((t=>({range:this._createDecorationRange(e.model,t),options:this._createDecorationOption(t)})));e.update(t,i)&&this._onDidChangeMarker.fire(e.model)}_createDecorationRange(e,t){let i=z.a.lift(t);if(t.severity!==Rr.c.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){let t=e.getWordAtPosition(i.getStartPosition());if(t)i=new z.a(i.startLineNumber,t.startColumn,i.endLineNumber,t.endColumn);else{let t=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);1===t||(i=i.endColumn>=t?new z.a(i.startLineNumber,t-1,i.endLineNumber,t):new z.a(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn+1))}}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&i.startLineNumber===i.endLineNumber){let n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n=0}};Gr=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Kr(0,et.a),Kr(1,Rr.b)],Gr);var Yr=i(104),Zr=function(e,t){return function(i,n){t(i,n,e)}};let Qr=class extends de.a{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new B.a,this._accessibilityModeEnabledContext=oo.a.bindTo(this._contextKeyService);const i=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(i(),this._onDidChangeScreenReaderOptimized.fire())}))),i(),this.onDidChangeScreenReaderOptimized((()=>i()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}getAccessibilitySupport(){return this._accessibilitySupport}};Qr=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Zr(0,rn.b),Zr(1,Yt.a)],Qr);var Xr=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Jr{constructor(){this.mapTextToType=new Map,this.findText=""}writeText(e,t){return Xr(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);try{return yield navigator.clipboard.writeText(e)}catch(e){console.error(e)}const i=document.activeElement,n=document.body.appendChild(Object(Z.a)("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(n)}))}readText(e){return Xr(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(e){return console.error(e),""}}))}readFindText(){return Xr(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return Xr(this,void 0,void 0,(function*(){this.findText=e}))}}var ea=function(e,t){return function(i,n){t(i,n,e)}},ta=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function ia(e){return e.scheme===ee.c.file?e.fsPath:e.path}let na=0;class oa{constructor(e,t,i,n,o,s,r){this.id=++na,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class sa{constructor(e,t){this.resourceLabel=e,this.reason=t}}class ra{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,i]of this.elements)(0===i.reason?e:t).push(i.resourceLabel);let i=[];return e.length>0&&i.push(ti.a({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(ti.a({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join("\n")}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class aa{constructor(e,t,i,n,o,s,r){this.id=++na,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new ra),this.removedResources.has(t)||this.removedResources.set(t,new sa(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new ra),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new sa(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class la{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){let e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let e=0,i=this._past.length;e=0;e--)t.push(this._future[e].id);return new Uo.b(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let s=0,r=this._past.length;s=t||r.id!==e.elements[n])&&(i=!1,o=0),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let o=this._future.length-1;o>=0;o--,n++){const r=this._future[o];i&&(n>=t||r.id!==e.elements[n])&&(i=!1,s=o),i||1!==r.type||r.removeResource(this.resourceLabel,this.strResource,0)}-1!==o&&(this._past=this._past.slice(0,o)),-1!==s&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const t of this._past)e.push(t.actual);for(const e of this._future)t.push(e.actual);return{past:e,future:t}}getClosestPastElement(){return 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class ha{constructor(e){this.editStacks=e,this._versionIds=[];for(let e=0,t=this.editStacks.length;et.sourceOrder)&&(t=s,i=n)}return[t,i]}canUndo(e){if(e instanceof Uo.d){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasPastElements()}_onError(e,t){Object(rt.e)(e);for(const e of t.strResources)this.removeElements(e);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,o){const s=this._acquireLocks(i);let r;try{r=t()}catch(t){return s(),n.dispose(),this._onError(t,e)}return r?r.then((()=>(s(),n.dispose(),o())),(t=>(s(),n.dispose(),this._onError(t,e)))):(s(),n.dispose(),o())}_invokeWorkspacePrepare(e){return ta(this,void 0,void 0,(function*(){if(void 0===e.actual.prepareUndoRedo)return de.a.None;const t=e.actual.prepareUndoRedo();return void 0===t?de.a.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(de.a.None);const i=e.actual.prepareUndoRedo();return i?Object(de.g)(i)?t(i):i.then((e=>t(e))):t(de.a.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||ca);return new ha(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new ua(this._undo(e,0,!0));for(const e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new ua}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,ti.a({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,ti.a({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const e of i.editStacks)e.getClosestPastElement()!==t&&o.push(e.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,ti.a({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const e of i.editStacks)e.locked&&s.push(e.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,ti.a({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,ti.a({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const i=t.getSecondClosestPastElement();if(i&&i.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,n){return ta(this,void 0,void 0,(function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){const o=yield this._dialogService.show(Ut.a.Info,ti.a("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),[ti.a({key:"ok",comment:["{0} denotes a number that is > 1"]},"Undo in {0} Files",i.editStacks.length),ti.a("nok","Undo this File"),ti.a("cancel","Cancel")],{cancelId:2});if(2===o.choice)return;if(1===o.choice)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const s=this._checkWorkspaceUndo(e,t,i,!1);if(s)return s.returnValue;n=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const s=this._checkWorkspaceUndo(e,t,i,!0);if(s)return o.dispose(),s.returnValue;for(const e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.undo()),i,o,(()=>this._continueUndoInGroup(t.groupId,n)))}))}_resourceUndo(e,t,i){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,(()=>t.actual.undo()),new ha([e]),n,(()=>this._continueUndoInGroup(t.groupId,i))))));{const e=ti.a({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);return i?this._undo(i,0,t):void 0}undo(e){if(e instanceof Uo.d){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),o=n.getClosestPastElement();if(o){if(o.groupId){const[e,n]=this._findClosestUndoElementInGroup(o.groupId);if(o!==e&&n)return this._undo(n,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return 1===o.type?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}}_confirmAndContinueUndo(e,t,i){return ta(this,void 0,void 0,(function*(){if(1!==(yield this._dialogService.show(Ut.a.Info,ti.a("confirmDifferentSource","Would you like to undo '{0}'?",i.label),[ti.a("confirmDifferentSource.ok","Undo"),ti.a("cancel","Cancel")],{cancelId:1})).choice)return this._undo(e,t,!0)}))}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,ti.a({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const e of i.editStacks)e.locked&&s.push(e.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,ti.a({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,ti.a({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return ta(this,void 0,void 0,(function*(){let n;try{n=yield this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const e of i.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.redo()),i,n,(()=>this._continueRedoInGroup(t.groupId)))}))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(i=>(e.moveForward(t),this._safeInvokeWithLocks(t,(()=>t.actual.redo()),new ha([e]),i,(()=>this._continueRedoInGroup(t.groupId))))));{const e=ti.a({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([ea(0,kr),ea(1,Li.a)],da);class ua{constructor(e){this.returnValue=e}}Object(Yr.b)(Uo.a,da);const ga={ctrlCmd:!1,alt:!1};var ma,pa;!function(e){e[e.Blur=1]="Blur",e[e.Gesture=2]="Gesture",e[e.Other=3]="Other"}(ma||(ma={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.SECOND=2]="SECOND",e[e.LAST=3]="LAST"}(pa||(pa={}));const fa=new Se.b((()=>{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}}));var _a=i(160),ba=i(134),va=i(78),Ca=i(140);const wa={},ya=new Ca.a("quick-input-button-icon-");function Sa(e){if(!e)return;let t;const i=e.dark.toString();return wa[i]?t=wa[i]:(t=ya.nextId(),Z.v(`.${t}`,`background-image: ${Z.s(e.light||e.dark)}`),Z.v(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${Z.s(e.dark)}`),wa[i]=t),t}const xa=Z.a;class La{constructor(e,t,i){this.os=t,this.keyElements=new Set,this.options=i||Object.create(null),this.labelBackground=this.options.keybindingLabelBackground,this.labelForeground=this.options.keybindingLabelForeground,this.labelBorder=this.options.keybindingLabelBorder,this.labelBottomBorder=this.options.keybindingLabelBottomBorder,this.labelShadow=this.options.keybindingLabelShadow,this.domNode=Z.q(e,xa(".monaco-keybinding")),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&La.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){if(this.clear(),this.keybinding){let[e,t]=this.keybinding.getParts();e&&this.renderPart(this.domNode,e,this.matches?this.matches.firstPart:null),t&&(Z.q(this.domNode,xa("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderPart(this.domNode,t,this.matches?this.matches.chordPart:null)),this.domNode.title=this.keybinding.getAriaLabel()||""}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.applyStyles(),this.didEverRender=!0}clear(){Z.t(this.domNode),this.keyElements.clear()}renderPart(e,t,i){const n=hi.b.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,n.ctrlKey,Boolean(null==i?void 0:i.ctrlKey),n.separator),t.shiftKey&&this.renderKey(e,n.shiftKey,Boolean(null==i?void 0:i.shiftKey),n.separator),t.altKey&&this.renderKey(e,n.altKey,Boolean(null==i?void 0:i.altKey),n.separator),t.metaKey&&this.renderKey(e,n.metaKey,Boolean(null==i?void 0:i.metaKey),n.separator);const o=t.keyLabel;o&&this.renderKey(e,o,Boolean(null==i?void 0:i.keyCode),"")}renderKey(e,t,i,n){Z.q(e,this.createKeyElement(t,i?".highlight":"")),n&&Z.q(e,xa("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){Z.q(e,this.createKeyElement(Object(ti.a)("unbound","Unbound")))}createKeyElement(e,t=""){const i=xa("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),i}style(e){this.labelBackground=e.keybindingLabelBackground,this.labelForeground=e.keybindingLabelForeground,this.labelBorder=e.keybindingLabelBorder,this.labelBottomBorder=e.keybindingLabelBottomBorder,this.labelShadow=e.keybindingLabelShadow,this.applyStyles()}applyStyles(){var e;if(this.element){for(const t of this.keyElements)this.labelBackground&&(t.style.backgroundColor=null===(e=this.labelBackground)||void 0===e?void 0:e.toString()),this.labelBorder&&(t.style.borderColor=this.labelBorder.toString()),this.labelBottomBorder&&(t.style.borderBottomColor=this.labelBottomBorder.toString()),this.labelShadow&&(t.style.boxShadow=`inset 0 -1px 0 ${this.labelShadow}`);this.labelForeground&&(this.element.style.color=this.labelForeground.toString())}}static areSame(e,t){return e===t||!e&&!t||!!e&&!!t&&Object(ue.d)(e.firstPart,t.firstPart)&&Object(ue.d)(e.chordPart,t.chordPart)}}var ka=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};const Da=Z.a;class Na{constructor(e){this.hidden=!1,this._onChecked=new B.a,this.onChecked=this._onChecked.event,Object.assign(this,e)}get checked(){return!!this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire(e))}dispose(){this._onChecked.dispose()}}class Ea{get templateId(){return Ea.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Z.q(e,Da(".quick-input-list-entry"));const i=Z.q(t.entry,Da("label.quick-input-list-label"));t.toDisposeTemplate.push(Z.o(i,Z.d.CLICK,(e=>{t.checkbox.offsetParent||e.preventDefault()}))),t.checkbox=Z.q(i,Da("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Z.o(t.checkbox,Z.d.CHANGE,(e=>{t.element.checked=t.checkbox.checked})));const n=Z.q(i,Da(".quick-input-list-rows")),o=Z.q(n,Da(".quick-input-list-row")),s=Z.q(n,Da(".quick-input-list-row"));t.label=new _a.a(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0});const r=Z.q(o,Da(".quick-input-list-entry-keybinding"));t.keybinding=new La(r,Ne.a);const a=Z.q(s,Da(".quick-input-list-label-meta"));return t.detail=new ba.a(a,!0),t.separator=Z.q(t.entry,Da(".quick-input-list-separator")),t.actionBar=new en.a(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){i.toDisposeElement=Object(de.f)(i.toDisposeElement),i.element=e,i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked((e=>i.checkbox.checked=e)));const{labelHighlights:n,descriptionHighlights:o,detailHighlights:s}=e,r=Object.create(null);r.matches=n||[],r.descriptionTitle=e.saneDescription,r.descriptionMatches=o||[],r.extraClasses=e.item.iconClasses,r.italic=e.item.italic,r.strikethrough=e.item.strikethrough,i.label.setLabel(e.saneLabel,e.saneDescription,r),i.keybinding.set(e.item.keybinding),i.detail.set(e.saneDetail,s),e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator),i.actionBar.clear();const a=e.item.buttons;a&&a.length?(i.actionBar.push(a.map(((t,i)=>{let n=t.iconClass||(t.iconPath?Sa(t.iconPath):void 0);t.alwaysVisible&&(n=n?`${n} always-visible`:"always-visible");const o=new nn.a(`id-${i}`,"",n,!0,(()=>{return i=this,n=void 0,s=function*(){e.fireButtonTriggered({button:t,item:e.item})},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(r,a)}l((s=s.apply(i,n||[])).next())}));var i,n,o,s}));return o.tooltip=t.tooltip||"",o})),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=Object(de.f)(i.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=Object(de.f)(e.toDisposeElement),e.toDisposeTemplate=Object(de.f)(e.toDisposeTemplate)}}Ea.ID="listelement";class Oa{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return Ea.ID}}var Ia;!function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage"}(Ia||(Ia={}));class Ta{constructor(e,t,i){this.parent=e,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnMeta=!0,this.sortByLabel=!0,this._onChangedAllVisibleChecked=new B.a,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new B.a,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new B.a,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new B.a,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new B.a,this.onButtonTriggered=this._onButtonTriggered.event,this._onKeyDown=new B.a,this.onKeyDown=this._onKeyDown.event,this._onLeave=new B.a,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Z.q(this.parent,Da(".quick-input-list"));const n=new Oa,o=new Ma;this.list=i.createList("QuickInput",this.container,n,[new Ea],{identityProvider:{getId:e=>e.saneLabel},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:o}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown((e=>{const t=new zt.a(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(Ne.f?e.metaKey:e.ctrlKey)&&this.list.setFocus(Object(ot.q)(this.list.length));break;case 16:const t=this.list.getFocus();1===t.length&&0===t[0]&&this._onLeave.fire();break;case 18:const i=this.list.getFocus();1===i.length&&i[0]===this.list.length-1&&this._onLeave.fire()}this._onKeyDown.fire(t)}))),this.disposables.push(this.list.onMouseDown((e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()}))),this.disposables.push(Z.i(this.container,Z.d.CLICK,(e=>{(e.x||e.y)&&this._onLeave.fire()}))),this.disposables.push(this.list.onMouseMiddleClick((e=>{this._onLeave.fire()}))),this.disposables.push(this.list.onContextMenu((e=>{"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))}))),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return B.b.map(this.list.onDidChangeFocus,(e=>e.elements.map((e=>e.item))))}get onDidChangeSelection(){return B.b.map(this.list.onDidChangeSelection,(e=>({items:e.elements.map((e=>e.item)),event:e.browserEvent})))}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i{t.hidden||(t.checked=e)}))}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=Object(de.f)(this.elementDisposables);const t=e=>this.fireButtonTriggered(e);this.inputElements=e,this.elements=e.reduce(((i,n,o)=>{var s,r,a;if("separator"!==n.type){const l=o&&e[o-1],h=n.label&&n.label.replace(/\r?\n/g," "),c=n.meta&&n.meta.replace(/\r?\n/g," "),d=n.description&&n.description.replace(/\r?\n/g," "),u=n.detail&&n.detail.replace(/\r?\n/g," "),g=n.ariaLabel||[h,d,u].map((e=>Object(hn.c)(e))).filter((e=>!!e)).join(", ");i.push(new Na({index:o,item:n,saneLabel:h,saneMeta:c,saneAriaLabel:g,saneDescription:d,saneDetail:u,labelHighlights:null===(s=n.highlights)||void 0===s?void 0:s.label,descriptionHighlights:null===(r=n.highlights)||void 0===r?void 0:r.description,detailHighlights:null===(a=n.highlights)||void 0===a?void 0:a.detail,checked:!1,separator:l&&"separator"===l.type?l:void 0,fireButtonTriggered:t}))}return i}),[]),this.elementDisposables.push(...this.elements),this.elementDisposables.push(...this.elements.map((e=>e.onChecked((()=>this.fireCheckedEvents()))))),this.elementsToIndexes=this.elements.reduce(((e,t,i)=>(e.set(t.item,i),e)),new Map),this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map((e=>e.item))}setFocusedElements(e){if(this.list.setFocus(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e)))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e))))}getCheckedElements(){return this.elements.filter((e=>e.checked)).map((e=>e.item))}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===Ia.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=Ia.First),e===Ia.Previous&&0===this.list.getFocus()[0]&&(e=Ia.Last),e===Ia.Second&&this.list.length<2&&(e=Ia.First),e){case Ia.First:this.list.focusFirst();break;case Ia.Second:this.list.focusNth(1);break;case Ia.Last:this.list.focusLast();break;case Ia.Next:this.list.focusNext();break;case Ia.Previous:this.list.focusPrevious();break;case Ia.NextPage:this.list.focusNextPage();break;case Ia.PreviousPage:this.list.focusPreviousPage()}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}layout(e){this.list.getHTMLElement().style.maxHeight=e?`calc(${44*Math.floor(e/44)}px)`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let t;this.elements.forEach((i=>{const n=this.matchOnLabel?Object(Ye.n)(Object(ar.c)(e,Object(ar.d)(i.saneLabel))):void 0,o=this.matchOnDescription?Object(Ye.n)(Object(ar.c)(e,Object(ar.d)(i.saneDescription||""))):void 0,s=this.matchOnDetail?Object(Ye.n)(Object(ar.c)(e,Object(ar.d)(i.saneDetail||""))):void 0,r=this.matchOnMeta?Object(Ye.n)(Object(ar.c)(e,Object(ar.d)(i.saneMeta||""))):void 0;if(n||o||s||r?(i.labelHighlights=n,i.descriptionHighlights=o,i.detailHighlights=s,i.hidden=!1):(i.labelHighlights=void 0,i.descriptionHighlights=void 0,i.detailHighlights=void 0,i.hidden=!i.item.alwaysShow),i.separator=void 0,!this.sortByLabel){const e=i.index&&this.inputElements[i.index-1];t=e&&"separator"===e.type?e:t,t&&!i.hidden&&(i.separator=t,t=void 0)}}))}else this.elements.forEach((e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.separator=t&&"separator"===t.type?t:void 0}));const t=this.elements.filter((e=>!e.hidden));if(this.sortByLabel&&e){const i=e.toLowerCase();t.sort(((e,t)=>function(e,t,i){const n=e.labelHighlights||[],o=t.labelHighlights||[];return n.length&&!o.length?-1:!n.length&&o.length?1:0===n.length&&0===o.length?0:function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=n.startsWith(i),r=o.startsWith(i);if(s!==r)return s?-1:1;if(s&&r){if(n.lengtho.length)return 1}return 0}(e,t,i);if(s)return s;const r=n.endsWith(i);if(r!==o.endsWith(i))return r?-1:1;const a=function(e,t,i=!1){const n=e||"",o=t||"",s=fa.value.collator.compare(n,o);return fa.value.collatorIsNumeric&&0===s&&n!==o?n(e.set(t.item,i),e)),new Map),this.list.splice(0,this.list.length,t),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(t.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=Object(de.f)(this.elementDisposables),this.disposables=Object(de.f)(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}style(e){this.list.style(e)}}ka([va.a],Ta.prototype,"onDidChangeFocus",null),ka([va.a],Ta.prototype,"onDidChangeSelection",null);class Ma{getWidgetAriaLabel(){return Object(ti.a)("quickInput","Quick Input")}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(){return"option"}}var Aa=i(172),Ra=i(103);const Pa=Z.a,Fa={inputBackground:_s.a.fromHex("#3C3C3C"),inputForeground:_s.a.fromHex("#CCCCCC"),inputValidationInfoBorder:_s.a.fromHex("#55AAFF"),inputValidationInfoBackground:_s.a.fromHex("#063B49"),inputValidationWarningBorder:_s.a.fromHex("#B89500"),inputValidationWarningBackground:_s.a.fromHex("#352A05"),inputValidationErrorBorder:_s.a.fromHex("#BE1100"),inputValidationErrorBackground:_s.a.fromHex("#5A1D1D")};class Wa extends Ra.a{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new B.a),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new B.a),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),Object(ue.f)(this.options,Fa,!1),this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=null!==(n=this.options.tooltip)&&void 0!==n?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground,this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Z.q(e,Pa(".monaco-inputbox.idle"));let o=this.options.flexibleHeight?"textarea":"input",s=Z.q(this.element,Pa(".ibwrapper"));if(this.input=Z.q(s,Pa(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,(()=>this.element.classList.add("synthetic-focus"))),this.onblur(this.input,(()=>this.element.classList.remove("synthetic-focus"))),this.options.flexibleHeight){this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=Z.q(s,Pa("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new tn.b(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Z.q(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll((e=>this.input.scrollTop=e.scrollTop)));const t=B.b.filter(Object(vr.a)(document,"selectionchange"),(()=>{const e=document.getSelection();return(null==e?void 0:e.anchorNode)===s}));this._register(t(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,(()=>this.onValueChange())),this.onblur(this.input,(()=>this.onBlur())),this.onfocus(this.input,(()=>this.onFocus())),this.ignoreGesture(this.input),setTimeout((()=>this.updateMirror()),0),this.options.actions&&(this.actionbar=this._register(new en.a(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage()}onFocus(){this._showMessage()}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}setAriaLabel(e){this.ariaLabel=e,e?this.input.setAttribute("aria-label",this.ariaLabel):this.input.removeAttribute("aria-label")}getAriaLabel(){return this.ariaLabel}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:Z.G(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}get width(){return Z.H(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;this.mirror&&(t=(parseFloat(this.mirror.style.paddingLeft||"")||0)+(parseFloat(this.mirror.style.paddingRight||"")||0)),this.input.style.width=e-t+"px"}else this.input.style.width=e+"px";this.mirror&&(this.mirror.style.width=e+"px")}set paddingRight(e){this.options.flexibleHeight&&this.options.flexibleWidth?this.input.style.width=`calc(100% - ${e}px)`:this.input.style.paddingRight=e+"px",this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=i.border?`1px solid ${i.border}`:"",(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),null==e?void 0:e.type}stylesForType(e){switch(e){case 1:return{border:this.inputValidationInfoBorder,background:this.inputValidationInfoBackground,foreground:this.inputValidationInfoForeground};case 2:return{border:this.inputValidationWarningBorder,background:this.inputValidationWarningBackground,foreground:this.inputValidationWarningForeground};default:return{border:this.inputValidationErrorBorder,background:this.inputValidationErrorBackground,foreground:this.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e,t,i=()=>e.style.width=Z.H(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:t=>{if(!this.message)return null;e=Z.q(t,Pa(".monaco-inputbox-container")),i();const n={inline:!0,className:"monaco-inputbox-message"},o=this.message.formatContent?Object(Aa.b)(this.message.content,n):Object(Aa.c)(this.message.content,n);o.classList.add(this.classForType(this.message.type));const s=this.stylesForType(this.message.type);return o.style.backgroundColor=s.background?s.background.toString():"",o.style.color=s.foreground?s.foreground.toString():"",o.style.border=s.border?`1px solid ${s.border}`:"",Z.q(e,o),null},onHide:()=>{this.state="closed"},layout:i}),t=3===this.message.type?ti.a("alertErrorMessage","Error: {0}",this.message.content):2===this.message.type?ti.a("alertWarningMessage","Warning: {0}",this.message.content):ti.a("alertInfoMessage","Info: {0}",this.message.content),Gi.a(t),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";e+t?this.mirror.textContent=e+t:this.mirror.innerText=" ",this.layout()}style(e){this.inputBackground=e.inputBackground,this.inputForeground=e.inputForeground,this.inputBorder=e.inputBorder,this.inputValidationInfoBackground=e.inputValidationInfoBackground,this.inputValidationInfoForeground=e.inputValidationInfoForeground,this.inputValidationInfoBorder=e.inputValidationInfoBorder,this.inputValidationWarningBackground=e.inputValidationWarningBackground,this.inputValidationWarningForeground=e.inputValidationWarningForeground,this.inputValidationWarningBorder=e.inputValidationWarningBorder,this.inputValidationErrorBackground=e.inputValidationErrorBackground,this.inputValidationErrorForeground=e.inputValidationErrorForeground,this.inputValidationErrorBorder=e.inputValidationErrorBorder,this.applyStyles()}applyStyles(){const e=this.inputBackground?this.inputBackground.toString():"",t=this.inputForeground?this.inputForeground.toString():"",i=this.inputBorder?this.inputBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.input.style.backgroundColor="inherit",this.input.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Z.G(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,o=t.value;null!==i&&null!==n&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar&&this.actionbar.dispose(),super.dispose()}}const Ba=Z.a;class ja extends de.a{constructor(e){super(),this.parent=e,this.onKeyDown=e=>Z.i(this.inputBox.inputElement,Z.d.KEY_DOWN,(t=>{e(new zt.a(t))})),this.onMouseDown=e=>Z.i(this.inputBox.inputElement,Z.d.MOUSE_DOWN,(t=>{e(new rr.a(t))})),this.onDidChange=e=>this.inputBox.onDidChange(e),this.container=Z.q(this.parent,Ba(".quick-input-box")),this.inputBox=this._register(new Wa(this.container,void 0))}get value(){return this.inputBox.value}set value(e){this.inputBox.value=e}select(e=null){this.inputBox.select(e)}isSelectionAtEnd(){return this.inputBox.isSelectionAtEnd()}get placeholder(){return this.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.inputBox.setPlaceHolder(e)}get ariaLabel(){return this.inputBox.getAriaLabel()}set ariaLabel(e){this.inputBox.setAriaLabel(e)}get password(){return"password"===this.inputBox.inputElement.type}set password(e){this.inputBox.inputElement.type=e?"password":"text"}setAttribute(e,t){this.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===Ut.a.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===Ut.a.Info?1:e===Ut.a.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===Ut.a.Info?1:e===Ut.a.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}var Va=i(173);const Ha="done",za="active",Ua="infinite",Ka="discrete",$a={progressBarBackground:_s.a.fromHex("#0E70C0")};class qa extends de.a{constructor(e,t){super(),this.options=t||Object.create(null),Object(ue.f)(this.options,$a,!1),this.workedVal=0,this.progressBarBackground=this.options.progressBarBackground,this._register(this.showDelayedScheduler=new Se.e((()=>Object(Z.U)(this.element)),0)),this.create(e)}create(e){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.element.appendChild(this.bit),this.applyStyles()}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(za,Ua,Ka),this.workedVal=0,this.totalWork=void 0}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Ha),this.element.classList.contains(Ua)?(this.bit.style.opacity="0",e?setTimeout((()=>this.off()),200):this.off()):(this.bit.style.width="inherit",e?setTimeout((()=>this.off()),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(Ka,Ha),this.element.classList.add(za,Ua),this}getContainer(){return this.element}style(e){this.progressBarBackground=e.progressBarBackground,this.applyStyles()}applyStyles(){if(this.bit){const e=this.progressBarBackground?this.progressBarBackground.toString():"";this.bit.style.backgroundColor=e}}}var Ga=i(47),Ya=i(127);const Za={buttonBackground:_s.a.fromHex("#0E639C"),buttonHoverBackground:_s.a.fromHex("#006BB3"),buttonForeground:_s.a.white};class Qa extends de.a{constructor(e,t){super(),this._onDidClick=this._register(new B.a),this.options=t||Object.create(null),Object(ue.f)(this.options,Za,!1),this.buttonForeground=this.options.buttonForeground,this.buttonBackground=this.options.buttonBackground,this.buttonHoverBackground=this.options.buttonHoverBackground,this.buttonSecondaryForeground=this.options.buttonSecondaryForeground,this.buttonSecondaryBackground=this.options.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=this.options.buttonSecondaryHoverBackground,this.buttonBorder=this.options.buttonBorder,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),e.appendChild(this._element),this._register(Ga.b.addTarget(this._element)),[Z.d.CLICK,Ga.a.Tap].forEach((e=>{this._register(Object(Z.i)(this._element,e,(e=>{this.enabled?this._onDidClick.fire(e):Z.c.stop(e)})))})),this._register(Object(Z.i)(this._element,Z.d.KEY_DOWN,(e=>{const t=new zt.a(e);let i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._element.blur(),i=!0),i&&Z.c.stop(t,!0)}))),this._register(Object(Z.i)(this._element,Z.d.MOUSE_OVER,(e=>{this._element.classList.contains("disabled")||this.setHoverBackground()}))),this._register(Object(Z.i)(this._element,Z.d.MOUSE_OUT,(e=>{this.applyStyles()}))),this.focusTracker=this._register(Object(Z.W)(this._element)),this._register(this.focusTracker.onDidFocus((()=>this.setHoverBackground()))),this._register(this.focusTracker.onDidBlur((()=>this.applyStyles()))),this.applyStyles()}get onDidClick(){return this._onDidClick.event}setHoverBackground(){let e;e=this.options.secondary?this.buttonSecondaryHoverBackground?this.buttonSecondaryHoverBackground.toString():null:this.buttonHoverBackground?this.buttonHoverBackground.toString():null,e&&(this._element.style.backgroundColor=e)}style(e){this.buttonForeground=e.buttonForeground,this.buttonBackground=e.buttonBackground,this.buttonHoverBackground=e.buttonHoverBackground,this.buttonSecondaryForeground=e.buttonSecondaryForeground,this.buttonSecondaryBackground=e.buttonSecondaryBackground,this.buttonSecondaryHoverBackground=e.buttonSecondaryHoverBackground,this.buttonBorder=e.buttonBorder,this.applyStyles()}applyStyles(){if(this._element){let e,t;this.options.secondary?(t=this.buttonSecondaryForeground?this.buttonSecondaryForeground.toString():"",e=this.buttonSecondaryBackground?this.buttonSecondaryBackground.toString():""):(t=this.buttonForeground?this.buttonForeground.toString():"",e=this.buttonBackground?this.buttonBackground.toString():"");const i=this.buttonBorder?this.buttonBorder.toString():"";this._element.style.color=t,this._element.style.backgroundColor=e,this._element.style.borderWidth=i?"1px":"",this._element.style.borderStyle=i?"solid":"",this._element.style.borderColor=i}}get element(){return this._element}set label(e){this._element.classList.add("monaco-text-button"),this.options.supportIcons?Object(Z.P)(this._element,...Object(Ya.a)(e)):this._element.textContent=e,"string"==typeof this.options.title?this._element.title=this.options.title:this.options.title&&(this._element.title=e)}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}var Xa=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Ja=Z.a,el={iconClass:Object(hn.e)("quick-input-back",hn.b.arrowLeft).classNames,tooltip:Object(ti.a)("quickInput.back","Back"),handle:-1};class tl extends de.a{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.noValidationMessage=tl.noPromptMessage,this._severity=Ut.a.Ignore,this.buttonsUpdated=!1,this.onDidTriggerButtonEmitter=this._register(new B.a),this.onDidHideEmitter=this._register(new B.a),this.onDisposeEmitter=this._register(new B.a),this.visibleDisposables=this._register(new de.b),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){this._ignoreFocusOut=e,this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton((e=>{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)}))),this.ui.show(this),this.visible=!0,this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=ma.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:e||" "===this.ui.title.innerHTML||(this.ui.title.innerText=" ;");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this.busy&&!this.busyDelay&&(this.busyDelay=new Se.g,this.busyDelay.setIfNotSet((()=>{this.visible&&this.ui.progressBar.infinite()}),800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const e=this.buttons.filter((e=>e===el));this.ui.leftActionBar.push(e.map(((e,t)=>{const i=new nn.a(`id-${t}`,"",e.iconClass||Sa(e.iconPath),!0,(()=>Xa(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter((e=>e!==el));this.ui.rightActionBar.push(t.map(((e,t)=>{const i=new nn.a(`id-${t}`,"",e.iconClass||Sa(e.iconPath),!0,(()=>Xa(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1})}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,Z.P(this.ui.message,...Object(Ya.a)(Object(Ee.s)(i)))),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?Object(ti.a)("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Ut.a.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.paddingBottom="4px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.paddingBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}tl.noPromptMessage=Object(ti.a)("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class il extends tl{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new B.a),this.onDidAcceptEmitter=this._register(new B.a),this.onDidCustomEmitter=this._register(new B.a),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._sortByLabel=!0,this._autoFocusOnList=!0,this._itemActivation=this.ui.isScreenReaderOptimized()?pa.NONE:pa.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new B.a),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new B.a),this.onDidTriggerItemButtonEmitter=this._register(new B.a),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this._value=e||"",this.update()}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?ga:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(Ia.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{e!==this.value&&(this._value=e,this.ui.list.filter(this.filterValue(this.ui.inputBox.value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.inputBox.onMouseDown((e=>{this.autoFocusOnList||this.ui.list.clearFocus()}))),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown((e=>{switch(e.keyCode){case 18:this.ui.list.focus(Ia.Next),this.canSelectMany&&this.ui.list.domFocus(),Z.c.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Ia.Previous):this.ui.list.focus(Ia.Last),this.canSelectMany&&this.ui.list.domFocus(),Z.c.stop(e,!0);break;case 12:this.ui.list.focus(Ia.NextPage),this.canSelectMany&&this.ui.list.domFocus(),Z.c.stop(e,!0);break;case 11:this.ui.list.focus(Ia.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),Z.c.stop(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.onDidAcceptEmitter.fire({inBackground:!0}));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(Ia.First),Z.c.stop(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(Ia.Last),Z.c.stop(e,!0))}}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>{!this.canSelectMany&&this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.onDidAcceptEmitter.fire({inBackground:!1})}))),this.visibleDisposables.add(this.ui.onDidCustom((()=>{this.onDidCustomEmitter.fire()}))),this.visibleDisposables.add(this.ui.list.onDidChangeFocus((e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Object(ot.g)(e,this._activeItems,((e,t)=>e===t))||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.list.onDidChangeSelection((({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&Object(ot.g)(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.onDidAcceptEmitter.fire({inBackground:t instanceof MouseEvent&&1===t.button}))}))),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Object(ot.g)(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))}))),this.visibleDisposables.add(this.ui.list.onButtonTriggered((e=>this.onDidTriggerItemButtonEmitter.fire(e)))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}registerQuickNavigation(){return Z.i(this.ui.container,Z.d.KEY_UP,(e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new zt.a(e),i=t.keyCode;this._quickNavigate.keybindings.some((e=>{const[n,o]=e.getParts();return!(o||(n.shiftKey&&4===i?t.ctrlKey||t.altKey||t.metaKey:!(n.altKey&&6===i||n.ctrlKey&&5===i||n.metaKey&&57===i)))}))&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.onDidAcceptEmitter.fire({inBackground:!1})),this._quickNavigate=void 0)}))}update(){if(!this.visible)return;const e=!!this._hideInput&&this._items.length>0;this.ui.container.classList.toggle("hidden-input",e&&!this.description);const t={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!e,progressBar:!e,visibleCount:!0,count:this.canSelectMany,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(t),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");const i=this.ariaLabel||this.placeholder||il.DEFAULT_ARIA_LABEL;if(this.ui.inputBox.ariaLabel!==i&&(this.ui.inputBox.ariaLabel=i),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case pa.NONE:this._itemActivation=pa.FIRST;break;case pa.SECOND:this.ui.list.focus(Ia.Second),this._itemActivation=pa.FIRST;break;case pa.LAST:this.ui.list.focus(Ia.Last),this._itemActivation=pa.FIRST;break;default:this.trySelectFirst()}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",this.ui.setComboboxAccessibility(!0),t.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Ia.First))}}il.DEFAULT_ARIA_LABEL=Object(ti.a)("quickInputBox.ariaLabel","Type to narrow down results.");class nl extends de.a{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new B.a),this.onDidCustomEmitter=this._register(new B.a),this.onDidTriggerButtonEmitter=this._register(new B.a),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new B.a),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new B.a),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};this._register(Z.i(window,Z.d.KEY_DOWN,e,!0)),this._register(Z.i(window,Z.d.KEY_UP,e,!0)),this._register(Z.i(window,Z.d.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=Z.q(this.parentElement,Ja(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Z.w(e),i=Z.q(e,Ja(".quick-input-titlebar")),n=this._register(new en.a(i));n.domNode.classList.add("quick-input-left-action-bar");const o=Z.q(i,Ja(".quick-input-title")),s=this._register(new en.a(i));s.domNode.classList.add("quick-input-right-action-bar");const r=Z.q(e,Ja(".quick-input-description")),a=Z.q(e,Ja(".quick-input-header")),l=Z.q(a,Ja("input.quick-input-check-all"));l.type="checkbox",this._register(Z.o(l,Z.d.CHANGE,(e=>{const t=l.checked;y.setAllVisibleChecked(t)}))),this._register(Z.i(l,Z.d.CLICK,(e=>{(e.x||e.y)&&u.setFocus()})));const h=Z.q(a,Ja(".quick-input-description")),c=Z.q(a,Ja(".quick-input-and-message")),d=Z.q(c,Ja(".quick-input-filter")),u=this._register(new ja(d));u.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=Z.q(d,Ja(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const m=new Va.a(g,{countFormat:Object(ti.a)({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")}),p=Z.q(d,Ja(".quick-input-count"));p.setAttribute("aria-live","polite");const f=new Va.a(p,{countFormat:Object(ti.a)({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")}),_=Z.q(a,Ja(".quick-input-action")),b=new Qa(_);b.label=Object(ti.a)("ok","OK"),this._register(b.onDidClick((e=>{this.onDidAcceptEmitter.fire()})));const v=Z.q(a,Ja(".quick-input-action")),C=new Qa(v);C.label=Object(ti.a)("custom","Custom"),this._register(C.onDidClick((e=>{this.onDidCustomEmitter.fire()})));const w=Z.q(c,Ja(`#${this.idPrefix}message.quick-input-message`)),y=this._register(new Ta(e,this.idPrefix+"list",this.options));this._register(y.onChangedAllVisibleChecked((e=>{l.checked=e}))),this._register(y.onChangedVisibleCount((e=>{m.setCount(e)}))),this._register(y.onChangedCheckedCount((e=>{f.setCount(e)}))),this._register(y.onLeave((()=>{setTimeout((()=>{u.setFocus(),this.controller instanceof il&&this.controller.canSelectMany&&y.clearFocus()}),0)}))),this._register(y.onDidChangeFocus((()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")})));const S=new qa(e);S.getContainer().classList.add("quick-input-progress");const x=Z.W(e);return this._register(x),this._register(Z.i(e,Z.d.FOCUS,(e=>{this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0}),!0)),this._register(x.onDidBlur((()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(ma.Blur),this.previousFocusElement=void 0}))),this._register(Z.i(e,Z.d.FOCUS,(e=>{u.setFocus()}))),this._register(Z.i(e,Z.d.KEY_DOWN,(t=>{const i=new zt.a(t);switch(i.keyCode){case 3:Z.c.stop(t,!0),this.onDidAcceptEmitter.fire();break;case 9:Z.c.stop(t,!0),this.hide(ma.Gesture);break;case 2:if(!i.altKey&&!i.ctrlKey&&!i.metaKey){const n=[".action-label.codicon"];e.classList.contains("show-checkboxes")?n.push("input"):n.push("input[type=text]"),this.getUI().list.isDisplayed()&&n.push(".monaco-list");const o=e.querySelectorAll(n.join(", "));i.shiftKey&&i.target===o[0]?(Z.c.stop(t,!0),o[o.length-1].focus()):i.shiftKey||i.target!==o[o.length-1]||(Z.c.stop(t,!0),o[0].focus())}}}))),this.ui={container:e,styleSheet:t,leftActionBar:n,titleBar:i,title:o,description1:r,description2:h,rightActionBar:s,checkAll:l,filterContainer:d,inputBox:u,visibleCountContainer:g,visibleCount:m,countContainer:p,count:f,okContainer:_,ok:b,message:w,customButtonContainer:v,customButton:C,list:y,progressBar:S,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,isScreenReaderOptimized:()=>this.options.isScreenReaderOptimized(),show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setComboboxAccessibility:e=>this.setComboboxAccessibility(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e)},this.updateStyles(),this.ui}pick(e,t={},i=W.a.None){return new Promise(((n,o)=>{let s=e=>{s=n,t.onKeyMods&&t.onKeyMods(r.keyMods),n(e)};if(i.isCancellationRequested)return void s(void 0);const r=this.createQuickPick();let a;const l=[r,r.onDidAccept((()=>{if(r.canSelectMany)s(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(s(e),r.hide())}})),r.onDidChangeActive((e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)})),r.onDidChangeSelection((e=>{if(!r.canSelectMany){const t=e[0];t&&(s(t),r.hide())}})),r.onDidTriggerItemButton((e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},e),{removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice(),i=e.splice(t,1),n=r.activeItems.filter((e=>e!==i[0]));r.items=e,n&&(r.activeItems=n)}}})))),r.onDidChangeValue((e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])})),i.onCancellationRequested((()=>{r.hide()})),r.onDidHide((()=>{Object(de.f)(l),s(void 0)}))];r.title=t.title,r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,r.quickNavigate=t.quickNavigate,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then((([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter((e=>"separator"!==e.type&&e.picked))),a&&(r.activeItems=[a])})),r.show(),Promise.resolve(e).then(void 0,(e=>{o(e),r.hide()}))}))}createQuickPick(){const e=this.getUI();return new il(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i&&i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Ut.a.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Z.P(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,this.setComboboxAccessibility(!1),t.inputBox.ariaLabel="";const n=this.options.backKeybindingLabel();el.tooltip=n?Object(ti.a)("quickInput.backWithKeybinding","Back ({0})",n):Object(ti.a)("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=!e.description||e.inputBox||e.checkAll?"none":"",t.checkAll.style.display=e.checkAll?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList[e.checkBox?"add":"remove"]("show-checkboxes"),this.updateLayout()}setComboboxAccessibility(e){if(e!==this.comboboxAccessibility){const t=this.getUI();this.comboboxAccessibility=e,this.comboboxAccessibility?(t.inputBox.setAttribute("role","combobox"),t.inputBox.setAttribute("aria-haspopup","true"),t.inputBox.setAttribute("aria-autocomplete","list"),t.inputBox.setAttribute("aria-activedescendant",t.list.getActiveDescendant()||"")):(t.inputBox.removeAttribute("role"),t.inputBox.removeAttribute("aria-haspopup"),t.inputBox.removeAttribute("aria-autocomplete"),t.inputBox.removeAttribute("aria-activedescendant"))}}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.getAction().enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.getAction().enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t;const i=this.controller;if(i){const n=!(null===(t=this.ui)||void 0===t?void 0:t.container.contains(document.activeElement));this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",n||(this.previousFocusElement&&this.previousFocusElement.offsetParent?(this.previousFocusElement.focus(),this.previousFocusElement=void 0):this.options.returnFocus()),i.didHide(e)}}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,nl.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,contrastBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e?e.toString():"",this.ui.container.style.backgroundColor=t?t.toString():"",this.ui.container.style.color=i?i.toString():"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.inputBox.style(this.styles.inputBox),this.ui.count.style(this.styles.countBadge),this.ui.ok.style(this.styles.button),this.ui.customButton.style(this.styles.button),this.ui.progressBar.style(this.styles.progressBar),this.ui.list.style(this.styles.list);const s=[];this.styles.list.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.list.pickerGroupBorder}; }`),this.styles.list.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.list.pickerGroupForeground}; }`),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const r=s.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}}nl.MAX_WIDTH=600;const ol=Object(tt.c)("quickInputService");var sl;!function(e){e[e.PRESERVE=0]="PRESERVE",e[e.LAST=1]="LAST"}(sl||(sl={}));const rl="workbench.contributions.quickaccess";Bo.a.add(rl,new class{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort(((e,t)=>t.prefix.length-e.prefix.length)),Object(de.h)((()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)}))}getQuickAccessProviders(){return Object(ot.d)([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find((t=>e.startsWith(t.prefix)))||this.defaultProvider}});var al=i(132),ll=function(e,t){return function(i,n){t(i,n,e)}};let hl=class extends de.a{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Bo.a.as(rl),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){var i;const[n,o]=this.getOrInstantiateProvider(e),s=this.visibleQuickAccess,r=null==s?void 0:s.descriptor;if(s&&o&&r===o)return e===o.prefix||(null==t?void 0:t.preserveValue)||(s.picker.value=e),void this.adjustValueSelection(s.picker,o,t);if(o&&!(null==t?void 0:t.preserveValue)){let t;if(s&&r&&r!==o){const e=s.value.substr(r.prefix.length);e&&(t=`${o.prefix}${e}`)}if(!t){const e=null==n?void 0:n.defaultFilterValue;e===sl.LAST?t=this.lastAcceptedPickerValues.get(o):"string"==typeof e&&(t=`${o.prefix}${e}`)}"string"==typeof t&&(e=t)}const a=new de.b,l=a.add(this.quickInputService.createQuickPick());l.value=e,this.adjustValueSelection(l,o,t),l.placeholder=null==o?void 0:o.placeholder,l.quickNavigate=null==t?void 0:t.quickNavigateConfiguration,l.hideInput=!!l.quickNavigate&&!s,("number"==typeof(null==t?void 0:t.itemActivation)||(null==t?void 0:t.quickNavigateConfiguration))&&(l.itemActivation=null!==(i=null==t?void 0:t.itemActivation)&&void 0!==i?i:pa.SECOND),l.contextKey=null==o?void 0:o.contextKey,l.filterValue=e=>e.substring(o?o.prefix.length:0),(null==o?void 0:o.placeholder)&&(l.ariaLabel=null==o?void 0:o.placeholder),a.add(this.registerPickerListeners(l,n,o,e));const h=a.add(new W.b);n&&a.add(n.provide(l,h.token)),Object(al.a)(l.onDidHide)((()=>{0===l.selectedItems.length&&h.cancel(),a.dispose()})),l.show()}adjustValueSelection(e,t,i){var n;let o;o=(null==i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null==t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,n){const o=new de.b,s=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return o.add(Object(de.h)((()=>{s===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)}))),o.add(e.onDidChangeValue((e=>{const[i]=this.getOrInstantiateProvider(e);i!==t?this.show(e,{preserveValue:!0}):s.value=e}))),i&&o.add(e.onDidAccept((()=>{this.lastAcceptedPickerValues.set(i,e.value)}))),o}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};hl=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([ll(0,ol),ll(1,tt.a)],hl);var cl=function(e,t){return function(i,n){t(i,n,e)}};let dl=class extends ln.c{constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.accessibilityService=n,this.layoutService=o,this.contexts=new Map}get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(hl))),this._quickAccess}createController(e=this.layoutService,t){var i,n;const o={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,isScreenReaderOptimized:()=>this.accessibilityService.isScreenReaderOptimized(),backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),returnFocus:()=>e.focus(),createList:(e,t,i,n,o)=>this.instantiationService.createInstance(Ar.d,e,t,i,n,o),styles:this.computeStyles()},s=this._register(new nl(Object.assign(Object.assign({},o),t)));return s.layout(e.dimension,null!==(n=null===(i=e.offset)||void 0===i?void 0:i.top)&&void 0!==n?n:0),this._register(e.onDidLayout((t=>{var i,n;return s.layout(t,null!==(n=null===(i=e.offset)||void 0===i?void 0:i.top)&&void 0!==n?n:0)}))),this._register(s.onShow((()=>this.resetContextKeys()))),this._register(s.onHide((()=>this.resetContextKeys()))),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new rn.c(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),t&&t.set(!0))}resetContextKeys(){this.contexts.forEach((e=>{e.get()&&e.reset()}))}pick(e,t={},i=W.a.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}updateStyles(){this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:Object.assign({},Object(br.d)(this.theme,{quickInputBackground:an.Wb,quickInputForeground:an.Xb,quickInputTitleBackground:an.Zb,contrastBorder:an.h,widgetShadow:an.pc})),inputBox:Object(br.d)(this.theme,{inputForeground:an.X,inputBackground:an.V,inputBorder:an.W,inputValidationInfoBackground:an.bb,inputValidationInfoForeground:an.db,inputValidationInfoBorder:an.cb,inputValidationWarningBackground:an.eb,inputValidationWarningForeground:an.gb,inputValidationWarningBorder:an.fb,inputValidationErrorBackground:an.Y,inputValidationErrorForeground:an.ab,inputValidationErrorBorder:an.Z}),countBadge:Object(br.d)(this.theme,{badgeBackground:an.c,badgeForeground:an.d,badgeBorder:an.h}),button:Object(br.d)(this.theme,{buttonForeground:an.f,buttonBackground:an.e,buttonHoverBackground:an.g,buttonBorder:an.h}),progressBar:Object(br.d)(this.theme,{progressBarBackground:an.Vb}),keybindingLabel:Object(br.d)(this.theme,{keybindingLabelBackground:an.hb,keybindingLabelForeground:an.kb,keybindingLabelBorder:an.ib,keybindingLabelBottomBorder:an.jb,keybindingLabelShadow:an.pc}),list:Object(br.d)(this.theme,{listBackground:an.Wb,listInactiveFocusForeground:an.sb,listInactiveFocusBackground:an.Yb,listFocusOutline:an.b,listInactiveFocusOutline:an.b,pickerGroupBorder:an.Qb,pickerGroupForeground:an.Rb})}}};dl=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([cl(0,tt.a),cl(1,rn.b),cl(2,ln.b),cl(3,oo.b),cl(4,xr)],dl);var ul=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},gl=function(e,t){return function(i,n){t(i,n,e)}};let ml=class extends dl{constructor(e,t,i,n,o,s){super(t,i,n,o,s),this.host=void 0;const r=fl.get(e);this.host={_serviceBrand:void 0,get container(){return r.widget.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus()}}createController(){return super.createController(this.host)}};ml=ul([gl(1,tt.a),gl(2,rn.b),gl(3,ln.b),gl(4,oo.b),gl(5,xr)],ml);let pl=class{constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(ml,e);this.mapEditorToService.set(e,t),Object(al.a)(e.onDidDispose)((()=>{i.dispose(),this.mapEditorToService.delete(e)}))}return t}get quickAccess(){return this.activeService.quickAccess}pick(e,t={},i=W.a.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}};pl=ul([gl(0,tt.a),gl(1,Y.a)],pl);class fl{constructor(e){this.editor=e,this.widget=new _l(this.editor)}static get(e){return e.getContribution(fl.ID)}dispose(){this.widget.dispose()}}fl.ID="editor.controller.quickInput";class _l{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return _l.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}var bl;_l.ID="editor.contrib.quickInputWidget",Object(on.j)(fl.ID,fl),function(e){const t=new xn.a;class i{constructor(e,t){this._serviceId=e,this._factory=t,this._value=null}get id(){return this._serviceId}get(e){if(!this._value){if(e&&(this._value=e[this._serviceId.toString()]),this._value||(this._value=this._factory(e)),!this._value)throw new Error("Service "+this._serviceId+" is missing!");t.set(this._serviceId,this._value)}return this._value}}e.LazyStaticService=i;let n=[];function o(e,t){let o=new i(e,t);return n.push(o),o}e.init=function(e){let t=new xn.a;for(const[e,i]of Object(Yr.a)())t.set(e,i);for(let i in e)e.hasOwnProperty(i)&&t.set(Object(tt.c)(i),e[i]);n.forEach((i=>t.set(i.id,i.get(e))));let i=new Ir(t,!0);return t.set(tt.a,i),[t,i]},e.instantiationService=o(tt.a,(()=>new Ir(t,!0)));const s=new Wi;e.configurationService=o(Yt.a,(()=>s)),e.resourceConfigurationService=o(it,(()=>new Bi(s))),e.resourcePropertiesService=o(nt,(()=>new ji(s))),e.contextService=o(ki.a,(()=>new Hi)),e.labelService=o(Mr.a,(()=>new Ki)),e.telemetryService=o(wr.a,(()=>new Vi)),e.dialogService=o(kr,(()=>new Mi)),e.notificationService=o(Li.a,(()=>new Ai)),e.markerService=o(Rr.b,(()=>new Wr)),e.modeService=o(we.a,(e=>new zo)),e.standaloneThemeService=o(to,(()=>new Ws)),e.logService=o(st.b,(()=>new st.d(new st.a))),e.undoRedoService=o(Uo.a,(t=>new da(e.dialogService.get(t),e.notificationService.get(t)))),e.modelService=o(et.a,(t=>new cs(e.configurationService.get(t),e.resourcePropertiesService.get(t),e.standaloneThemeService.get(t),e.logService.get(t),e.undoRedoService.get(t)))),e.markerDecorationsService=o(Ur.a,(t=>new Gr(e.modelService.get(t),e.markerService.get(t)))),e.contextKeyService=o(rn.b,(t=>new Ys(e.configurationService.get(t)))),e.codeEditorService=o(Y.a,(t=>new bo(null,e.contextKeyService.get(t),e.standaloneThemeService.get(t)))),e.editorProgressService=o(On.a,(()=>new Ti)),e.storageService=o(Br.a,(()=>new Br.b)),e.editorWorkerService=o(Ce.a,(t=>new ct(e.modelService.get(t),e.resourceConfigurationService.get(t),e.logService.get(t))))}(bl||(bl={}));class vl extends de.a{constructor(e,t){super();const[i,n]=bl.init(t);this._serviceCollection=i,this._instantiationService=n;const o=this.get(Yt.a),s=this.get(Li.a),r=this.get(wr.a),a=this.get(ln.b),l=this.get(st.b),h=this.get(rn.b);let c=(e,i)=>{let n=null;return t&&(n=t[e.toString()]),n||(n=i()),this._serviceCollection.set(e,n),n};c(oo.b,(()=>new Qr(h,o))),c(Ar.a,(()=>new Ar.b(a)));let d=c(ie.b,(()=>new Ri(this._instantiationService))),u=c(no.a,(()=>this._register(new Pi(h,d,r,s,l,e)))),g=c(xr,(()=>new $i(bl.codeEditorService.get(Y.a),e)));c(ol,(()=>new pl(n,bl.codeEditorService.get(Y.a))));let m=c(Ln.b,(()=>this._register(new Lr(g))));c(En.a,(()=>new Jr)),c(Ln.a,(()=>{const e=new Sr(r,s,m,u,a);return e.configure({blockMouse:!1}),this._register(e)})),c(io.a,(()=>new Hr(d))),c($t.a,(()=>new Ui(bl.modelService.get(et.a))))}get(e){let t=this._serviceCollection.get(e);if(!t)throw new Error("Missing service "+e);return t}set(e,t){this._serviceCollection.set(e,t)}has(e){return this._serviceCollection.has(e)}}function Cl(e,t,i){let n=new vl(e,t),o=null;n.has(ye.a)||(o=new Ii(bl.modelService.get()),n.set(ye.a,o)),n.has(ne.a)||n.set(ne.a,new he(n.get(Y.a),n.get(ie.b)));let s=i(n);return o&&o.setEditor(s),s}function wl(e,t){return"boolean"==typeof e?e:t}function yl(e,t){return"string"==typeof e?e:t}function Sl(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const i=function(e){const t={};for(const i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function xl(e,t){t=t.replace(/@@/g,"");let i,n=0;do{i=!1,t=t.replace(/@(\w+)/g,(function(n,o){i=!0;let s="";if("string"==typeof e[o])s=e[o];else{if(!(e[o]&&e[o]instanceof RegExp))throw void 0===e[o]?Dt(e,"language definition does not contain attribute '"+o+"', used at: "+t):Dt(e,"attribute reference '"+o+"' must be a string, used at: "+t);s=e[o].source}return xt(s)?"":"(?:"+s+")"})),n++}while(i&&n<5);t=t.replace(/\x01/g,"@");let o=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,o)}function Ll(e,t,i,n){let o=-1,s=i,r=i.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(o=parseInt(r[3]),r[2]&&(o+=100)),s=r[4]);let a,l="~",h=s;if(s&&0!==s.length?/^\w*$/.test(h)?l="==":(r=s.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(l=r[1],h=r[2])):(l="!=",h=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(h))if("@"===l||"!@"===l){let i=e[h];if(!i)throw Dt(e,"the @ match target '"+h+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const e of t)if("string"!=typeof e)return!1;return!0}(0,i))throw Dt(e,"the @ match target '"+h+"' must be an array of strings, in rule: "+t);let n=Sl(i,e.ignoreCase);a=function(e){return"@"===l?n(e):!n(e)}}else if("~"===l||"!~"===l)if(h.indexOf("$")<0){let t=xl(e,"^"+h+"$");a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,i,n,o){return xl(e,"^"+Nt(e,h,i,n,o)+"$").test(t)};else if(h.indexOf("$")<0){let t=Lt(e,h);a=function(e){return"=="===l?e===t:e!==t}}else{let t=Lt(e,h);a=function(i,n,o,s,r){let a=Nt(e,t,n,o,s);return"=="===l?i===a:i!==a}}else{let t=Sl(h.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===o?{name:i,value:n,test:function(e,t,i,n){return a(e,e,t,i,n)}}:{name:i,value:n,test:function(e,t,i,n){let s=function(e,t,i,n){if(n<0)return e;if(n=100){n-=100;let e=i.split(".");if(e.unshift(i),n=0&&(n.tokenSubst=!0),"string"==typeof i.bracket)if("@open"===i.bracket)n.bracket=1;else{if("@close"!==i.bracket)throw Dt(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);n.bracket=-1}if(i.next){if("string"!=typeof i.next)throw Dt(e,"the next state must be a string value in rule: "+t);{let o=i.next;if(!/^(@pop|@push|@popall)$/.test(o)&&("@"===o[0]&&(o=o.substr(1)),o.indexOf("$")<0&&!function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}(e,Nt(e,o,"",[],""))))throw Dt(e,"the next state '"+i.next+"' is not defined in rule: "+t);n.next=o}}return"number"==typeof i.goBack&&(n.goBack=i.goBack),"string"==typeof i.switchTo&&(n.switchTo=i.switchTo),"string"==typeof i.log&&(n.log=i.log),"string"==typeof i.nextEmbedded&&(n.nextEmbedded=i.nextEmbedded,e.usesEmbedded=!0),n}}if(Array.isArray(i)){let n=[];for(let o=0,s=i.length;o0&&"^"===i[0],this.name=this.name+": "+i,this.regex=xl(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=kl(e,this.name,t)}}class Nl{constructor(e,t){this._languageIdentifier=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i,n){if("function"==typeof this._actual.tokenize)return El.adaptTokenize(this._languageIdentifier.language,this._actual,e,i,n);throw new Error("Not supported!")}tokenize2(e,t,i){let n=this._actual.tokenizeEncoded(e,i);return new K.c(n.tokens,n.endState)}}class El{constructor(e,t,i){this._standaloneThemeService=e,this._languageIdentifier=t,this._actual=i}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t,i){let n=[],o=0;for(let s=0,r=e.length;s0&&o[s-1]===h)continue;let c=l.startIndex;0===a?c=0:ce.provideDocumentRangeFormattingEdits(t,t.getFullModelRange(),i,n)})}return t}(t);for(const s of o){let o=yield Promise.resolve(s.provideDocumentFormattingEdits(t,i,n)).catch(rt.f);if(Object(ot.m)(o))return yield e.computeMoreMinimalEdits(t.uri,o)}}))}(e.get(Ce.a),o,n,W.a.None)})),ie.a.registerCommand("_executeFormatOnTypeProvider",(function(e,...t){const[i,n,o,s]=t;Object(Ye.b)(V.a.isUri(i)),Object(Ye.b)(H.a.isIPosition(n)),Object(Ye.b)("string"==typeof o);const r=e.get(et.a).getModel(i);if(!r)throw Object(rt.b)("resource");return function(e,t,i,n,o){const s=be.u.ordered(t);return 0===s.length||s[0].autoFormatTriggerCharacters.indexOf(n)<0?Promise.resolve(void 0):Promise.resolve(s[0].provideOnTypeFormattingEdits(t,i,n,o,W.a.None)).catch(rt.f).then((i=>e.computeMoreMinimalEdits(t.uri,i)))}(e.get(Ce.a),r,H.a.lift(n),o,s)})),F.g.wrappingIndent.defaultValue=0,F.g.glyphMargin.defaultValue=!1,F.g.autoIndent.defaultValue=3,F.g.overviewRulerLanes.defaultValue=2,Al.setFormatterSelector(((e,t,i)=>Promise.resolve(e[0])));const Rl=q();Rl.editor={create:function(e,t,i){return Cl(e,i||{},(i=>new xo(e,t,i,i.get(tt.a),i.get(Y.a),i.get(ie.b),i.get(rn.b),i.get(no.a),i.get(Ln.b),i.get(to),i.get(Li.a),i.get(Yt.a),i.get(oo.b),i.get(et.a),i.get(we.a))))},onDidCreateEditor:function(e){return bl.codeEditorService.get().onCodeEditorAdd((t=>{e(t)}))},createDiffEditor:function(e,t,i){return Cl(e,i||{},(i=>new Lo(e,t,i,i.get(tt.a),i.get(rn.b),i.get(no.a),i.get(Ln.b),i.get(Ce.a),i.get(Y.a),i.get(to),i.get(Li.a),i.get(Yt.a),i.get(Ln.a),i.get(On.a),i.get(En.a))))},createDiffNavigator:function(e,t){return new me(e,t)},createModel:function(e,t,i){return ko(bl.modelService.get(),bl.modeService.get(),e,t,i)},setModelLanguage:function(e,t){bl.modelService.get().setMode(e,bl.modeService.get().create(t))},setModelMarkers:function(e,t,i){e&&bl.markerService.get().changeOne(t,e.uri,i)},getModelMarkers:function(e){return bl.markerService.get().read(e)},onDidChangeMarkers:function(e){return bl.markerService.get().onMarkerChanged(e)},getModels:function(){return bl.modelService.get().getModels()},getModel:function(e){return bl.modelService.get().getModel(e)},onDidCreateModel:function(e){return bl.modelService.get().onModelAdded(e)},onWillDisposeModel:function(e){return bl.modelService.get().onModelRemoved(e)},onDidChangeModelLanguage:function(e){return bl.modelService.get().onModelModeChanged((t=>{e({model:t.model,oldLanguage:t.oldModeId})}))},createWebWorker:function(e){return function(e,t){return new _t(e,t)}(bl.modelService.get(),e)},colorizeElement:function(e,t){const i=bl.standaloneThemeService.get();return i.registerEditorContainer(e),jt.colorizeElement(i,bl.modeService.get(),e,t)},colorize:function(e,t,i){return bl.standaloneThemeService.get().registerEditorContainer(document.body),jt.colorize(bl.modeService.get(),e,t,i)},colorizeModelLine:function(e,t,i=4){return bl.standaloneThemeService.get().registerEditorContainer(document.body),jt.colorizeModelLine(e,t,i)},tokenize:function(e,t){bl.modeService.get().triggerMode(t);let i=(r=t,be.B.get(r)||{getInitialState:()=>ve.c,tokenize:(e,t,i,n)=>Object(ve.d)(r,e,i,n)}),n=Object(Ee.P)(e),o=[],s=i.getInitialState();var r;for(let e=0,t=n.length;e{n.getId()===e&&(i.dispose(),t())}));return i},getEncodedLanguageId:function(e){let t=bl.modeService.get().getLanguageIdentifier(e);return t?t.id:0},setLanguageConfiguration:function(e,t){let i=bl.modeService.get().getLanguageIdentifier(e);if(!i)throw new Error(`Cannot set configuration for unknown language ${e}`);return ke.a.register(i,t,100)},setColorMap:function(e){if(e){const t=[null];for(let i=1,n=e.length;ifunction(e){return"tokenizeEncoded"in e}(e)?new Nl(i,e):new El(bl.standaloneThemeService.get(),i,e);return Ol(t)?be.B.registerPromise(e,t.then((e=>n(e)))):be.B.register(e,n(t))},setMonarchTokensProvider:function(e,t){const i=t=>{return i=bl.modeService.get(),n=bl.standaloneThemeService.get(),o=e,s=function(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");let i={};i.languageId=e,i.includeLF=wl(t.includeLF,!1),i.noThrow=!1,i.maxStack=100,i.start="string"==typeof t.start?t.start:null,i.ignoreCase=wl(t.ignoreCase,!1),i.unicode=wl(t.unicode,!1),i.tokenPostfix=yl(t.tokenPostfix,"."+i.languageId),i.defaultToken=yl(t.defaultToken,"source"),i.usesEmbedded=!1;let n=t;function o(e,s,r){for(const a of r){let r=a.include;if(r){if("string"!=typeof r)throw Dt(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw Dt(i,"include target '"+r+"' is not defined at: "+e);o(e+"."+r,s,t.tokenizer[r])}else{const t=new Dl(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(n,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(n,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw Dt(i,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);{const e=a[1];e.next=a[2],t.setAction(n,e)}}else t.setAction(n,a[1]);else{if(!a.regex)throw Dt(i,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=wl(a.matchOnlyAtLineStart,!1)),t.setRegex(n,a.regex),t.setAction(n,a.action)}s.push(t)}}}if(n.languageId=e,n.includeLF=i.includeLF,n.ignoreCase=i.ignoreCase,n.unicode=i.unicode,n.noThrow=i.noThrow,n.usesEmbedded=i.usesEmbedded,n.stateNames=t.tokenizer,n.defaultToken=i.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw Dt(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(let e in t.tokenizer)if(t.tokenizer.hasOwnProperty(e)){i.start||(i.start=e);const n=t.tokenizer[e];i.tokenizer[e]=new Array,o("tokenizer."+e,i.tokenizer[e],n)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw Dt(i,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];let s=[];for(let e of t.brackets){let t=e;if(t&&Array.isArray(t)&&3===t.length&&(t={token:t[2],open:t[0],close:t[1]}),t.open===t.close)throw Dt(i,"open and close brackets in a 'brackets' attribute must be different: "+t.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof t.open||"string"!=typeof t.token||"string"!=typeof t.close)throw Dt(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");s.push({token:t.token+i.tokenPostfix,open:Lt(i,t.open),close:Lt(i,t.close)})}return i.brackets=s,i.noThrow=!0,i}(e,t),new Ft(i,n,o,s);var i,n,o,s};return Ol(t)?be.B.registerPromise(e,t.then((e=>i(e)))):be.B.register(e,i(t))},registerReferenceProvider:function(e,t){return be.v.register(e,t)},registerRenameProvider:function(e,t){return be.w.register(e,t)},registerCompletionItemProvider:function(e,t){return be.d.register(e,t)},registerSignatureHelpProvider:function(e,t){return be.y.register(e,t)},registerHoverProvider:function(e,t){return be.o.register(e,{provideHover:(e,i,n)=>{let o=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n)).then((e=>{if(e)return!e.range&&o&&(e.range=new z.a(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)),e.range||(e.range=new z.a(i.lineNumber,i.column,i.lineNumber,i.column)),e}))}})},registerDocumentSymbolProvider:function(e,t){return be.l.register(e,t)},registerDocumentHighlightProvider:function(e,t){return be.h.register(e,t)},registerLinkedEditingRangeProvider:function(e,t){return be.t.register(e,t)},registerDefinitionProvider:function(e,t){return be.f.register(e,t)},registerImplementationProvider:function(e,t){return be.p.register(e,t)},registerTypeDefinitionProvider:function(e,t){return be.C.register(e,t)},registerCodeLensProvider:function(e,t){return be.b.register(e,t)},registerCodeActionProvider:function(e,t){return be.a.register(e,{provideCodeActions:(e,i,n,o)=>{let s=bl.markerService.get().read({resource:e.uri}).filter((e=>z.a.areIntersectingOrTouching(e,i)));return t.provideCodeActions(e,i,{markers:s,only:n.only},o)}})},registerDocumentFormattingEditProvider:function(e,t){return be.g.register(e,t)},registerDocumentRangeFormattingEditProvider:function(e,t){return be.i.register(e,t)},registerOnTypeFormattingEditProvider:function(e,t){return be.u.register(e,t)},registerLinkProvider:function(e,t){return be.s.register(e,t)},registerColorProvider:function(e,t){return be.c.register(e,t)},registerFoldingRangeProvider:function(e,t){return be.n.register(e,t)},registerDeclarationProvider:function(e,t){return be.e.register(e,t)},registerSelectionRangeProvider:function(e,t){return be.x.register(e,t)},registerDocumentSemanticTokensProvider:function(e,t){return be.k.register(e,t)},registerDocumentRangeSemanticTokensProvider:function(e,t){return be.j.register(e,t)},DocumentHighlightKind:d,CompletionItemKind:s,CompletionItemTag:r,CompletionItemInsertTextRule:o,SymbolKind:I,SymbolTag:T,IndentAction:f,CompletionTriggerKind:a,SignatureHelpTriggerKind:O,InlineHintKind:_,FoldingRangeKind:be.m};const Pl=Rl.CancellationTokenSource,Fl=Rl.Emitter,Wl=Rl.KeyCode,Bl=Rl.KeyMod,jl=Rl.Position,Vl=Rl.Range,Hl=Rl.Selection,zl=Rl.SelectionDirection,Ul=Rl.MarkerSeverity,Kl=Rl.MarkerTag,$l=Rl.Uri,ql=Rl.Token,Gl=Rl.editor,Yl=Rl.languages;((null===(Tl=Ne.b.MonacoEnvironment)||void 0===Tl?void 0:Tl.globalAPI)||"function"==typeof define&&i(239))&&(self.monaco=Rl),void 0!==self.require&&"function"==typeof self.require.config&&self.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]})},function(e,t,i){"use strict";function n(e){const t=this;let i,n=!1;return function(){return n||(n=!0,i=e.apply(t,arguments)),i}}i.d(t,"a",(function(){return n}))},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));class n{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i(36),o=i(1),s=i(127);class r{constructor(e,t){this.supportIcons=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.domNode=document.createElement("span"),this.domNode.className="monaco-highlighted-label",e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t=[],i="",o){e||(e=""),o&&(e=r.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===i&&n.d(this.highlights,t)||(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t{n="\r\n"===e?-1:0,o+=i;for(const e of t)e.end<=o||(e.start>=o&&(e.start+=n),e.end>=o&&(e.end+=n));return i+=n,"⏎"}))}}},function(e,t,i){"use strict";(t=e.exports=i(211).default).default=t},function(e,t,i){"use strict";i.d(t,"b",(function(){return p})),i.d(t,"a",(function(){return f}));var n=i(0),o=i(18),s=i(23),r=i(22),a=i(169),l=i(53),h=i(41);function c(e){return e.toString()}class d{constructor(e,t,i,n,o,s,r){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=s,this.changes=r}static create(e,t){const i=e.getAlternativeVersionId(),n=m(e);return new d(i,i,n,n,t,t,[])}append(e,t,i,n,o){t.length>0&&(this.changes=Object(a.b)(this.changes,t)),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(l.f(e,t?t.length:0,i),i+=4,t)for(const n of t)l.f(e,n.selectionStartLineNumber,i),i+=4,l.f(e,n.selectionStartColumn,i),i+=4,l.f(e,n.positionLineNumber,i),i+=4,l.f(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=l.c(e,t);t+=4;for(let o=0;oe.toString())).join(", ")}matchesResource(e){return(r.a.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof d}append(e,t,i,n,o){this._data instanceof d&&this._data.append(e,t,i,n,o)}close(){this._data instanceof d&&(this._data=this._data.serialize())}open(){this._data instanceof d||(this._data=d.deserialize(this._data))}undo(){if(r.a.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof d&&(this._data=this._data.serialize());const e=d.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(r.a.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof d&&(this._data=this._data.serialize());const e=d.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof d&&(this._data=this._data.serialize()),this._data.byteLength+168}}class g{constructor(e,t){this.type=1,this.label=e,this._isOpen=!0,this._editStackElementsArr=t.slice(0),this._editStackElementsMap=new Map;for(const e of this._editStackElementsArr){const t=c(e.resource);this._editStackElementsMap.set(t,e)}this._delegate=null}get resources(){return this._editStackElementsArr.map((e=>e.resource))}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=c(e);return this._editStackElementsMap.has(t)}setModel(e){const t=c(r.a.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=c(e.uri);return!!this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).canAppend(e)}append(e,t,i,n,o){const s=c(e.uri);this._editStackElementsMap.get(s).append(e,t,i,n,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=c(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){let e=[];for(const t of this._editStackElementsArr)e.push(`${Object(h.b)(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function m(e){return"\n"===e.getEOL()?0:1}function p(e){return!!e&&(e instanceof u||e instanceof g)}class f{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);p(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);p(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(p(t)&&t.canAppend(this._model))return t;const i=new u(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],m(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),s=f._computeCursorState(i,o),r=o.map(((e,t)=>({index:t,textChange:e.textChange})));return r.sort(((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition)),n.append(this._model,r.map((e=>e.textChange)),m(this._model),this._model.getAlternativeVersionId(),s),s}static _computeCursorState(e,t){try{return e?e(t):null}catch(e){return Object(o.e)(e),null}}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));var n=i(6),o=i(16),s=i(3),r=i(23),a=i(32);const l=Object.create(null);function h(e,t){if(t<=0)return"";l[e]||(l[e]=["",e]);const i=l[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}class c{constructor(e,t){this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}static unshiftIndent(e,t,i,n,s){const r=o.a.visibleColumnFromColumn(e,t,i);if(s){const e=h(" ",n);return h(e,o.a.prevIndentTabStop(r,n)/n)}return h("\t",o.a.prevRenderTabStop(r,i)/i)}static shiftIndent(e,t,i,n,s){const r=o.a.visibleColumnFromColumn(e,t,i);if(s){const e=h(" ",n);return h(e,o.a.nextIndentTabStop(r,n)/n)}return h("\t",o.a.nextRenderTabStop(r,i)/i)}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let r=this._selection.endLineNumber;1===this._selection.endColumn&&i!==r&&(r-=1);const{tabSize:l,indentSize:d,insertSpaces:u}=this._opts,g=i===r;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let h=0,m=0;for(let p=i;p<=r;p++,h=m){m=0;let r,f=e.getLineContent(p),_=n.u(f);if((!this._opts.isUnshift||0!==f.length&&0!==_)&&(g||this._opts.isUnshift||0!==f.length)){if(-1===_&&(_=f.length),p>1&&o.a.visibleColumnFromColumn(f,_+1,l)%d!=0&&e.isCheapToTokenize(p-1)){let t=a.a.getEnterAction(this._opts.autoIndent,e,new s.a(p-1,e.getLineMaxColumn(p-1),p-1,e.getLineMaxColumn(p-1)));if(t){if(m=h,t.appendText)for(let e=0,i=t.appendText.length;es(t,e)),n)):function(e,t){return t=r(181387,t),Object.keys(e).sort().reduce(((t,i)=>(t=a(i,t),s(e[i],t))),t)}(e,t);case"string":return a(e,t);case"boolean":return function(e,t){return r(e?433:863,t)}(e,t);case"number":return r(e,t);case"undefined":return r(937,t);default:return r(617,t)}var i,n}function r(e,t){return(t<<5)-t+e|0}function a(e,t){t=r(149417,t);for(let i=0,n=e.length;i>>n)>>>0}function h(e,t=0,i=e.byteLength,n=0){for(let o=0;oe.toString(16).padStart(2,"0"))).join(""):function(e,t,i="0"){for(;e.length>>0).toString(16),t/4)}class d{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const i=this._buff;let o,s,r=this._buffLen,a=this._leftoverHighSurrogate;for(0!==a?(o=a,s=-1,a=0):(o=e.charCodeAt(0),s=0);;){let l=o;if(n.D(o)){if(!(s+1>>6,e[t++]=128|(63&i)>>>0):i<65536?(e[t++]=224|(61440&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0):(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),c(this._h0)+c(this._h1)+c(this._h2)+c(this._h3)+c(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,h(this._buff,this._buffLen),this._buffLen>56&&(this._step(),h(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=d._bigBlock32,t=this._buffDV;for(let i=0;i<64;i+=4)e.setUint32(i,t.getUint32(i,!1),!1);for(let t=64;t<320;t+=4)e.setUint32(t,l(e.getUint32(t-12,!1)^e.getUint32(t-32,!1)^e.getUint32(t-56,!1)^e.getUint32(t-64,!1),1),!1);let i,n,o,s=this._h0,r=this._h1,a=this._h2,h=this._h3,c=this._h4;for(let t=0;t<80;t++)t<20?(i=r&a|~r&h,n=1518500249):t<40?(i=r^a^h,n=1859775393):t<60?(i=r&a|r&h|a&h,n=2400959708):(i=r^a^h,n=3395469782),o=l(s,5)+i+c+n+e.getUint32(4*t,!1)&4294967295,c=h,h=a,a=l(r,30),r=s,s=o;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+h&4294967295,this._h4=this._h4+c&4294967295}}d._bigBlock32=new DataView(new ArrayBuffer(320))},function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i(5),o=i(2);class s{constructor(e,t,i,n,o,s){e|=0,t|=0,i|=0,n|=0,o|=0,s|=0,this.rawScrollLeft=i,this.rawScrollTop=s,e<0&&(e=0),i+e>t&&(i=t-e),i<0&&(i=0),n<0&&(n=0),s+n>o&&(s=o-n),s<0&&(s=0),this.width=e,this.scrollWidth=t,this.scrollLeft=i,this.height=n,this.scrollHeight=o,this.scrollTop=s}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new s(void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new s(this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:r,scrollTopChanged:a}}}class r extends o.a{constructor(e,t){super(),this._onScroll=this._register(new n.a),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e,this._scheduleAtNextAnimationFrame=t,this._state=new s(0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){const i=this._state.withScrollDimensions(e,t);this._setState(i,Boolean(this._smoothScrolling)),this._smoothScrolling&&this._smoothScrolling.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;n=t?new h(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=h.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))):void 0}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class a{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function l(e,t){const i=t-e;return function(t){return e+i*(1-(n=1-t,Math.pow(n,3)));var n}}class h{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,a;return e=n.range.end)continue;if(e.end({range:u(e.range,n),size:e.size}))),r=i.map(((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size})));this.groups=function(...e){return function(e){const t=[];let i=null;for(let n of e){const e=n.range.start,o=n.range.end,s=n.size;i&&s===i.size?i.range.end=o:(i={range:{start:e,end:o},size:s},t.push(i))}return t}(e.reduce(((e,t)=>e.concat(t)),[]))}(o,r,s),this._size=this.groups.reduce(((e,t)=>e+t.size*(t.range.end-t.range.start)),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;let t=0,i=0;for(let n of this.groups){const o=n.range.end-n.range.start,s=i+o*n.size;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null})),this.cache.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var f=i(78),_=i(20),b=i(101),v=i(21),C=i(30),w=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};const y={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class S{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class x{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class L{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ti,(null==e?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null==e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null==e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class D{constructor(e,t,i,c=y){if(this.virtualDelegate=t,this.domId="list_id_"+ ++D.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new v.a(50),this.splicing=!1,this.dragOverAnimationStopDisposable=o.a.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=o.a.None,this.onDragLeaveTimeout=o.a.None,this.disposables=new o.b,this._onDidChangeContentHeight=new r.a,this._horizontalScrolling=!1,c.horizontalScrolling&&c.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new g;for(const e of i)this.renderers.set(e.templateId,e);this.cache=this.disposables.add(new p(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support","boolean"!=typeof c.mouseSupport||c.mouseSupport),this._horizontalScrolling=Object(n.e)(c,(e=>e.horizontalScrolling),y.horizontalScrolling),this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight=void 0===c.additionalScrollHeight?0:c.additionalScrollHeight,this.accessibilityProvider=new k(c.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",Object(n.e)(c,(e=>e.transformOptimization),y.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)"),this.disposables.add(s.b.addTarget(this.rowsContainer)),this.scrollable=new h.a(Object(n.e)(c,(e=>e.smoothScrolling),!1)?125:0,(e=>Object(m.T)(e))),this.scrollableElement=this.disposables.add(new l.c(this.rowsContainer,{alwaysConsumeMouseWheel:Object(n.e)(c,(e=>e.alwaysConsumeMouseWheel),y.alwaysConsumeMouseWheel),horizontal:1,vertical:Object(n.e)(c,(e=>e.verticalScrollMode),y.verticalScrollMode),useShadows:Object(n.e)(c,(e=>e.useShadows),y.useShadows)},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),Object(a.a)(this.rowsContainer,s.a.Change)((e=>this.onTouchChange(e)),this,this.disposables),Object(a.a)(this.scrollableElement.getDomNode(),"scroll")((e=>e.target.scrollTop=0),null,this.disposables),r.b.map(Object(a.a)(this.domNode,"dragover"),(e=>this.toDragEvent(e)))(this.onDragOver,this,this.disposables),r.b.map(Object(a.a)(this.domNode,"drop"),(e=>this.toDragEvent(e)))(this.onDrop,this,this.disposables),Object(a.a)(this.domNode,"dragleave")(this.onDragLeave,this,this.disposables),Object(a.a)(window,"dragend")(this.onDragEnd,this,this.disposables),this.setRowLineHeight=Object(n.e)(c,(e=>e.setRowLineHeight),y.setRowLineHeight),this.setRowHeight=Object(n.e)(c,(e=>e.setRowHeight),y.setRowHeight),this.supportDynamicHeights=Object(n.e)(c,(e=>e.supportDynamicHeights),y.supportDynamicHeights),this.dnd=Object(n.e)(c,(e=>e.dnd),y.dnd),this.layout()}get contentHeight(){return this.rangeMap.size}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:Object(m.B)(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}updateOptions(e){void 0!==e.additionalScrollHeight&&(this.additionalScrollHeight=e.additionalScrollHeight,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s={start:e,end:e+t},r=c.a.intersect(n,s),a=new Map;for(let e=r.start;e({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:o.a.None})));let p;0===e&&t>=this.items.length?(this.rangeMap=new g,this.rangeMap.splice(0,0,m),p=this.items,this.items=m):(this.rangeMap.splice(e,t,m),p=this.items.splice(e,t,...m));const f=i.length-t,_=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),b=u(h,f),v=c.a.intersect(_,b);for(let e=v.start;eu(e,f))),y=[{start:e,end:e+i.length},...w].map((e=>c.a.intersect(_,e))),S=this.getNextToLastElement(y);for(const e of y)for(let t=e.start;te.element))}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Object(m.T)((()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null})))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger((()=>this.updateScrollWidth())):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10})}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}element(e){return this.items[e].element}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){let i={height:"number"==typeof e?e:Object(m.A)(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),void 0!==t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"==typeof t?t:Object(m.B)(this.domNode)})}render(e,t,i,n,o,s=!1){const r=this.getRenderRange(t,i),a=c.a.relativeComplement(r,e),l=c.a.relativeComplement(e,r),h=this.getNextToLastElement(a);if(s){const t=c.a.intersect(e,r);for(let e=t.start;ethis.onDragStart(n.element,l,e)))}this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width=C.g?"-moz-fit-content":"fit-content",e.width=Object(m.B)(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.additionalScrollHeight}get onMouseClick(){return r.b.map(Object(a.a)(this.domNode,"click"),(e=>this.toMouseEvent(e)))}get onMouseDblClick(){return r.b.map(Object(a.a)(this.domNode,"dblclick"),(e=>this.toMouseEvent(e)))}get onMouseMiddleClick(){return r.b.filter(r.b.map(Object(a.a)(this.domNode,"auxclick"),(e=>this.toMouseEvent(e))),(e=>1===e.browserEvent.button))}get onMouseDown(){return r.b.map(Object(a.a)(this.domNode,"mousedown"),(e=>this.toMouseEvent(e)))}get onContextMenu(){return r.b.map(Object(a.a)(this.domNode,"contextmenu"),(e=>this.toMouseEvent(e)))}get onTouchStart(){return r.b.map(Object(a.a)(this.domNode,"touchstart"),(e=>this.toTouchEvent(e)))}get onTap(){return r.b.map(Object(a.a)(this.rowsContainer,s.a.Tap),(e=>this.toGestureEvent(e)))}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const n=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(b.a.RESOURCES,JSON.stringify([t])),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(n,i)),void 0===e&&(e=String(n.length));const t=Object(m.a)(".monaco-drag-image");t.textContent=e,document.body.appendChild(t),i.dataTransfer.setDragImage(t,-10,-10),setTimeout((()=>document.body.removeChild(t)),0)}this.currentDragData=new S(n),b.c.CurrentDragAndDropData=new x(n),this.dnd.onDragStart&&this.dnd.onDragStart(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),b.c.CurrentDragAndDropData&&"vscode-ui"===b.c.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(b.c.CurrentDragAndDropData)this.currentDragData=b.c.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new L}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop="boolean"==typeof t?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let i;if(e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof t&&0===t.effect?"copy":"move",i="boolean"!=typeof t&&t.feedback?t.feedback:void 0===e.index?[-1]:[e.index],i=Object(_.e)(i).filter((e=>e>=-1&&ee-t)),i=-1===i[0]?[-1]:i,n=this.currentDragFeedback,s=i,Array.isArray(n)&&Array.isArray(s)?Object(_.g)(n,s):n===s)return!0;var n,s;if(this.currentDragFeedback=i,this.currentDragFeedbackDisposable.dispose(),-1===i[0])this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=Object(o.h)((()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")}));else{for(const e of i){const t=this.items[e];t.dropTarget=!0,t.row&&t.row.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=Object(o.h)((()=>{for(const e of i){const t=this.items[e];t.dropTarget=!1,t.row&&t.row.domNode.classList.remove("drop-target")}}))}return!0}onDragLeave(){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Object(v.i)((()=>this.clearDragOverFeedback()),100)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,b.c.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,b.c.CurrentDragAndDropData=void 0,this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=o.a.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=Object(m.F)(this.domNode).top;this.dragOverAnimationDisposable=Object(m.p)(this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Object(v.i)((()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}),1e3),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const e=i.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const n=this.getRenderRange(e,t);let o,s;e===this.elementTop(n.start)?(o=n.start,s=0):n.end-n.start>1&&(o=n.start+1,s=this.elementTop(o)-e);let r=0;for(;;){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;e=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([(r=1,a=n.a,function(e,t){a(e,t,r)})],s),Object(o.j)(s.ID,s);var l=i(0),h=i(1),c=i(18),d=i(5),u=i(2),g=i(34),m=i(68),p=i(38),f=i(30),_=i(23),b=i(29),v=i(13),C=i(47),w=i(54),y=i(21),S=i(82);class x{constructor(e,t){this.x=e,this.y=t}toClientCoordinates(){return new L(this.x-h.f.scrollX,this.y-h.f.scrollY)}}class L{constructor(e,t){this.clientX=e,this.clientY=t}toPageCoordinates(){return new x(this.clientX+h.f.scrollX,this.clientY+h.f.scrollY)}}class k{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n}}function D(e){const t=h.C(e);return new k(t.left,t.top,t.width,t.height)}class N extends w.a{constructor(e,t){super(e),this.pos=new x(this.posx,this.posy),this.editorPos=D(t)}}class E{constructor(e){this._editorViewDomNode=e}_create(e){return new N(e,this._editorViewDomNode)}onContextMenu(e,t){return h.i(e,"contextmenu",(e=>{t(this._create(e))}))}onMouseUp(e,t){return h.i(e,"mouseup",(e=>{t(this._create(e))}))}onMouseDown(e,t){return h.i(e,"mousedown",(e=>{t(this._create(e))}))}onMouseLeave(e,t){return h.j(e,(e=>{t(this._create(e))}))}onMouseMoveThrottled(e,t,i,n){return h.l(e,"mousemove",t,((e,t)=>i(e,this._create(t))),n)}}class O{constructor(e){this._editorViewDomNode=e}_create(e){return new N(e,this._editorViewDomNode)}onPointerUp(e,t){return h.i(e,"pointerup",(e=>{t(this._create(e))}))}onPointerDown(e,t){return h.i(e,"pointerdown",(e=>{t(this._create(e))}))}onPointerLeave(e,t){return h.k(e,(e=>{t(this._create(e))}))}onPointerMoveThrottled(e,t,i,n){return h.l(e,"pointermove",t,((e,t)=>i(e,this._create(t))),n)}}class I extends u.a{constructor(e){super(),this._editorViewDomNode=e,this._globalMouseMoveMonitor=this._register(new S.a),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=h.o(document,"keydown",(e=>{e.toKeybinding().isModifierKey()||this._globalMouseMoveMonitor.stopMonitoring(!0,e.browserEvent)}),!0),this._globalMouseMoveMonitor.startMonitoring(e,t,((e,t)=>i(e,new N(t,this._editorViewDomNode))),n,(e=>{this._keydownListener.dispose(),o(e)}))}stopMonitoring(){this._globalMouseMoveMonitor.stopMonitoring(!0)}}class T extends u.a{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i=a?o=Math.max(o,a+l-n):(t[i++]=new W(n,o),n=a,o=l)}return t[i++]=new W(n,o),t}static _createHorizontalRangesFromClientRects(e,t){if(!e||0===e.length)return null;const i=[];for(let n=0,o=e.length;na)return null;if((t=Math.min(a,Math.max(0,t)))===(n=Math.min(a,Math.max(0,n)))&&i===o&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(i,s)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let l=e.children[t].firstChild,h=e.children[n].firstChild;if(l&&h||(!l&&0===i&&t>0&&(l=e.children[t-1].firstChild,i=1073741824),!h&&0===o&&n>0&&(h=e.children[n-1].firstChild,o=1073741824)),!l||!h)return null;i=Math.min(l.textContent.length,Math.max(0,i)),o=Math.min(h.textContent.length,Math.max(0,o));const c=this._readClientRects(l,i,h,o,r);return this._createHorizontalRangesFromClientRects(c,s)}}var z=i(123),U=i(71),K=i(97),$=i(25);const q=!!v.g||!(v.d||f.g||f.h);let G=!0;class Y{constructor(e,t){this._domNode=e,this._clientRectDeltaLeft=0,this._clientRectDeltaLeftRead=!1,this.endNode=t}get clientRectDeltaLeft(){return this._clientRectDeltaLeftRead||(this._clientRectDeltaLeftRead=!0,this._clientRectDeltaLeft=this._domNode.getBoundingClientRect().left),this._clientRectDeltaLeft}}class Z{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(40);this.renderWhitespace=i.get(85),this.renderControlCharacters=i.get(79),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(27),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(55),this.stopRenderingLineAfter=i.get(102),this.fontLigatures=i.get(41)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class Q{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=Object(b.b)(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return(this._options.themeType===K.a.HIGH_CONTRAST||"selection"===this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)}renderLine(e,t,i,n){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),s=this._options,r=z.a.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let a=null;if(s.themeType===K.a.HIGH_CONTRAST||"selection"===this._options.renderWhitespace){const t=i.selections;for(const i of t){if(i.endLineNumbere)continue;const t=i.startLineNumber===e?i.startColumn:o.minColumn,n=i.endLineNumber===e?i.endColumn:o.maxColumn;t');const h=Object(U.d)(l,n);n.appendASCIIString("");let c=null;return G&&q&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===h.containsForeignElements&&o.content.length<300&&l.lineTokens.getCount()<100&&(c=new X(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping)),c||(c=te(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=c,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(){return this._renderedViewLine?this._renderedViewLine.getWidth():0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof X}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof X?this._renderedViewLine.monospaceAssumptionsAreValid():G}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof X&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i){if(!this._renderedViewLine)return null;e|=0,t|=0,e=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,e)),t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t));const n=0|this._renderedViewLine.input.stopRenderingLineAfter;let o=!1;-1!==n&&e>n+1&&t>n+1&&(o=!0),-1!==n&&e>n+1&&(e=n+1),-1!==n&&t>n+1&&(t=n+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,i);return s&&s.length>0?new j(o,s):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}Q.CLASS_NAME="view-line";class X{constructor(e,t,i){this.domNode=e,this.input=t,this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(){return this._getCharPosition(this._characterMapping.length)}getWidthIsFast(){return!0}monospaceAssumptionsAreValid(){if(!this.domNode)return G;const e=this.getWidth(),t=this.domNode.domNode.firstChild.offsetWidth;return Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),G=!1),G}toSlowRenderedLine(){return te(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i){const n=this._getCharPosition(e),o=this._getCharPosition(t);return[new W(n,o-n)]}_getCharPosition(e){const t=this._characterMapping.getAbsoluteOffsets();return 0===t.length?0:Math.round(this._charWidth*t[e-1])}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.partDataToCharOffset(o,n,i)+1}}class J{constructor(e,t,i,n,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||0===this._characterMapping.length){this._pixelOffsetCache=new Int32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const n=this._readPixelOffset(this.domNode,e,i);if(-1===n)return null;const o=this._readPixelOffset(this.domNode,t,i);return-1===o?null:[new W(n,o-n)]}return this._readVisibleRangesForRange(this.domNode,e,t,i)}_readVisibleRangesForRange(e,t,i,n){if(t===i){const i=this._readPixelOffset(e,t,n);return-1===i?null:[new W(i,0)]}return this._readRawVisibleRangesForRange(e,t,i,n)}_readPixelOffset(e,t,i){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth();const t=this._getReadingTarget(e);return t.firstChild?t.firstChild.offsetWidth:0}if(null!==this._pixelOffsetCache){const n=this._pixelOffsetCache[t];if(-1!==n)return n;const o=this._actualReadPixelOffset(e,t,i);return this._pixelOffsetCache[t]=o,o}return this._actualReadPixelOffset(e,t,i)}_actualReadPixelOffset(e,t,i){if(0===this._characterMapping.length){const t=H.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,i.clientRectDeltaLeft,i.endNode);return t&&0!==t.length?t[0].left:-1}if(t===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth();const n=this._characterMapping.charOffsetToPartData(t-1),o=U.a.getPartIndex(n),s=U.a.getCharIndex(n),r=H.readHorizontalRanges(this._getReadingTarget(e),o,s,o,s,i.clientRectDeltaLeft,i.endNode);if(!r||0===r.length)return-1;const a=r[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getAbsoluteOffsets(),i=Math.round(this.input.spaceWidth*e[t-1]);if(Math.abs(i-a)<=1)return i}return a}_readRawVisibleRangesForRange(e,t,i,n){if(1===t&&i===this._characterMapping.length)return[new W(0,this.getWidth())];const o=this._characterMapping.charOffsetToPartData(t-1),s=U.a.getPartIndex(o),r=U.a.getCharIndex(o),a=this._characterMapping.charOffsetToPartData(i-1),l=U.a.getPartIndex(a),h=U.a.getCharIndex(a);return H.readHorizontalRanges(this._getReadingTarget(e),s,r,l,h,n.clientRectDeltaLeft,n.endNode)}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return this._characterMapping.partDataToCharOffset(o,n,i)+1}}class ee extends J{_readVisibleRangesForRange(e,t,i,n){const o=super._readVisibleRangesForRange(e,t,i,n);if(!o||0===o.length||t===i||1===t&&i===this._characterMapping.length)return o;if(!this.input.containsRTL){const t=this._readPixelOffset(e,i,n);if(-1!==t){const e=o[o.length-1];e.left=4&&3===e[0]&&7===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&7===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&5===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&8===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}}class he{constructor(e,t,i){this.model=e.model;const n=e.configuration.options;this.layoutInfo=n.get(127),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(55),this.stickyTabStops=n.get(101),this.typicalHalfwidthCharacterWidth=n.get(40).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return he.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.model.getLineCount();let s,r=null,a=null;return i.afterLineNumber!==o&&(a=new ie.a(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new ie.a(i.afterLineNumber,e.model.getLineMaxColumn(i.afterLineNumber))),s=null===a?r:null===r?a:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,me._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class de extends ce{constructor(e,t,i,n){super(e,t,i),this._ctx=e,n?(this.target=n,this.targetPath=A.collect(n,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}fulfill(e,t=null,i=null,n=null){let o=this.mouseColumn;return t&&t.columns.contentLeft+s.width)continue;const i=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(i<=o&&o<=i+s.height)return t.fulfill(6,s.position)}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfill(e,i.position,null,i)}return null}static _hitTestTextArea(e,t){return le.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfill(6,e.lastRenderData.lastTextareaPosition):t.fulfill(1,e.lastRenderData.lastTextareaPosition):null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.pos.x-t.editorPos.x);const s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfill(2,n,i.range,s):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfill(3,n,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfill(4,n,i.range,s)))}return null}static _hitTestViewLines(e,t,i){if(!le.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfill(7,new ie.a(1,1),void 0,ue);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return t.fulfill(7,new ie.a(i,n),void 0,ue)}if(i){if(le.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.model.getLineLength(i)){const n=e.getLineWidth(i),o=ge(t.mouseContentHorizontalOffset-n);return t.fulfill(7,new ie.a(i,1),void 0,o)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const o=ge(t.mouseContentHorizontalOffset-n),s=new ie.a(i,e.model.getLineMaxColumn(i));return t.fulfill(7,s,void 0,o)}}return t.fulfill(0)}const n=me._doHitTest(e,t);return n.position?me.createMouseTargetFromHitTestPosition(e,t,n.position.lineNumber,n.position.column):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(le.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new ie.a(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(le.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new ie.a(i,n))}}return null}static _hitTestScrollbar(e,t){if(le.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new ie.a(i,n))}return null}getMouseColumn(e,t){const i=this._context.configuration.options,n=i.get(127),o=this._context.viewLayout.getCurrentScrollLeft()+t.x-e.x-n.contentLeft;return me._getMouseColumn(o,i.get(40).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n){const o=new ie.a(i,n),s=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>s){const e=ge(t.mouseContentHorizontalOffset-s);return t.fulfill(7,o,void 0,e)}const r=e.visibleRangeForPosition(i,n);if(!r)return t.fulfill(0,o);const a=r.left;if(t.mouseContentHorizontalOffset===a)return t.fulfill(6,o);const l=[];if(l.push({offset:r.left,column:n}),n>1){const t=e.visibleRangeForPosition(i,n-1);t&&l.push({offset:t.left,column:n-1})}if(ne.offset-t.offset));for(let e=1;e=t.editorPos.y+e.layoutInfo.height&&(o=t.editorPos.y+e.layoutInfo.height-1);const s=new x(t.pos.x,o),r=this._actualDoHitTestWithCaretRangeFromPoint(e,s.toClientCoordinates());return r.position?r:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=h.E(e.viewDomNode);let n;if(n=i?void 0===i.caretRangeFromPoint?function(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(null!==o){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const e=o.getBoundingClientRect(),i=window.getComputedStyle(o,null).getPropertyValue("font"),s=o.innerText;let r,a=e.left,l=0;if(t>e.left+e.width)l=s.length;else{const e=pe.getInstance();for(let n=0;nthis._createMouseTarget(e,t)),(e=>this._getMouseColumn(e)))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(127).height;const n=new E(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,(e=>this._onContextMenu(e,!0)))),this._register(n.onMouseMoveThrottled(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)),_e(this.mouseTargetFactory),be.MOUSE_MOVE_MINIMUM_TIME)),this._register(n.onMouseUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(n.onMouseDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e)))),this._register(h.i(this.viewHelper.viewDomNode,h.d.MOUSE_WHEEL,(e=>{if(this.viewController.emitMouseWheel(e),!this._context.configuration.options.get(64))return;const t=new w.b(e);if(v.f?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){const e=fe.a.getZoomLevel(),i=t.deltaY>0?1:-1;fe.a.setZoomLevel(e+i),t.preventDefault(),t.stopPropagation()}}),{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(127)){const e=this._context.configuration.options.get(127).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}onScrollChanged(e){return this._mouseDownOperation.onScrollChanged(),!1}getTargetAtClientPoint(e,t){const i=new L(e,t).toPageCoordinates(),n=D(this.viewHelper.viewDomNode);return i.yn.y+n.height||i.xn.x+n.width?null:this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,null)}_createMouseTarget(e,t){return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,t?e.target:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.editorPos,e.pos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(l&&(i||o&&s))h(),this._mouseDownOperation.start(t.type,e);else if(n)e.preventDefault();else if(r){const i=t.detail;this.viewHelper.shouldSuppressMouseDownOnViewZone(i.viewZoneId)&&(h(),this._mouseDownOperation.start(t.type,e),e.preventDefault())}else a&&this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)&&(h(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:t})}}be.MOUSE_MOVE_MINIMUM_TIME=100;class ve extends u.a{constructor(e,t,i,n,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._createMouseTarget=n,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new I(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new y.g),this._mouseState=new Ce,this._currentSelection=new _.a(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!0);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):this._dispatchMouse(t,!0))}start(e,t){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const i=this._findMousePosition(t,!0);if(!i||!i.position)return;this._mouseState.trySetCount(t.detail,i.position),t.detail=this._mouseState.count;const n=this._context.configuration.options;if(!n.get(77)&&n.get(29)&&!n.get(16)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===i.type&&i.position&&this._currentSelection.containsPosition(i.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,_e(null),(e=>this._onMouseDownThenMove(e)),(e=>{const t=this._findMousePosition(this._lastMouseEvent,!0);e&&e instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()}));this._mouseState.isDragAndDrop=!1,this._dispatchMouse(i,t.shiftKey),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(t.target,t.buttons,_e(null),(e=>this._onMouseDownThenMove(e)),(()=>this._stop())))}_stop(){this._isActive=!1,this._onScrollTimeout.cancel()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onScrollChanged(){this._isActive&&this._onScrollTimeout.setIfNotSet((()=>{if(!this._lastMouseEvent)return;const e=this._findMousePosition(this._lastMouseEvent,!1);e&&(this._mouseState.isDragAndDrop||this._dispatchMouse(e,!0))}),10)}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.model,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const s=n.getCurrentScrollTop()+(e.posy-t.y),r=he.getZoneAtCoord(this._context,s);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return new ae(null,13,o,e)}const a=n.getLineNumberAtVerticalOffset(s);return new ae(null,13,o,new ie.a(a,i.getLineMaxColumn(a)))}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+(e.posy-t.y));return e.posxt.x+t.width?new ae(null,13,o,new ie.a(s,i.getLineMaxColumn(s))):null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return new ae(n.element,n.type,n.mouseColumn,e,null,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new ie.a(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton})}}class Ce{constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=(new Date).getTime();i-this._lastSetMouseDownCountTime>Ce.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}Ce.CLEAR_MOUSE_DOWN_COUNT_TIME=400;var we,ye=i(146),Se=i(6);class xe{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selectionStartPosition=n,this.selectionEndPosition=o}toString(){return"[ <"+this.value+">, selectionStart: "+this.selectionStart+", selectionEnd: "+this.selectionEnd+"]"}static readFromTextArea(e){return new xe(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)}collapseSelection(){return new xe(this.value,this.value.length,this.value.length,null,null)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selectionStartPosition,t,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selectionEndPosition,t,1)}const t=this.value.substring(this.selectionStart,e);if(-1===t.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selectionStartPosition,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selectionEndPosition,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;-1!==(o=t.indexOf("\n",o+1));)n++;return[e,i*t.length,n]}static selectedText(e){return new xe(e,0,e.length,null,null)}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};let n=e.value,o=e.selectionStart,s=e.selectionEnd,r=t.value,a=t.selectionStart,l=t.selectionEnd;const h=n.substring(s),c=r.substring(l),d=Se.e(h,c);r=r.substring(0,r.length-d),n=n.substring(0,n.length-d);const u=n.substring(0,o),g=r.substring(0,a),m=Se.d(u,g);if(r=r.substring(m),n=n.substring(m),a-=m,o-=m,l-=m,s-=m,i&&a===l&&n.length>0){let e=null;if(a===r.length?r.startsWith(n)&&(e=r.substring(n.length)):r.endsWith(n)&&(e=r.substring(0,r.length-n.length)),null!==e&&e.length>0&&(/\uFE0F/.test(e)||Se.k(e)))return{text:e,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0}}return a===l?n===r&&0===o&&s===n.length&&a===r.length&&-1===r.indexOf("\n")&&Se.l(r)?{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0}:{text:r,replacePrevCharCnt:u.length-m,replaceNextCharCnt:0,positionDelta:0}:{text:r,replacePrevCharCnt:s-o,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(Se.d(e.value,t.value),e.selectionEnd),n=Math.min(Se.e(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),s=t.value.substring(i,t.value.length-n),r=(e.selectionStart,e.selectionEnd-i),a=(t.selectionStart,t.selectionEnd-i);return{text:s,replacePrevCharCnt:r,replaceNextCharCnt:o.length-r,positionDelta:a-s.length}}}xe.EMPTY=new xe("",0,0,null,null);class Le{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,o=i+t;return new ne.a(n,1,o+1,1)}static fromEditorSelection(e,t,i,n,o){const s=Le._getPageOfLine(i.startLineNumber,n),r=Le._getRangeForPage(s,n),a=Le._getPageOfLine(i.endLineNumber,n),l=Le._getRangeForPage(a,n),h=r.intersectRanges(new ne.a(1,1,i.startLineNumber,i.startColumn));let c=t.getValueInRange(h,1);const d=t.getLineCount(),u=t.getLineMaxColumn(d),g=l.intersectRanges(new ne.a(i.endLineNumber,i.endColumn,d,u));let m,p=t.getValueInRange(g,1);if(s===a||s+1===a)m=t.getValueInRange(i,1);else{const e=r.intersectRanges(i),n=l.intersectRanges(i);m=t.getValueInRange(e,1)+String.fromCharCode(8230)+t.getValueInRange(n,1)}if(o){const e=500;c.length>e&&(c=c.substring(c.length-e,c.length)),p.length>e&&(p=p.substring(0,e)),m.length>2*e&&(m=m.substring(0,e)+String.fromCharCode(8230)+m.substring(m.length-e,m.length))}return new xe(c+m+p,c.length,c.length+m.length,new ie.a(i.startLineNumber,i.startColumn),new ie.a(i.endLineNumber,i.endColumn))}}!function(e){e.Tap="-monaco-textarea-synthetic-tap"}(we||(we={}));class ke{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}ke.INSTANCE=new ke;class De extends u.a{constructor(e,t){super(),this.textArea=t,this._onFocus=this._register(new d.a),this.onFocus=this._onFocus.event,this._onBlur=this._register(new d.a),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new d.a),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new d.a),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new d.a),this.onCut=this._onCut.event,this._onPaste=this._register(new d.a),this.onPaste=this._onPaste.event,this._onType=this._register(new d.a),this.onType=this._onType.event,this._onCompositionStart=this._register(new d.a),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new d.a),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new d.a),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new d.a),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._host=e,this._textArea=this._register(new Ee(t)),this._asyncTriggerCut=this._register(new y.e((()=>this._onCut.fire()),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new y.e((()=>this.writeScreenReaderContent("asyncFocusGain")),0)),this._textAreaState=xe.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._isDoingComposition=!1,this._nextCommand=0;let i=null;this._register(h.o(t.domNode,"keydown",(e=>{(109===e.keyCode||this._isDoingComposition&&1===e.keyCode)&&e.stopPropagation(),e.equals(9)&&e.preventDefault(),i=e,this._onKeyDown.fire(e)}))),this._register(h.o(t.domNode,"keyup",(e=>{this._onKeyUp.fire(e)}))),this._register(h.i(t.domNode,"compositionstart",(e=>{if(!this._isDoingComposition){if(this._isDoingComposition=!0,v.f&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&(i&&i.equals(109)&&("ArrowRight"===i.code||"ArrowLeft"===i.code)||f.g))return this._textAreaState=new xe(this._textAreaState.value,this._textAreaState.selectionStart-1,this._textAreaState.selectionEnd,this._textAreaState.selectionStartPosition?new ie.a(this._textAreaState.selectionStartPosition.lineNumber,this._textAreaState.selectionStartPosition.column-1):null,this._textAreaState.selectionEndPosition),void this._onCompositionStart.fire({revealDeltaColumns:-1});f.e?this._onCompositionStart.fire({revealDeltaColumns:-this._textAreaState.selectionStart}):(this._setAndWriteTextAreaState("compositionstart",xe.EMPTY),this._onCompositionStart.fire({revealDeltaColumns:0}))}})));const n=e=>{const t=this._textAreaState,i=xe.readFromTextArea(this._textArea);return[i,xe.deduceInput(t,i,e)]},o=()=>{const e=this._textAreaState,t=xe.readFromTextArea(this._textArea);return[t,xe.deduceAndroidCompositionInput(e,t)]},s=e=>{const t=this._textAreaState,i=xe.selectedText(e);return[i,{text:i.value,replacePrevCharCnt:t.selectionEnd-t.selectionStart,replaceNextCharCnt:0,positionDelta:0}]};this._register(h.i(t.domNode,"compositionupdate",(e=>{if(f.e){const[t,i]=o();return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const[t,i]=s(e.data||"");this._textAreaState=t,this._onType.fire(i),this._onCompositionUpdate.fire(e)}))),this._register(h.i(t.domNode,"compositionend",(e=>{if(!this._isDoingComposition)return;if(this._isDoingComposition=!1,f.e){const[e,t]=o();return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const[t,i]=s(e.data||"");this._textAreaState=t,this._onType.fire(i),(f.f||f.g)&&(this._textAreaState=xe.readFromTextArea(this._textArea)),this._onCompositionEnd.fire()}))),this._register(h.i(t.domNode,"input",(()=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._isDoingComposition)return;const[e,t]=n(v.f);0===t.replacePrevCharCnt&&1===t.text.length&&Se.D(t.text.charCodeAt(0))||(this._textAreaState=e,0===this._nextCommand?""===t.text&&0===t.replacePrevCharCnt||this._onType.fire(t):(""===t.text&&0===t.replacePrevCharCnt||this._firePaste(t.text,null),this._nextCommand=0))}))),this._register(h.i(t.domNode,"cut",(e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()}))),this._register(h.i(t.domNode,"copy",(e=>{this._ensureClipboardGetsEditorSelection(e)}))),this._register(h.i(t.domNode,"paste",(e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),Ne.canUseTextData(e)){const[t,i]=Ne.getTextData(e);""!==t&&this._firePaste(t,i)}else this._textArea.getSelectionStart()!==this._textArea.getSelectionEnd()&&this._setAndWriteTextAreaState("paste",xe.EMPTY),this._nextCommand=1}))),this._register(h.i(t.domNode,"focus",(()=>{const e=this._hasFocus;this._setHasFocus(!0),f.h&&!e&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()}))),this._register(h.i(t.domNode,"blur",(()=>{this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}))),this._register(h.i(t.domNode,we.Tap,(()=>{f.e&&this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())})))}_installSelectionChangeListener(){let e=0;return h.i(document,"selectionchange",(t=>{if(!this._hasFocus)return;if(this._isDoingComposition)return;if(!f.f)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100)return;if(!this._textAreaState.selectionStartPosition||!this._textAreaState.selectionEndPosition)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const r=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===r&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(r),h=this._host.deduceModelPosition(l[0],l[1],l[2]),c=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(c[0],c[1],c[2]),u=new _.a(h.lineNumber,h.column,d.lineNumber,d.column);this._onSelectionChangeRequest.fire(u)}))}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){const e=h.E(this.textArea.domNode);e?this._setHasFocus(e.activeElement===this.textArea.domNode):h.M(this.textArea.domNode)?this._setHasFocus(document.activeElement===this.textArea.domNode):this._setHasFocus(!1)}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._isDoingComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent(this._textAreaState))}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(Ne.canUseTextData(e)),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};ke.INSTANCE.set(f.g?t.text.replace(/\r\n/g,"\n"):t.text,i),Ne.canUseTextData(e)?Ne.setTextData(e,t.text,t.html,i):this._setAndWriteTextAreaState("copy or cut",xe.selectedText(t.text))}_firePaste(e,t){t||(t=ke.INSTANCE.get(e)),this._onPaste.fire({text:e,metadata:t})}}class Ne{static canUseTextData(e){return!!e.clipboardData||!!window.clipboardData}static getTextData(e){if(e.clipboardData){e.preventDefault();const t=e.clipboardData.getData("text/plain");let i=null;const n=e.clipboardData.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(e){}return[t,i]}if(window.clipboardData)return e.preventDefault(),[window.clipboardData.getData("Text"),null];throw new Error("ClipboardEventUtils.getTextData: Cannot use text data!")}static setTextData(e,t,i,n){if(e.clipboardData)return e.clipboardData.setData("text/plain",t),"string"==typeof i&&e.clipboardData.setData("text/html",i),e.clipboardData.setData("vscode-editor-data",JSON.stringify(n)),void e.preventDefault();if(window.clipboardData)return window.clipboardData.setData("Text",t),void e.preventDefault();throw new Error("ClipboardEventUtils.setTextData: Cannot use text data!")}}class Ee extends u.a{constructor(e){super(),this._actual=e,this._ignoreSelectionChangeTime=0}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.domNode.value}setValue(e,t){const i=this._actual.domNode;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return"backward"===this._actual.domNode.selectionDirection?this._actual.domNode.selectionEnd:this._actual.domNode.selectionStart}getSelectionEnd(){return"backward"===this._actual.domNode.selectionDirection?this._actual.domNode.selectionStart:this._actual.domNode.selectionEnd}setSelectionRange(e,t,i){const n=this._actual.domNode;let o=null;const s=h.E(n);o=s?s.activeElement:document.activeElement;const r=o===n,a=n.selectionStart,l=n.selectionEnd;if(r&&a===t&&l===i)f.g&&window.parent!==window&&n.focus();else{if(r)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(f.g&&window.parent!==window&&n.focus());try{const e=h.S(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),h.Q(n,e)}catch(e){}}}}class Oe extends be{constructor(e,t,i){super(e,t,i),this._register(C.b.addTarget(this.viewHelper.linesContentDomNode)),this._register(h.i(this.viewHelper.linesContentDomNode,C.a.Tap,(e=>this.onTap(e)))),this._register(h.i(this.viewHelper.linesContentDomNode,C.a.Change,(e=>this.onChange(e)))),this._register(h.i(this.viewHelper.linesContentDomNode,C.a.Contextmenu,(e=>this._onContextMenu(new N(e,this.viewHelper.viewDomNode),!1)))),this._lastPointerType="mouse",this._register(h.i(this.viewHelper.linesContentDomNode,"pointerdown",(e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"})));const n=new O(this.viewHelper.viewDomNode);this._register(n.onPointerMoveThrottled(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)),_e(this.mouseTargetFactory),be.MOUSE_MOVE_MINIMUM_TIME)),this._register(n.onPointerUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e))))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new N(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1})}onChange(e){"touch"===this._lastPointerType&&this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e)}}class Ie extends be{constructor(e,t,i){super(e,t,i),this._register(C.b.addTarget(this.viewHelper.linesContentDomNode)),this._register(h.i(this.viewHelper.linesContentDomNode,C.a.Tap,(e=>this.onTap(e)))),this._register(h.i(this.viewHelper.linesContentDomNode,C.a.Change,(e=>this.onChange(e)))),this._register(h.i(this.viewHelper.linesContentDomNode,C.a.Contextmenu,(e=>this._onContextMenu(new N(e,this.viewHelper.viewDomNode),!1))))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new N(e,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent(we.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position)}}onChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}}class Te extends u.a{constructor(e,t,i){super(),v.c&&ye.a.pointerEvents?this.handler=this._register(new Oe(e,t,i)):window.TouchEvent?this.handler=this._register(new Ie(e,t,i)):this.handler=this._register(new be(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Me extends T{}var Ae=i(49),Re=i(17);class Pe extends Me{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ie.a(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(55);const t=e.get(56);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(81);const i=e.get(127);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new ie.a(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?''+i+"":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10==0?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=v.d?this._lineHeight%2==0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o='
',s=this._context.model.getLineCount(),r=[];for(let e=i;e<=n;e++){const n=e-i;if(!this._renderFinalNewline&&e===s&&0===this._context.model.getLineLength(e)){r[n]="";continue}const a=this._getLineRenderLineNumber(e);a?e===this._activeLineNumber?r[n]='
'+a+"
":r[n]=o+a+"
":r[n]=""}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Pe.CLASS_NAME="line-numbers",Object(Re.f)(((e,t)=>{const i=e.getColor(Ae.j);i&&t.addRule(`.monaco-editor .line-numbers { color: ${i}; }`);const n=e.getColor(Ae.b);n&&t.addRule(`.monaco-editor .line-numbers.active-line-number { color: ${n}; }`)}));class Fe extends M{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(127);this._canUseLayerHinting=!t.get(26),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=Object(b.b)(document.createElement("div")),this._domNode.setClassName(Fe.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Object(b.b)(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(Fe.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(127);return this._canUseLayerHinting=!t.get(26),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}Fe.CLASS_NAME="glyph-margin",Fe.OUTER_CLASS_NAME="margin";var We=i(87),Be=i(121);class je{constructor(e,t,i){this.top=e,this.left=t,this.width=i}setWidth(e){return new je(this.top,this.left,e)}}const Ve=f.g;class He extends M{constructor(e,t,i){super(e),this._primaryCursorPosition=new ie.a(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._viewHelper=i,this._scrollLeft=0,this._scrollTop=0;const n=this._context.configuration.options,o=n.get(127);this._setAccessibilityOptions(n),this._contentLeft=o.contentLeft,this._contentWidth=o.contentWidth,this._contentHeight=o.height,this._fontInfo=n.get(40),this._lineHeight=n.get(55),this._emptySelectionClipboard=n.get(30),this._copyWithSyntaxHighlighting=n.get(19),this._visibleTextArea=null,this._selections=[new _.a(1,1,1,1)],this._modelSelections=[new _.a(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Object(b.b)(document.createElement("textarea")),A.write(this.textArea,6),this.textArea.setClassName(`inputarea ${Be.a}`),this.textArea.setAttribute("wrap","off"),this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(n)),this.textArea.setAttribute("tabindex",String(n.get(109))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",l.a("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),n.get(28)&&n.get(77)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=Object(b.b)(document.createElement("div")),this.textAreaCover.setPosition("absolute");const s={getLineCount:()=>this._context.model.getLineCount(),getLineMaxColumn:e=>this._context.model.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.model.getValueInRange(e,t)},r={getDataToCopy:e=>{const t=this._context.model.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,v.j),i=this._context.model.getEOL(),n=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),o=Array.isArray(t)?t:null,s=Array.isArray(t)?t.join(i):t;let r,a=null;if(e&&this._copyWithSyntaxHighlighting&&s.length<65536){const e=this._context.model.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(r=e.html,a=e.mode)}return{isFromEmptySelection:n,multicursorText:o,text:s,html:r,mode:a}},getScreenReaderContent:e=>{if(1===this._accessibilitySupport){if(v.f){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new xe(i,i.length,i.length,t,t)}}return xe.EMPTY}if(f.e){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new xe(i,n,n,t,t)}return xe.EMPTY}return Le.fromEditorSelection(e,s,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.model.deduceModelPositionRelativeToViewPosition(e,t,i)};this._textAreaInput=this._register(new De(r,this.textArea)),this._register(this._textAreaInput.onKeyDown((e=>{this._viewController.emitKeyDown(e)}))),this._register(this._textAreaInput.onKeyUp((e=>{this._viewController.emitKeyUp(e)}))),this._register(this._textAreaInput.onPaste((e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)}))),this._register(this._textAreaInput.onCut((()=>{this._viewController.cut()}))),this._register(this._textAreaInput.onType((e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)}))),this._register(this._textAreaInput.onSelectionChangeRequest((e=>{this._viewController.setSelection(e)}))),this._register(this._textAreaInput.onCompositionStart((e=>{const t=this._selections[0].startLineNumber,i=this._selections[0].startColumn+e.revealDeltaColumns;this._context.model.revealRange("keyboard",!0,new ne.a(t,i,t,i),0,1);const n=this._viewHelper.visibleRangeForPositionRelativeToEditor(t,i);n&&(this._visibleTextArea=new je(this._context.viewLayout.getVerticalOffsetForLineNumber(t),n.left,Ve?0:1),this._render()),this.textArea.setClassName(`inputarea ${Be.a} ime-input`),this._viewController.compositionStart(),this._context.model.onCompositionStart()}))),this._register(this._textAreaInput.onCompositionUpdate((e=>{this._visibleTextArea&&(this._visibleTextArea=this._visibleTextArea.setWidth(function(e,t){const i=document.createElement("canvas").getContext("2d");var n;i.font=("normal",`normal normal ${(n=t).fontWeight} ${n.fontSize}px / ${n.lineHeight}px ${n.fontFamily}`);const o=i.measureText(e);return f.g?o.width+2:o.width}(e.data,this._fontInfo)),this._render())}))),this._register(this._textAreaInput.onCompositionEnd((()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName(`inputarea ${Be.a}`),this._viewController.compositionEnd(),this._context.model.onCompositionEnd()}))),this._register(this._textAreaInput.onFocus((()=>{this._context.model.setHasFocus(!0)}))),this._register(this._textAreaInput.onBlur((()=>{this._context.model.setHasFocus(!1)})))}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t=this._context.model.getLineContent(e.lineNumber),i=Object(We.a)('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?');let n=!0,o=e.column,s=!0,r=e.column,a=0;for(;a<50&&(n||s);){if(n&&o<=1&&(n=!1),n){const e=t.charCodeAt(o-2);0!==i.get(e)?n=!1:o--}if(s&&r>t.length&&(s=!1),s){const e=t.charCodeAt(r-1);0!==i.get(e)?s=!1:r++}a++}return[t.substring(o-1,r-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.model.getLineContent(e.lineNumber),i=Object(We.a)(this._context.configuration.options.get(113));let n=e.column,o=0;for(;n>1;){const s=t.charCodeAt(n-2);if(0!==i.get(s)||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.model.getLineContent(e.lineNumber).charAt(e.column-2);if(!Se.D(t.charCodeAt(0)))return t}return""}_getAriaLabel(e){return 1===e.get(2)?l.a("accessibilityOffAriaLabel","The editor is not accessible at this time. Press {0} for options.",v.d?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===$.g.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(127);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(40),this._lineHeight=t.get(55),this._emptySelectionClipboard=t.get(30),this._copyWithSyntaxHighlighting=t.get(19),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(109))),(e.hasChanged(28)||e.hasChanged(77))&&(t.get(28)&&t.get(77)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}prepareRender(e){this._primaryCursorPosition=new ie.a(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){if(this._visibleTextArea)return void this._renderInsideEditor(null,this._visibleTextArea.top-this._scrollTop,this._contentLeft+this._visibleTextArea.left-this._scrollLeft,this._visibleTextArea.width,this._lineHeight);if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(ethis._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;t<0||t>this._contentHeight?this._renderAtTopLeft():v.f?this._renderInsideEditor(this._primaryCursorPosition,t,e,Ve?0:1,this._lineHeight):this._renderInsideEditor(this._primaryCursorPosition,t,e,Ve?0:1,Ve?0:1)}_renderInsideEditor(e,t,i,n,o){this._lastRenderPosition=e;const s=this.textArea,r=this.textAreaCover;m.a.applyFontInfo(s,this._fontInfo),s.setTop(t),s.setLeft(i),s.setWidth(n),s.setHeight(o),r.setTop(0),r.setLeft(0),r.setWidth(0),r.setHeight(0)}_renderAtTopLeft(){this._lastRenderPosition=null;const e=this.textArea,t=this.textAreaCover;if(m.a.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),Ve)return e.setWidth(0),e.setHeight(0),t.setWidth(0),void t.setHeight(0);e.setWidth(1),e.setHeight(1),t.setWidth(1),t.setHeight(1);const i=this._context.configuration.options;i.get(46)?t.setClassName("monaco-editor-background textAreaCover "+Fe.OUTER_CLASS_NAME):0!==i.get(56).renderType?t.setClassName("monaco-editor-background textAreaCover "+Pe.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")}}var ze=i(88);class Ue{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){ze.b.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position):this._lastCursorLineSelect(e.position):e.inSelectionMode?this._lineSelectDrag(e.position):this._lineSelect(e.position):2===e.mouseDownCount?this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position):e.inSelectionMode?this._wordSelectDrag(e.position):this._wordSelect(e.position):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position):this.moveTo(e.position)}_usualArgs(e){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e}}moveTo(e){ze.b.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){ze.b.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,i){e=this._validateViewColumn(e),ze.b.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),ze.b.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){ze.b.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){ze.b.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelectDrag(e){ze.b.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){ze.b.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){ze.b.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){ze.b.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){ze.b.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){ze.b.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){ze.b.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class Ke{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown&&this.onKeyDown(e)}emitKeyUp(e){this.onKeyUp&&this.onKeyUp(e)}emitContextMenu(e){this.onContextMenu&&this.onContextMenu(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove&&this.onMouseMove(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave&&this.onMouseLeave(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown&&this.onMouseDown(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp&&this.onMouseUp(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag&&this.onMouseDrag(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop&&this.onMouseDrop(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled&&this.onMouseDropCanceled()}emitMouseWheel(e){this.onMouseWheel&&this.onMouseWheel(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return Ke.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){return new $e(e.element,e.type,e.mouseColumn,e.position?t.convertViewPositionToModelPosition(e.position):null,e.range?t.convertViewRangeToModelRange(e.range):null,e.detail)}}class $e{constructor(e,t,i,n,o,s){this.element=e,this.type=t,this.mouseColumn=i,this.position=n,this.range=o,this.detail=s}toString(){return ae.toString(this)}}var qe,Ge=i(109);class Ye{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Error("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(tn)return null;let o=0,s=0;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===s?(o=i,s=1):s++)}if(e=i&&s<=n&&(this._lines[s-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let e=0;ei)continue;const r=Math.max(t,s.fromLineNumber),a=Math.min(i,s.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class Ze{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new Ye((()=>this._host.createVisibleLine()))}_createDomNode(){const e=Object(b.b)(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(127)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.toLineNumber)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;et){const e=t,s=Math.min(i,o.rendLineNumberStart-1);e<=s&&(this._insertLinesBefore(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const e=Math.max(0,i-o.rendLineNumberStart+1),t=o.linesLength-1-e+1;t>0&&(this._removeLinesAfter(o,t),o.linesLength-=t)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let e=t;e<=i;e++){const t=s+e;r[e].layoutLine(t,n[t-o])}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let e=t;e<=i;e++)s[r++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;t--){const i=e.lines[t];n[t]&&(i.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");Qe._ttPolicy&&(t=Qe._ttPolicy.createHTML(t)),n.innerHTML=t;for(let t=0;te}),Qe._sb=Object(Ge.a)(1e5);class Xe extends M{constructor(e){super(e),this._visibleLines=new Ze(this),this.domNode=this._visibleLines.domNode,this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ee.shouldRender()));for(let i=0,n=t.length;i'),n.appendASCIIString(o),n.appendASCIIString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class et extends Xe{constructor(e){super(e);const t=this._context.configuration.options.get(127);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(127);return this._contentWidth=t.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class tt extends Xe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(127);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),m.a.applyFontInfo(this.domNode,t.get(40))}onConfigurationChanged(e){const t=this._context.configuration.options;m.a.applyFontInfo(this.domNode,t.get(40));const i=t.get(127);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class it{constructor(e,t){this.top=e,this.left=t}}class nt extends M{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=Object(b.b)(document.createElement("div")),A.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=Object(b.b)(document.createElement("div")),A.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onLineMappingChanged(e);return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}addWidget(e){const t=new ot(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i){this._widgets[e.getId()].setPosition(t,i),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const i=e.domNode.domNode;i.parentNode.removeChild(i),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class ot{constructor(e,t,i){this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=Object(b.b)(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const n=this._context.configuration.options,o=n.get(127);this._fixedOverflowWidgets=n.get(34),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=n.get(55),this._range=null,this._viewRange=null,this._preference=[],this._cachedDomNodeClientWidth=-1,this._cachedDomNodeClientHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(55),e.hasChanged(127)){const e=t.get(127);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}onLineMappingChanged(e){this._setPosition(this._range)}_setPosition(e){if(this._range=e,this._viewRange=null,this._range){const e=this._context.model.validateModelRange(this._range);(this._context.model.coordinatesConverter.modelPositionIsVisible(e.getStartPosition())||this._context.model.coordinatesConverter.modelPositionIsVisible(e.getEndPosition()))&&(this._viewRange=this._context.model.coordinatesConverter.convertModelRangeToViewRange(e))}}_getMaxWidth(){return this.allowEditorOverflow?window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth:this._contentWidth}setPosition(e,t){this._setPosition(e),this._preference=t,this._cachedDomNodeClientWidth=-1,this._cachedDomNodeClientHeight=-1}_layoutBoxInViewport(e,t,i,n,o){const s=e.top,r=s,a=t.top+this._lineHeight,l=s-n,h=r>=n,c=a,d=o.viewportHeight-a>=n;let u=e.left,g=t.left;return u+i>o.scrollLeft+o.viewportWidth&&(u=o.scrollLeft+o.viewportWidth-i),g+i>o.scrollLeft+o.viewportWidth&&(g=o.scrollLeft+o.viewportWidth-i),us){const e=r-(s-n);r-=e,i-=e}if(r=22,_=c+n<=d.height-22;return this._fixedOverflowWidgets?{fitsAbove:f,aboveTop:Math.max(l,22),aboveLeft:g,fitsBelow:_,belowTop:c,belowLeft:p}:{fitsAbove:f,aboveTop:s,aboveLeft:u,fitsBelow:_,belowTop:r,belowLeft:m}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new it(e.top,e.left+this._contentLeft)}_getTopAndBottomLeft(e){if(!this._viewRange)return[null,null];const t=e.linesVisibleRangesForRange(this._viewRange,!1);if(!t||0===t.length)return[null,null];let i=t[0],n=t[0];for(const e of t)e.lineNumbern.lineNumber&&(n=e);let o=1073741824;for(const e of i.ranges)e.lefte.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),void("function"==typeof this._actual.afterRender&&st(this._actual.afterRender,this._actual,null));this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),"function"==typeof this._actual.afterRender&&st(this._actual.afterRender,this._actual,this._renderData.position)}}function st(e,t,...i){try{return e.call(t,...i)}catch(e){return null}}var rt=i(20);let at=!0;class lt extends Me{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(127);this._lineHeight=t.get(55),this._renderLineHighlight=t.get(82),this._renderLineHighlightOnlyWhenFocus=t.get(83),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new _.a(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=at?this._selections.slice(0,1):this._selections,i=t.map((e=>e.positionLineNumber));i.sort(((e,t)=>e-t)),rt.g(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=t.every((e=>e.isEmpty()));return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(127);return this._lineHeight=t.get(55),this._renderLineHighlight=t.get(82),this._renderLineHighlightOnlyWhenFocus=t.get(83),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHighlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=this._renderOne(e),i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let s=0;const r=[];for(let e=i;e<=n;e++){const n=e-i;for(;s=this._renderData.length?"":this._renderData[i]}}class ht extends lt{_renderOne(e){return`
`}_shouldRenderThis(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderOther(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class ct extends lt{_renderOne(e){return`
`}_shouldRenderMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderThis(){return!0}_shouldRenderOther(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}Object(Re.f)(((e,t)=>{at=!1;const i=e.getColor(Ae.h);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines(Ae.i)){const i=e.getColor(Ae.i);i&&(at=!0,t.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),"hc"===e.type&&(t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}}));class dt extends Me{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(55),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(55),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let e=0,o=t.length;e{if(e.options.zIndext.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return in?1:ne.a.compareRangesUsingStarts(e.range,t.range)}));const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=[];for(let e=o;e<=s;e++)r[e-o]="";this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let e=0,r=t.length;e',l=Math.max(r.range.startLineNumber,o),h=Math.min(r.range.endLineNumber,s);for(let e=l;e<=h;e++)i[e-o]+=a}}_renderNormalDecorations(e,t,i){const n=String(this._lineHeight),o=e.visibleRange.startLineNumber;let s=null,r=!1,a=null;for(let l=0,h=t.length;l';r[l]+=s}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}var ut=i(76);class gt extends M{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,s=o.get(89),r=o.get(63),a=o.get(32),l=o.get(92),c={listenOnDomNode:i.domNode,className:"editor-scrollable "+Object(Re.e)(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new ut.c(t.domNode,c,this._context.viewLayout.getScrollable())),A.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=Object(b.b)(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(e,t,i)=>{const n={};if(t){const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.model.setScrollPosition(n,1)};this._register(h.i(i.domNode,"scroll",(e=>d(i.domNode,!0,!0)))),this._register(h.i(t.domNode,"scroll",(e=>d(t.domNode,!0,!1)))),this._register(h.i(n.domNode,"scroll",(e=>d(n.domNode,!0,!1)))),this._register(h.i(this.scrollbarDomNode.domNode,"scroll",(e=>d(this.scrollbarDomNode.domNode,!0,!1))))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(127);this.scrollbarDomNode.setLeft(t.contentLeft),"right"===e.get(61).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarMouseDown(e){this.scrollbar.delegateVerticalScrollbarMouseDown(e)}onConfigurationChanged(e){if(e.hasChanged(89)||e.hasChanged(63)||e.hasChanged(32)){const e=this._context.configuration.options,t=e.get(89),i=e.get(63),n=e.get(32),o=e.get(92),s={handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(127)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+Object(Re.e)(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class mt{constructor(e,t,i){this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class pt extends Me{_render(e,t,i){const n=[];for(let i=e;i<=t;i++)n[i-e]=[];if(0===i.length)return n;i.sort(((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className',r=[];for(let e=t;e<=i;e++){const i=e-t,o=n[i];0===o.length?r[i]="":r[i]='
=this._renderResult.length?"":this._renderResult[i]}}class _t extends Me{constructor(e){super(),this._context=e,this._primaryLineNumber=0;const t=this._context.configuration.options,i=t.get(128),n=t.get(40);this._lineHeight=t.get(55),this._spaceWidth=n.spaceWidth,this._enabled=t.get(80),this._activeIndentEnabled=t.get(49),this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(128),n=t.get(40);return this._lineHeight=t.get(55),this._spaceWidth=n.spaceWidth,this._enabled=t.get(80),this._activeIndentEnabled=t.get(49),this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){const t=e.selections[0],i=t.isEmpty()?t.positionLineNumber:0;return this._primaryLineNumber!==i&&(this._primaryLineNumber=i,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){if(!this._enabled)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,{indentSize:n}=this._context.model.getTextModelOptions(),o=n*this._spaceWidth,s=e.scrollWidth,r=this._lineHeight,a=this._context.model.getLinesIndentGuides(t,i);let l=0,h=0,c=0;if(this._activeIndentEnabled&&this._primaryLineNumber){const e=this._context.model.getActiveIndentGuide(this._primaryLineNumber,t,i);l=e.startLineNumber,h=e.endLineNumber,c=e.indent}const d=[];for(let n=t;n<=i;n++){const i=l<=n&&n<=h,u=n-t,g=a[u];let m="";if(g>=1){const t=e.visibleRangeForPosition(new ie.a(n,1));let a=t?t.left:0;for(let e=1;e<=g&&(m+=`
`,a+=o,!(a>s||this._maxIndentLeft>0&&a>this._maxIndentLeft));e++);}d[u]=m}this._renderResult=d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Object(Re.f)(((e,t)=>{const i=e.getColor(Ae.g);i&&t.addRule(`.monaco-editor .lines-content .cigr { box-shadow: 1px 0 0 0 ${i} inset; }`);const n=e.getColor(Ae.a)||i;n&&t.addRule(`.monaco-editor .lines-content .cigra { box-shadow: 1px 0 0 0 ${n} inset; }`)}));class bt{constructor(){this._currentVisibleRange=new ne.a(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class vt{constructor(e,t,i,n,o,s){this.lineNumber=e,this.startColumn=t,this.endColumn=i,this.startScrollTop=n,this.stopScrollTop=o,this.scrollType=s,this.type="range",this.minLineNumber=e,this.maxLineNumber=e}}class Ct{constructor(e,t,i,n){this.selections=e,this.startScrollTop=t,this.stopScrollTop=i,this.scrollType=n,this.type="selections";let o=e[0].startLineNumber,s=e[0].endLineNumber;for(let t=1,i=e.length;t{this._updateLineWidthsSlow()}),200),this._asyncCheckMonospaceFontAssumptions=new y.e((()=>{this._checkMonospaceFontAssumptions()}),2e3),this._lastRenderedData=new bt,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Q(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(128)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(40),n=t.get(128);return this._lineHeight=t.get(55),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(86),this._cursorSurroundingLines=t.get(23),this._cursorSurroundingLinesStyle=t.get(24),this._canUseLayerHinting=!t.get(26),m.a.applyFontInfo(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(127)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Z(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++)this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let e=t;e<=i;e++)n=this._visibleLines.getVisibleLine(e).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.range,e.selections,e.verticalType);if(-1===t)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new vt(e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Ct(e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.model.setScrollPosition(i,n),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.model.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.model.getLineCount())return null;if(1===this._context.model.getLineMaxColumn(n))return new ie.a(n,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(ns)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(n,e,t);const a=this._context.model.getLineMinColumn(n);return ri?-1:this._visibleLines.getVisibleLine(e).getWidth()}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=ne.a.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;let o=[],s=0;const r=new Y(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new ie.a(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),h=this._visibleLines.getEndLineNumber();for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(eh)continue;const c=e===n.startLineNumber?n.startColumn:1,d=e===n.endLineNumber?n.endColumn:this._context.model.getLineMaxColumn(e),u=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(c,d,r);if(u){if(t&&ethis._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(t,i,new Y(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new B(t.outsideRenderedLine,t.ranges[0].left):null}updateLineWidths(){this._updateLineWidths(!1)}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let s=t;s<=i;s++){const t=this._visibleLines.getVisibleLine(s);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth()):o=!1}return o&&1===t&&i===this._context.model.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const i=this._visibleLines.getVisibleLine(o);if(i.needsMonospaceFontCheck()){const n=i.getWidth();n>t&&(t=n,e=o)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=i;e<=n;e++)this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.model.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()||this._asyncUpdateLineWidths.schedule(),v.d&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)if(this._visibleLines.getVisibleLine(i).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let e=n[0].startLineNumber,t=n[0].endLineNumber;for(let i=1,o=n.length;ir){if(!l)return-1;d=h}else if(5===o||6===o)if(6===o&&s<=h&&c<=a)d=s;else{const e=h-Math.max(5*this._lineHeight,.2*r),t=c-r;d=Math.max(t,e)}else if(1===o||2===o)if(2===o&&s<=h&&c<=a)d=s;else{const e=(h+c)/2;d=Math.max(0,e-r/2)}else d=this._computeMinimumScrolling(s,a,h,c,3===o,4===o);return d}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=t.left,n=i+t.width;let o=1073741824,s=0;if("range"===e.type){const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)o=Math.min(o,e.left),s=Math.max(s,e.left+e.width)}else for(const t of e.selections){if(t.startLineNumber!==t.endLineNumber)return null;const e=this._visibleRangesForLineRange(t.startLineNumber,t.startColumn,t.endColumn);if(!e)return null;for(const t of e.ranges)o=Math.min(o,t.left),s=Math.max(s,t.left+t.width)}return o=Math.max(0,o-wt.HORIZONTAL_EXTRA_PX),s+=this._revealHorizontalRightPadding,"selections"===e.type&&s-o>t.width?null:{scrollLeft:this._computeMinimumScrolling(i,n,o,s),maxHorizontalOffset:s}}_computeMinimumScrolling(e,t,i,n,o,s){o=!!o,s=!!s;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)t?Math.max(0,n-r):e:i}}wt.HORIZONTAL_EXTRA_PX=30;class yt extends pt{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(127);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options.get(127);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let e=0,o=t.length;e
',s=[];for(let e=t;e<=i;e++){const i=e-t,r=n[i];let a="";for(let e=0,t=r.length;e';o[i]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class xt{constructor(e,t,i,n){this.r=xt._clamp(e),this.g=xt._clamp(t),this.b=xt._clamp(i),this.a=xt._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:0|e}}xt.Empty=new xt(0,0,0,0);var Lt=i(11);class kt{constructor(){this._onDidChange=new d.a,this.onDidChange=this._onDidChange.event,this._updateColorMap(),Lt.B.onDidChange((e=>{e.changedColorMap&&this._updateColorMap()}))}static getInstance(){return this._INSTANCE||(this._INSTANCE=new kt),this._INSTANCE}_updateColorMap(){const e=Lt.B.getColorMap();if(!e)return this._colors=[xt.Empty],void(this._backgroundIsLight=!0);this._colors=[xt.Empty];for(let t=1;t=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}kt._INSTANCE=null;var Dt=i(44),Nt=i(4);const Et=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})();var Ot=i(107);class It{constructor(e,t){this.scale=t,this.charDataNormal=It.soften(e,.8),this.charDataLight=It.soften(e,50/60)}static soften(e,t){let i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;ne.width||i+d>e.height)return void console.warn("bad render request outside image data");const u=a?this.charDataLight:this.charDataNormal,g=((e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e)(n,r),m=4*e.width,p=s.r,f=s.g,_=s.b,b=o.r-p,v=o.g-f,C=o.b-_,w=e.data;let y=g*h*c,S=i*m+4*t;for(let e=0;ee.width||i+h>e.height)return void console.warn("bad render request outside image data");const c=4*e.width,d=o.r,u=o.g,g=o.b,m=d+.5*(n.r-d),p=u+.5*(n.g-u),f=g+.5*(n.b-g),_=e.data;let b=i*c+4*t;for(let e=0;e{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i>1]=Mt[e[i]]<<4|15&Mt[e[i+1]];return t},Rt={1:Object(Tt.a)((()=>At("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792"))),2:Object(Tt.a)((()=>At("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126")))};class Pt{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=Rt[e]?new It(Rt[e](),e):Pt.createFromSampleData(Pt.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const e of Et)i.fillText(String.fromCharCode(e),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");let i=Pt._downsample(e,t);return new It(i,t)}static _downsampleChar(e,t,i,n,o){const s=1*o,r=2*o;let a=n,l=0;for(let n=0;n0){const e=255/a;for(let t=0;tPt.create(this.fontScale,a.fontFamily))),this.backgroundColor=Wt._getMinimapBackground(t,i)}static _getMinimapBackground(e,t){const i=e.getColor(Nt.Ib);return i?new xt(i.rgba.r,i.rgba.g,i.rgba.b,i.rgba.a):t.getColor(2)}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.showSlider===e.showSlider&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)}}class Bt{constructor(e,t,i,n,o,s,r,a){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=s,this.startLineNumber=r,this.endLineNumber=a}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}static create(e,t,i,n,o,s,r,a,l,h,c){const d=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){const t=a*e.lineHeight+(e.scrollBeyondLastLine?o-e.lineHeight:0),i=Math.max(1,Math.floor(o*o/t)),n=Math.max(0,e.minimapHeight-i),s=n/(h-o),c=l*s,d=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new Bt(l,h,d,s,c,i,1,Math.min(r,u))}let p,f;if(s&&i!==r){const e=i-t+1;p=Math.floor(e*u/d)}else{const e=o/m;p=Math.floor(e*u/d)}f=e.scrollBeyondLastLine?(r-1)*u/d:Math.max(0,r*u/d-p),f=Math.min(e.minimapHeight-p,f);const _=f/(h-o),b=l*_;let v=0;if(e.scrollBeyondLastLine&&(v=o/m-1),g>=r+v)return new Bt(l,h,f>0,_,b,p,1,r);{let e=Math.max(1,Math.floor(t-b*d/u));c&&c.scrollHeight===h&&(c.scrollTop>l&&(e=Math.min(e,c.startLineNumber)),c.scrollTopjt.INVALID)),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let e=0,i=t.length;e1){for(let t=0,i=r-1;t0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,i]=zt.compute(this.options,this._context.model.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const e of i)switch(e.type){case"deleted":this._actual.onLinesDeleted(e.deleteFromLineNumber,e.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(e.insertFromLineNumber,e.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.model.getLineCount()}getRealLineCount(){return this._context.model.getLineCount()}getLineContent(e){return this._samplingState?this._context.model.getLineContent(this._samplingState.minimapLines[e-1]):this._context.model.getLineContent(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){let n=[];for(let o=0,s=t-e+1;o{if(e.preventDefault(),0===this._model.options.renderMinimap)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(e.leftButton&&this._lastRenderData){const t=h.C(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e.buttons,e.posx,i,e.posy,this._lastRenderData.renderedLayout)}return}const t=this._model.options.minimapLineHeight,i=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.browserEvent.offsetY;let n=Math.floor(i/t)+this._lastRenderData.renderedLayout.startLineNumber;n=Math.min(n,this._model.getLineCount()),this._model.revealLineNumber(n)})),this._sliderMouseMoveMonitor=new S.a,this._sliderMouseDownListener=h.o(this._slider.domNode,"mousedown",(e=>{e.preventDefault(),e.stopPropagation(),e.leftButton&&this._lastRenderData&&this._startSliderDragging(e.buttons,e.posx,e.posy,e.posy,this._lastRenderData.renderedLayout)})),this._gestureDisposable=C.b.addTarget(this._domNode.domNode),this._sliderTouchStartListener=h.i(this._domNode.domNode,C.a.Start,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))}),{passive:!1}),this._sliderTouchMoveListener=h.i(this._domNode.domNode,C.a.Change,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)}),{passive:!1}),this._sliderTouchEndListener=h.o(this._domNode.domNode,C.a.End,(e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)}))}_startSliderDragging(e,t,i,n,o){this._slider.toggleClassName("active",!0);const s=(e,n)=>{const s=Math.abs(n-t);if(v.j&&s>140)return void this._model.setScrollTop(o.scrollTop);const r=e-i;this._model.setScrollTop(o.getDesiredScrollTopFromDelta(r))};n!==i&&s(n,t),this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode,e,S.b,(e=>s(e.posy,e.posx)),(()=>{this._slider.toggleClassName("active",!1)}))}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._mouseDownListener.dispose(),this._sliderMouseMoveMonitor.dispose(),this._sliderMouseDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){return"always"===this._model.options.showSlider?"minimap slider-always":"minimap slider-mouseover"}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new Ht(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData&&this._lastRenderData.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Nt.Kb),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=Bt.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight);const i=e.scrollLeft/this._model.options.typicalHalfwidthCharacterWidth,n=Math.min(this._model.options.minimapWidth,Math.round(i*this._model.options.minimapCharWidth/this._model.options.pixelRatio));this._sliderHorizontal.setLeft(n),this._sliderHorizontal.setWidth(this._model.options.minimapWidth-n),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections(),i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber),{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,o);const h=new Map;for(let i=0;ithis._model.options.canvasInnerHeight)return;let d=t.get(s);const u=!d;if(!d){const e=this._model.getLineContent(s);d=[$.h];for(let t=1;ts?d.length-1:m-1;if(b>0){const t=d[b]-_||2;this.renderDecoration(e,n,_,c,t,r)}u&&this.renderLineHighlight(e,n,c,r)}renderLineHighlight(e,t,i,n){e.fillStyle=t&&t.transparent(.5).toString()||"",e.fillRect($.h,i,e.canvas.width,n)}renderDecoration(e,t,i,n,o,s){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,o,s)}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const t=this._lastRenderData._get();return new Vt(e,t.imageData,t.lines)}const o=this._getBuffer();if(!o)return null;let[s,r,a]=Kt._renderUntouchedLines(o,t,i,n,this._lastRenderData);const l=this._model.getMinimapLinesRenderingData(t,i,a),h=this._model.getOptions().tabSize,c=this._model.options.backgroundColor,d=this._model.tokensColorTracker,u=d.backgroundIsLight(),g=this._model.options.renderMinimap,m=this._model.options.charRenderer(),p=this._model.options.fontScale,f=this._model.options.minimapCharWidth,_=(1===g?2:3)*p,b=n>_?Math.floor((n-_)/2):0;let v=0;const C=[];for(let e=0,s=i-t+1;e=0&&op)return;const s=g.charCodeAt(b);if(9===s){const e=h-(b+v)%h;v+=e-1,_+=e*o}else if(32===s)_+=o;else{const h=Se.C(s)?2:1;for(let c=0;cp)return}}}}}Object(Re.f)(((e,t)=>{const i=e.getColor(Nt.Ib);i&&t.addRule(`.monaco-editor .minimap > canvas { opacity: ${i.rgba.a}; will-change: opacity; }`);const n=e.getColor(Nt.Mb);n&&t.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${n}; }`);const o=e.getColor(Nt.Nb);o&&t.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${o}; }`);const s=e.getColor(Nt.Lb);s&&t.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${s}; }`);const r=e.getColor(Nt.cc);r&&t.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${r} -6px 0 6px -6px inset; }`)}));class $t extends M{constructor(e){super(e);const t=this._context.configuration.options.get(127);this._widgets={},this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,this._domNode=Object(b.b)(document.createElement("div")),A.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(127);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){const t=Object(b.b)(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference!==t&&(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.parentNode.removeChild(e),this.setShouldRender()}}_renderWidget(e){const t=e.domNode;if(null!==e.preference)if(0===e.preference)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(1===e.preference){const e=t.domNode.clientHeight;t.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else 2===e.preference&&(t.setTop(0),t.domNode.style.right="50%");else t.unsetTop()}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let e=0,i=t.length;e=3){const t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,s=e+t;return[[0,e,s,e,e+t+o,e,s,e],[0,t,o,t+o,i,t+o+i,o+i,t+o+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]]}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&this.backgroundColor===e.backgroundColor&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class Yt extends M{constructor(e){super(e),this._domNode=Object(b.b)(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=Lt.B.onDidChange((e=>{e.changedColorMap&&this._updateSettings(!0)})),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Gt(this._context.configuration,this._context.theme);return!(this._settings&&this._settings.equals(t)||(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),0))}onConfigurationChanged(e){return this._updateSettings(!1)}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;tt&&(e=t-a),_=e-a,b=e+a}_>f+1||s!==m?(0!==e&&l.fillRect(h[m],p,c[m],f-p),m=s,p=_,f=b):b>f&&(f=b)}l.fillRect(h[m],p,c[m],f-p)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,i=e/2|0,s=this._settings.x[7],r=this._settings.w[7];l.fillStyle=this._settings.cursorColor;let a=-100,h=-100;for(let c=0,d=this._cursorPositions.length;ct&&(u=t-i);const g=u-i,m=g+e;g>h+1?(0!==c&&l.fillRect(s,a,r,h-a),a=g,h=m):m>h&&(h=m)}l.fillRect(s,a,r,h-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(l.beginPath(),l.lineWidth=1,l.strokeStyle=this._settings.borderColor,l.moveTo(0,0),l.lineTo(0,t),l.stroke(),l.moveTo(0,0),l.lineTo(e,0),l.stroke())}}var Zt=i(153);class Qt extends T{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=Object(b.b)(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Zt.b((e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e))),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(55)),this._zoneManager.setPixelRatio(i.get(125)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(55)&&(this._zoneManager.setLineHeight(t.get(55)),this._render()),e.hasChanged(125)&&(this._zoneManager.setPixelRatio(t.get(125)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,s=0,r=0;for(const a of t){const t=a.colorId,l=a.from,h=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=h):r>=l?r=Math.max(r,h):(e.fillRect(0,s,n,r-s),s=l,r=h)}e.fillRect(0,s,n,r-s)}}class Xt extends M{constructor(e){super(e),this.domNode=Object(b.b)(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(88),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(88),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const e=Object(b.b)(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let i=e-t;for(;i>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t{const i=e.getColor(Ae.m);i&&t.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${i} inset; }`)}));class Jt extends M{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options.get(89);this._useShadows=t.useShadows,this._domNode=Object(b.b)(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(127);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(89);return this._useShadows=t.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}Object(Re.f)(((e,t)=>{const i=e.getColor(Nt.cc);i&&t.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${i} 0 6px 6px -6px inset; }`)}));class ei{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class ti{constructor(e,t){this.lineNumber=e,this.ranges=t}}function ii(e){return new ei(e)}function ni(e){return new ti(e.lineNumber,e.ranges.map(ii))}class oi extends Me{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(55),this._roundedSelection=t.get(87),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(55),this._roundedSelection=t.get(87),this._typicalHalfwidthCharacterWidth=t.get(40).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!o&&e=0;e--)i[e].lineNumber===r&&(s=i[e].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let e=0,i=t.length;e0){const i=t[e-1].ranges[0].left,o=t[e-1].ranges[0].left+t[e-1].ranges[0].width;si(a-i)i&&(h.top=1),si(l-o)'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;const o=!!n[0].ranges[0].startStyle,s=this._lineHeight.toString(),r=(this._lineHeight-1).toString(),a=n[0].lineNumber,l=n[n.length-1].lineNumber;for(let h=0,c=n.length;h1,r)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map((([e,t])=>e+t))}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function si(e){return e<0?-e:e}oi.SELECTION_CLASS_NAME="selected-text",oi.SELECTION_TOP_LEFT="top-left-radius",oi.SELECTION_BOTTOM_LEFT="bottom-left-radius",oi.SELECTION_TOP_RIGHT="top-right-radius",oi.SELECTION_BOTTOM_RIGHT="bottom-right-radius",oi.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",oi.ROUNDED_PIECE_WIDTH=10,Object(Re.f)(((e,t)=>{const i=e.getColor(Nt.K);i&&t.addRule(`.monaco-editor .focused .selected-text { background-color: ${i}; }`);const n=e.getColor(Nt.E);n&&t.addRule(`.monaco-editor .selected-text { background-color: ${n}; }`);const o=e.getColor(Nt.L);o&&!o.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${o}; }`)}));class ri{constructor(e,t,i,n,o,s){this.top=e,this.left=t,this.width=i,this.height=n,this.textContent=o,this.textContentClassName=s}}class ai{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(40);this._cursorStyle=t.get(22),this._lineHeight=t.get(55),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(25),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Object(b.b)(document.createElement("div")),this._domNode.setClassName(`cursor ${Be.a}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),m.a.applyFontInfo(this._domNode,i),this._domNode.setDisplay("none"),this._position=new ie.a(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(40);return this._cursorStyle=t.get(22),this._lineHeight=t.get(55),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(25),this._typicalHalfwidthCharacterWidth),m.a.applyFontInfo(this._domNode,i),!0}onCursorPositionChanged(e){return this._position=e,!0}_prepareRender(e){let t="";if(this._cursorStyle===$.i.Line||this._cursorStyle===$.i.LineThin){const i=e.visibleRangeForPosition(this._position);if(!i||i.outsideRenderedLine)return null;let n;if(this._cursorStyle===$.i.Line){if(n=h.u(this._lineCursorWidth>0?this._lineCursorWidth:2),n>2){const e=this._context.model.getLineContent(this._position.lineNumber),i=Se.J(e,this._position.column-1);t=e.substr(this._position.column-1,i)}}else n=h.u(1);let o=i.left;n>=2&&o>=1&&(o-=1);const s=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new ri(s,o,n,this._lineHeight,t,"")}const i=this._context.model.getLineContent(this._position.lineNumber),n=Se.J(i,this._position.column-1),o=e.linesVisibleRangesForRange(new ne.a(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column+n),!1);if(!o||0===o.length)return null;const s=o[0];if(s.outsideRenderedLine||0===s.ranges.length)return null;const r=s.ranges[0],a=r.width<1?this._typicalHalfwidthCharacterWidth:r.width;let l="";if(this._cursorStyle===$.i.Block){const e=this._context.model.getViewLineData(this._position.lineNumber);t=i.substr(this._position.column-1,n);const o=e.tokens.findTokenIndexAtOffset(this._position.column-1);l=e.tokens.getClassName(o)}let c=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return this._cursorStyle!==$.i.Underline&&this._cursorStyle!==$.i.UnderlineThin||(c+=this._lineHeight-2,d=2),new ri(c,r.left,a,d,t,l)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${Be.a} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class li extends M{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(77),this._cursorBlinking=t.get(20),this._cursorStyle=t.get(22),this._cursorSmoothCaretAnimation=t.get(21),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new ai(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Object(b.b)(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new y.g,this._cursorFlatBlinkInterval=new y.c,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(77),this._cursorBlinking=t.get(20),this._cursorStyle=t.get(22),this._cursorSmoothCaretAnimation=t.get(21),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,i=this._secondaryCursors.length;tt.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t{for(let i=0,n=e.ranges.length;i{this._isVisible?this._hide():this._show()}),li.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet((()=>{this._blinkingEnabled=!0,this._updateDomClassName()}),li.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case $.i.Line:e+=" cursor-line-style";break;case $.i.Block:e+=" cursor-block-style";break;case $.i.Underline:e+=" cursor-underline-style";break;case $.i.LineThin:e+=" cursor-line-thin-style";break;case $.i.BlockOutline:e+=" cursor-block-outline-style";break;case $.i.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return this._cursorSmoothCaretAnimation&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const i=e.getColor(Ae.f);if(i){let n=e.getColor(Ae.e);n||(n=i.opposite()),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${i}; border-color: ${i}; color: ${n}; }`),"hc"===e.type&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}}));const hi=()=>{throw new Error("Invalid change accessor")};class ci extends M{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(127);this._lineHeight=t.get(55),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=Object(b.b)(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=Object(b.b)(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const i of e)t.set(i.id,i);let i=!1;return this._context.model.changeWhitespace((e=>{const n=Object.keys(this._zones);for(let o=0,s=n.length;o{const n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{return e(t)}catch(e){Object(c.e)(e)}}(e,n),n.addZone=hi,n.removeZone=hi,n.layoutZone=hi})),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isVisible:!1,domNode:Object(b.b)(t.domNode),marginDomNode:t.marginDomNode?Object(b.b)(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(e){Object(c.e)(e)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(e){Object(c.e)(e)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(let e=0,o=t.length;e{this._context.theme.update(e),this._context.model.onDidColorThemeChange(),this.render(!0,!1)}))),this._viewParts=[],this._textAreaHandler=new He(this._context,r,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Object(b.b)(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Object(b.b)(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Object(b.b)(document.createElement("div")),A.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new gt(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new wt(this._context,this._linesContent),this._viewZones=new ci(this._context),this._viewParts.push(this._viewZones);const a=new Yt(this._context);this._viewParts.push(a);const l=new Jt(this._context);this._viewParts.push(l);const h=new et(this._context);this._viewParts.push(h),h.addDynamicOverlay(new ht(this._context)),h.addDynamicOverlay(new oi(this._context)),h.addDynamicOverlay(new _t(this._context)),h.addDynamicOverlay(new dt(this._context));const c=new tt(this._context);this._viewParts.push(c),c.addDynamicOverlay(new ct(this._context)),c.addDynamicOverlay(new ft(this._context)),c.addDynamicOverlay(new St(this._context)),c.addDynamicOverlay(new yt(this._context)),c.addDynamicOverlay(new Pe(this._context));const d=new Fe(this._context);d.getDomNode().appendChild(this._viewZones.marginDomNode),d.getDomNode().appendChild(c.getDomNode()),this._viewParts.push(d),this._contentWidgets=new nt(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new li(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new $t(this._context),this._viewParts.push(this._overlayWidgets);const u=new Xt(this._context);this._viewParts.push(u);const g=new Ut(this._context);if(this._viewParts.push(g),a){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(a.getDomNode(),e.insertBefore)}this._linesContent.appendChild(h.getDomNode()),this._linesContent.appendChild(u.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(l.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new Te(this._context,r,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._renderNow()}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new re(e,t)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new ie.a(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPositionRelativeToEditor:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new ie.a(e,t)))}}_applyLayout(){const e=this._context.configuration.options.get(127);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(124)+" "+Object(Re.e)(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this._configPixelRatio=this._context.configuration.options.get(125),this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){null===this._renderAnimationFrame&&(this._renderAnimationFrame=h.R(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){!function(e){try{return e()}catch(e){Object(c.e)(e)}}((()=>this._actualRender()))}_getViewPartsToRender(){let e=[],t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!h.M(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return;const t=this._context.viewLayout.getLinesViewportData();this._context.model.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new gi(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.model);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const n=new P(this._context.viewLayout,i,this._viewLines);for(const t of e)t.prepareRender(n);for(const t of e)t.render(n),t.onDidRender();Math.abs(f.a()-this._configPixelRatio)>.001&&this._context.configuration.updatePixelRatio()}delegateVerticalScrollbarMouseDown(e){this._scrollbar.delegateVerticalScrollbarMouseDown(e)}restoreState(e){this._context.model.setScrollPosition({scrollTop:e.scrollTop},1),this._context.model.tokenizeViewport(),this._renderNow(),this._viewLines.updateLineWidths(),this._context.model.setScrollPosition({scrollLeft:e.scrollLeft},1)}getOffsetForColumn(e,t){const i=this._context.model.validateModelPosition({lineNumber:e,column:t}),n=this._context.model.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new ie.a(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?Ke.convertViewToModelMouseTarget(i,this._context.model.coordinatesConverter):null}createOverviewRuler(e){return new Qt(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){let t=e.position&&e.position.range||null;if(null===t){const i=e.position?e.position.position:null;null!==i&&(t=new ne.a(i.lineNumber,i.column,i.lineNumber,i.column))}const i=e.position?e.position.preference:null;this._contentWidgets.setWidgetPosition(e.widget,t,i),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}class pi{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new oe.f(new ne.a(1,1,1,1),0,new ie.a(1,1),0),new oe.f(new ne.a(1,1,1,1),0,new ie.a(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new oe.d(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return 0===this.modelState.selection.getDirection()?new _.a(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new _.a(t.endLineNumber,t.endColumn,t.startLineNumber,t.startColumn)}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}_setState(e,t,i){if(t){const i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,o=e.model.validatePosition(t.position),s=t.position.equals(o)?t.leftoverVisibleColumns:0;t=new oe.f(i,n,o,s)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new oe.f(n,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new oe.f(n,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new ie.a(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new ie.a(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new ne.a(n.lineNumber,n.column,o.lineNumber,o.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new oe.f(s,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class fi{constructor(e){this.context=e,this.primaryCursor=new pi(e),this.secondaryCursors=[],this.lastAddedCursorIndex=0}dispose(){this.primaryCursor.dispose(this.context),this.killSecondaryCursors()}startTrackingSelections(){this.primaryCursor.startTrackingSelection(this.context);for(let e=0,t=this.secondaryCursors.length;ei){let e=t-i;for(let t=0;t=e+1&&this.lastAddedCursorIndex--,this.secondaryCursors[e].dispose(this.context),this.secondaryCursors.splice(e,1)}_getAll(){let e=[];e[0]=this.primaryCursor;for(let t=0,i=this.secondaryCursors.length;te.selection.startLineNumber===t.selection.startLineNumber?e.selection.startColumn-t.selection.startColumn:e.selection.startLineNumber-t.selection.startLineNumber));for(let i=0;ia&&e.index--;e.splice(a,1),t.splice(r,1),this._removeSecondaryCursor(a-1),i--}}}}var _i=i(152),bi=i(102);class vi{constructor(){this.type=0}}class Ci{constructor(){this.type=1}}class wi{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class yi{constructor(e,t){this.type=3,this.selections=e,this.modelSelections=t}}class Si{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}}class xi{constructor(){this.type=5}}class Li{constructor(e){this.type=6,this.isFocused=e}}class ki{constructor(){this.type=7}}class Di{constructor(){this.type=8}}class Ni{constructor(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t}}class Ei{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class Oi{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class Ii{constructor(e,t,i,n,o,s){this.type=12,this.source=e,this.range=t,this.selections=i,this.verticalType=n,this.revealHorizontal=o,this.scrollType=s}}class Ti{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class Mi{constructor(){this.type=14}}class Ai{constructor(e){this.type=15,this.ranges=e}}class Ri{constructor(){this.type=16}}class Pi{constructor(){this.type=17}}class Fi extends u.a{constructor(){super(),this._onEvent=this._register(new d.a),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOugoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOugoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class Wi{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class Bi{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}merge(e){return 0!==e.kind?this:new Bi(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class ji{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}merge(e){return 1!==e.kind?this:new ji(this.oldHasFocus,e.hasFocus)}}class Vi{constructor(e,t,i,n,o,s,r,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=r,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!(this.scrollWidthChanged||this.scrollLeftChanged||this.scrollHeightChanged||this.scrollTopChanged)}merge(e){return 2!==e.kind?this:new Vi(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Hi{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}}class zi{constructor(e,t,i,n,o,s,r){this.kind=5,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=s,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class qi extends u.a{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new oe.c(this._model,this._coordinatesConverter,n),this._cursors=new fi(this.context),this._hasFocus=!1,this._isHandling=!1,this._isDoingComposition=!1,this._selectionsWhenCompositionStarted=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=Object(u.f)(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new oe.c(this._model,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){let e=this._cursors.getSelections();for(let t=0;tqi.MAX_CURSOR_COUNT&&(n=n.slice(0,qi.MAX_CURSOR_COUNT),o=!0);const s=new Ki(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,s,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n){const o=this._cursors.getViewPositions();if(o.length>1)this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),0,i,n);else{const s=o[0],r=new ne.a(s.lineNumber,s.column,s.lineNumber,s.column);this._emitCursorRevealRange(e,t,r,null,0,i,n)}}_revealPrimaryCursor(e,t,i,n,o){const s=this._cursors.getViewPositions();if(s.length>1)this._emitCursorRevealRange(e,t,null,this._cursors.getViewSelections(),i,n,o);else{const r=s[0],a=new ne.a(r.lineNumber,r.column,r.lineNumber,r.column);this._emitCursorRevealRange(e,t,a,null,i,n,o)}}_emitCursorRevealRange(e,t,i,n,o,s,r){e.emitViewEvent(new Ii(t,i,n,o,s,r))}saveState(){let e=[];const t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const i=oe.d.fromModelSelections(t.resultingSelection);this.setStates(e,"modelChange",t.isUndoing?5:t.isRedoing?6:2,i)&&this._revealPrimaryCursor(e,"modelChange",0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,oe.d.fromModelSelections(t))}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:oe.a.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:oe.a.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,oe.d.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],n=[];for(let o=0,s=e.length;o0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const s=new Ki(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new yi(a,r)),!n||n.cursorState.length!==s.cursorState.length||s.cursorState.some(((e,t)=>!e.modelState.equals(n.cursorState[t].modelState)))){const a=n?n.cursorState.map((e=>e.modelState.selection)):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new zi(a,r,l,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;let t=[];for(let i=0,n=e.length;i=0)return null;const o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const s=o[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(s);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-o[2].length-1,h=n.text.lastIndexOf(a,l-1);if(-1===h)return null;t.push([h,l])}return t}executeEdits(e,t,i,n){let o=null;"snippet"===t&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);let s=[],r=[];const a=this._model.pushEditOperations(this.getSelections(),i,(e=>{if(o)for(let t=0,i=o.length;t0&&this._pushAutoClosedAction(s,r)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=new Ki(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(e){Object(c.e)(e)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this._revealPrimaryCursor(t,i,0,!0,0)}setIsDoingComposition(e){this._isDoingComposition=e}getAutoClosedCharacters(){return $i.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit((()=>{"keyboard"===t&&(this._executeEditOperation(bi.a.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),this.getAutoClosedCharacters())),this._selectionsWhenCompositionStarted=null)}),e,t)}type(e,t,i){this._executeEdit((()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i{this._executeEditOperation(bi.a.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))}),e,s);else if(0!==o){const t=this.getSelections().map((e=>{const t=e.getPosition();return new _.a(t.lineNumber,t.column+o,t.lineNumber,t.column+o)}));this.setSelections(e,s,t,0)}}paste(e,t,i,n,o){this._executeEdit((()=>{this._executeEditOperation(bi.a.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))}),e,o,4)}cut(e,t){this._executeEdit((()=>{this._executeEditOperation(_i.a.cut(this.context.cursorConfig,this._model,this.getSelections()))}),e,t)}executeCommand(e,t,i){this._executeEdit((()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new oe.e(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}executeCommands(e,t,i){this._executeEdit((()=>{this._executeEditOperation(new oe.e(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}}qi.MAX_CURSOR_COUNT=1e4;class Gi{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let e=0,t=n.trackedRanges.length;e0&&(s[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,s,(i=>{let n=[];for(let t=0;te.identifier.minor-t.identifier.minor;let s=[];for(let i=0;i0?(n[i].sort(o),s[i]=t[i].computeCursorState(e.model,{getInverseEditOperations:()=>n[i],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new _.a(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new _.a(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[i]=e.selectionsBefore[i];return s}));r||(r=e.selectionsBefore);let a=[];for(let e in o)o.hasOwnProperty(e)&&a.push(parseInt(e,10));a.sort(((e,t)=>t-e));for(const e of a)r.splice(e,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{ne.a.isEmpty(e)&&""===s||n.push({identifier:{major:t,minor:o++},range:e,text:s,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let r=!1;const a={addEditOperation:s,addTrackedEditOperation:(e,t,i)=>{r=!0,s(e,t,i)},trackSelection:(t,i)=>{const n=_.a.liftSelection(t);let o;if(n.isEmpty())if("boolean"==typeof i)o=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);o=n.startColumn===t?2:3}else o=1;const s=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,o);return e.trackedRanges[s]=r,e.trackedRangesDirection[s]=n.getDirection(),s.toString()}};try{i.getEditOperations(e.model,a)}catch(e){return Object(c.e)(e),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:r}}static _getLoserCursorMap(e){(e=e.slice(0)).sort(((e,t)=>-ne.a.compareRangesUsingEnds(e.range,t.range)));let t={};for(let i=1;io.identifier.major?n.identifier.major:o.identifier.major,t[s.toString()]=!0;for(let t=0;t0&&i--}}return t}}var Yi=i(182),Zi=i(118),Qi=i(9),Xi=i(171),Ji=i(139);class en{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class tn{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}}class nn{constructor(e,t,i,n){this._instanceId=Se.O(++nn.INSTANCE_COUNT),this._pendingChanges=new en,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=n}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n>>1;t===e[s].afterLineNumber?i{t=!0,e|=0,i|=0,n|=0,o|=0;const s=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new tn(s,e,i,n,o)),s},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of i){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const n=new Set;for(const e of i)n.add(e.id);const o=new Map;for(const e of t)o.set(e.id,e);const s=e=>{let t=[];for(const i of e)if(!n.has(i.id)){if(o.has(i.id)){const e=o.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=s(this._arr).concat(s(e));r.sort(((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber)),this._arr=r,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=nn.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i=t.length||t[o+1].afterLineNumber>=e)return o;i=o+1|0}else n=o-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t1?this._lineHeight*(e-1):0,t+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e)+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;tthis.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e=this.getLinesTotalHeight()-this._paddingBottom)}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),(e|=0)<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,o=t;for(;n=s+i)n=t+1;else{if(e>=s)return t;o=t}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this._lineHeight,n=0|this.getLineNumberAtOrAfterVerticalOffset(e),o=0|this.getVerticalOffsetForLineNumber(n);let s=0|this._lineCount,r=0|this.getFirstWhitespaceIndexAfterLineNumber(n);const a=0|this.getWhitespacesCount();let l,h;-1===r?(r=a,h=s+1,l=0):(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let c=o,d=c;const u=5e5;let g=0;o>=u&&(g=Math.floor(o/u)*u,g=Math.floor(g/i)*i,d-=g);const m=[],p=e+(t-e)/2;let f=-1;for(let e=n;e<=s;e++){for(-1===f&&(c<=p&&pp)&&(f=e),c+=i,m[e-n]=d,d+=i;h===e;)d+=l,c+=l,r++,r>=a?h=s+1:(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(c>=t){s=e;break}}-1===f&&(f=s);const _=0|this.getVerticalOffsetForLineNumber(s);let b=n,v=s;return bt&&v--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:s,relativeVerticalOffset:m,centeredLineNumber:f,completelyVisibleStartLineNumber:b,completelyVisibleEndLineNumber:v}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i,n;return i=t>=1?this._lineHeight*t:0,n=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this.getHeightForWhitespaceIndex(i))return-1;for(;t=o+this.getHeightForWhitespaceIndex(n))t=n+1;else{if(e>=o)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];let o=[];for(let e=i;e<=n;e++){const i=this.getVerticalOffsetForWhitespaceIndex(e),n=this.getHeightForWhitespaceIndex(e);if(i>=t)break;o.push({id:this.getIdForWhitespaceIndex(e),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(e),verticalOffset:i,height:n})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].height}}nn.INSTANCE_COUNT=0;class on{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class sn extends u.a{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new d.a),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new on(0,0,0,0),this._scrollable=this._register(new Ji.a(e,t)),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new Bi(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}}class rn extends u.a{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(127),s=n.get(71);this._linesLayout=new nn(t,n.get(55),s.top,s.bottom),this._scrollable=this._register(new sn(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new on(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(100)?125:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(55)&&this._linesLayout.setLineHeight(t.get(55)),e.hasChanged(71)){const e=t.get(71);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(127)){const e=t.get(127),i=e.contentWidth,n=e.height,o=this._scrollable.getScrollDimensions(),s=o.contentWidth;this._scrollable.setScrollDimensions(new on(i,o.contentWidth,n,this._getContentHeight(i,n,s)))}else this._updateHeight();e.hasChanged(100)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const i=this._configuration.options.get(89);return 2===i.horizontal||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(91)?o+=Math.max(0,t-n.get(55)-n.get(71).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new on(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Dt.g(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Dt.g(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(128),n=t.get(40);if(i.isViewportWrapping){const i=t.get(127),o=t.get(61);return e>i.contentWidth+n.typicalHalfwidthCharacterWidth&&o.enabled&&"right"===o.side?e+i.verticalScrollbarWidth:e}{const i=t.get(90)*n.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+i,o)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new on(t.width,this._computeContentWidth(e),t.height,t.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition();let t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e){return this._linesLayout.getVerticalOffsetForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}var an=i(39),ln=i(179);class hn{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column)}convertModelRangeToViewRange(e){return this._lines.convertModelRangeToViewRange(e)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}}class cn{constructor(e){this._counts=e,this._isValid=!1,this._validEndIndex=-1,this._modelToView=[],this._viewToModel=[]}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._counts.length;e0?this._modelToView[e-1]:0;this._modelToView[e]=i+t;for(let n=0;n0?this._modelToView[t-1]:0;return new ln.b(t,e-i)}}class dn{constructor(e,t,i,n,o,s,r,a){this.model=e,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=t,this._monospaceLineBreaksComputerFactory=i,this.fontInfo=n,this.tabSize=o,this.wrappingStrategy=s,this.wrappingColumn=r,this.wrappingIndent=a,this._constructLines(!0,null)}dispose(){this.hiddenAreasIds=this.model.deltaDecorations(this.hiddenAreasIds,[])}createCoordinatesConverter(){return new hn(this)}_constructLines(e,t){this.lines=[],e&&(this.hiddenAreasIds=[]);let i=this.model.getLinesContent();const n=i.length,o=this.createLineBreaksComputer();for(let e=0;ethis.model.getDecorationRange(e))).sort(ne.a.compareRangesUsingStarts),l=1,h=0,c=-1,d=c+1=l&&t<=h,o=bn(s[e],!i);r[e]=o.getViewLineCount(),this.lines[e]=o}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new cn(r)}getHiddenAreas(){return this.hiddenAreasIds.map((e=>this.model.getDecorationRange(e)))}_reduceRanges(e){if(0===e.length)return[];let t=e.map((e=>this.model.validateRange(e))).sort(ne.a.compareRangesUsingStarts),i=[],n=t[0].startLineNumber,o=t[0].endLineNumber;for(let e=1,s=t.length;eo+1?(i.push(new ne.a(n,1,o,1)),n=s.startLineNumber,o=s.endLineNumber):s.endLineNumber>o&&(o=s.endLineNumber)}return i.push(new ne.a(n,1,o,1)),i}setHiddenAreas(e){let t=this._reduceRanges(e),i=this.hiddenAreasIds.map((e=>this.model.getDecorationRange(e))).sort(ne.a.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n=s&&t<=r?this.lines[e].isVisible()&&(this.lines[e]=this.lines[e].setVisible(!1),i=!0):(h=!0,this.lines[e].isVisible()||(this.lines[e]=this.lines[e].setVisible(!0),i=!0)),i){let t=this.lines[e].getViewLineCount();this.prefixSumComputer.changeValue(e,t)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.lines.length)&&this.lines[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.lines.length?1:this.lines[e-1].getViewLineCount()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n){const o=this.fontInfo.equals(e),s=this.wrappingStrategy===t,r=this.wrappingColumn===i,a=this.wrappingIndent===n;if(o&&s&&r&&a)return!1;const l=o&&s&&!r&&a;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n;let h=null;if(l){h=[];for(let e=0,t=this.lines.length;e2&&!this.lines[t-2].isVisible();let s=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,r=0,a=[],l=[];for(let e=0,t=n.length;er?(l=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,h=l+r-1,u=h+1,g=u+(o-r)-1,a=!0):ot?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.getActiveIndentGuide(n.lineNumber,o.lineNumber,s.lineNumber),a=this.convertModelPositionToViewPosition(r.startLineNumber,1),l=this.convertModelPositionToViewPosition(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:r.indent}}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[],s=[],r=[];const a=i.lineNumber-1,l=n.lineNumber-1;let h=null;for(let e=a;e<=l;e++){const t=this.lines[e];if(t.isVisible()){let n=t.getViewLineNumberOfModelPosition(0,e===a?i.column:1),o=t.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(e+1)),l=o-n+1,c=0;l>1&&1===t.getViewLineMinColumn(this.model,e+1,o)&&(c=0===n?1:2),s.push(l),r.push(c),null===h&&(h=new ie.a(e+1,0))}else null!==h&&(o=o.concat(this.model.getLinesIndentGuides(h.lineNumber,e)),h=null)}null!==h&&(o=o.concat(this.model.getLinesIndentGuides(h.lineNumber,n.lineNumber)),h=null);const c=t-e+1;let d=new Array(c),u=0;for(let e=0,t=o.length;et&&(d=!0,c=t-o+1);let u=h+c;if(l.getViewLinesData(this.model,n+1,h,u,o-e,i,a),o+=c,d)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);let n=this.prefixSumComputer.getIndexOf(e-1),o=n.index,s=n.remainder,r=this.lines[o],a=r.getViewLineMinColumn(this.model,o+1,s),l=r.getViewLineMaxColumn(this.model,o+1,s);tl&&(t=l);let h=r.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new ie.a(o+1,h)).equals(i)?new ie.a(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new ne.a(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){e=this._toValidViewLineNumber(e);let i=this.prefixSumComputer.getIndexOf(e-1),n=i.index,o=i.remainder,s=this.lines[n].getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new ie.a(n+1,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new ne.a(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t){const i=this.model.validatePosition(new ie.a(e,t)),n=i.lineNumber,o=i.column;let s=n-1,r=!1;for(;s>0&&!this.lines[s].isVisible();)s--,r=!0;if(0===s&&!this.lines[s].isVisible())return new ie.a(1,1);const a=1+(0===s?0:this.prefixSumComputer.getAccumulatedValue(s-1));let l;return l=r?this.lines[s].getViewPositionOfModelPosition(a,this.model.getLineMaxColumn(s+1)):this.lines[n-1].getViewPositionOfModelPosition(a,o),l}convertModelRangeToViewRange(e){let t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn);return e.startLineNumber===e.endLineNumber&&t.lineNumber!==i.lineNumber&&i.column===this.getViewLineMinColumn(i.lineNumber)?new ne.a(t.lineNumber,t.column,i.lineNumber-1,this.getViewLineMaxColumn(i.lineNumber-1)):new ne.a(t.lineNumber,t.column,i.lineNumber,i.column)}_getViewLineNumberForModelPosition(e,t){let i=e-1;if(this.lines[i].isVisible()){const e=1+(0===i?0:this.prefixSumComputer.getAccumulatedValue(i-1));return this.lines[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.lines[i].isVisible();)i--;if(0===i&&!this.lines[i].isVisible())return 1;const n=1+(0===i?0:this.prefixSumComputer.getAccumulatedValue(i-1));return this.lines[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getAllOverviewRulerDecorations(e,t,i){const n=this.model.getOverviewRulerDecorations(e,t),o=new wn;for(const e of n){const t=e.options.overviewRuler,n=t?t.position:0;if(0===n)continue;const s=t.getColor(i),r=this._getViewLineNumberForModelPosition(e.range.startLineNumber,e.range.startColumn),a=this._getViewLineNumberForModelPosition(e.range.endLineNumber,e.range.endColumn);o.accept(s,r,a,n)}return o.result}getDecorationsInRange(e,t,i){const n=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),o=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(o.lineNumber-n.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new ne.a(n.lineNumber,1,o.lineNumber,o.column),t,i);let s=[];const r=n.lineNumber-1,a=o.lineNumber-1;let l=null;for(let e=r;e<=a;e++)if(this.lines[e].isVisible())null===l&&(l=new ie.a(e+1,e===r?n.column:1));else if(null!==l){const n=this.model.getLineMaxColumn(e);s=s.concat(this.model.getDecorationsInRange(new ne.a(l.lineNumber,l.column,e,n),t,i)),l=null}null!==l&&(s=s.concat(this.model.getDecorationsInRange(new ne.a(l.lineNumber,l.column,o.lineNumber,o.column),t,i)),l=null),s.sort(((e,t)=>{const i=ne.a.compareRangesUsingStarts(e.range,t.range);return 0===i?e.idt.id?1:0:i}));let h=[],c=0,d=null;for(const e of s){const t=e.id;d!==t&&(d=t,h[c++]=e)}return h}}class un{constructor(){}isVisible(){return!0}setVisible(e){return e?this:gn.INSTANCE}getLineBreakData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){let n=e.getLineTokens(t),o=n.getLineContent();return new Dt.d(o,!1,1,o.length+1,0,n.inflate())}getViewLinesData(e,t,i,n,o,s,r){s[o]?r[o]=this.getViewLineData(e,t,0):r[o]=null}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new ie.a(e,t)}getViewLineNumberOfModelPosition(e,t){return e}}un.INSTANCE=new un;class gn{constructor(){}isVisible(){return!1}setVisible(e){return e?un.INSTANCE:this}getLineBreakData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,n,o,s,r){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}}gn.INSTANCE=new gn;class mn{constructor(e,t){this._lineBreakData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getLineBreakData(){return this._lineBreakData}getViewLineCount(){return this._isVisible?this._lineBreakData.breakOffsets.length:0}getInputStartOffsetOfOutputLineIndex(e){return Dt.b.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets,e,0)}getInputEndOffsetOfOutputLineIndex(e,t,i){return i+1===this._lineBreakData.breakOffsets.length?e.getLineMaxColumn(t)-1:Dt.b.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets,i+1,0)}getViewLineContent(e,t,i){if(!this._isVisible)throw new Error("Not supported");let n=this.getInputStartOffsetOfOutputLineIndex(i),o=this.getInputEndOffsetOfOutputLineIndex(e,t,i),s=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(s=fn(this._lineBreakData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,i){if(!this._isVisible)throw new Error("Not supported");let n=this.getInputStartOffsetOfOutputLineIndex(i),o=this.getInputEndOffsetOfOutputLineIndex(e,t,i)-n;return i>0&&(o=this._lineBreakData.wrappedTextIndentLength+o),o}getViewLineMinColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return i>0?this._lineBreakData.wrappedTextIndentLength+1:1}getViewLineMaxColumn(e,t,i){if(!this._isVisible)throw new Error("Not supported");return this.getViewLineContent(e,t,i).length+1}getViewLineData(e,t,i){if(!this._isVisible)throw new Error("Not supported");let n=this.getInputStartOffsetOfOutputLineIndex(i),o=this.getInputEndOffsetOfOutputLineIndex(e,t,i),s=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});i>0&&(s=fn(this._lineBreakData.wrappedTextIndentLength)+s);let r=i>0?this._lineBreakData.wrappedTextIndentLength+1:1,a=s.length+1,l=i+10&&(h=this._lineBreakData.wrappedTextIndentLength);let c=e.getLineTokens(t);const d=0===i?0:this._lineBreakData.breakOffsetsVisibleColumn[i-1];return new Dt.d(s,l,r,a,d,c.sliceAndInflate(n,o,h))}getViewLinesData(e,t,i,n,o,s,r){if(!this._isVisible)throw new Error("Not supported");for(let a=i;a0&&(i0&&(o+=this._lineBreakData.wrappedTextIndentLength),new ie.a(e+n,o)}getViewLineNumberOfModelPosition(e,t){if(!this._isVisible)throw new Error("Not supported");return e+Dt.b.getOutputPositionOfInputOffset(this._lineBreakData.breakOffsets,t-1).outputLineIndex}}let pn=[""];function fn(e){if(e>=pn.length)for(let t=1;t<=e;t++)pn[t]=_n(t);return pn[e]}function _n(e){return new Array(e+1).join(" ")}function bn(e,t){return null===e?t?un.INSTANCE:gn.INSTANCE:new mn(e,t)}class vn{constructor(e){this._lines=e}_validPosition(e){return this._lines.model.validatePosition(e)}_validRange(e){return this._lines.model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._lines.model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}}class Cn{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new vn(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){let e=[];return{addRequest:(t,i)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new Ei(t,i)}onModelLinesInserted(e,t,i,n){return new Oi(t,i)}onModelLineChanged(e,t,i){return[!1,new Ni(t,t),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesIndentGuides(e,t){const i=t-e+1;let n=new Array(i);for(let e=0;e=t)return void(i>s&&(o[o.length-1]=i));o.push(n,t,i)}else this.result[e]=[n,t,i]}}class yn{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,o=e.options;let s;if(o.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new ie.a(n.startLineNumber,1)),t=this._coordinatesConverter.convertModelPositionToViewPosition(new ie.a(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)));s=new ne.a(e.lineNumber,e.column,t.lineNumber,t.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(n);i=new Dt.f(s,o),this._decorationsCache[t]=i}return i}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsViewportData(e),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}_getDecorationsViewportData(e){const t=this._linesCollection.getDecorationsInRange(e,this.editorId,Object($.m)(this.configuration.options)),i=e.startLineNumber,n=e.endLineNumber;let o=[],s=0,r=[];for(let e=i;e<=n;e++)r[e-i]=[];for(let e=0,a=t.length;ethis.tokenizeViewport()),50)),this._updateConfigurationViewLineCount=this._register(new y.e((()=>this._updateConfigurationViewLineCountNow()),0)),this._hasFocus=!1,this._viewportStartLine=-1,this._viewportStartLineTrackedRange=null,this._viewportStartLineDelta=0,this.model.isTooLargeForTokenization())this._lines=new Cn(this.model);else{const e=this._configuration.options,t=e.get(40),i=e.get(121),s=e.get(128),r=e.get(120);this._lines=new dn(this.model,n,o,t,this.model.getOptions().tabSize,i,s.wrappingColumn,r)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new qi(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new rn(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll((e=>{e.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitSingleViewEvent(new Ti(e)),this._eventDispatcher.emitOutgoingEvent(new Vi(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))}))),this._register(this.viewLayout.onDidContentSizeChange((e=>{this._eventDispatcher.emitOutgoingEvent(e)}))),this._decorations=new yn(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}}))),this._register(kt.getInstance().onDidChange((()=>{this._eventDispatcher.emitSingleViewEvent(new Ri)}))),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this.invalidateMinimapColorCache(),this._viewportStartLineTrackedRange=this.model._setTrackedRange(this._viewportStartLineTrackedRange,null,1),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}tokenizeViewport(){const e=this.viewLayout.getLinesViewportData(),t=this.coordinatesConverter.convertViewPositionToModelPosition(new ie.a(e.startLineNumber,1)),i=this.coordinatesConverter.convertViewPositionToModelPosition(new ie.a(e.endLineNumber,1));this.model.tokenizeViewport(t.lineNumber,i.lineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new Li(e)),this._eventDispatcher.emitOutgoingEvent(new ji(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new vi)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Ci)}onDidColorThemeChange(){this._eventDispatcher.emitSingleViewEvent(new Mi)}_onConfigurationChanged(e,t){let i=null;if(-1!==this._viewportStartLine){let e=new ie.a(this._viewportStartLine,this.getLineMinColumn(this._viewportStartLine));i=this.coordinatesConverter.convertViewPositionToModelPosition(e)}let n=!1;const o=this._configuration.options,s=o.get(40),r=o.get(121),a=o.get(128),l=o.get(120);if(this._lines.setWrappingSettings(s,r,a.wrappingColumn,l)&&(e.emitViewEvent(new xi),e.emitViewEvent(new Di),e.emitViewEvent(new Si(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),0!==this.viewLayout.getCurrentScrollTop()&&(n=!0),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(77)&&(this._decorations.reset(),e.emitViewEvent(new Si(null))),e.emitViewEvent(new wi(t)),this.viewLayout.onConfigurationChanged(t),n&&i){const e=this.coordinatesConverter.convertModelPositionToViewPosition(i),t=this.viewLayout.getVerticalOffsetForLineNumber(e.lineNumber);this.viewLayout.setScrollPosition({scrollTop:t+this._viewportStartLineDelta},1)}oe.b.shouldRecreate(t)&&(this.cursorConfig=new oe.b(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeRawContentFast((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const o=e.changes,s=e.versionId,r=this._lines.createLineBreaksComputer();for(const e of o)switch(e.changeType){case 4:for(const t of e.detail)r.addRequest(t,null);break;case 2:r.addRequest(e.detail,null)}const a=r.finalize();let l=0;for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new xi),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(s,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=a.slice(l,l+e.detail.length);l+=e.detail.length;const o=this._lines.onModelLinesInserted(s,e.fromLineNumber,e.toLineNumber,n);null!==o&&(t.emitViewEvent(o),this.viewLayout.onLinesInserted(o.fromLineNumber,o.toLineNumber)),i=!0;break}case 2:{const i=a[l];l++;const[o,r,h,c]=this._lines.onModelLineChanged(s,e.lineNumber,i);n=o,r&&t.emitViewEvent(r),h&&(t.emitViewEvent(h),this.viewLayout.onLinesInserted(h.fromLineNumber,h.toLineNumber)),c&&(t.emitViewEvent(c),this.viewLayout.onLinesDeleted(c.fromLineNumber,c.toLineNumber));break}}this._lines.acceptVersionId(s),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new Di),t.emitViewEvent(new Si(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}if(this._viewportStartLine=-1,this._configuration.setMaxLineNumber(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&this._viewportStartLineTrackedRange){const e=this.model._getTrackedRange(this._viewportStartLineTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStartLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}}))),this._register(this.model.onDidChangeTokens((e=>{let t=[];for(let i=0,n=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new ki),this.cursorConfig=new oe.b(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)}))),this._register(this.model.onDidChangeLanguage((e=>{this.cursorConfig=new oe.b(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)}))),this._register(this.model.onDidChangeOptions((e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new xi),e.emitViewEvent(new Di),e.emitViewEvent(new Si(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new oe.b(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)}))),this._register(this.model.onDidChangeDecorations((e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new Si(e))})))}setHiddenAreas(e){try{const t=this._eventDispatcher.beginEmitViewEvents();this._lines.setHiddenAreas(e)&&(t.emitViewEvent(new xi),t.emitViewEvent(new Di),t.emitViewEvent(new Si(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(127),t=this._configuration.options.get(55),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),s=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new ne.a(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];let n=[],o=0,s=t.startLineNumber,r=t.startColumn,a=t.endLineNumber,l=t.endColumn;for(let e=0,t=i.length;ea||(se.startLineNumber));let o="";for(let e=0;e0&&i[e-1]===i[e]||(o+=this.model.getLineContent(i[e])+n);return o}if(o&&t){let t=[],n=0;for(const o of e){const e=o.startLineNumber;o.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(o,i?2:0)),n=e}return 1===t.length?t[0]:t}let r=[];for(const t of e)t.isEmpty()||r.push(this.model.getValueInRange(t,i?2:0));return 1===r.length?r[0]:r}getRichTextToCopy(e,t){const i=this.model.getLanguageIdentifier();if(1===i.id)return null;if(1!==e.length)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const e=n.startLineNumber;n=new ne.a(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(40),s=this._getColorMap();let r;return/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===$.c.fontFamily?r=$.c.fontFamily:(r=o.fontFamily,r=r.replace(/"/g,"'"),/[,']/.test(r)||/[+ ]/.test(r)&&(r=`'${r}'`),r=`${r}, ${$.c.fontFamily}`),{mode:i.language,html:`
`+this._getHTMLToCopy(n,s)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn,r=this.getTabSize();let a="";for(let e=i;e<=o;e++){const l=this.model.getLineTokens(e),h=l.getLineContent(),c=e===i?n-1:0,d=e===o?s-1:h.length;a+=""===h?"
":Object(Xi.a)(h,l.inflate(),t,c,d,r,v.j)}return a}_getColorMap(){let e=Lt.B.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;ithis._cursor.setStates(n,e,t,i)))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector((n=>this._cursor.setSelections(n,e,t,i)))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector((t=>this._cursor.restoreState(t,e)))}_executeCursorEdit(e){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new Ui):this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit((n=>this._cursor.executeEdits(n,e,t,i)))}startComposition(){this._cursor.setIsDoingComposition(!0),this._executeCursorEdit((e=>this._cursor.startComposition(e)))}endComposition(e){this._cursor.setIsDoingComposition(!1),this._executeCursorEdit((t=>this._cursor.endComposition(t,e)))}type(e,t){this._executeCursorEdit((i=>this._cursor.type(i,e,t)))}compositionType(e,t,i,n,o){this._executeCursorEdit((s=>this._cursor.compositionType(s,e,t,i,n,o)))}paste(e,t,i,n){this._executeCursorEdit((o=>this._cursor.paste(o,e,t,i,n)))}cut(e){this._executeCursorEdit((t=>this._cursor.cut(t,e)))}executeCommand(e,t){this._executeCursorEdit((i=>this._cursor.executeCommand(i,e,t)))}executeCommands(e,t){this._executeCursorEdit((i=>this._cursor.executeCommands(i,e,t)))}revealPrimaryCursor(e,t){this._withViewEventsCollector((i=>this._cursor.revealPrimary(i,e,t,0)))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new ne.a(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new Ii(e,i,null,0,!0,0))))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new ne.a(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new Ii(e,i,null,0,!0,0))))}revealRange(e,t,i,n,o){this._withViewEventsCollector((s=>s.emitViewEvent(new Ii(e,i,null,n,t,o))))}getVerticalOffsetForLineNumber(e){return this.viewLayout.getVerticalOffsetForLineNumber(e)}getScrollTop(){return this.viewLayout.getCurrentScrollTop()}setScrollTop(e,t){this.viewLayout.setScrollPosition({scrollTop:e},t)}setScrollPosition(e,t){this.viewLayout.setScrollPosition(e,t)}deltaScrollNow(e,t){this.viewLayout.deltaScrollNow(e,t)}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new Pi),this._eventDispatcher.emitOutgoingEvent(new Hi))}setMaxLineWidth(e){this.viewLayout.setMaxLineWidth(e)}_withViewEventsCollector(e){try{e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}}}var xn=i(27),Ln=i(8),kn=i(15),Dn=i(133),Nn=i(59),En=i(62),On=i(14),In=i(110);class Tn extends In.a{constructor(e,t){super(0);for(let t=0;t=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let Mn=[],An=[];class Rn{constructor(e,t){this.classifier=new Tn(e,t)}static create(e){return new Rn(e.get(116),e.get(115))}createLineBreaksComputer(e,t,i,n){t|=0,i=+i;let o=[],s=[];return{addRequest:(e,t)=>{o.push(e),s.push(t)},finalize:()=>{const r=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth;let a=[];for(let e=0,l=o.length;e=0){let e=Math.abs(h[v]-_);for(;v+1=e)break;e=t,v++}}for(;vt&&(t=p,o=f);let r=0,c=0,C=0,w=0;if(o<=_){let f=o,b=0===t?0:i.charCodeAt(t-1),v=0===t?0:e.get(b),y=!0;for(let o=t;op&&jn(0,v,a,l)&&(r=t,c=f),f+=h,f>_){t>p?(C=t,w=f-h):(C=o+1,w=f),f-c>d&&(r=0),y=!1;break}b=a,v=l}if(y){m>0&&(u[m]=l[l.length-1],g[m]=h[l.length-1],m++);break}}if(0===r){let a=o,l=i.charCodeAt(t),h=e.get(l),u=!1;for(let n=t-1;n>=p;n--){const t=n+1,o=i.charCodeAt(n);if(9===o){u=!0;break}let g,m;if(Se.E(o)?(n--,g=0,m=2):(g=e.get(o),m=Se.C(o)?s:1),a<=_){if(0===C&&(C=t,w=a),a<=_-d)break;if(jn(0,g,l,h)){r=t,c=a;break}}a-=m,l=o,h=g}if(0!==r){const e=d-(w-c);if(e<=n){const t=i.charCodeAt(C);let o;o=Se.D(t)?2:Wn(t,w,n,s),e-o<0&&(r=0)}}if(u){v--;continue}}if(0===r&&(r=C,c=w),r<=p){const e=i.charCodeAt(p);Se.D(e)?(r=p+2,c=f+2):(r=p+1,c=f+Wn(e,f,n,s))}for(p=r,u[m]=r,f=c,g[m]=c,m++,_=c+d;v<0||v=y)break;y=e,v++}}return 0===m?null:(u.length=m,g.length=m,Mn=t.breakOffsets,An=t.breakOffsetsVisibleColumn,t.breakOffsets=u,t.breakOffsetsVisibleColumn=g,t.wrappedTextIndentLength=c,t)}function Fn(e,t,i,n,o,s){if(-1===n)return null;const r=t.length;if(r<=1)return null;const a=Vn(t,i,n,o,s),l=n-a;let h=[],c=[],d=0,u=0,g=0,m=n,p=t.charCodeAt(0),f=e.get(p),_=Wn(p,0,i,o),b=1;Se.D(p)&&(_+=1,p=t.charCodeAt(1),f=e.get(p),b++);for(let n=b;nm&&((0===u||_-g>l)&&(u=s,g=_-b),h[d]=u,c[d]=g,d++,m=g+l,u=0),p=r,f=a}return 0===d?null:(h[d]=r,c[d]=_,new Dt.b(h,c,a))}function Wn(e,t,i,n){return 9===e?i-t%i:Se.C(e)||e<32?n:1}function Bn(e,t){return t-e%t}function jn(e,t,i,n){return 32!==i&&(2===t||3===t&&2!==n||1===n||3===n&&1!==t)}function Vn(e,t,i,n,o){let s=0;if(0!==o){const r=Se.u(e);if(-1!==r){for(let i=0;ii&&(s=0)}}return s}var Hn;const zn=null===(Hn=window.trustedTypes)||void 0===Hn?void 0:Hn.createPolicy("domLineBreaksComputer",{createHTML:e=>e});class Un{static create(){return new Un}constructor(){}createLineBreaksComputer(e,t,i,n){t|=0,i=+i;let o=[];return{addRequest:(e,t)=>{o.push(e)},finalize:()=>function(e,t,i,n,o){var s;if(-1===n){const t=[];for(let i=0,n=e.length;ir?(a=0,m=0):p=r-e}const f=s.substr(a),_=Kn(f,m,i,p,l);h[n]=a,c[n]=m,d[n]=f,u[n]=_[0],g[n]=_[1]}const p=l.build(),f=null!==(s=null==zn?void 0:zn.createHTML(p))&&void 0!==s?s:p;a.innerHTML=f,a.style.position="absolute",a.style.top="10000",a.style.wordWrap="break-word",document.body.appendChild(a);let _=document.createRange();const b=Array.prototype.slice.call(a.children,0);let v=[];for(let t=0;t');const s=e.length;let r=t,a=0,l=[],h=[],c=0");for(let t=0;t"),l[t]=a,h[t]=r;const n=c;c=t+1"),l[e.length]=a,h[e.length]=r,o.appendASCIIString(""),[l,h]}function $n(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{qn(e,o,n,0,null,i.length-1,null,s)}catch(e){return console.log(e),null}return 0===s.length?null:(s.push(i.length),s)}function qn(e,t,i,n,o,s,r,a){if(n===s)return;if(o=o||Gn(e,t,i[n],i[n+1]),r=r||Gn(e,t,i[s],i[s+1]),Math.abs(o[0].top-r[0].top)<=.1)return;if(n+1===s)return void a.push(s);const l=n+(s-n)/2|0,h=Gn(e,t,i[l],i[l+1]);qn(e,t,i,n,o,l,h,a),qn(e,t,i,l,h,s,r,a)}function Gn(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}var Yn=i(129),Zn=function(e,t){return function(i,n){t(i,n,e)}};let Qn=0;class Xn{constructor(e,t,i,n,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o}dispose(){Object(u.f)(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let Jn=class e extends u.a{constructor(e,t,i,n,s,r,a,l,h,u){super(),this._onDidDispose=this._register(new d.a),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new d.a),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new d.a),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new d.a),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new d.a),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new d.a),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeConfiguration=this._register(new d.a),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new d.a),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new d.a),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new d.a),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new d.a),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new d.a),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new eo),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new eo),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new d.a),this.onWillType=this._onWillType.event,this._onDidType=this._register(new d.a),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new d.a),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new d.a),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new d.a),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new d.a),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new d.a),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new d.a),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new d.a),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new d.a),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onContextMenu=this._register(new d.a),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new d.a),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new d.a),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new d.a),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new d.a),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new d.a),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new d.a),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new d.a),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new d.a),this.onDidChangeViewZones=this._onDidChangeViewZones.event;const g=Object.assign({},t);let m;this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++Qn,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this.isSimpleWidget=i.isSimpleWidget||!1,this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(g,u)),this._register(this._configuration.onDidChange((e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(127)){const e=t.get(127);this._onDidLayoutChange.fire(e)}}))),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=h,this._codeEditorService=s,this._commandService=r,this._themeService=l,this._register(new to(this,this._contextKeyService)),this._register(new io(this,this._contextKeyService)),this._instantiationService=n.createChild(new Dn.a([Ln.b,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={},this._focusTracker=new no(e),this._focusTracker.onChange((()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},m=Array.isArray(i.contributions)?i.contributions:o.d.getEditorContributions();for(const e of m)try{const t=this._instantiationService.createInstance(e.ctor,this);this._contributions[e.id]=t}catch(e){Object(c.e)(e)}o.d.getEditorActions().forEach((e=>{const t=new Yi.a(e.id,e.label,e.alias,Object(On.n)(e.precondition),(()=>this._instantiationService.invokeFunction((t=>Promise.resolve(e.runEditorCommand(t,this,null))))),this._contextKeyService);this._actions[t.id]=t})),this._codeEditorService.addCodeEditor(this)}_createConfiguration(e,t){return new m.a(this.isSimpleWidget,e,this._domElement,t)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return Zi.a.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose();const e=Object.keys(this._contributions);for(let t=0,i=e.length;tne.a.lift(e))))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return oe.a.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e){if(this._modelData){if(!ie.a.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections("api",[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!ne.a.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new ne.a(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!ie.a.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new ne.a(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e){const t=_.a.isISelection(e),i=ne.a.isIRange(e);if(!t&&!i)throw new Error("Invalid arguments");if(t)this._setSelectionImpl(e);else if(i){const t={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(t)}}_setSelectionImpl(e){if(!this._modelData)return;const t=new _.a(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections("api",[t])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new ne.a(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!ne.a.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(ne.a.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;te.isSupported())),e}getAction(e){return this._actions[e]||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=i;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null)}case"cut":return void this._cut(e)}const n=this.getAction(t);n?Promise.resolve(n.run()).then(void 0,c.e):this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o){if(!this._modelData||0===t.length)return;const s=this._modelData.viewModel.getSelection().getStartPosition();this._modelData.viewModel.paste(t,i,n,e);const r=this._modelData.viewModel.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new ne.a(s.lineNumber,s.column,r.lineNumber,r.column),mode:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=o.d.getEditorCommand(t);return!!n&&((i=i||{}).source=e,this._instantiationService.invokeFunction((e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,c.e)})),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&!this._configuration.options.get(77)&&(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!!this._modelData&&!this._configuration.options.get(77)&&(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(77))return!1;let n;return n=i?Array.isArray(i)?()=>i:i:()=>null,this._modelData.viewModel.executeEdits(e,t,n),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,Object($.m)(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(127)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarMouseDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarMouseDown(e)}layout(e){this._configuration.observeReferenceElement(e),this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(t){if(!this._modelData||!this._modelData.hasRealView)return null;const i=this._modelData.model.validatePosition(t),n=this._configuration.options,o=n.get(127);return{top:e._getVerticalOffsetForPosition(this._modelData,i.lineNumber,i.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(i.lineNumber,i.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft(),height:n.get(55)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.view.render(!0,e)}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){m.a.applyFontInfoSlow(e,this._configuration.options.get(40))}_attachModel(e){if(!e)return void(this._modelData=null);const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageIdentifier().language),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setMaxLineNumber(e.getLineCount()),e.onBeforeAttached();const i=new Sn(this._id,this._configuration,e,Un.create(),Rn.create(this._configuration.options),(e=>h.T(e)));t.push(e.onDidChangeDecorations((e=>this._onDidChangeModelDecorations.fire(e)))),t.push(e.onDidChangeLanguage((t=>{this._domElement.setAttribute("data-mode-id",e.getLanguageIdentifier().language),this._onDidChangeModelLanguage.fire(t)}))),t.push(e.onDidChangeLanguageConfiguration((e=>this._onDidChangeModelLanguageConfiguration.fire(e)))),t.push(e.onDidChangeContent((e=>this._onDidChangeModelContent.fire(e)))),t.push(e.onDidChangeOptions((e=>this._onDidChangeModelOptions.fire(e)))),t.push(e.onWillDispose((()=>this.setModel(null)))),t.push(i.onEvent((e=>{switch(e.kind){case 0:this._onDidContentSizeChange.fire(e);break;case 1:this._editorTextFocus.setValue(e.hasFocus);break;case 2:this._onDidScrollChange.fire(e);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidAttemptReadOnlyEdit.fire();break;case 5:{e.reachedMaxCursorCount&&this._notificationService.warn(l.a("cursors.maximum","The number of cursors has been limited to {0}.",qi.MAX_CURSOR_COUNT));const t=[];for(let i=0,n=e.selections.length;i{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const o={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",o)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const o={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",o)}else{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new Ke(e.coordinatesConverter);return i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e),[new mi(t,this._configuration,this._themeService,e,i,this._overflowWidgetsDomNode),!0]}_postDetachModelCleanup(e){e&&e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}};Jn=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Zn(3,kn.a),Zn(4,p.a),Zn(5,xn.b),Zn(6,Ln.b),Zn(7,Re.b),Zn(8,Nn.a),Zn(9,En.b)],Jn);class eo extends u.a{constructor(){super(),this._onDidChangeToTrue=this._register(new d.a),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new d.a),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class to extends u.a{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=Qi.a.editorSimpleInput.bindTo(t),this._editorFocus=Qi.a.focus.bindTo(t),this._textInputFocus=Qi.a.textInputFocus.bindTo(t),this._editorTextFocus=Qi.a.editorTextFocus.bindTo(t),this._editorTabMovesFocus=Qi.a.tabMovesFocus.bindTo(t),this._editorReadonly=Qi.a.readOnly.bindTo(t),this._inDiffEditor=Qi.a.inDiffEditor.bindTo(t),this._editorColumnSelection=Qi.a.columnSelection.bindTo(t),this._hasMultipleSelections=Qi.a.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=Qi.a.hasNonEmptySelection.bindTo(t),this._canUndo=Qi.a.canUndo.bindTo(t),this._canRedo=Qi.a.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromConfig()))),this._register(this._editor.onDidChangeCursorSelection((()=>this._updateFromSelection()))),this._register(this._editor.onDidFocusEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorWidget((()=>this._updateFromFocus()))),this._register(this._editor.onDidFocusEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidBlurEditorText((()=>this._updateFromFocus()))),this._register(this._editor.onDidChangeModel((()=>this._updateFromModel()))),this._register(this._editor.onDidChangeConfiguration((()=>this._updateFromModel()))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._editorTabMovesFocus.set(e.get(126)),this._editorReadonly.set(e.get(77)),this._inDiffEditor.set(e.get(51)),this._editorColumnSelection.set(e.get(16))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some((e=>!e.isEmpty())))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class io extends u.a{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this._langId=Qi.a.languageId.bindTo(t),this._hasCompletionItemProvider=Qi.a.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=Qi.a.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=Qi.a.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=Qi.a.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=Qi.a.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=Qi.a.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=Qi.a.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=Qi.a.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=Qi.a.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=Qi.a.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=Qi.a.hasReferenceProvider.bindTo(t),this._hasRenameProvider=Qi.a.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=Qi.a.hasSignatureHelpProvider.bindTo(t),this._hasInlineHintsProvider=Qi.a.hasInlineHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=Qi.a.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=Qi.a.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=Qi.a.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=Qi.a.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=Qi.a.isInWalkThroughSnippet.bindTo(t);const i=()=>this._update();this._register(e.onDidChangeModel(i)),this._register(e.onDidChangeModelLanguage(i)),this._register(Lt.d.onDidChange(i)),this._register(Lt.a.onDidChange(i)),this._register(Lt.b.onDidChange(i)),this._register(Lt.f.onDidChange(i)),this._register(Lt.e.onDidChange(i)),this._register(Lt.p.onDidChange(i)),this._register(Lt.C.onDidChange(i)),this._register(Lt.o.onDidChange(i)),this._register(Lt.h.onDidChange(i)),this._register(Lt.l.onDidChange(i)),this._register(Lt.v.onDidChange(i)),this._register(Lt.w.onDidChange(i)),this._register(Lt.g.onDidChange(i)),this._register(Lt.i.onDidChange(i)),this._register(Lt.y.onDidChange(i)),this._register(Lt.q.onDidChange(i)),i()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents((()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()}))}_update(){const e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents((()=>{this._langId.set(e.getLanguageIdentifier().language),this._hasCompletionItemProvider.set(Lt.d.has(e)),this._hasCodeActionsProvider.set(Lt.a.has(e)),this._hasCodeLensProvider.set(Lt.b.has(e)),this._hasDefinitionProvider.set(Lt.f.has(e)),this._hasDeclarationProvider.set(Lt.e.has(e)),this._hasImplementationProvider.set(Lt.p.has(e)),this._hasTypeDefinitionProvider.set(Lt.C.has(e)),this._hasHoverProvider.set(Lt.o.has(e)),this._hasDocumentHighlightProvider.set(Lt.h.has(e)),this._hasDocumentSymbolProvider.set(Lt.l.has(e)),this._hasReferenceProvider.set(Lt.v.has(e)),this._hasRenameProvider.set(Lt.w.has(e)),this._hasSignatureHelpProvider.set(Lt.y.has(e)),this._hasInlineHintsProvider.set(Lt.q.has(e)),this._hasDocumentFormattingProvider.set(Lt.g.has(e)||Lt.i.has(e)),this._hasDocumentSelectionFormattingProvider.set(Lt.i.has(e)),this._hasMultipleDocumentFormattingProvider.set(Lt.g.all(e).length+Lt.i.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(Lt.i.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===g.c.walkThroughSnippet)})):this.reset()}}class no extends u.a{constructor(e){super(),this._onChange=this._register(new d.a),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(h.W(e)),this._register(this._domFocusTracker.onDidFocus((()=>{this._hasFocus=!0,this._onChange.fire(void 0)}))),this._register(this._domFocusTracker.onDidBlur((()=>{this._hasFocus=!1,this._onChange.fire(void 0)})))}hasFocus(){return this._hasFocus}}const oo=encodeURIComponent("");function ro(e){return oo+encodeURIComponent(e.toString())+so}const ao=encodeURIComponent('');Object(Re.f)(((e,t)=>{const i=e.getColor(Nt.t);i&&t.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${i}; }`);const n=e.getColor(Nt.u);n&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${ro(n)}") repeat-x bottom left; }`);const o=e.getColor(Nt.s);o&&t.addRule(`.monaco-editor .squiggly-error::before { display: block; content: ''; width: 100%; height: 100%; background: ${o}; }`);const s=e.getColor(Nt.O);s&&t.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${s}; }`);const r=e.getColor(Nt.P);r&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${ro(r)}") repeat-x bottom left; }`);const a=e.getColor(Nt.N);a&&t.addRule(`.monaco-editor .squiggly-warning::before { display: block; content: ''; width: 100%; height: 100%; background: ${a}; }`);const l=e.getColor(Nt.G);l&&t.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${l}; }`);const h=e.getColor(Nt.H);h&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${ro(h)}") repeat-x bottom left; }`);const c=e.getColor(Nt.F);c&&t.addRule(`.monaco-editor .squiggly-info::before { display: block; content: ''; width: 100%; height: 100%; background: ${c}; }`);const d=e.getColor(Nt.x);d&&t.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${d}; }`);const u=e.getColor(Nt.y);var g;u&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${g=u,ao+encodeURIComponent(g.toString())+lo}") no-repeat bottom left; }`);const m=e.getColor(Ae.o);m&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${m.rgba.a}; }`);const p=e.getColor(Ae.n);p&&t.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${p}; }`);const f=e.getColor(Nt.w)||"inherit";t.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${f}}`)}))},function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i(30),o=i(13);const s={clipboard:{writeText:o.g||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:o.g||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:o.g||n.i?0:navigator.keyboard||n.h?1:2,touch:"ontouchstart"in window||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0)}},function(e,t,i){"use strict";i.d(t,"d",(function(){return r})),i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return l})),i.d(t,"a",(function(){return h}));var n=i(13),o=i(6),s=i(50);function r(e){return e.replace(/[\\/]/g,s.e.sep)}function a(e,t,i,n=s.h){if(e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(i){if(!Object(o.Q)(e,t))return!1;if(t.length===e.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,e.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function l(e){const t=Object(s.d)(e);return n.j?!(e.length>3)&&h(t)&&(2===e.length||92===t.charCodeAt(2)):t===s.e.sep}function h(e){return!!n.j&&((t=e.charCodeAt(0))>=65&&t<=90||t>=97&&t<=122)&&58===e.charCodeAt(1);var t}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(5);const o=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new n.a,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))}}},function(e,t,i){"use strict";i.d(t,"b",(function(){return l})),i.d(t,"a",(function(){return c}));var n=i(18),o=i(2),s=i(13),r=i(14);let a=!1;function l(e){s.i&&(a||(a=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(e.message))}class h{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null)}setWorkerId(e){this._workerId=e}sendMessage(e,t){let i=String(++this._lastSentReq);return new Promise(((n,o)=>{this._pendingReplies[i]={resolve:n,reject:o},this._send({vsWorker:this._workerId,req:i,method:e,args:t})}))}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){if(e.seq){let t=e;if(!this._pendingReplies[t.seq])return void console.warn("Got reply to unknown seq");let i=this._pendingReplies[t.seq];if(delete this._pendingReplies[t.seq],t.err){let e=t.err;return t.err.$isError&&(e=new Error,e.name=t.err.name,e.message=t.err.message,e.stack=t.err.stack),void i.reject(e)}return void i.resolve(t.res)}let t=e,i=t.req;this._handler.handleMessage(t.method,t.args).then((e=>{this._send({vsWorker:this._workerId,seq:i,res:e,err:void 0})}),(e=>{e.detail instanceof Error&&(e.detail=Object(n.g)(e.detail)),this._send({vsWorker:this._workerId,seq:i,res:void 0,err:Object(n.g)(e)})}))}_send(e){let t=[];if(e.req){const i=e;for(let e=0;e{this._protocol.handleMessage(e)}),(e=>{n&&n(e)}))),this._protocol=new h({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t)=>{if("function"!=typeof i[e])return Promise.reject(new Error("Missing method "+e+" on main thread host."));try{return Promise.resolve(i[e].apply(i,t))}catch(e){return Promise.reject(e)}}}),this._protocol.setWorkerId(this._worker.getId());let o=null;void 0!==self.require&&"function"==typeof self.require.getConfig?o=self.require.getConfig():void 0!==self.requirejs&&(o=self.requirejs.s.contexts._.config);const s=r.d(i);this._onModuleLoaded=this._protocol.sendMessage("$initialize",[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,s]);const a=(e,t)=>this._request(e,t);this._lazyProxy=new Promise(((e,i)=>{n=i,this._onModuleLoaded.then((t=>{e(r.c(t,a))}),(e=>{i(e),this._onError("Worker failed to load "+t,e)}))}))}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise(((i,n)=>{this._onModuleLoaded.then((()=>{this._protocol.sendMessage(e,t).then(i,n)}),n)}))}_onError(e,t){console.error(e),console.info(t)}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return l}));var n=i(15),o=i(22),s=i(14);const r=Object(n.c)("IWorkspaceEditService");class a{constructor(e){this.metadata=e}static convert(e){return e.edits.map((e=>{if(t=e,Object(s.i)(t)&&o.a.isUri(t.resource)&&Object(s.i)(t.edit))return new l(e.resource,e.edit,e.modelVersionId,e.metadata);var t;if(function(e){return Object(s.i)(e)&&(Boolean(e.newUri)||Boolean(e.oldUri))}(e))return new h(e.oldUri,e.newUri,e.options,e.metadata);throw new Error("Unsupported edit")}))}}class l extends a{constructor(e,t,i,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class h extends a{constructor(e,t,i,n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}},function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return r}));var n=i(0);class o{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;const n=[];for(let o=0,s=t.length;o=d.length+1)return!1;const u=d.charAt(c.column-2),g=n.get(u);if(!g)return!1;if(Object(s.g)(u)){if("never"===i)return!1}else if("never"===t)return!1;const m=d.charAt(c.column-1);let p=!1;for(const e of g)e.open===u&&e.close===m&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,i=a.length;t1){let o=i.getLineContent(e.lineNumber),r=n.u(o),l=-1===r?o.length+1:r+1;if(e.column<=l){let n=s.a.visibleColumnFromColumn2(t,i,e),o=s.a.prevIndentTabStop(n,t.indentSize),r=s.a.columnFromVisibleColumn2(t,i,e.lineNumber,o);u=new a.a(e.lineNumber,r,e.lineNumber,e.column)}else u=new a.a(e.lineNumber,e.column-1,e.lineNumber,e.column)}else{let n=r.a.left(t,i,e.lineNumber,e.column);u=new a.a(n.lineNumber,n.column,e.lineNumber,e.column)}}u.isEmpty()?c[e]=null:(u.startLineNumber!==u.endLineNumber&&(d=!0),c[e]=new o.a(u,""))}return[d,c]}static cut(e,t,i){let n=[];for(let s=0,r=i.length;s1?(e=c.lineNumber-1,i=t.getLineMaxColumn(c.lineNumber-1),l=c.lineNumber,h=t.getLineMaxColumn(c.lineNumber)):(e=c.lineNumber,i=1,l=c.lineNumber,h=t.getLineMaxColumn(c.lineNumber));let d=new a.a(e,i,l,h);d.isEmpty()?n[s]=null:n[s]=new o.a(d,"")}else n[s]=null;else n[s]=new o.a(r,"")}return new s.e(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),i.d(t,"b",(function(){return s}));class n{constructor(e,t,i){this.from=0|e,this.to=0|t,this.colorId=0|i}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class o{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.color=i,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.colori&&(d=i-u);const g=l.color;let m=this._color2Id[g];m||(m=++this._lastAssignedId,this._color2Id[g]=m,this._id2Color[m]=g);const p=new n(d-u,d+u,m);l.setColorZone(p),r.push(p)}return this._colorZonesInvalid=!1,r.sort(n.compare),r}}},function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return a}));var n=i(0),o=i(8),s=i(13);const r=new o.c("isWindows",s.j,Object(n.a)("isWindows","Whether the operating system is Windows")),a="inputFocus"},function(e,t,i){e.exports=i(33)(40)},function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i(51),o=i(5);const s={JSONContribution:"base.contributions.json"},r=new class{constructor(){this._onDidChangeSchema=new o.a,this.schemasById={}}registerSchema(e,t){var i;this.schemasById[(i=e,i.length>0&&"#"===i.charAt(i.length-1)?i.substring(0,i.length-1):i)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}};n.a.add(s.JSONContribution,r)},function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),i.d(t,"b",(function(){return s}));var n=i(15);i(61);const o=Object(n.c)("contextService");class s{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(15);const o=Object(n.c)("markerDecorationsService")},function(e,t,i){e.exports=i(33)(1173)},function(e,t,i){"use strict";i.d(t,"a",(function(){return m}));var n=i(1),o=i(134),s=i(2),r=i(74),a=i(36),l=i(14),h=i(26),c=i(0),d=i(31),u=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class g{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class m extends s.a{constructor(e,t){super(),this.hoverDelegate=void 0,this.customHovers=new Map,this.domNode=this._register(new g(n.q(e,n.a(".monaco-icon-label")))),this.labelContainer=n.q(this.domNode.element,n.a(".monaco-icon-label-container"));const i=n.q(this.labelContainer,n.a("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new g(n.q(this.labelContainer,n.a("span.monaco-icon-description-container")))),(null==t?void 0:t.supportHighlights)?this.nameNode=new f(i,!!t.supportIcons):this.nameNode=new p(i),(null==t?void 0:t.supportDescriptionHighlights)?this.descriptionNodeFactory=()=>new o.a(n.q(this.descriptionContainer.element,n.a("span.label-description")),!!t.supportIcons):this.descriptionNodeFactory=()=>this._register(new g(n.q(this.descriptionContainer.element,n.a("span.label-description")))),(null==t?void 0:t.hoverDelegate)&&(this.hoverDelegate=t.hoverDelegate)}setLabel(e,t,i){const n=["monaco-icon-label"];i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough")),this.domNode.className=n.join(" "),this.setupHover(this.labelContainer,null==i?void 0:i.title),this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof o.a?(this.descriptionNode.set(t||"",i?i.descriptionMatches:void 0),this.setupHover(this.descriptionNode.element,null==i?void 0:i.descriptionTitle)):(this.descriptionNode.textContent=t||"",this.setupHover(this.descriptionNode.element,(null==i?void 0:i.descriptionTitle)||""),this.descriptionNode.empty=!t))}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),t)return this.hoverDelegate?this.setupCustomHover(this.hoverDelegate,e,t):this.setupNativeHover(e,t);e.removeAttribute("title")}static adjustXAndShowCustomHover(e,t,i,n){if(e&&n)return void 0!==t&&(e.target.x=t+10),i.showHover(e)}getTooltipForCustom(e){if(Object(l.j)(e))return()=>u(this,void 0,void 0,(function*(){return e}));if(Object(l.g)(e.markdown))return e.markdown;{const t=e.markdown;return()=>u(this,void 0,void 0,(function*(){return t}))}}setupCustomHover(e,t,i){t.setAttribute("title",""),t.removeAttribute("title");let o,s,r,a,g=this.getTooltipForCustom(i),p=!1;const f=this._register(Object(h.a)(t,n.d.MOUSE_OVER,!0)(function(f){if(p)return;function _(e){const i=e.type===n.d.MOUSE_DOWN;i&&(null==a||a.dispose(),a=void 0),(i||e.fromElement===t)&&(p=!1,o=void 0,r.dispose(!0),b.dispose(),v.dispose())}r=new d.b;const b=Object(h.a)(t,n.d.MOUSE_LEAVE,!0)(_.bind(t)),v=Object(h.a)(t,n.d.MOUSE_DOWN,!0)(_.bind(t));p=!0;const C=Object(h.a)(t,n.d.MOUSE_MOVE,!0)(function(e){s=e.x}.bind(t));setTimeout((()=>u(this,void 0,void 0,(function*(){var t;if(p&&g&&!o){const n={targetElements:[this],dispose:()=>{}};o={text:Object(c.a)("iconLabel.loading","Loading..."),target:n,hoverPosition:2},a=m.adjustXAndShowCustomHover(o,s,e,p);const h=null!==(t=yield g(r.token))&&void 0!==t?t:Object(l.j)(i)?void 0:i.markdownNotSupportedFallback;h?(o={text:h,target:n,hoverPosition:2},a=m.adjustXAndShowCustomHover(o,s,e,p)):a&&(a.dispose(),a=void 0)}C.dispose()}))),e.delay)}.bind(t)));this.customHovers.set(t,f)}setupNativeHover(e,t){let i="";Object(l.j)(t)?i=t:(null==t?void 0:t.markdownNotSupportedFallback)&&(i=t.markdownNotSupportedFallback),e.title=i}}class p{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!Object(a.d)(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=n.q(this.container,n.a("a.label-name",{id:null==t?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:n,end:n+e.length},s=i.map((e=>r.a.intersect(o,e))).filter((e=>!r.a.isEmpty(e))).map((({start:e,end:t})=>({start:e-n,end:t-n})));return n=o.end+t.length,s}))}(e,i,null==t?void 0:t.matches);for(let r=0;r0||this.m_modifiedCount>0)&&this.m_changes.push(new n(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class c{constructor(e,t,i=null){this.ContinueProcessingPredicate=i;const[n,o,s]=c._getElements(e),[r,a,l]=c._getElements(t);this._hasStrings=s&&l,this._originalStringElements=n,this._originalElementsOrHash=o,this._modifiedStringElements=r,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(c._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,n=t.length;i=e&&o>=i&&this.ElementsAreEqual(t,o);)t--,o--;if(e>t||i>o){let s;return i<=o?(a.Assert(e===t+1,"originalStart should only be one more than originalEnd"),s=[new n(e,0,i,o-i+1)]):e<=t?(a.Assert(i===o+1,"modifiedStart should only be one more than modifiedEnd"),s=[new n(e,t-e+1,i,0)]):(a.Assert(e===t+1,"originalStart should only be one more than originalEnd"),a.Assert(i===o+1,"modifiedStart should only be one more than modifiedEnd"),s=[]),s}const r=[0],l=[0],h=this.ComputeRecursionPoint(e,t,i,o,r,l,s),c=r[0],d=l[0];if(null!==h)return h;if(!s[0]){const r=this.ComputeDiffRecursive(e,c,i,d,s);let a=[];return a=s[0]?[new n(c+1,t-(c+1)+1,d+1,o-(d+1)+1)]:this.ComputeDiffRecursive(c+1,t,d+1,o,s),this.ConcatenateChanges(r,a)}return[new n(e,t-e+1,i,o-i+1)]}WALKTRACE(e,t,i,o,s,r,a,l,c,d,u,g,m,p,f,_,b,v){let C=null,w=null,y=new h,S=t,x=i,L=m[0]-_[0]-o,k=-1073741824,D=this.m_forwardHistory.length-1;do{const t=L+e;t===S||t=0&&(e=(c=this.m_forwardHistory[D])[0],S=1,x=c.length-1)}while(--D>=-1);if(C=y.getReverseChanges(),v[0]){let e=m[0]+1,t=_[0]+1;if(null!==C&&C.length>0){const i=C[C.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}w=[new n(e,g-e+1,t,f-t+1)]}else{y=new h,S=r,x=a,L=m[0]-_[0]-l,k=1073741824,D=b?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=L+s;e===S||e=d[e+1]?(p=(u=d[e+1]-1)-L-l,u>k&&y.MarkNextChange(),k=u+1,y.AddOriginalElement(u+1,p+1),L=e+1-s):(p=(u=d[e-1])-L-l,u>k&&y.MarkNextChange(),k=u,y.AddModifiedElement(u+1,p+1),L=e-1-s),D>=0&&(s=(d=this.m_reverseHistory[D])[0],S=1,x=d.length-1)}while(--D>=-1);w=y.getChanges()}return this.ConcatenateChanges(C,w)}ComputeRecursionPoint(e,t,i,o,s,r,a){let h=0,c=0,d=0,u=0,g=0,m=0;e--,i--,s[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const p=t-e+(o-i),f=p+1,_=new Int32Array(f),b=new Int32Array(f),v=o-i,C=t-e,w=e-i,y=t-o,S=(C-v)%2==0;_[v]=e,b[C]=t,a[0]=!1;for(let x=1;x<=p/2+1;x++){let p=0,L=0;d=this.ClipDiagonalBound(v-x,x,v,f),u=this.ClipDiagonalBound(v+x,x,v,f);for(let e=d;e<=u;e+=2){h=e===d||ep+L&&(p=h,L=c),!S&&Math.abs(e-C)<=x-1&&h>=b[e])return s[0]=h,r[0]=c,i<=b[e]&&x<=1448?this.WALKTRACE(v,d,u,w,C,g,m,y,_,b,h,t,s,c,o,r,S,a):null}const k=(p-e+(L-i)-x)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(p,k))return a[0]=!0,s[0]=p,r[0]=L,k>0&&x<=1448?this.WALKTRACE(v,d,u,w,C,g,m,y,_,b,h,t,s,c,o,r,S,a):(e++,i++,[new n(e,t-e+1,i,o-i+1)]);g=this.ClipDiagonalBound(C-x,x,C,f),m=this.ClipDiagonalBound(C+x,x,C,f);for(let n=g;n<=m;n+=2){h=n===g||n=b[n+1]?b[n+1]-1:b[n-1],c=h-(n-C)-y;const l=h;for(;h>e&&c>i&&this.ElementsAreEqual(h,c);)h--,c--;if(b[n]=h,S&&Math.abs(n-v)<=x&&h<=_[n])return s[0]=h,r[0]=c,l>=_[n]&&x<=1448?this.WALKTRACE(v,d,u,w,C,g,m,y,_,b,h,t,s,c,o,r,S,a):null}if(x<=1447){let e=new Int32Array(u-d+2);e[0]=v-d+1,l.Copy2(_,d,e,1,u-d+1),this.m_forwardHistory.push(e),e=new Int32Array(m-g+2),e[0]=C-g+1,l.Copy2(b,g,e,1,m-g+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(v,d,u,w,C,g,m,y,_,b,h,t,s,c,o,r,S,a)}PrettifyChanges(e){for(let t=0;t0,r=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let n=0,o=0;if(t>0){const i=e[t-1];n=i.originalStart+i.originalLength,o=i.modifiedStart+i.modifiedLength}const s=i.originalLength>0,r=i.modifiedLength>0;let a=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let e=1;;e++){const t=i.originalStart-e,h=i.modifiedStart-e;if(tl&&(l=c,a=e)}i.originalStart-=a,i.modifiedStart-=a;const h=[null];t>0&&this.ChangesOverlap(e[t-1],e[t],h)&&(e[t-1]=h[0],e.splice(t,1),t++)}if(this._hasStrings)for(let t=1,i=e.length;t0&&i>a&&(a=i,l=t,h=e)}return a>0?[l,h]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let o=0;o=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(i,n)?1:0)}ConcatenateChanges(e,t){let i=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1);return l.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],l.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return l.Copy(e,0,i,0,e.length),l.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(a.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),a.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const o=e.originalStart;let s=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(s=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new n(o,s,r,a),!0}return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e{this.viewContainer.scrollTop=e.scrollTop,this.viewContainer.scrollLeft=e.scrollLeft}))),Object(d.q)(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||m),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach(((e,t)=>{const i=s.k(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)})),this.contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0),this.saveProportions())}get orthogonalStartSash(){return this._orthogonalStartSash}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions)for(let t=0;t1===this.viewItems[e].priority)),o=t.filter((e=>2===this.viewItems[e].priority));this.resize(this.viewItems.length-1,e-i,void 0,n,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map((e=>e.size/this.contentSize)))}onSashStart({sash:e,start:t,alt:i}){for(const e of this.viewItems)e.enabled=!1;const o=this.sashItems.findIndex((t=>t.sash===e)),s=Object(n.e)(Object(c.a)(document.body,"keydown")((e=>r(this.sashDragState.current,e.altKey))),Object(c.a)(document.body,"keyup")((()=>r(this.sashDragState.current,!1)))),r=(e,t)=>{const i=this.viewItems.map((e=>e.size));let n,r,l=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t)if(o===this.sashItems.length-1){const e=this.viewItems[o];l=(e.minimumSize-e.size)/2,h=(e.maximumSize-e.size)/2}else{const e=this.viewItems[o+1];l=(e.size-e.maximumSize)/2,h=(e.size-e.minimumSize)/2}if(!t){const e=Object(a.q)(o,-1),t=Object(a.q)(o+1,this.viewItems.length),s=e.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),l=e.reduce(((e,t)=>e+(this.viewItems[t].viewMaximumSize-i[t])),0),h=0===t.length?Number.POSITIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),c=0===t.length?Number.NEGATIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize)),0),d=Math.max(s,c),u=Math.min(h,l),g=this.findFirstSnapIndex(e),m=this.findFirstSnapIndex(t);if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);n={index:g,limitDelta:e.visible?d-t:d+t,size:e.size}}if("number"==typeof m){const e=this.viewItems[m],t=Math.floor(e.viewMinimumSize/2);r={index:m,limitDelta:e.visible?u+t:u-t,size:e.size}}}this.sashDragState={start:e,current:e,index:o,sizes:i,minDelta:l,maxDelta:h,alt:t,snapBefore:n,snapAfter:r,disposable:s}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:s,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const h=e-i,c=this.resize(t,h,n,void 0,void 0,s,r,a,l);if(o){const e=t===this.sashItems.length-1,i=this.viewItems.map((e=>e.size)),n=e?t:t+1,o=this.viewItems[n],s=o.size-o.maximumSize,r=o.size-o.minimumSize,a=e?t-1:t+1;this.resize(a,-c,i,void 0,void 0,s,r)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const e of this.viewItems)e.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t="number"==typeof t?t:e.size,t=Object(r.b)(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==b.Idle)throw new Error("Cant modify splitview");if(this.state=b.Busy,e<0||e>=this.viewItems.length)return;const i=Object(a.q)(this.viewItems.length).filter((t=>t!==e)),n=[...i.filter((e=>1===this.viewItems[e].priority)),e],o=i.filter((e=>2===this.viewItems[e].priority)),s=this.viewItems[e];t=Math.round(t),t=Object(r.b)(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(n,o),this.state=b.Idle}distributeViewSizes(){const e=[];let t=0;for(const i of this.viewItems)i.maximumSize-i.minimumSize>0&&(e.push(i),t+=i.size);const i=Math.floor(t/e.length);for(const t of e)t.size=Object(r.b)(i,t.minimumSize,t.maximumSize);const n=Object(a.q)(this.viewItems.length),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==b.Idle)throw new Error("Cant modify splitview");this.state=b.Busy;const r=Object(d.a)(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(r):this.viewContainer.insertBefore(r,this.viewContainer.children.item(i));const h=e.onDidChange((e=>this.onViewChange(m,e))),c=Object(n.h)((()=>this.viewContainer.removeChild(r))),u=Object(n.e)(h,c);let g;g="number"==typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize;const m=0===this.orientation?new f(r,e,g,u):new _(r,e,g,u);if(this.viewItems.splice(i,0,m),this.viewItems.length>1){let e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash};const t=0===this.orientation?new l.b(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:1})):new l.b(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:0})),s=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),r=o.b.map(t.onDidStart,s)(this.onSashStart,this),h=o.b.map(t.onDidChange,s)(this.onSashChange,this),c=o.b.map(t.onDidEnd,(()=>this.sashItems.findIndex((e=>e.sash===t)))),d=c(this.onSashEnd,this),u=t.onDidReset((()=>{const e=this.sashItems.findIndex((e=>e.sash===t)),i=Object(a.q)(e,-1),n=Object(a.q)(e+1,this.viewItems.length),o=this.findFirstSnapIndex(i),s=this.findFirstSnapIndex(n);("number"!=typeof o||this.viewItems[o].visible)&&("number"!=typeof s||this.viewItems[s].visible)&&this._onDidSashReset.fire(e)})),g=Object(n.e)(r,h,d,u,t),m={sash:t,disposable:g};this.sashItems.splice(i-1,0,m)}let p;r.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(p=[t.index]),s||this.relayout([i],p),this.state=b.Idle,s||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce(((e,t)=>e+t.size),0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map((e=>e.size)),n,o,s=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,h,c){if(e<0||e>=this.viewItems.length)return 0;const d=Object(a.q)(e,-1),u=Object(a.q)(e+1,this.viewItems.length);if(o)for(const e of o)Object(a.o)(d,e),Object(a.o)(u,e);if(n)for(const e of n)Object(a.n)(d,e),Object(a.n)(u,e);const g=d.map((e=>this.viewItems[e])),m=d.map((e=>i[e])),p=u.map((e=>this.viewItems[e])),f=u.map((e=>i[e])),_=d.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),b=d.reduce(((e,t)=>e+(this.viewItems[t].maximumSize-i[t])),0),v=0===u.length?Number.POSITIVE_INFINITY:u.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),C=0===u.length?Number.NEGATIVE_INFINITY:u.reduce(((e,t)=>e+(i[t]-this.viewItems[t].maximumSize)),0),w=Math.max(_,C,s),y=Math.min(v,b,l);let S=!1;if(h){const e=this.viewItems[h.index],i=t>=h.limitDelta;S=i!==e.visible,e.setVisible(i,h.size)}if(!S&&c){const e=this.viewItems[c.index],i=te+t.size),0);let i=this.size-t;const n=Object(a.q)(this.viewItems.length-1,-1),o=n.filter((e=>1===this.viewItems[e].priority)),s=n.filter((e=>2===this.viewItems[e].priority));for(const e of s)Object(a.o)(n,e);for(const e of o)Object(a.n)(n,e);"number"==typeof e&&Object(a.n)(n,e);for(let e=0;0!==i&&ee+t.size),0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach((e=>e.sash.layout())),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map((t=>e=t.size-t.minimumSize>0||e));e=!1;const i=this.viewItems.map((t=>e=t.maximumSize-t.size>0||e)),n=[...this.viewItems].reverse();e=!1;const o=n.map((t=>e=t.size-t.minimumSize>0||e)).reverse();e=!1;const s=n.map((t=>e=t.maximumSize-t.size>0||e)).reverse();let r=0;for(let e=0;e0||this.startSnappingEnabled)?n.state=1:d&&t[e]&&(r0)return;if(!e.visible&&e.snap)return t}}dispose(){super.dispose(),this.viewItems.forEach((e=>e.dispose())),this.viewItems=[],this.sashItems.forEach((e=>e.disposable.dispose())),this.sashItems=[]}}},function(e,t,i){"use strict";var n=i(131);i.d(t,"a",(function(){return n.Emitter})),i.d(t,"b",(function(){return n.MarkerSeverity})),i.d(t,"c",(function(){return n.Range})),i.d(t,"d",(function(){return n.Uri})),i.d(t,"e",(function(){return n.editor})),i.d(t,"f",(function(){return n.languages}))},function(e,t,i){"use strict";var n=i(131);i.d(t,"a",(function(){return n.languages}))},function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));let n=!1,o=null;function s(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&(t.protocol!==i.protocol||t.hostname!==i.hostname||t.port!==i.port))return n=!0,null}catch(e){return n=!0,null}return e.parent}class r{static getSameOriginWindowChain(){if(!o){o=[];let e,t=window;do{e=s(t),e?o.push({window:t,iframeElement:t.frameElement||null}):o.push({window:t,iframeElement:null}),t=e}while(t)}return o.slice(0)}static hasDifferentOriginAncestor(){return o||this.getSameOriginWindowChain(),n}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0,o=this.getSameOriginWindowChain();for(const e of o){if(i+=e.window.scrollY,n+=e.window.scrollX,e.window===t)break;if(!e.iframeElement)break;let o=e.iframeElement.getBoundingClientRect();i+=o.top,n+=o.left}return{top:i,left:n}}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i(53),o=i(22);function s(e){let t=JSON.parse(e);return t=r(t),t}function r(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return o.a.revive(e);case 2:return new RegExp(e.source,e.flags)}if(e instanceof n.a||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;i{const t=a.filteredTypes[e.key];!1===t&&(a[e.value]=t)}))}const l=e.hover;!0===l?e.hover={enabled:!0}:!1===l&&(e.hover={enabled:!1});const h=e.parameterHints;!0===h?e.parameterHints={enabled:!0}:!1===h&&(e.parameterHints={enabled:!1});const c=e.autoIndent;!0===c?e.autoIndent="full":!1===c&&(e.autoIndent="advanced");const d=e.matchBrackets;!0===d?e.matchBrackets="always":!1===d&&(e.matchBrackets="never")}(t),t}class C extends s.a{constructor(e,t){super(),this._onDidChange=this._register(new o.a),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new o.a),this.onDidChangeFast=this._onDidChangeFast.event,this.isSimpleWidget=e,this._isDominatedByLongLines=!1,this._computeOptionsMemory=new l.a,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._rawOptions=v(t),this._readOptions=b.readOptions(this._rawOptions),this._validatedOptions=b.validateOptions(this._readOptions),this._register(h.a.onDidChangeZoomLevel((e=>this._recomputeOptions()))),this._register(m.onDidChangeTabFocus((e=>this._recomputeOptions())))}observeReferenceElement(e){}updatePixelRatio(){}_recomputeOptions(){const e=this.options,t=this._computeInternalOptions();if(e){const i=b.checkEquals(e,t);if(null===i)return;this.options=t,this._onDidChangeFast.fire(i),this._onDidChange.fire(i)}else this.options=t}getRawOptions(){return this._rawOptions}_computeInternalOptions(){const e=this._getEnvConfiguration(),t=c.a.createFromValidatedSettings(this._validatedOptions,e.zoomLevel,e.pixelRatio,this.isSimpleWidget),i={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,fontInfo:this.readConfiguration(t),extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:m.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return b.computeOptions(this._validatedOptions,i)}static _subsetEquals(e,t){for(const i in t)if(p.call(t,i)){const n=t[i],o=e[i];if(o===n)continue;if(Array.isArray(o)&&Array.isArray(n)){if(!a.g(o,n))return!1;continue}if(o&&"object"==typeof o&&n&&"object"==typeof n){if(!this._subsetEquals(o,n))return!1;continue}return!1}return!0}updateOptions(e){if(void 0===e)return;const t=v(e);C._subsetEquals(this._rawOptions,t)||(this._rawOptions=r.f(this._rawOptions,t||{}),this._readOptions=b.readOptions(this._rawOptions),this._validatedOptions=b.validateOptions(this._readOptions),this._recomputeOptions())}setIsDominatedByLongLines(e){this._isDominatedByLongLines=e,this._recomputeOptions()}setMaxLineNumber(e){const t=C._digitCount(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}static _digitCount(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}}const w=Object.freeze({id:"editor",order:5,type:"object",title:n.a("editorConfigurationTitle","Editor"),scope:5}),y=u.a.as(d.a.Configuration),S=Object.assign(Object.assign({},w),{properties:{"editor.tabSize":{type:"number",default:l.d.tabSize,minimum:1,markdownDescription:n.a("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.insertSpaces":{type:"boolean",default:l.d.insertSpaces,markdownDescription:n.a("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")},"editor.detectIndentation":{type:"boolean",default:l.d.detectIndentation,markdownDescription:n.a("detectIndentation","Controls whether `#editor.tabSize#` and `#editor.insertSpaces#` will be automatically detected when a file is opened based on the file contents.")},"editor.trimAutoWhitespace":{type:"boolean",default:l.d.trimAutoWhitespace,description:n.a("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:l.d.largeFileOptimizations,description:n.a("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:n.a("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[n.a("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),n.a("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),n.a("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:n.a("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[n.a("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),n.a("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),n.a("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:n.a("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:n.a("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:n.a("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:n.a("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:n.a("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:n.a("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:n.a("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:!1,description:n.a("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:"inherit",markdownEnumDescriptions:[n.a("wordWrap.off","Lines will never wrap."),n.a("wordWrap.on","Lines will wrap at the viewport width."),n.a("wordWrap.inherit","Lines will wrap according to the `#editor.wordWrap#` setting.")]}}});for(const e of l.l){const t=e.schema;if(void 0!==t)if(void 0!==(x=t).type||void 0!==x.anyOf)S.properties[`editor.${e.name}`]=t;else for(let e in t)p.call(t,e)&&(S.properties[e]=t[e])}var x;let L=null;function k(){return null===L&&(L=Object.create(null),Object.keys(S.properties).forEach((e=>{L[e]=!0}))),L}function D(e){return k()[`editor.${e}`]||!1}function N(e){return k()[`diffEditor.${e}`]||!1}y.registerConfiguration(S)},function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return a}));var n=i(53),o=i(109);function s(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class r{constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}toString(){return 0===this.oldText.length?`(insert@${this.oldPosition} "${s(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${s(this.oldText)}")`:`(replace@${this.oldPosition} "${s(this.oldText)}" with "${s(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const o=t.length;n.f(e,o,i),i+=4;for(let s=0;ss.c,tokenize2:(e,t,i,n)=>Object(s.e)(0,e,i,n)};function a(e,t=r){return function(e,t){let i='
',s=n.P(e),r=t.getInitialState();for(let e=0,a=s.length;e0&&(i+="
");let l=t.tokenize2(a,!0,r,0);o.a.convertToEndOffset(l.tokens,a.length);let h=new o.a(l.tokens,a).inflate(),c=0;for(let e=0,t=h.getCount();e${n.s(a.substring(c,o))}`,c=o}r=l.endState}return i+="
",i}(e,t||r)}function l(e,t,i,n,o,s,r){let a="
",l=n,h=0;for(let c=0,d=t.getCount();c0;)u+=r?" ":" ",e--;break;case 60:u+="<";break;case 62:u+=">";break;case 38:u+="&";break;case 0:u+="�";break;case 65279:case 8232:case 8233:case 133:u+="�";break;case 13:u+="​";break;case 32:u+=r?" ":" ";break;default:u+=String.fromCharCode(t)}}if(a+=`${u}`,d>o||l>=o)break}return a+="
",a}},function(e,t,i){"use strict";i.d(t,"c",(function(){return o})),i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return r}));var n=i(1);function o(e,t={}){const i=r(t);return i.textContent=e,i}function s(e,t={}){const i=r(t);return l(i,function(e,t){const i={type:1,children:[]};let n=0,o=i;const s=[],r=new a(e);for(;!r.eos();){let e=r.next();const i="\\"===e&&0!==h(r.peek(),t);if(i&&(e=r.next()),i||0===h(e,t)||e!==r.peek())if("\n"===e)2===o.type&&(o=s.pop()),o.children.push({type:8});else if(2!==o.type){const t={type:2,content:e};o.children.push(t),s.push(o),o=t}else o.content+=e;else{r.advance(),2===o.type&&(o=s.pop());const i=h(e,t);if(o.type===i||5===o.type&&6===i)o=s.pop();else{const e={type:i,children:[]};5===i&&(e.index=n,n++),o.children.push(e),s.push(o),o=e}}}return 2===o.type&&(o=s.pop()),s.length,i}(e,!!t.renderCodeSegements),t.actionHandler,t.renderCodeSegements),i}function r(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}class a{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function l(e,t,i,o){let s;if(2===t.type)s=document.createTextNode(t.content||"");else if(3===t.type)s=document.createElement("b");else if(4===t.type)s=document.createElement("i");else if(7===t.type&&o)s=document.createElement("code");else if(5===t.type&&i){const e=document.createElement("a");e.href="#",i.disposeables.add(n.o(e,"click",(e=>{i.callback(String(t.index),e)}))),s=e}else 8===t.type?s=document.createElement("br"):1===t.type&&(s=e);s&&e!==s&&e.appendChild(s),s&&Array.isArray(t.children)&&t.children.forEach((e=>{l(s,e,i,o)}))}function h(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return t?7:0;default:return 0}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return l}));var n=i(1),o=i(6),s=i(12),r=i(36);const a={badgeBackground:s.a.fromHex("#4D4D4D"),badgeForeground:s.a.fromHex("#FFFFFF")};class l{constructor(e,t){this.count=0,this.options=t||Object.create(null),Object(r.f)(this.options,a,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=Object(n.q)(e,Object(n.a)(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){this.element.textContent=Object(o.v)(this.countFormat,this.count),this.element.title=Object(o.v)(this.titleFormat,this.count),this.applyStyles()}style(e){this.badgeBackground=e.badgeBackground,this.badgeForeground=e.badgeForeground,this.badgeBorder=e.badgeBorder,this.applyStyles()}applyStyles(){if(this.element){const e=this.badgeBackground?this.badgeBackground.toString():"",t=this.badgeForeground?this.badgeForeground.toString():"",i=this.badgeBorder?this.badgeBorder.toString():"";this.element.style.backgroundColor=e,this.element.style.color=t,this.element.style.borderWidth=i?"1px":"",this.element.style.borderStyle=i?"solid":"",this.element.style.borderColor=i}}}},function(e,t,i){"use strict";e.exports=function(e,t,i,n,o,s,r,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[i,n,o,s,r,a],c=0;(l=new Error(t.replace(/%s/g,(function(){return h[c++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(e,t,i){"use strict";var n=i(259),o=i(260);function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){return o.isString(e)&&(e=v(e)),e instanceof s?e.format():s.prototype.format.call(e)},t.Url=s;var r=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,h=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(h),d=["%","/","?",";","#"].concat(c),u=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},f={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=i(261);function v(e,t,i){if(e&&o.isObject(e)&&e instanceof s)return e;var n=new s;return n.parse(e,t,i),n}s.prototype.parse=function(e,t,i){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var s=e.indexOf("?"),a=-1!==s&&s127?M+="x":M+=T[A];if(!M.match(g)){var P=O.slice(0,D),F=O.slice(D+1),W=T.match(m);W&&(P.push(W[1]),F.unshift(W[2])),F.length&&(v="/"+F.join(".")+v),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),E||(this.hostname=n.toASCII(this.hostname));var B=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+B,this.href+=this.host,E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!p[y])for(D=0,I=c.length;D0)&&i.host.split("@"))&&(i.auth=E.shift(),i.host=i.hostname=E.shift())),i.search=e.search,i.query=e.query,o.isNull(i.pathname)&&o.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i;if(!S.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var L=S.slice(-1)[0],k=(i.host||e.host||S.length>1)&&("."===L||".."===L)||""===L,D=0,N=S.length;N>=0;N--)"."===(L=S[N])?S.splice(N,1):".."===L?(S.splice(N,1),D++):D&&(S.splice(N,1),D--);if(!w&&!y)for(;D--;D)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),k&&"/"!==S.join("/").substr(-1)&&S.push("");var E,O=""===S[0]||S[0]&&"/"===S[0].charAt(0);return x&&(i.hostname=i.host=O?"":S.length?S.shift():"",(E=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=E.shift(),i.host=i.hostname=E.shift())),(w=w||i.host&&S.length)&&!O&&S.unshift(""),S.length?i.pathname=S.join("/"):(i.pathname=null,i.path=null),o.isNull(i.pathname)&&o.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},s.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,i){var n,o,s,r,a;"undefined"!=typeof self&&self,e.exports=(n={uri_ok:{"~":!0,"!":!0,"*":!0,"(":!0,")":!0,"-":!0,_:!0,".":!0,",":!0,":":!0,"@":!0,$:!0,"'":!0,"/":!0}},function(){for(var e=[],t=0;t<16;t++)for(var i=0;i<16;i++)if(t+i!==0){var o=String.fromCharCode(16*t+i);/\w|[-_./~]/.test(o)||e.push("\\u00"+t.toString(16)+i.toString(16))}n.not_idchar=e.join("")}(),n.not_idchar=" '!:(),*@$",n.not_idstart="-0123456789",a="[^"+n.not_idstart+n.not_idchar+"][^"+n.not_idchar+"]*",n.id_ok=new RegExp("^"+a+"$"),n.next_id=new RegExp(a,"g"),n.quote=function(e){return/^[-A-Za-z0-9~!*()_.',:@$/]*$/.test(e)?e:encodeURIComponent(e).replace(/%2C/g,",").replace(/%3A/g,":").replace(/%40/g,"@").replace(/%24/g,"$").replace(/%2F/g,"/").replace(/%20/g,"+")},o={"'":!0,"!":!0},s=function(e){e&&"function"==typeof e.toJSON&&(e=e.toJSON());var t=r[typeof e];if(t)return t(e)},r={array:function(e){var t,i,n,o=["!("],r=e.length;for(i=0;i0){var r=s[0];return this.index=o+r.length,r}return e?this.error("invalid character: '"+e+"'"):this.error("empty expression")},n.parser.parse_array=function(e){for(var t,i=[];")"!==(t=e.next());){if(!t)return e.error("unmatched '!('");if(i.length)","!==t&&e.error("missing ','");else{if(","===t)return e.error("extra ','");--e.index}var n=e.readValue();if(void 0===n)return;i.push(n)}return i},n.parser.bangs={t:!0,f:!1,n:null,"(":n.parser.parse_array},n.parser.prototype.table={"!":function(){var e=this.string.charAt(this.index++);if(!e)return this.error('"!" at end of input');var t=n.parser.bangs[e];return"function"==typeof t?t.call(null,this):void 0===t?this.error('unknown literal: "!'+e+'"'):t},"(":function(){for(var e,t={},i=0;")"!==(e=this.next());){if(i)","!==e&&this.error("missing ','");else{if(","===e)return this.error("extra ','");--this.index}var n=this.readValue();if(void 0===n)return;if(":"!==this.next())return this.error("missing ':'");var o=this.readValue();if(void 0===o)return;t[n]=o,i++}return t},"'":function(){for(var e,t=this.string,i=this.index,n=i,o=[];"'"!==(e=t.charAt(i++));){if(!e)return this.error('unmatched "\'"');if("!"===e){if(n=0))return this.error('invalid string escape: "!'+e+'"');o.push(e),n=i}}return n=0?o="":"exp"===(n=s[n+"+"+r.toLowerCase()])&&(o="-"))}while(n);return this.index=--t,"-"===(e=e.slice(i,t))?this.error("invalid number"):Number(e)}},function(e){for(var t=0;t<=9;t++)e[String(t)]=e["-"]}(n.parser.prototype.table),n.parser.prototype.next=function(){var e,t=this.string,i=this.index;do{if(i===t.length)return;e=t.charAt(i++)}while(n.parser.WHITESPACE.indexOf(e)>=0);return this.index=i,e},n)},function(e,t,i){e.exports=i(33)(0)},function(e,t,i){"use strict";i.d(t,"a",(function(){return E}));var n=i(6),o=i(147),s=i(50),r=i(61),a=i(21);const l="**",h="/",c="[/\\\\]",d="[^/\\\\]",u=/\//g;function g(e){switch(e){case 0:return"";case 1:return`${d}*?`;default:return`(?:${c}|${d}+${c}|${c}${d}+)*?`}}function m(e,t){if(!e)return[];const i=[];let n=!1,o=!1,s="";for(const r of e){switch(r){case t:if(!n&&!o){i.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1}s+=r}return s&&i.push(s),i}function p(e){if(!e)return"";let t="";const i=m(e,h);if(i.every((e=>e===l)))t=".*";else{let e=!1;i.forEach(((o,s)=>{if(o===l)return void(e||(t+=g(2),e=!0));let r=!1,a="",u=!1,f="";for(const e of o)if("}"!==e&&r)a+=e;else if(!u||"]"===e&&f)switch(e){case"{":r=!0;continue;case"[":u=!0;continue;case"}":const i=`(?:${m(a,",").map((e=>p(e))).join("|")})`;t+=i,r=!1,a="";break;case"]":t+="["+f+"]",u=!1,f="";break;case"?":t+=d;continue;case"*":t+=g(1);continue;default:t+=n.t(e)}else{let t;t="-"===e?e:"^"!==e&&"!"!==e||f?e===h?"":n.t(e):"^",f+=t}sL(e,t))).filter((e=>e!==x)),e),n=i.length;if(!n)return x;if(1===n)return i[0];const o=function(t,n){for(let o=0,s=i.length;o!!e.allBasenames));s&&(o.allBasenames=s.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return r.length&&(o.allPaths=r),o}(i,t):(o=C.exec(D(i,t)))?N(o[1].substr(1),i,!0):(o=w.exec(D(i,t)))?N(o[1],i,!1):function(e){try{const t=new RegExp(`^${p(e)}$`);return function(i){return t.lastIndex=0,"string"==typeof i&&t.test(i)?e:null}}catch(e){return x}}(i);return y.set(n,s),k(s,e)}function k(e,t){return"string"==typeof t?e:function(i,n){return o.b(i,t.base)?e(s.f(t.base,i),n):null}}function D(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substr(0,e.length-2):e}function N(e,t,i){const n=s.h===s.e.sep,o=n?e:e.replace(u,s.h),r=s.h+o,a=s.e.sep+e,l=i?function(i,s){return"string"!=typeof i||i!==o&&!i.endsWith(r)&&(n||i!==e&&!i.endsWith(a))?null:t}:function(i,s){return"string"!=typeof i||i!==o&&(n||i!==e)?null:t};return l.allPaths=[(i?"*/":"./")+e],l}function E(e,t,i){return!(!e||"string"!=typeof t)&&function(e,t={}){if(!e)return S;if("string"==typeof e||function(e){const t=e;return t&&"string"==typeof t.base&&"string"==typeof t.pattern}(e)){const i=L(e,t);if(i===x)return S;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return function(e,t){const i=O(Object.getOwnPropertyNames(e).map((i=>function(e,t,i){if(!1===t)return x;const n=L(e,i);if(n===x)return x;if("boolean"==typeof t)return n;if(t){const i=t.when;if("string"==typeof i){const t=(t,o,s,r)=>{if(!r||!n(t,o))return null;const l=r(i.replace("$(basename)",s));return Object(a.j)(l)?l.then((t=>t?e:null)):l?e:null};return t.requiresSiblings=!0,t}}return n}(i,e[i],t))).filter((e=>e!==x))),n=i.length;if(!n)return x;if(!i.some((e=>!!e.requiresSiblings))){if(1===n)return i[0];const e=function(e,t){for(let n=0,o=i.length;n!!e.allBasenames));t&&(e.allBasenames=t.allBasenames);const o=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return o.length&&(e.allPaths=o),e}const o=function(e,t,n){let o;for(let r=0,a=i.length;r!!e.allBasenames));r&&(o.allBasenames=r.allBasenames);const l=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return l.length&&(o.allPaths=l),o}(e,t)}(e)(t,void 0,i)}function O(e,t){const i=e.filter((e=>!!e.basenames));if(i.length<2)return e;const n=i.reduce(((e,t)=>{const i=t.basenames;return i?e.concat(i):e}),[]);let o;if(t){o=[];for(let e=0,i=n.length;e{const i=t.patterns;return i?e.concat(i):e}),[]);const s=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){const t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substr(i)}const i=n.indexOf(t);return-1!==i?o[i]:null};s.basenames=n,s.patterns=o,s.allBasenames=n;const r=e.filter((e=>!e.basenames));return r.push(s),r}},function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return s}));var n=i(107);class o{constructor(e,t){this.index=e,this.remainder=t}}class s{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=Object(n.a)(e);const i=this.values,o=this.prefixSum,s=t.length;return 0!==s&&(this.values=new Uint32Array(i.length+s),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+s),this.values.set(t,e),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}changeValue(e,t){return e=Object(n.a)(e),t=Object(n.a)(t),this.values[e]!==t&&(this.values[e]=t,e-1=i.length)return!1;let s=i.length-e;return t>=s&&(t=s),0!==t&&(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalValue(){return 0===this.values.length?0:this._getAccumulatedValue(this.values.length-1)}getAccumulatedValue(e){return e<0?0:(e=Object(n.a)(e),this._getAccumulatedValue(e))}_getAccumulatedValue(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalValue();let t=0,i=this.values.length-1,n=0,s=0,r=0;for(;t<=i;)if(n=t+(i-t)/2|0,s=this.prefixSum[n],r=s-this.values[n],e=s))break;t=n+1}return new o(n,e-r)}}},function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return s}));const n=Object.prototype.hasOwnProperty;function o(e,t){for(let i in e)if(n.call(e,i)&&!1===t({key:i,value:e[i]},(function(){delete e[i]})))return}class s{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),0===i.size&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(2);class o extends n.a{constructor(e,t,i){super(),this.referenceDomElement=e,this.changeCallback=i,this.width=-1,this.height=-1,this.resizeObserver=null,this.measureReferenceDomElementToken=-1,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this.width}getHeight(){return this.height}startObserving(){"undefined"!=typeof ResizeObserver?!this.resizeObserver&&this.referenceDomElement&&(this.resizeObserver=new ResizeObserver((e=>{e&&e[0]&&e[0].contentRect?this.observe({width:e[0].contentRect.width,height:e[0].contentRect.height}):this.observe()})),this.resizeObserver.observe(this.referenceDomElement)):-1===this.measureReferenceDomElementToken&&(this.measureReferenceDomElementToken=setInterval((()=>this.observe()),100))}stopObserving(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),-1!==this.measureReferenceDomElementToken&&(clearInterval(this.measureReferenceDomElementToken),this.measureReferenceDomElementToken=-1)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this.referenceDomElement&&(i=this.referenceDomElement.clientWidth,n=this.referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),this.width===i&&this.height===n||(this.width=i,this.height=n,e&&this.changeCallback())}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));class n{constructor(e,t,i,n,o,s){this.id=e,this.label=t,this.alias=i,this._precondition=n,this._run=o,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(){return this.isSupported()?this._run():Promise.resolve(void 0)}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i(19);function o(e){let t=e.definition;for(;t instanceof n.b;)t=t.definition;return`.codicon-${e.id}:before { content: '${t.fontCharacter}'; }`}},function(e,t,i){"use strict";i.d(t,"a",(function(){return l}));var n,o=i(13),s=i(149);const r=null===(n=window.trustedTypes)||void 0===n?void 0:n.createPolicy("defaultWorkerFactory",{createScriptURL:e=>e});class a{constructor(e,t,i,n,s){this.id=t;const a=function(e,t){if(o.b.MonacoEnvironment){if("function"==typeof o.b.MonacoEnvironment.getWorker)return o.b.MonacoEnvironment.getWorker(e,t);if("function"==typeof o.b.MonacoEnvironment.getWorkerUrl){const i=o.b.MonacoEnvironment.getWorkerUrl(e,t);return new Worker(r?r.createScriptURL(i):i,{name:t})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}("workerMain.js",i);"function"==typeof a.then?this.worker=a:this.worker=Promise.resolve(a),this.postMessage(e,[]),this.worker.then((e=>{e.onmessage=function(e){n(e.data)},e.onmessageerror=s,"function"==typeof e.addEventListener&&e.addEventListener("error",s)}))}getId(){return this.id}postMessage(e,t){this.worker&&this.worker.then((i=>i.postMessage(e,t)))}dispose(){this.worker&&this.worker.then((e=>e.terminate())),this.worker=null}}class l{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){let n=++l.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new a(e,n,this._label||"anonymous"+n,t,(e=>{Object(s.b)(e),this._webWorkerFailedBeforeError=e,i(e)}))}}l.LAST_WORKER_ID=0},function(e,t,i){e.exports=function(){"use strict";function e(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}var n=function(e){var t={exports:{}};return e(t,t.exports),t.exports}((function(e){function t(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.exports={defaults:{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:t,changeDefaults:function(t){e.exports.defaults=t}}})),o=/[&<>"']/,s=/[&<>"']/g,r=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(e){return l[e]};var c=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(c,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var u=/(^|[^\[])\^/g;var g=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var p={},f=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,b=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(e,t){p[" "+e]||(f.test(e)?p[" "+e]=e+"/":p[" "+e]=C(e,"/",!0));var i=-1===(e=p[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(_,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(b,"$1")+t:e+t}function C(e,t,i){var n=e.length;if(0===n)return"";for(var o=0;o=0&&"\\"===i[o];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(i.length>t)i.splice(t);else for(;i.length1;)1&t&&(i+=e),t>>=1,e+=e;return i+e},T=n.defaults,M=N,A=D,R=w,P=E;function F(e,t,i){var n=t.href,o=t.title?R(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:i,href:n,title:o,text:s}:{type:"image",raw:i,href:n,title:o,text:R(s)}}var W=function(){function e(e){this.options=e||T}var t=e.prototype;return t.space=function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e){var t=this.rules.block.code.exec(e);if(t){var i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:M(i,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var i=t[0],n=function(e,t){var i=e.match(/^(\s+)(?:```)/);if(null===i)return t;var n=i[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=n.length?e.slice(n.length):e})).join("\n")}(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var i=t[2].trim();if(/#$/.test(i)){var n=M(i,"#");this.options.pedantic?i=n.trim():n&&!/ $/.test(n)||(i=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i}}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var i={type:"table",header:A(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(i.header.length===i.align.length){var n,o=i.align.length;for(n=0;n ?/gm,"");return{type:"blockquote",raw:t[0],text:i}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){var i,n,o,s,r,a,l,h,c=t[0],d=t[2],u=d.length>1,g={type:"list",raw:c,ordered:u,start:u?+d.slice(0,-1):"",loose:!1,items:[]},m=t[0].match(this.rules.block.item),p=!1,f=m.length;o=this.rules.block.listItemStart.exec(m[0]);for(var _=0;_o[1].length:s[1].length>o[0].length||s[1].length>3){m.splice(_,2,m[_]+"\n"+m[_+1]),_--,f--;continue}(!this.options.pedantic||this.options.smartLists?s[2][s[2].length-1]!==d[d.length-1]:u===(1===s[2].length))&&(r=m.slice(_+1).join("\n"),g.raw=g.raw.substring(0,g.raw.length-r.length),_=f-1),o=s}n=i.length,~(i=i.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(n-=i.length,i=this.options.pedantic?i.replace(/^ {1,4}/gm,""):i.replace(new RegExp("^ {1,"+n+"}","gm"),"")),a=p||/\n\n(?!\s*$)/.test(i),_!==f-1&&(p="\n"===i.charAt(i.length-1),a||(a=p)),a&&(g.loose=!0),this.options.gfm&&(h=void 0,(l=/^\[[ xX]\] /.test(i))&&(h=" "!==i[1],i=i.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:c,task:l,checked:h,loose:a,text:i})}return g}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):R(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var i={type:"table",header:A(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=t[0];var n,o=i.align.length;for(n=0;n/i.test(n[0])&&(t=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:t,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):R(n[0]):n[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var i=t[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;var n=M(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var o=P(t[2],"()");if(o>-1){var s=(0===t[0].indexOf("!")?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,s).trim(),t[3]=""}}var r=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^$/.test(i)?r.slice(1):r.slice(1,-1)),F(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0])}},t.reflink=function(e,t){var i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var n=(i[2]||i[1]).replace(/\s+/g," ");if(!(n=t[n.toLowerCase()])||!n.href){var o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return F(i,n,i[0])}},t.emStrong=function(e,t,i){void 0===i&&(i="");var n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!i.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var o=n[1]||n[2]||"";if(!o||o&&(""===i||this.rules.inline.punctuation.exec(i))){var s,r,a=n[0].length-1,l=a,h=0,c="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+a);null!=(n=c.exec(t));)if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])if(r=s.length,n[3]||n[4])l+=r;else if(!((n[5]||n[6])&&a%3)||(a+r)%3){if(!((l-=r)>0)){if(l+h-r<=0&&!t.slice(c.lastIndex).match(c)&&(r=Math.min(r,r+l+h)),Math.min(a,r)%2)return{type:"em",raw:e.slice(0,a+n.index+r+1),text:e.slice(1,a+n.index+r)};if(Math.min(a,r)%2==0)return{type:"strong",raw:e.slice(0,a+n.index+r+1),text:e.slice(2,a+n.index+r-1)}}}else h+=r}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var i=t[2].replace(/\n/g," "),n=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return n&&o&&(i=i.substring(1,i.length-1)),i=R(i,!0),{type:"codespan",raw:t[0],text:i}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}},t.autolink=function(e,t){var i,n,o=this.rules.inline.autolink.exec(e);if(o)return n="@"===o[2]?"mailto:"+(i=R(this.options.mangle?t(o[1]):o[1])):i=R(o[1]),{type:"link",raw:o[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}},t.url=function(e,t){var i;if(i=this.rules.inline.url.exec(e)){var n,o;if("@"===i[2])o="mailto:"+(n=R(this.options.mangle?t(i[0]):i[0]));else{var s;do{s=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(s!==i[0]);n=R(i[0]),o="www."===i[1]?"http://"+n:n}return{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}},t.inlineText=function(e,t,i){var n,o=this.rules.inline.text.exec(e);if(o)return n=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(o[0]):R(o[0]):o[0]:R(this.options.smartypants?i(o[0]):o[0]),{type:"text",raw:o[0],text:n}},e}(),B=L,j=S,V=k,H={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:B,table:B,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};H.def=j(H.def).replace("label",H._label).replace("title",H._title).getRegex(),H.bullet=/(?:[*+-]|\d{1,9}[.)])/,H.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,H.item=j(H.item,"gm").replace(/bull/g,H.bullet).getRegex(),H.listItemStart=j(/^( *)(bull)/).replace("bull",H.bullet).getRegex(),H.list=j(H.list).replace(/bull/g,H.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+H.def.source+")").getRegex(),H._tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",H._comment=/|$)/,H.html=j(H.html,"i").replace("comment",H._comment).replace("tag",H._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),H.paragraph=j(H._paragraph).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.blockquote=j(H.blockquote).replace("paragraph",H.paragraph).getRegex(),H.normal=V({},H),H.gfm=V({},H.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),H.gfm.nptable=j(H.gfm.nptable).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.gfm.table=j(H.gfm.table).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.pedantic=V({},H.normal,{html:j("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",H._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:B,paragraph:j(H.normal._paragraph).replace("hr",H.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",H.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:B,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_]*?\*[^_]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^*]*?\_[^*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:B,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};z.punctuation=j(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,z.escapedEmSt=/\\\*|\\_/g,z._comment=j(H._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),z.emStrong.lDelim=j(z.emStrong.lDelim).replace(/punct/g,z._punctuation).getRegex(),z.emStrong.rDelimAst=j(z.emStrong.rDelimAst,"g").replace(/punct/g,z._punctuation).getRegex(),z.emStrong.rDelimUnd=j(z.emStrong.rDelimUnd,"g").replace(/punct/g,z._punctuation).getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,z.autolink=j(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=j(z.tag).replace("comment",z._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=j(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=j(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=j(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=V({},z),z.pedantic=V({},z.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:j(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=V({},z.normal,{escape:j(z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}var Q=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||K,this.options.tokenizer=this.options.tokenizer||new W,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:$.normal,inline:q.normal};this.options.pedantic?(t.block=$.pedantic,t.inline=q.pedantic):this.options.gfm&&(t.block=$.gfm,this.options.breaks?t.inline=q.breaks:t.inline=q.gfm),this.tokenizer.rules=t}t.lex=function(e,i){return new t(i).lex(e)},t.lexInline=function(e,i){return new t(i).inlineTokens(e)};var i,n,o,s=t.prototype;return s.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},s.blockTokens=function(e,t,i){var n,o,s,r;for(void 0===t&&(t=[]),void 0===i&&(i=!0),this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),n.type&&t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),(r=t[t.length-1])&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text):t.push(n);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.nptable(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),n.tokens=this.blockTokens(n.text,[],i),t.push(n);else if(n=this.tokenizer.list(e)){for(e=e.substring(n.raw.length),s=n.items.length,o=0;o0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(h));)c.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,r.index)+"["+G("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,r.index)+"["+G("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,r.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(l=""),a=!1,o=this.tokenizer.escape(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.tag(e,i,n)){e=e.substring(o.raw.length),i=o.inLink,n=o.inRawBlock;var d=t[t.length-1];d&&"text"===o.type&&"text"===d.type?(d.raw+=o.raw,d.text+=o.text):t.push(o)}else if(o=this.tokenizer.link(e))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,n)),t.push(o);else if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);var u=t[t.length-1];"link"===o.type?(o.tokens=this.inlineTokens(o.text,[],!0,n),t.push(o)):u&&"text"===o.type&&"text"===u.type?(u.raw+=o.raw,u.text+=o.text):t.push(o)}else if(o=this.tokenizer.emStrong(e,h,l))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],i,n),t.push(o);else if(o=this.tokenizer.codespan(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.br(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.del(e))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],i,n),t.push(o);else if(o=this.tokenizer.autolink(e,Z))e=e.substring(o.raw.length),t.push(o);else if(i||!(o=this.tokenizer.url(e,Z))){if(o=this.tokenizer.inlineText(e,n,Y))e=e.substring(o.raw.length),"_"!==o.raw.slice(-1)&&(l=o.raw.slice(-1)),a=!0,(s=t[t.length-1])&&"text"===s.type?(s.raw+=o.raw,s.text+=o.text):t.push(o);else if(e){var g="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(g);break}throw new Error(g)}}else e=e.substring(o.raw.length),t.push(o);return t},i=t,o=[{key:"rules",get:function(){return{block:$,inline:q}}}],(n=null)&&e(i.prototype,n),o&&e(i,o),t}(),X=n.defaults,J=x,ee=w,te=function(){function e(e){this.options=e||X}var t=e.prototype;return t.code=function(e,t,i){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var o=this.options.highlight(e,n);null!=o&&o!==e&&(i=!0,e=o)}return e=e.replace(/\n$/,"")+"\n",n?'
'+(i?e:ee(e,!0))+"
\n":"
"+(i?e:ee(e,!0))+"
\n"},t.blockquote=function(e){return"
\n"+e+"
\n"},t.html=function(e){return e},t.heading=function(e,t,i,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},t.hr=function(){return this.options.xhtml?"
\n":"
\n"},t.list=function(e,t,i){var n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"},t.listitem=function(e){return"
  • "+e+"
  • \n"},t.checkbox=function(e){return" "},t.paragraph=function(e){return"

    "+e+"

    \n"},t.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},t.tablerow=function(e){return"\n"+e+"\n"},t.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
    ":"
    "},t.del=function(e){return""+e+""},t.link=function(e,t,i){if(null===(e=J(this.options.sanitize,this.options.baseUrl,e)))return i;var n='"+i+""},t.image=function(e,t,i){if(null===(e=J(this.options.sanitize,this.options.baseUrl,e)))return i;var n=''+i+'":">")},t.text=function(e){return e},e}(),ie=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,i){return""+i},t.image=function(e,t,i){return""+i},t.br=function(){return""},e}(),ne=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{i=e+"-"+ ++n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i},t.slug=function(e,t){void 0===t&&(t={});var i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)},e}(),oe=n.defaults,se=y,re=function(){function e(e){this.options=e||oe,this.options.renderer=this.options.renderer||new te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ie,this.slugger=new ne}e.parse=function(t,i){return new e(i).parse(t)},e.parseInline=function(t,i){return new e(i).parseInline(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var i,n,o,s,r,a,l,h,c,d,u,g,m,p,f,_,b,v,C="",w=e.length;for(i=0;i0&&"text"===f.tokens[0].type?(f.tokens[0].text=v+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&"text"===f.tokens[0].tokens[0].type&&(f.tokens[0].tokens[0].text=v+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:v}):p+=v),p+=this.parse(f.tokens,m),c+=this.renderer.listitem(p,b,_);C+=this.renderer.list(c,u,g);continue;case"html":C+=this.renderer.html(d.text);continue;case"paragraph":C+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(c=d.tokens?this.parseInline(d.tokens):d.text;i+1An error occurred:

    "+he(e.message+"",!0)+"
    ";throw e}}return ge.options=ge.setOptions=function(e){return ae(ge.defaults,e),de(ge.defaults),ge},ge.getDefaults=ce,ge.defaults=ue,ge.use=function(e){var t=ae({},e);if(e.renderer&&function(){var i=ge.defaults.renderer||new te,n=function(t){var n=i[t];i[t]=function(){for(var o=arguments.length,s=new Array(o),r=0;rAn error occurred:

    "+he(e.message+"",!0)+"
    ";throw e}},ge.Parser=re,ge.parser=re.parse,ge.Renderer=te,ge.TextRenderer=ie,ge.Lexer=Q,ge.lexer=Q.lex,ge.Tokenizer=W,ge.Slugger=ne,ge.parse=ge,ge}()},function(e,t,i){e.exports=i(33)(448)},function(e,t,i){"use strict";t.extend=function(e){var t,i,o,s,r=Array.prototype.slice.call(arguments,1);for(t=0,i=r.length;t{const t=new u.a(e.positionLineNumber,e.positionColumn),i=this._move(n,o,t,this._wordNavigationType);return this._moveTo(e,i,this._inSelectionMode)}));if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,s.map((e=>h.d.fromModelSelection(e)))),1===s.length){const e=new u.a(s[0].positionLineNumber,s[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,i){return i?new m.a(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new m.a(t.lineNumber,t.column,t.lineNumber,t.column)}}class y extends w{_move(e,t,i,n){return c.a.moveWordLeft(e,t,i,n)}}class S extends w{_move(e,t,i,n){return c.a.moveWordRight(e,t,i,n)}}class x extends a.c{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Object(d.a)(t.getOption(113)),o=t.getModel(),s=t.getSelections(),r=t.getOption(5),a=t.getOption(8),h=v.a.getAutoClosingPairs(o.getLanguageIdentifier().id),c=t._getViewModel(),u=s.map((e=>{const i=this._delete({wordSeparators:n,model:o,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(6),autoClosingBrackets:r,autoClosingQuotes:a,autoClosingPairs:h,autoClosedCharacters:c.getCursorAutoClosedCharacters()},this._wordNavigationType);return new l.a(i,"")}));t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class L extends x{_delete(e,t){return c.a.deleteWordLeft(e,t)||new g.a(1,1,1,1)}}class k extends x{_delete(e,t){let i=c.a.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new g.a(n,o,n,o)}}class D extends a.b{constructor(){super({id:"deleteInsideWord",precondition:p.a.writable,label:r.a("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=Object(d.a)(t.getOption(113)),o=t.getModel(),s=t.getSelections().map((e=>{const t=c.a.deleteInsideWord(n,o,e);return new l.a(t,"")}));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}Object(a.i)(new class extends y{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}),Object(a.i)(new class extends y{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}),Object(a.i)(new class extends y{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:_.a.and(p.a.textInputFocus,null===(e=_.a.and(f.a,C.b))||void 0===e?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}),Object(a.i)(new class extends y{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}),Object(a.i)(new class extends y{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}),Object(a.i)(new class extends y{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:_.a.and(p.a.textInputFocus,null===(e=_.a.and(f.a,C.b))||void 0===e?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}),Object(a.i)(new class extends S{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}),Object(a.i)(new class extends S{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:_.a.and(p.a.textInputFocus,null===(e=_.a.and(f.a,C.b))||void 0===e?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}),Object(a.i)(new class extends S{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}),Object(a.i)(new class extends S{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}),Object(a.i)(new class extends S{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:_.a.and(p.a.textInputFocus,null===(e=_.a.and(f.a,C.b))||void 0===e?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}),Object(a.i)(new class extends S{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}),Object(a.i)(new class extends y{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n){return super._move(Object(d.a)(b.g.wordSeparators.defaultValue),t,i,n)}}),Object(a.i)(new class extends y{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n){return super._move(Object(d.a)(b.g.wordSeparators.defaultValue),t,i,n)}}),Object(a.i)(new class extends S{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n){return super._move(Object(d.a)(b.g.wordSeparators.defaultValue),t,i,n)}}),Object(a.i)(new class extends S{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n){return super._move(Object(d.a)(b.g.wordSeparators.defaultValue),t,i,n)}}),Object(a.i)(new class extends L{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:p.a.writable})}}),Object(a.i)(new class extends L{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:p.a.writable})}}),Object(a.i)(new class extends L{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:p.a.writable,kbOpts:{kbExpr:p.a.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}),Object(a.i)(new class extends k{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:p.a.writable})}}),Object(a.i)(new class extends k{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:p.a.writable})}}),Object(a.i)(new class extends k{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:p.a.writable,kbOpts:{kbExpr:p.a.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}),Object(a.h)(D);var N=i(42),E=i(6),O=i(70);class I{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){let i=function(e,t){t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column-t.column:e.lineNumber-t.lineNumber));for(let e=t.length-2;e>=0;e--)t[e].lineNumber===t[e+1].lineNumber&&t.splice(e,1);let i=[],n=0,o=0,s=t.length;for(let r=1,a=e.getLineCount();r<=a;r++){let a=e.getLineContent(r),l=a.length+1,h=0;if(oe.getLineTokens(t),getLanguageIdentifier:()=>e.getLanguageIdentifier(),getLanguageIdAtPosition:(t,i)=>e.getLanguageIdAtPosition(t,i),getLineContent:null};if(n.startLineNumber===n.endLineNumber&&1===e.getLineMaxColumn(n.startLineNumber)){let i=n.startLineNumber,o=this._isMovingDown?i+1:i-1;1===e.getLineMaxColumn(o)?t.addEditOperation(new g.a(1,1,1,1),null):(t.addEditOperation(new g.a(i,1,i,1),e.getLineContent(o)),t.addEditOperation(new g.a(o,1,o,e.getLineMaxColumn(o)),null)),n=new m.a(o,1,o,1)}else{let i,s;if(this._isMovingDown){i=n.endLineNumber+1,s=e.getLineContent(i),t.addEditOperation(new g.a(i-1,e.getLineMaxColumn(i-1),i,e.getLineMaxColumn(i)),null);let h=s;if(this.shouldAutoIndent(e,n)){let c=this.matchEnterRule(e,a,o,i,n.startLineNumber-1);if(null!==c){let t=F(c+P(E.x(e.getLineContent(i)),o),o,r);h=t+this.trimLeft(s)}else{l.getLineContent=t=>t===n.startLineNumber?e.getLineContent(i):e.getLineContent(t);let t=v.a.getGoodIndentForLine(this._autoIndent,l,e.getLanguageIdAtPosition(i,1),n.startLineNumber,a);if(null!==t){let n=E.x(e.getLineContent(i)),a=P(t,o);if(a!==P(n,o)){let e=F(a,o,r);h=e+this.trimLeft(s)}}}t.addEditOperation(new g.a(n.startLineNumber,1,n.startLineNumber,1),h+"\n");let d=this.matchEnterRuleMovingDown(e,a,o,n.startLineNumber,i,h);if(null!==d)0!==d&&this.getIndentEditsOfMovingBlock(e,t,n,o,r,d);else{l.getLineContent=t=>t===n.startLineNumber?h:t>=n.startLineNumber+1&&t<=n.endLineNumber+1?e.getLineContent(t-1):e.getLineContent(t);let s=v.a.getGoodIndentForLine(this._autoIndent,l,e.getLanguageIdAtPosition(i,1),n.startLineNumber+1,a);if(null!==s){const i=E.x(e.getLineContent(n.startLineNumber)),a=P(s,o),l=P(i,o);if(a!==l){const i=a-l;this.getIndentEditsOfMovingBlock(e,t,n,o,r,i)}}}}else t.addEditOperation(new g.a(n.startLineNumber,1,n.startLineNumber,1),h+"\n")}else if(i=n.startLineNumber-1,s=e.getLineContent(i),t.addEditOperation(new g.a(i,1,i+1,1),null),t.addEditOperation(new g.a(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),"\n"+s),this.shouldAutoIndent(e,n)){l.getLineContent=t=>t===i?e.getLineContent(n.startLineNumber):e.getLineContent(t);let s=this.matchEnterRule(e,a,o,n.startLineNumber,n.startLineNumber-2);if(null!==s)0!==s&&this.getIndentEditsOfMovingBlock(e,t,n,o,r,s);else{let s=v.a.getGoodIndentForLine(this._autoIndent,l,e.getLanguageIdAtPosition(n.startLineNumber,1),i,a);if(null!==s){let i=E.x(e.getLineContent(n.startLineNumber)),a=P(s,o),l=P(i,o);if(a!==l){let i=a-l;this.getIndentEditsOfMovingBlock(e,t,n,o,r,i)}}}}}this._selectionId=t.trackSelection(n)}buildIndentConverter(e,t,i){return{shiftIndent:n=>A.a.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>A.a.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,o){if(o){let s=o.indentation;o.indentAction===R.b.None||o.indentAction===R.b.Indent?s=o.indentation+o.appendText:o.indentAction===R.b.IndentOutdent?s=o.indentation:o.indentAction===R.b.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);let r=e.getLineContent(n);if(this.trimLeft(r).indexOf(this.trimLeft(s))>=0){let o=E.x(e.getLineContent(n)),r=E.x(s),a=v.a.getIndentMetadata(e,n);return null!==a&&2&a&&(r=t.unshiftIndent(r)),P(r,i)-P(o,i)}}return null}matchEnterRuleMovingDown(e,t,i,n,o,s){if(E.H(s)>=0){let s=e.getLineMaxColumn(o),r=v.a.getEnterAction(this._autoIndent,e,new g.a(o,s,o,s));return this.parseEnterResult(e,t,i,n,r)}{let o=n-1;for(;o>=1;){let t=e.getLineContent(o);if(E.H(t)>=0)break;o--}if(o<1||n>e.getLineCount())return null;let s=e.getLineMaxColumn(o),r=v.a.getEnterAction(this._autoIndent,e,new g.a(o,s,o,s));return this.parseEnterResult(e,t,i,n,r)}}matchEnterRule(e,t,i,n,o,s){let r=o;for(;r>=1;){let t;if(t=r===o&&void 0!==s?s:e.getLineContent(r),E.H(t)>=0)break;r--}if(r<1||n>e.getLineCount())return null;let a=e.getLineMaxColumn(r),l=v.a.getEnterAction(this._autoIndent,e,new g.a(r,a,r,a));return this.parseEnterResult(e,t,i,n,l)}trimLeft(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4)return!1;if(!e.isCheapToTokenize(t.startLineNumber))return!1;let i=e.getLanguageIdAtPosition(t.startLineNumber,1);return i===e.getLanguageIdAtPosition(t.endLineNumber,1)&&null!==v.a.getIndentRulesSupport(i)}getIndentEditsOfMovingBlock(e,t,i,n,o,s){for(let r=i.startLineNumber;r<=i.endLineNumber;r++){let a=e.getLineContent(r),l=E.x(a),h=F(P(l,n)+s,n,o);h!==l&&(t.addEditOperation(new g.a(r,1,r,l.length+1),h),r===i.endLineNumber&&i.endColumn<=l.length+1&&""===h&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber=o)return null;let s=[];for(let t=n;t<=o;t++)s.push(e.getLineContent(t));let r=s.slice(0);return r.sort(B.getCollator().compare),!0===i&&(r=r.reverse()),{startLineNumber:n,endLineNumber:o,before:s,after:r}}B._COLLATOR=null;var V=i(28);class H extends a.b{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map(((e,t)=>({selection:e,index:t,ignore:!1})));i.sort(((e,t)=>g.a.compareRangesUsingStarts(e.selection,t.selection)));let n=i[0];for(let e=1;enew u.a(e.positionLineNumber,e.positionColumn))));let o=t.getSelection();if(null===o)return;let s=new I(o,n);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}$.ID="editor.action.trimTrailingWhitespace";class q extends a.b{constructor(){super({id:"editor.action.deleteLines",label:r.a("lines.delete","Delete Line"),alias:"Delete Line",precondition:p.a.writable,kbOpts:{kbExpr:p.a.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;let i=this._getLinesToRemove(t),n=t.getModel();if(1===n.getLineCount()&&1===n.getLineMaxColumn(1))return;let o=0,s=[],r=[];for(let e=0,t=i.length;e1&&(a-=1,h=n.getLineMaxColumn(a)),s.push(O.a.replace(new m.a(a,h,l,c),"")),r.push(new m.a(a-o,t.positionColumn,a-o,t.positionColumn)),o+=t.endLineNumber-t.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,r),t.pushUndoStop()}_getLinesToRemove(e){let t=e.getSelections().map((e=>{let t=e.endLineNumber;return e.startLineNumbere.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber));let i=[],n=t[0];for(let e=1;e=t[e].startLineNumber?n.endLineNumber=t[e].endLineNumber:(i.push(n),n=t[e]);return i.push(n),i}}class G extends a.b{constructor(){super({id:"editor.action.indentLines",label:r.a("lines.indent","Indent Line"),alias:"Indent Line",precondition:p.a.writable,kbOpts:{kbExpr:p.a.editorTextFocus,primary:2137,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,T.a.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class Y extends a.b{constructor(){super({id:"editor.action.outdentLines",label:r.a("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:p.a.writable,kbOpts:{kbExpr:p.a.editorTextFocus,primary:2135,weight:100}})}run(e,t){o.a.Outdent.runEditorCommand(e,t,null)}}class Z extends a.b{constructor(){super({id:"editor.action.insertLineBefore",label:r.a("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:p.a.writable,kbOpts:{kbExpr:p.a.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,T.a.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class Q extends a.b{constructor(){super({id:"editor.action.insertLineAfter",label:r.a("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:p.a.writable,kbOpts:{kbExpr:p.a.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,T.a.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class X extends a.b{run(e,t){if(!t.hasModel())return;const i=t.getSelection();let n=this._getRangesToDelete(t),o=[];for(let e=0,t=n.length-1;eO.a.replace(e,"")));t.pushUndoStop(),t.executeEdits(this.id,r,s),t.pushUndoStop()}}class J extends a.b{constructor(){super({id:"editor.action.joinLines",label:r.a("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:p.a.writable,kbOpts:{kbExpr:p.a.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){let i=t.getSelections();if(null===i)return;let n=t.getSelection();if(null===n)return;i.sort(g.a.compareRangesUsingStarts);let o=[],s=i.reduce(((e,t)=>e.isEmpty()?e.endLineNumber===t.startLineNumber?(n.equalsSelection(e)&&(n=t),t):t.startLineNumber>e.endLineNumber+1?(o.push(e),t):new m.a(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn):t.startLineNumber>e.endLineNumber?(o.push(e),t):new m.a(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)));o.push(s);let r=t.getModel();if(null===r)return;let a=[],l=[],h=n,c=0;for(let e=0,t=o.length;e=1){let e=!0;""===_&&(e=!1),!e||" "!==_.charAt(_.length-1)&&"\t"!==_.charAt(_.length-1)||(e=!1,_=_.replace(/[\s\uFEFF\xA0]+$/g," "));let n=t.substr(i-1);_+=(e?" ":"")+n,p=e?n.length+1:n.length}else p=0}let b=new g.a(d,u,t,i);if(!b.isEmpty()){let e;s.isEmpty()?(a.push(O.a.replace(b,_)),e=new m.a(b.startLineNumber-c,_.length-p+1,d-c,_.length-p+1)):s.startLineNumber===s.endLineNumber?(a.push(O.a.replace(b,_)),e=new m.a(s.startLineNumber-c,s.startColumn,s.endLineNumber-c,s.endColumn)):(a.push(O.a.replace(b,_)),e=new m.a(s.startLineNumber-c,s.startColumn,s.startLineNumber-c,_.length-f)),null!==g.a.intersectRanges(b,n)?h=e:l.push(e)}c+=b.endLineNumber-b.startLineNumber}l.unshift(h),t.pushUndoStop(),t.executeEdits(this.id,a,l),t.pushUndoStop()}}class ee extends a.b{constructor(){super({id:"editor.action.transpose",label:r.a("editor.transpose","Transpose characters around the cursor"),alias:"Transpose characters around the cursor",precondition:p.a.writable})}run(e,t){let i=t.getSelections();if(null===i)return;let n=t.getModel();if(null===n)return;let o=[];for(let e=0,t=i.length;e=r){if(s.lineNumber===n.getLineCount())continue;let e=new g.a(s.lineNumber,Math.max(1,s.column-1),s.lineNumber+1,1),t=n.getValueInRange(e).split("").reverse().join("");o.push(new l.a(new m.a(s.lineNumber,Math.max(1,s.column-1),s.lineNumber+1,1),t))}else{let e=new g.a(s.lineNumber,Math.max(1,s.column-1),s.lineNumber,s.column+1),t=n.getValueInRange(e).split("").reverse().join("");o.push(new l.b(e,t,new m.a(s.lineNumber,s.column+1,s.lineNumber,s.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class te extends a.b{run(e,t){const i=t.getSelections();if(null===i)return;const n=t.getModel();if(null===n)return;const o=t.getOption(113),s=[];for(const e of i)if(e.isEmpty()){const i=e.getStartPosition(),r=t.getConfiguredWordAtPosition(i);if(!r)continue;const a=new g.a(i.lineNumber,r.startColumn,i.lineNumber,r.endColumn),l=n.getValueInRange(a);s.push(O.a.replace(a,this._modifyText(l,o)))}else{const t=n.getValueInRange(e);s.push(O.a.replace(e,this._modifyText(t,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class ie{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch(e){}}return this._actual}isSupported(){return null!==this.get()}}class ne extends te{constructor(){super({id:"editor.action.transformToSnakecase",label:r.a("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:p.a.writable})}_modifyText(e,t){const i=ne.regExp1.get(),n=ne.regExp2.get();return i&&n?e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase():e}}ne.regExp1=new ie("(\\p{Ll})(\\p{Lu})","gmu"),ne.regExp2=new ie("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu"),Object(a.h)(class extends H{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:r.a("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:p.a.writable,kbOpts:{kbExpr:p.a.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:V.b.MenubarSelectionMenu,group:"2_line",title:r.a({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}),Object(a.h)(class extends H{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:r.a("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:p.a.writable,kbOpts:{kbExpr:p.a.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:V.b.MenubarSelectionMenu,group:"2_line",title:r.a({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}),Object(a.h)(z),Object(a.h)(class extends U{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:r.a("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:p.a.writable,kbOpts:{kbExpr:p.a.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:V.b.MenubarSelectionMenu,group:"2_line",title:r.a({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}),Object(a.h)(class extends U{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:r.a("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:p.a.writable,kbOpts:{kbExpr:p.a.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:V.b.MenubarSelectionMenu,group:"2_line",title:r.a({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}),Object(a.h)(class extends K{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:r.a("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:p.a.writable})}}),Object(a.h)(class extends K{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:r.a("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:p.a.writable})}}),Object(a.h)($),Object(a.h)(q),Object(a.h)(G),Object(a.h)(Y),Object(a.h)(Z),Object(a.h)(Q),Object(a.h)(class extends X{constructor(){super({id:"deleteAllLeft",label:r.a("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:p.a.writable,kbOpts:{kbExpr:p.a.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null,n=[],o=0;return t.forEach((t=>{let s;if(1===t.endColumn&&o>0){let e=t.startLineNumber-o;s=new m.a(e,t.startColumn,e,t.startColumn)}else s=new m.a(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn);o+=t.endLineNumber-t.startLineNumber,t.intersectRanges(e)?i=s:n.push(s)})),i&&n.unshift(i),n}_getRangesToDelete(e){let t=e.getSelections();if(null===t)return[];let i=t,n=e.getModel();return null===n?[]:(i.sort(g.a.compareRangesUsingStarts),i=i.map((e=>{if(e.isEmpty()){if(1===e.startColumn){let t=Math.max(1,e.startLineNumber-1),i=1===e.startLineNumber?1:n.getLineContent(t).length+1;return new g.a(t,i,e.startLineNumber,1)}return new g.a(e.startLineNumber,1,e.startLineNumber,e.startColumn)}return new g.a(e.startLineNumber,1,e.endLineNumber,e.endColumn)})),i)}}),Object(a.h)(class extends X{constructor(){super({id:"deleteAllRight",label:r.a("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:p.a.writable,kbOpts:{kbExpr:p.a.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null,n=[];for(let o=0,s=t.length,r=0;o{if(e.isEmpty()){const i=t.getLineMaxColumn(e.startLineNumber);return e.startColumn===i?new g.a(e.startLineNumber,e.startColumn,e.startLineNumber+1,1):new g.a(e.startLineNumber,e.startColumn,e.startLineNumber,i)}return e}));return n.sort(g.a.compareRangesUsingStarts),n}}),Object(a.h)(J),Object(a.h)(ee),Object(a.h)(class extends te{constructor(){super({id:"editor.action.transformToUppercase",label:r.a("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:p.a.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}),Object(a.h)(class extends te{constructor(){super({id:"editor.action.transformToLowercase",label:r.a("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:p.a.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}),Object(a.h)(class extends te{constructor(){super({id:"editor.action.transformToTitlecase",label:r.a("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:p.a.writable})}_modifyText(e,t){const i=("\r\n\t "+t).split("");let n="",o=!0;for(let t=0;t=0?(o=!0,n+=s):o?(o=!1,n+=s.toLocaleUpperCase()):n+=s.toLocaleLowerCase()}return n}}),ne.regExp1.isSupported()&&ne.regExp2.isSupported()&&Object(a.h)(ne);var oe=i(14),se=i(21),re=i(2),ae=i(5);const le=16777215,he=4278190080;class ce{constructor(e,t,i){if(e.length!==t.length||e.length>65535)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new Uint32Array(Math.ceil(e.length/32)),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;let e=[],t=(t,i)=>{let n=e[e.length-1];return this.getStartLineNumber(n)<=t&&this.getEndLineNumber(n)>=i};for(let i=0,n=this._startIndexes.length;ile||o>le)throw new Error("startLineNumber or endLineNumber must not exceed "+le);for(;e.length>0&&!t(n,o);)e.pop();let s=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=n+((255&s)<<24),this._endIndexes[i]=o+((65280&s)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&le}getEndLineNumber(e){return this._endIndexes[e]&le}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){let t=e/32|0,i=e%32;return 0!=(this._collapseStates[t]&1<>>24)+((this._endIndexes[e]&he)>>>16);return 65535===t?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(0===i)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);-1!==t;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){let e=[];for(let t=0;t=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class ue{constructor(e,t){this._updateEventEmitter=new ae.a,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new ce(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[],this._isInitialized=!1}get regions(){return this._regions}get textModel(){return this._textModel}get isInitialized(){return this._isInitialized}toggleCollapseState(e){if(!e.length)return;e=e.sort(((e,t)=>e.regionIndex-t.regionIndex));const t={};this._decorationProvider.changeDecorations((i=>{let n=0,o=-1,s=-1;const r=e=>{for(;ns&&(s=e),n++}};for(let i of e){let e=i.regionIndex,n=this._editorDecorationIds[e];if(n&&!t[n]){t[n]=!0,r(e);let i=!this._regions.isCollapsed(e);this._regions.setCollapsed(e,i),o=Math.max(o,this._regions.getEndLineNumber(e))}}r(this._regions.length)})),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}update(e,t=[]){let i=[],n=-1,o=(o,s)=>{const r=e.getStartLineNumber(o),a=e.getEndLineNumber(o);s&&((e,i)=>{for(let n of t)if(en&&(n=a)},s=0,r=()=>{for(;s=t))break;o(a,i===t),a++}}l=r()}for(;a0)return e}applyMemento(e){if(!Array.isArray(e))return;let t=[];for(let i of e){let e=this.getRegionAtLine(i.startLineNumber);e&&!e.isCollapsed&&t.push(e)}this.toggleCollapseState(t)}dispose(){this._decorationProvider.deltaDecorations(this._editorDecorationIds,[])}getAllRegionsAtLine(e,t){let i=[];if(this._regions){let n=this._regions.findRange(e),o=1;for(;n>=0;){let e=this._regions.toRegion(n);t&&!t(e,o)||i.push(e),o++,n=e.parentIndex}}return i}getRegionAtLine(e){if(this._regions){let t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){let i=[],n=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&2===t.length){const e=[];for(let s=n,r=this._regions.length;s0&&!n.containedBy(e[e.length-1]);)e.pop();e.push(n),t(n,e.length)&&i.push(n)}}else for(let e=n,s=this._regions.length;e0)for(let s of n){let n=e.getRegionAtLine(s);if(n&&(n.isCollapsed!==t&&o.push(n),i>1)){let s=e.getRegionsInside(n,((e,n)=>e.isCollapsed!==t&&ne.isCollapsed!==t&&ne.isCollapsed!==t&&n<=i));o.push(...n)}e.toggleCollapseState(o)}function pe(e,t,i){let n=[];for(let t of i)n.push(e.getAllRegionsAtLine(t,void 0)[0]);let o=e.getRegionsInside(null,(e=>n.every((t=>!t.containedBy(e)&&!e.containedBy(t)))&&e.isCollapsed!==t));e.toggleCollapseState(o)}function fe(e,t,i){let n=e.textModel,o=e.regions,s=[];for(let e=o.length-1;e>=0;e--)if(i!==o.isCollapsed(e)){let i=o.getStartLineNumber(e);t.test(n.getLineContent(i))&&s.push(o.toRegion(e))}e.toggleCollapseState(s)}function _e(e,t,i){let n=e.regions,o=[];for(let e=n.length-1;e>=0;e--)i!==n.isCollapsed(e)&&t===n.getType(e)&&o.push(n.toRegion(e));e.toggleCollapseState(o)}var be=i(39),ve=i(19),Ce=i(77),we=i(17);const ye=Object(Ce.b)("folding-expanded",ve.b.chevronDown,Object(r.a)("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),Se=Object(Ce.b)("folding-collapsed",ve.b.chevronRight,Object(r.a)("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin."));class xe{constructor(e){this.editor=e,this.autoHideFoldingControls=!0,this.showFoldingHighlights=!0}getDecorationOption(e,t){return t?xe.HIDDEN_RANGE_DECORATION:e?this.showFoldingHighlights?xe.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:xe.COLLAPSED_VISUAL_DECORATION:this.autoHideFoldingControls?xe.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:xe.EXPANDED_VISUAL_DECORATION}deltaDecorations(e,t){return this.editor.deltaDecorations(e,t)}changeDecorations(e){return this.editor.changeDecorations(e)}}xe.COLLAPSED_VISUAL_DECORATION=be.a.register({stickiness:1,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:we.d.asClassName(Se)}),xe.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=be.a.register({stickiness:1,afterContentClassName:"inline-folded",className:"folded-background",isWholeLine:!0,firstLineDecorationClassName:we.d.asClassName(Se)}),xe.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=be.a.register({stickiness:1,isWholeLine:!0,firstLineDecorationClassName:we.d.asClassName(ye)}),xe.EXPANDED_VISUAL_DECORATION=be.a.register({stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+we.d.asClassName(ye)}),xe.HIDDEN_RANGE_DECORATION=be.a.register({stickiness:1});var Le=i(20);class ke{constructor(e){this._updateEventEmitter=new ae.a,this._foldingModel=e,this._foldingModelListener=e.onDidChange((e=>this.updateHiddenRanges())),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}updateHiddenRanges(){let e=!1,t=[],i=0,n=0,o=Number.MAX_VALUE,s=-1,r=this._foldingModel.regions;for(;i({startLineNumber:e.startLineNumber-1,endLineNumber:e.endLineNumber})))}applyHiddenRanges(e){this._hiddenRanges=e,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return null!==De(this._hiddenRanges,e)}adjustSelections(e){let t=!1,i=this._foldingModel.textModel,n=null,o=e=>(n&&function(e,t){return e>=t.startLineNumber&&e<=t.endLineNumber}(e,n)||(n=De(this._hiddenRanges,e)),n?n.startLineNumber-1:null);for(let n=0,s=e.length;n0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function De(e,t){let i=Object(Le.h)(e,(e=>t=0&&e[i].endLineNumber>=t?e[i]:null}class Ne{constructor(e){this.editorModel=e,this.id="indent"}dispose(){}compute(e){let t=v.a.getFoldingRules(this.editorModel.getLanguageIdentifier().id),i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(function(e,t,i,n=5e3){const o=e.getOptions().tabSize;let s,r=new Ee(n);i&&(s=new RegExp(`(${i.start.source})|(?:${i.end.source})`));let a=[],l=e.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let i=e.getLineCount();i>0;i--){let n,l=e.getLineContent(i),h=be.b.computeIndentLevel(l,o),c=a[a.length-1];if(-1!==h){if(s&&(n=l.match(s))){if(!n[1]){a.push({indent:-2,endAbove:i,line:i});continue}{let e=a.length-1;for(;e>0&&-2!==a[e].indent;)e--;if(e>0){a.length=e+1,c=a[e],r.insertFirst(i,c.line,h),c.line=i,c.indent=h,c.endAbove=i;continue}}}if(c.indent>h){do{a.pop(),c=a[a.length-1]}while(c.indent>h);let e=c.endAbove-1;e-i>=1&&r.insertFirst(i,e,h)}c.indent===h?c.endAbove=i:a.push({indent:h,endAbove:i,line:i})}else t&&(c.endAbove=i)}return r.toIndentRanges(e)}(this.editorModel,i,n))}}class Ee{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>le||t>le)return;let n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){if(this._length<=this._foldingRangesLimit){let e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=this._length-1,n=0;i>=0;i--,n++)e[n]=this._startIndexes[i],t[n]=this._endIndexes[i];return new ce(e,t)}{let t=0,i=this._indentOccurrences.length;for(let e=0;ethis._foldingRangesLimit){i=e;break}t+=n}}const n=e.getOptions().tabSize;let o=new Uint32Array(this._foldingRangesLimit),s=new Uint32Array(this._foldingRangesLimit);for(let r=this._length-1,a=0;r>=0;r--){let l=this._startIndexes[r],h=e.getLineContent(l),c=be.b.computeIndentLevel(h,n);(cPromise.resolve(e.provideFoldingRanges(t,Te,i)).then((e=>{if(!i.isCancellationRequested&&Array.isArray(e)){Array.isArray(n)||(n=[]);let i=t.getLineCount();for(let t of e)t.start>0&&t.end>t.start&&t.end<=i&&n.push({start:t.start,end:t.end,rank:o,kind:t.kind})}}),Ie.f)));return Promise.all(o).then((e=>n))}(this.providers,this.editorModel,e).then((e=>e?Pe(e,this.limit):null))}dispose(){var e;null===(e=this.disposables)||void 0===e||e.dispose()}}class Re{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>le||t>le)return;let o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=n,this._types[o]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||0)+1)}toIndentRanges(){if(this._length<=this._foldingRangesLimit){let e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=0;ithis._foldingRangesLimit){t=i;break}e+=n}}let i=new Uint32Array(this._foldingRangesLimit),n=new Uint32Array(this._foldingRangesLimit),o=[];for(let s=0,r=0;s{let i=e.start-t.start;return 0===i&&(i=e.rank-t.rank),i})),o=new Re(t),s=[];for(let e of n)if(i){if(e.start>i.start)if(e.end<=i.end)s.push(i),i=e,o.add(e.start,e.end,e.kind&&e.kind.value,s.length);else{if(e.start>i.end){do{i=s.pop()}while(i&&e.start>i.end);i&&s.push(i),i=e}o.add(e.start,e.end,e.kind&&e.kind.value,s.length)}}else i=e,o.add(e.start,e.end,e.kind&&e.kind.value,s.length);return o.toIndentRanges()}const Fe="init";class We{constructor(e,t,i,n){if(this.editorModel=e,this.id=Fe,t.length){let o=t=>({range:{startLineNumber:t.startLineNumber,startColumn:0,endLineNumber:t.endLineNumber,endColumn:e.getLineLength(t.endLineNumber)},options:{stickiness:1}});this.decorationIds=e.deltaDecorations([],t.map(o)),this.timeout=setTimeout(i,n)}}dispose(){this.decorationIds&&(this.editorModel.deltaDecorations(this.decorationIds,[]),this.decorationIds=void 0),"number"==typeof this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)}compute(e){let t=[];if(this.decorationIds)for(let e of this.decorationIds){let i=this.editorModel.getDecorationRange(e);i&&t.push({start:i.startLineNumber,end:i.endLineNumber,rank:1})}return Promise.resolve(Pe(t,Number.MAX_VALUE))}}var Be=i(4);const je=new _.c("foldingEnabled",!1);let Ve=class e extends re.a{constructor(e,t){super(),this.contextKeyService=t,this.localToDispose=this._register(new re.b),this.editor=e;const i=this.editor.getOptions();this._isEnabled=i.get(35),this._useFoldingProviders="indentation"!==i.get(36),this._unfoldOnClickAfterEndOfLine=i.get(38),this._restoringViewState=!1,this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingStateMemento=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new xe(e),this.foldingDecorationProvider.autoHideFoldingControls="mouseover"===i.get(96),this.foldingDecorationProvider.showFoldingHighlights=i.get(37),this.foldingEnabled=je.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel((()=>this.onModelChanged()))),this._register(this.editor.onDidChangeConfiguration((e=>{if(e.hasChanged(35)&&(this._isEnabled=this.editor.getOptions().get(35),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),e.hasChanged(96)||e.hasChanged(37)){const e=this.editor.getOptions();this.foldingDecorationProvider.autoHideFoldingControls="mouseover"===e.get(96),this.foldingDecorationProvider.showFoldingHighlights=e.get(37),this.onModelContentChanged()}e.hasChanged(36)&&(this._useFoldingProviders="indentation"!==this.editor.getOptions().get(36),this.onFoldingStrategyChanged()),e.hasChanged(38)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(38))}))),this.onModelChanged()}static get(t){return t.getContribution(e.ID)}saveViewState(){let e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){let t=this.foldingModel.isInitialized?this.foldingModel.getMemento():this.hiddenRangeModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i}}}restoreViewState(e){let t=this.editor.getModel();if(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)return;if(!e||!e.collapsedRegions||e.lineCount!==t.getLineCount())return;e.provider!==Me&&e.provider!==Fe||(this.foldingStateMemento=e);const i=e.collapsedRegions;if(this.hiddenRangeModel.applyMemento(i)){const e=this.getFoldingModel();e&&e.then((e=>{if(e){this._restoringViewState=!0;try{e.applyMemento(i)}finally{this._restoringViewState=!1}}})).then(void 0,Ie.e)}}onModelChanged(){this.localToDispose.clear();let e=this.editor.getModel();this._isEnabled&&e&&!e.isTooLargeForTokenization()&&(this.foldingModel=new ue(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new ke(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange((e=>this.onHiddenRangesChanges(e)))),this.updateScheduler=new se.a(200),this.cursorChangedScheduler=new se.e((()=>this.revealCursor()),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(Oe.n.onDidChange((()=>this.onFoldingStrategyChanged()))),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration((()=>this.onFoldingStrategyChanged()))),this.localToDispose.add(this.editor.onDidChangeModelContent((()=>this.onModelContentChanged()))),this.localToDispose.add(this.editor.onDidChangeCursorPosition((()=>this.onCursorPositionChanged()))),this.localToDispose.add(this.editor.onMouseDown((e=>this.onEditorMouseDown(e)))),this.localToDispose.add(this.editor.onMouseUp((e=>this.onEditorMouseUp(e)))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler&&this.updateScheduler.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.foldingStateMemento=null,this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null}}),this.onModelContentChanged())}onFoldingStrategyChanged(){this.rangeProvider&&this.rangeProvider.dispose(),this.rangeProvider=null,this.onModelContentChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;if(this.rangeProvider=new Ne(e),this._useFoldingProviders&&this.foldingModel){let t=Oe.n.ordered(this.foldingModel.textModel);if(0===t.length&&this.foldingStateMemento&&this.foldingStateMemento.collapsedRegions)return this.rangeProvider=new We(e,this.foldingStateMemento.collapsedRegions,(()=>{this.foldingStateMemento=null,this.onFoldingStrategyChanged()}),3e4);t.length>0&&(this.rangeProvider=new Ae(e,t,(()=>this.onModelContentChanged())))}return this.foldingStateMemento=null,this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onModelContentChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger((()=>{const e=this.foldingModel;if(!e)return null;let t=this.foldingRegionPromise=Object(se.h)((t=>this.getRangeProvider(e.textModel).compute(t)));return t.then((i=>{if(i&&t===this.foldingRegionPromise){let t=this.editor.getSelections(),n=t?t.map((e=>e.startLineNumber)):[];e.update(i,n)}return e}))})).then(void 0,(e=>(Object(Ie.e)(e),null))))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){let e=this.editor.getSelections();e&&this.hiddenRangeModel.adjustSelections(e)&&this.editor.setSelections(e)}this.editor.setHiddenAreas(e)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then((e=>{if(e){let t=this.editor.getSelections();if(t&&t.length>0){let i=[];for(let n of t){let t=n.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(t)&&i.push(...e.getAllRegionsAtLine(t,(e=>e.isCollapsed&&t>e.startLineNumber)))}i.length&&(e.toggleCollapseState(i),this.reveal(t[0].getPosition()))}}})).then(void 0,Ie.e)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range)return;if(!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:const n=e.target.detail,o=e.target.element.offsetLeft;if(n.offsetX-o<5)return;i=!0;break;case 7:if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return;case 6:if(this.hiddenRangeModel.hasRanges()){let e=this.editor.getModel();if(e&&t.startColumn===e.getLineMaxColumn(t.startLineNumber))break}return;default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.getFoldingModel();if(!t||!this.mouseDownInfo||!e.target)return;let i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,o=e.target.range;if(o&&o.startLineNumber===i){if(n){if(4!==e.target.type)return}else{let e=this.editor.getModel();if(!e||o.startColumn!==e.getLineMaxColumn(i))return}t.then((t=>{if(t){let o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){let s=o.isCollapsed;if(n||s){let n=[];if(e.event.altKey){let e=e=>!e.containedBy(o)&&!o.containedBy(e),i=t.getRegionsInside(null,e);for(const e of i)e.isCollapsed&&n.push(e);0===n.length&&(n=i)}else{let i=e.event.middleButton||e.event.shiftKey;if(i)for(const e of t.getRegionsInside(o))e.isCollapsed===s&&n.push(e);!s&&i&&0!==n.length||n.push(o)}t.toggleCollapseState(n),this.reveal({lineNumber:i,column:1})}}}})).then(void 0,Ie.e)}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};var He,ze;Ve.ID="editor.contrib.folding",Ve=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([(He=1,ze=_.b,function(e,t){ze(e,t,He)})],Ve);class Ue extends a.b{runEditorCommand(e,t,i){let n=Ve.get(t);if(!n)return;let o=n.getFoldingModel();return o?(this.reportTelemetry(e,t),o.then((e=>{if(e){this.invoke(n,e,t,i);const o=t.getSelection();o&&n.reveal(o.getStartPosition())}}))):void 0}getSelectedLines(e){let t=e.getSelections();return t?t.map((e=>e.startLineNumber)):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map((e=>e+1)):this.getSelectedLines(t)}run(e,t){}}function Ke(e){if(!oe.k(e)){if(!oe.i(e))return!1;const t=e;if(!oe.k(t.levels)&&!oe.h(t.levels))return!1;if(!oe.k(t.direction)&&!oe.j(t.direction))return!1;if(!(oe.k(t.selectionLines)||oe.e(t.selectionLines)&&t.selectionLines.every(oe.h)))return!1}return!0}class $e extends Ue{getFoldingLevel(){return parseInt(this.id.substr($e.ID_PREFIX.length))}invoke(e,t,i){!function(e,t,i,n){let o=e.getRegionsInside(null,((e,i)=>i===t&&true!==e.isCollapsed&&!n.some((t=>e.containsLine(t)))));e.toggleCollapseState(o)}(t,this.getFoldingLevel(),0,this.getSelectedLines(i))}}$e.ID_PREFIX="editor.foldLevel",$e.ID=e=>$e.ID_PREFIX+e,Object(a.j)(Ve.ID,Ve),Object(a.h)(class extends Ue{constructor(){super({id:"editor.unfold",label:r.a("unfoldAction.label","Unfold"),alias:"Unfold",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:3161,mac:{primary:2649},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t* 'levels': Number of levels to unfold. If not set, defaults to 1.\n\t\t\t\t\t\t* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n\t\t\t\t\t\t* 'selectionLines': The start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t",constraint:Ke,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){let o=n&&n.levels||1,s=this.getLineNumbers(n,i);n&&"up"===n.direction?me(t,!1,o,s):ge(t,!1,o,s)}}),Object(a.h)(class extends Ue{constructor(){super({id:"editor.unfoldRecursively",label:r.a("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2137),weight:100}})}invoke(e,t,i,n){ge(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}),Object(a.h)(class extends Ue{constructor(){super({id:"editor.fold",label:r.a("foldAction.label","Fold"),alias:"Fold",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:3159,mac:{primary:2647},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t\t* 'levels': Number of levels to fold.\n\t\t\t\t\t\t\t* 'direction': If 'up', folds given number of levels up otherwise folds down.\n\t\t\t\t\t\t\t* 'selectionLines': The start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t\tIf no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n\t\t\t\t\t\t",constraint:Ke,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){let o=this.getLineNumbers(n,i);const s=n&&n.levels,r=n&&n.direction;"number"!=typeof s&&"string"!=typeof r?function(e,t,i){let n=[];for(let t of i){let i=e.getAllRegionsAtLine(t,(e=>true!==e.isCollapsed));i.length>0&&n.push(i[0])}e.toggleCollapseState(n)}(t,0,o):"up"===r?me(t,!0,s||1,o):ge(t,!0,s||1,o)}}),Object(a.h)(class extends Ue{constructor(){super({id:"editor.foldRecursively",label:r.a("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2135),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);ge(t,!0,Number.MAX_VALUE,n)}}),Object(a.h)(class extends Ue{constructor(){super({id:"editor.foldAll",label:r.a("foldAllAction.label","Fold All"),alias:"Fold All",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2069),weight:100}})}invoke(e,t,i){ge(t,!0)}}),Object(a.h)(class extends Ue{constructor(){super({id:"editor.unfoldAll",label:r.a("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2088),weight:100}})}invoke(e,t,i){ge(t,!1)}}),Object(a.h)(class extends Ue{constructor(){super({id:"editor.foldAllBlockComments",label:r.a("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2133),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())_e(t,Oe.m.Comment.value,!0);else{const e=i.getModel();if(!e)return;let n=v.a.getComments(e.getLanguageIdentifier().id);n&&n.blockCommentStartToken&&fe(t,new RegExp("^\\s*"+Object(E.t)(n.blockCommentStartToken)),!0)}}}),Object(a.h)(class extends Ue{constructor(){super({id:"editor.foldAllMarkerRegions",label:r.a("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2077),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())_e(t,Oe.m.Region.value,!0);else{const e=i.getModel();if(!e)return;let n=v.a.getFoldingRules(e.getLanguageIdentifier().id);n&&n.markers&&n.markers.start&&fe(t,new RegExp(n.markers.start),!0)}}}),Object(a.h)(class extends Ue{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:r.a("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2078),weight:100}})}invoke(e,t,i){if(t.regions.hasTypes())_e(t,Oe.m.Region.value,!1);else{const e=i.getModel();if(!e)return;let n=v.a.getFoldingRules(e.getLanguageIdentifier().id);n&&n.markers&&n.markers.start&&fe(t,new RegExp(n.markers.start),!1)}}}),Object(a.h)(class extends Ue{constructor(){super({id:"editor.foldAllExcept",label:r.a("foldAllExcept.label","Fold All Regions Except Selected"),alias:"Fold All Regions Except Selected",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2131),weight:100}})}invoke(e,t,i){pe(t,!0,this.getSelectedLines(i))}}),Object(a.h)(class extends Ue{constructor(){super({id:"editor.unfoldAllExcept",label:r.a("unfoldAllExcept.label","Unfold All Regions Except Selected"),alias:"Unfold All Regions Except Selected",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2129),weight:100}})}invoke(e,t,i){pe(t,!1,this.getSelectedLines(i))}}),Object(a.h)(class extends Ue{constructor(){super({id:"editor.toggleFold",label:r.a("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2090),weight:100}})}invoke(e,t,i){!function(e,t,i){let n=[];for(let t of i){let i=e.getRegionAtLine(t);if(i){i.isCollapsed;n.push(i),0}}e.toggleCollapseState(n)}(t,0,this.getSelectedLines(i))}});for(let e=1;e<=7;e++)Object(a.k)(new $e({id:$e.ID(e),label:r.a("foldLevelAction.label","Fold Level {0}",e),alias:`Fold Level ${e}`,precondition:je,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2048|21+e),weight:100}}));const qe=Object(Be.ac)("editor.foldBackground",{light:Object(Be.nc)(Be.K,.3),dark:Object(Be.nc)(Be.K,.3),hc:null},r.a("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0),Ge=Object(Be.ac)("editorGutter.foldingControlForeground",{dark:Be.U,light:Be.U,hc:Be.U},r.a("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));Object(we.f)(((e,t)=>{const i=e.getColor(qe);i&&t.addRule(`.monaco-editor .folded-background { background-color: ${i}; }`);const n=e.getColor(Ge);n&&t.addRule(`\n\t\t.monaco-editor .cldr${we.d.asCSSSelector(ye)},\n\t\t.monaco-editor .cldr${we.d.asCSSSelector(Se)} {\n\t\t\tcolor: ${n} !important;\n\t\t}\n\t\t`)}));var Ye=i(69),Ze=i(94),Qe=i(31),Xe=i(65);class Je{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return 95===e||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let e,t=this.pos,i=0,n=this.value.charCodeAt(t);if(e=Je._table[n],"number"==typeof e)return this.pos+=1,{type:e,pos:t,len:1};if(Je.isDigitCharacter(n)){e=8;do{i+=1,n=this.value.charCodeAt(t+i)}while(Je.isDigitCharacter(n));return this.pos+=i,{type:e,pos:t,len:i}}if(Je.isVariableCharacter(n)){e=9;do{n=this.value.charCodeAt(t+ ++i)}while(Je.isVariableCharacter(n)||Je.isDigitCharacter(n));return this.pos+=i,{type:e,pos:t,len:i}}e=10;do{i+=1,n=this.value.charCodeAt(t+i)}while(!isNaN(n)&&void 0===Je._table[n]&&!Je.isDigitCharacter(n)&&!Je.isVariableCharacter(n));return this.pos+=i,{type:e,pos:t,len:i}}}Je._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class et{constructor(){this._children=[]}appendChild(e){return e instanceof tt&&this._children[this._children.length-1]instanceof tt?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,function e(t,i){for(const n of t)n.parent=i,e(n.children,n)}(t,i)}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof ht)return e;e=e.parent}}toString(){return this.children.reduce(((e,t)=>e+t.toString()),"")}len(){return 0}}class tt extends et{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new tt(this.value)}}class it extends et{}class nt extends it{constructor(e){super(),this.index=e}static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}get isFinalTabstop(){return 0===this.index}get choice(){return 1===this._children.length&&this._children[0]instanceof ot?this._children[0]:void 0}clone(){let e=new nt(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}class ot extends et{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof tt&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let e=new ot;return this.options.forEach(e.appendChild,e),e}}class st extends et{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,(function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))}));return!i&&this._children.some((e=>e instanceof rt&&Boolean(e.elseValue)))&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof rt){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){let e=new st;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map((e=>e.clone())),e}}class rt extends et{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return"upcase"===this.shorthandName?e?e.toLocaleUpperCase():"":"downcase"===this.shorthandName?e?e.toLocaleLowerCase():"":"capitalize"===this.shorthandName?e?e[0].toLocaleUpperCase()+e.substr(1):"":"pascalcase"===this.shorthandName?e?this._toPascalCase(e):"":Boolean(e)&&"string"==typeof this.ifValue?this.ifValue:Boolean(e)||"string"!=typeof this.elseValue?e||"":this.elseValue}_toPascalCase(e){const t=e.match(/[a-z]+/gi);return t?t.map((function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})).join(""):e}clone(){return new rt(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class at extends it{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),void 0!==t&&(this._children=[new tt(t)],!0)}clone(){const e=new at(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}function lt(e,t){const i=[...e];for(;i.length>0;){const e=i.shift();if(!t(e))break;i.unshift(...e.children)}}class ht extends et{get placeholderInfo(){if(!this._placeholders){let e,t=[];this.walk((function(i){return i instanceof nt&&(t.push(i),e=!e||e.indexn===e?(i=!0,!1):(t+=n.len(),!0))),i?t:-1}fullLen(e){let t=0;return lt([e],(e=>(t+=e.len(),!0))),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof nt&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk((t=>(t instanceof at&&t.resolve(e)&&(this._placeholders=void 0),!0))),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let e=new ht;return this._children=this.children.map((e=>e.clone())),e}walk(e){lt(this.children,e)}}class ct{constructor(){this._scanner=new Je,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){this._scanner.text(e),this._token=this._scanner.next();const n=new ht;for(;this._parse(n););const o=new Map,s=[];let r=0;n.walk((e=>(e instanceof nt&&(r+=1,e.isFinalTabstop?o.set(0,void 0):!o.has(e.index)&&e.children.length>0?o.set(e.index,e.children):s.push(e)),!0)));for(const e of s){const t=o.get(e.index);if(t){const i=new nt(e.index);i.transform=e.transform;for(const e of t)i.appendChild(e.clone());n.replace(e,[i])}}return i||(i=r>0&&t),!o.has(0)&&i&&n.appendChild(new nt(0)),n}_accept(e,t){if(void 0===e||this._token.type===e){let e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(14===this._token.type)return!1;if(5===this._token.type){const e=this._scanner.next();if(0!==e.type&&4!==e.type&&5!==e.type)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return!!(t=this._accept(5,!0))&&(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new tt(t)),!0)}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new nt(Number(t)):new at(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const n=new nt(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new tt("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else{if(!(n.index>0&&this._accept(7)))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);{const t=new ot;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(n.appendChild(t),this._accept(4)))return e.appendChild(n),!0}return this._backTo(i),!1}}}}_parseChoiceElement(e){const t=this._token,i=[];for(;2!==this._token.type&&7!==this._token.type;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;i.push(e)}return 0===i.length?(this._backTo(t),!1):(e.appendChild(new tt(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const n=new at(t);if(!this._accept(1))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new tt("${"+t+":")),n.children.forEach(e.appendChild,e),!0}}_parseTransform(e){let t=new st,i="",n="";for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,i+=e;else{if(14===this._token.type)return!1;i+=this._accept(void 0,!0)}}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new tt(e));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}for(;!this._accept(4);){if(14===this._token.type)return!1;n+=this._accept(void 0,!0)}try{t.regexp=new RegExp(i,n)}catch(e){return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);let n=this._accept(8,!0);if(!n)return this._backTo(t),!1;if(!i)return e.appendChild(new rt(Number(n))),!0;if(this._accept(4))return e.appendChild(new rt(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let i=this._accept(9,!0);return i&&this._accept(4)?(e.appendChild(new rt(Number(n),i)),!0):(this._backTo(t),!1)}if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new rt(Number(n),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new rt(Number(n),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let i=this._until(4);if(i)return e.appendChild(new rt(Number(n),void 0,t,i)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new rt(Number(n),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return 14!==this._token.type&&(e.appendChild(new tt(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}}var dt=i(105),ut=i(27),gt=i(22),mt=i(91),pt=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ft={Visible:new _.c("suggestWidgetVisible",!1,Object(r.a)("suggestWidgetVisible","Whether suggestion are visible")),DetailsVisible:new _.c("suggestWidgetDetailsVisible",!1,Object(r.a)("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new _.c("suggestWidgetMultipleSuggestions",!1,Object(r.a)("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new _.c("suggestionMakesTextEdit",!0,Object(r.a)("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new _.c("acceptSuggestionOnEnter",!0,Object(r.a)("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new _.c("suggestionHasInsertAndReplaceRange",!1,Object(r.a)("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new _.c("suggestionInsertMode",void 0,{type:"string",description:Object(r.a)("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new _.c("suggestionCanResolve",!1,Object(r.a)("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},_t=new V.b("suggestWidgetStatusBar");class bt{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=Xe.a.Default,this.distance=0,this.textLabel="string"==typeof t.label?t.label:t.label.name,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),g.a.isIRange(t.range)?(this.editStart=new u.a(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new u.a(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new u.a(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||g.a.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new u.a(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new u.a(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new u.a(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||g.a.spansMultipleLines(t.range.insert)||g.a.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),"function"!=typeof n.resolveCompletionItem&&(this._resolveCache=Promise.resolve(),this._isResolved=!0)}get isResolved(){return!!this._isResolved}resolve(e){return pt(this,void 0,void 0,(function*(){if(!this._resolveCache){const t=e.onCancellationRequested((()=>{this._resolveCache=void 0,this._isResolved=!1}));this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then((e=>{Object.assign(this.completion,e),this._isResolved=!0,t.dispose()}),(e=>{Object(Ie.d)(e)&&(this._resolveCache=void 0,this._isResolved=!1)}))}return this._resolveCache}))}}class vt{constructor(e=2,t=new Set,i=new Set){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i}}let Ct;vt.default=new vt;class wt{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}function yt(e,t,i=vt.default,n={triggerKind:0},o=Qe.a.None){return pt(this,void 0,void 0,(function*(){const s=new dt.a(!0);t=t.clone();const r=e.getWordAtPosition(t),a=r?new g.a(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):g.a.fromPositions(t),l={replace:a,insert:a.setEndPosition(t.lineNumber,t.column)},h=[],c=new re.b,d=[];let u=!1;const m=(e,n,o)=>{var s,r;if(n){for(let o of n.suggestions)i.kindFilter.has(o.kind)||(o.range||(o.range=l),o.sortText||(o.sortText="string"==typeof o.label?o.label:o.label.name),!u&&o.insertTextRules&&4&o.insertTextRules&&(u=ct.guessNeedsClipboard(o.insertText)),h.push(new bt(t,o,n,e)));Object(re.g)(n)&&c.add(n),d.push({providerName:null!==(s=e._debugDisplayName)&&void 0!==s?s:"unkown_provider",elapsedProvider:null!==(r=n.duration)&&void 0!==r?r:-1,elapsedOverall:o.elapsed()})}},p=(()=>pt(this,void 0,void 0,(function*(){if(!Ct||i.kindFilter.has(27))return;if(i.providerFilter.size>0&&!i.providerFilter.has(Ct))return;const s=new dt.a(!0),r=yield Ct.provideCompletionItems(e,t,n,o);m(Ct,r,s)})))();for(let s of Oe.d.orderedGroups(e)){let r=h.length;if(yield Promise.all(s.map((s=>pt(this,void 0,void 0,(function*(){if(!(i.providerFilter.size>0)||i.providerFilter.has(s))try{const i=new dt.a(!0),r=yield s.provideCompletionItems(e,t,n,o);m(s,r,i)}catch(e){Object(Ie.f)(e)}}))))),r!==h.length||o.isCancellationRequested)break}return yield p,o.isCancellationRequested?(c.dispose(),Promise.reject(Object(Ie.a)())):new wt(h.sort(Lt(i.snippetSortOrder)),u,{entries:d,elapsed:s.elapsed()},c)}))}function St(e,t){if(e.sortTextLow&&t.sortTextLow){if(e.sortTextLowt.sortTextLow)return 1}return e.completion.labelt.completion.label?1:e.completion.kind-t.completion.kind}const xt=new Map;function Lt(e){return xt.get(e)}xt.set(0,(function(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return St(e,t)})),xt.set(2,(function(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return St(e,t)})),xt.set(1,St),ut.a.registerCommand("_executeCompletionItemProvider",((e,...t)=>pt(void 0,void 0,void 0,(function*(){const[i,n,o,s]=t;Object(oe.b)(gt.a.isUri(i)),Object(oe.b)(u.a.isIPosition(n)),Object(oe.b)("string"==typeof o||!o),Object(oe.b)("number"==typeof s||!s);const r=yield e.get(mt.a).createModelReference(i);try{const e={incomplete:!1,suggestions:[]},t=[],i=yield yt(r.object.textEditorModel,u.a.lift(n),void 0,{triggerCharacter:o,triggerKind:o?1:0});for(const n of i.items)t.length<(null!=s?s:0)&&t.push(n.resolve(Qe.a.None)),e.incomplete=e.incomplete||n.container.incomplete,e.suggestions.push(n.completion);try{return yield Promise.all(t),e}finally{setTimeout((()=>i.disposable.dispose()),100)}}finally{r.dispose()}}))));const kt=new class{constructor(){this.onlyOnceSuggestions=[]}provideCompletionItems(){let e={suggestions:this.onlyOnceSuggestions.slice(0)};return this.onlyOnceSuggestions.length=0,e}};Oe.d.register("*",kt);var Dt=i(73),Nt=i(157),Et=i(15),Ot=i(50),It=i(41);const Tt="code-workspace";function Mt(e){const t=e;return"string"==typeof(null==t?void 0:t.id)&>.a.isUri(t.uri)}var At=i(34),Rt=i(13),Pt=i(147);function Ft(e){if(!e)return;"string"==typeof e&&(e=gt.a.file(e));const t=Object(It.b)(e)||(e.scheme===At.c.file?e.fsPath:e.path);return Rt.j&&Object(Pt.c)(t)?Wt(t):t}function Wt(e){return Object(Pt.a)(e)?e.charAt(0).toUpperCase()+e.slice(1):e}const Bt=new Uint8Array(16),jt=[];for(let e=0;e<256;e++)jt.push(e.toString(16).padStart(2,"0"));let Vt;Vt="object"==typeof crypto&&"function"==typeof crypto.getRandomValues?crypto.getRandomValues.bind(crypto):function(e){for(let t=0;tt!==e&&(t instanceof tt&&(o=Object(E.x)(Object(E.P)(t.value).pop())),!0)));const s=Object(E.d)(o,n);t=t.replace(/(\r\n|\r|\n)(.*)/g,((e,t,i)=>`${t}${o.substr(s)}${i}`))}return t}if("TM_CURRENT_LINE"===t)return this._model.getLineContent(this._selection.positionLineNumber);if("TM_CURRENT_WORD"===t){const e=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return e&&e.word||void 0}return"TM_LINE_INDEX"===t?String(this._selection.positionLineNumber-1):"TM_LINE_NUMBER"===t?String(this._selection.positionLineNumber):void 0}}class Ut{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if("TM_FILENAME"===t)return Ot.a(this._model.uri.fsPath);if("TM_FILENAME_BASE"===t){const e=Ot.a(this._model.uri.fsPath),t=e.lastIndexOf(".");return t<=0?e:e.slice(0,t)}return"TM_DIRECTORY"===t&&this._labelService?"."===Ot.b(this._model.uri.fsPath)?"":this._labelService.getUriLabel(Object(It.d)(this._model.uri)):"TM_FILEPATH"===t&&this._labelService?this._labelService.getUriLabel(this._model.uri):"RELATIVE_FILEPATH"===t&&this._labelService?this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0}):void 0}}class Kt{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if("CLIPBOARD"!==e.name)return;const t=this._readClipboardText();if(t){if(this._spread){const e=t.split(/\r\n|\n|\r/).filter((e=>!Object(E.B)(e)));if(e.length===this._selectionCount)return e[this._selectionIdx]}return t}}}class $t{constructor(e,t){this._model=e,this._selection=t}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=v.a.getComments(i);if(n)return"LINE_COMMENT"===t?n.lineCommentToken||void 0:"BLOCK_COMMENT_START"===t?n.blockCommentStartToken||void 0:"BLOCK_COMMENT_END"===t&&n.blockCommentEndToken||void 0}}class qt{resolve(e){const{name:t}=e;return"CURRENT_YEAR"===t?String((new Date).getFullYear()):"CURRENT_YEAR_SHORT"===t?String((new Date).getFullYear()).slice(-2):"CURRENT_MONTH"===t?String((new Date).getMonth().valueOf()+1).padStart(2,"0"):"CURRENT_DATE"===t?String((new Date).getDate().valueOf()).padStart(2,"0"):"CURRENT_HOUR"===t?String((new Date).getHours().valueOf()).padStart(2,"0"):"CURRENT_MINUTE"===t?String((new Date).getMinutes().valueOf()).padStart(2,"0"):"CURRENT_SECOND"===t?String((new Date).getSeconds().valueOf()).padStart(2,"0"):"CURRENT_DAY_NAME"===t?qt.dayNames[(new Date).getDay()]:"CURRENT_DAY_NAME_SHORT"===t?qt.dayNamesShort[(new Date).getDay()]:"CURRENT_MONTH_NAME"===t?qt.monthNames[(new Date).getMonth()]:"CURRENT_MONTH_NAME_SHORT"===t?qt.monthNamesShort[(new Date).getMonth()]:"CURRENT_SECONDS_UNIX"===t?String(Math.floor(Date.now()/1e3)):void 0}}qt.dayNames=[r.a("Sunday","Sunday"),r.a("Monday","Monday"),r.a("Tuesday","Tuesday"),r.a("Wednesday","Wednesday"),r.a("Thursday","Thursday"),r.a("Friday","Friday"),r.a("Saturday","Saturday")],qt.dayNamesShort=[r.a("SundayShort","Sun"),r.a("MondayShort","Mon"),r.a("TuesdayShort","Tue"),r.a("WednesdayShort","Wed"),r.a("ThursdayShort","Thu"),r.a("FridayShort","Fri"),r.a("SaturdayShort","Sat")],qt.monthNames=[r.a("January","January"),r.a("February","February"),r.a("March","March"),r.a("April","April"),r.a("May","May"),r.a("June","June"),r.a("July","July"),r.a("August","August"),r.a("September","September"),r.a("October","October"),r.a("November","November"),r.a("December","December")],qt.monthNamesShort=[r.a("JanuaryShort","Jan"),r.a("FebruaryShort","Feb"),r.a("MarchShort","Mar"),r.a("AprilShort","Apr"),r.a("MayShort","May"),r.a("JuneShort","Jun"),r.a("JulyShort","Jul"),r.a("AugustShort","Aug"),r.a("SeptemberShort","Sep"),r.a("OctoberShort","Oct"),r.a("NovemberShort","Nov"),r.a("DecemberShort","Dec")];class Gt{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=function(e){return e.configuration?{id:e.id,configPath:e.configuration}:1===e.folders.length?{id:e.id,uri:e.folders[0].uri}:void 0}(this._workspaceService.getWorkspace());return t?"WORKSPACE_NAME"===e.name?this._resolveWorkspaceName(t):"WORKSPACE_FOLDER"===e.name?this._resoveWorkspacePath(t):void 0:void 0}_resolveWorkspaceName(e){if(Mt(e))return Ot.a(e.uri.path);let t=Ot.a(e.configPath.path);return t.endsWith(Tt)&&(t=t.substr(0,t.length-Tt.length-1)),t}_resoveWorkspacePath(e){if(Mt(e))return Wt(e.uri.fsPath);let t=Ot.a(e.configPath.path),i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?Wt(i):"/"}}class Yt{resolve(e){const{name:t}=e;return"RANDOM"===t?Math.random().toString().slice(-6):"RANDOM_HEX"===t?Math.random().toString(16).slice(-6):"UUID"===t?function(){Vt(Bt),Bt[6]=15&Bt[6]|64,Bt[8]=63&Bt[8]|128;let e=0,t="";return t+=jt[Bt[e++]],t+=jt[Bt[e++]],t+=jt[Bt[e++]],t+=jt[Bt[e++]],t+="-",t+=jt[Bt[e++]],t+=jt[Bt[e++]],t+="-",t+=jt[Bt[e++]],t+=jt[Bt[e++]],t+="-",t+=jt[Bt[e++]],t+=jt[Bt[e++]],t+="-",t+=jt[Bt[e++]],t+=jt[Bt[e++]],t+=jt[Bt[e++]],t+=jt[Bt[e++]],t+=jt[Bt[e++]],t+=jt[Bt[e++]],t}():void 0}}var Zt=i(126);Object(we.f)(((e,t)=>{function i(t){const i=e.getColor(t);return i?i.toString():"transparent"}t.addRule(`.monaco-editor .snippet-placeholder { background-color: ${i(Be.ic)}; outline-color: ${i(Be.jc)}; }`),t.addRule(`.monaco-editor .finish-snippet-placeholder { background-color: ${i(Be.gc)}; outline-color: ${i(Be.hc)}; }`)}));class Qt{constructor(e,t,i,n){this._editor=e,this._snippet=t,this._offset=i,this._snippetLineLeadingWhitespace=n,this._nestingLevel=1,this._placeholderGroups=Object(Le.k)(t.placeholders,nt.compareByIndex),this._placeholderGroupsIdx=-1}dispose(){this._placeholderDecorations&&this._editor.deltaDecorations([...this._placeholderDecorations.values()],[]),this._placeholderGroups.length=0}_initDecorations(){if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations((t=>{for(const i of this._snippet.placeholders){const n=this._snippet.offset(i),o=this._snippet.fullLen(i),s=g.a.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+o)),r=i.isFinalTabstop?Qt._decor.inactiveFinal:Qt._decor.inactive,a=t.addDecoration(s,r);this._placeholderDecorations.set(i,a)}}))}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){let e=[];for(const t of this._placeholderGroups[this._placeholderGroupsIdx])if(t.transform){const i=this._placeholderDecorations.get(t),n=this._editor.getModel().getDecorationRange(i),o=this._editor.getModel().getValueInRange(n),s=t.transform.resolve(o).split(/\r\n|\r|\n/);for(let e=1;e0&&this._editor.executeEdits("snippet.placeholderTransform",e)}let t=!1;!0===e&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations((e=>{const i=new Set,n=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx]){const s=this._placeholderDecorations.get(o),r=this._editor.getModel().getDecorationRange(s);n.push(new m.a(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(o),e.changeDecorationOptions(s,o.isFinalTabstop?Qt._decor.activeFinal:Qt._decor.active),i.add(o);for(const t of this._snippet.enclosingPlaceholders(o)){const n=this._placeholderDecorations.get(t);e.changeDecorationOptions(n,t.isFinalTabstop?Qt._decor.activeFinal:Qt._decor.active),i.add(t)}}for(const[t,n]of this._placeholderDecorations)i.has(t)||e.changeDecorationOptions(n,t.isFinalTabstop?Qt._decor.inactiveFinal:Qt._decor.inactive);return n}));return t?this.move(e):null!=i?i:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof nt){const e=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(e).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||0===this._placeholderGroups.length}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const t=this._placeholderDecorations.get(n),o=this._editor.getModel().getDecorationRange(t);if(!o){e.delete(n.index);break}i.push(o)}}return e}get choice(){return this._placeholderGroups[this._placeholderGroupsIdx][0].choice}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations((i=>{for(const n of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(!o._placeholderDecorations);const s=o._snippet.placeholderInfo.last.index;for(const e of o._snippet.placeholderInfo.all)e.isFinalTabstop?e.index=n.index+(s+1)/this._nestingLevel:e.index=n.index+e.index/this._nestingLevel;this._snippet.replace(n,o._snippet.children);const r=this._placeholderDecorations.get(n);i.removeDecoration(r),this._placeholderDecorations.delete(n);for(const e of o._snippet.placeholders){const n=o._snippet.offset(e),s=o._snippet.fullLen(e),r=g.a.fromPositions(t.getPositionAt(o._offset+n),t.getPositionAt(o._offset+n+s)),a=i.addDecoration(r,Qt._decor.inactive);this._placeholderDecorations.set(e,a)}}this._placeholderGroups=Object(Le.k)(this._snippet.placeholders,nt.compareByIndex)}))}}Qt._decor={active:be.a.register({stickiness:0,className:"snippet-placeholder"}),inactive:be.a.register({stickiness:1,className:"snippet-placeholder"}),activeFinal:be.a.register({stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:be.a.register({stickiness:1,className:"finish-snippet-placeholder"})};const Xt={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};class Jt{constructor(e,t,i=Xt){this._templateMerges=[],this._snippets=[],this._editor=e,this._template=t,this._options=i}static adjustWhitespace(e,t,i,n,o){const s=e.getLineContent(t.lineNumber),r=Object(E.x)(s,0,t.column-1);let a;return i.walk((t=>{if(!(t instanceof tt)||t.parent instanceof ot)return!0;const o=t.value.split(/\r\n|\r|\n/);if(n){const n=i.offset(t);if(0===n)o[0]=e.normalizeIndentation(o[0]);else{a=null!=a?a:i.toString();let t=a.charCodeAt(n-1);10!==t&&13!==t||(o[0]=e.normalizeIndentation(r+o[0]))}for(let t=1;te.get(Nt.a,Et.d))),u=e.invokeWithinContext((e=>new Ut(e.get(Zt.a,Et.d),c))),m=()=>r;let p=0,f=c.getValueInRange(Jt.adjustSelection(c,e.getSelection(),i,0)),_=c.getValueInRange(Jt.adjustSelection(c,e.getSelection(),0,n)),b=c.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber);const v=e.getSelections().map(((e,t)=>({selection:e,idx:t}))).sort(((e,t)=>g.a.compareRangesUsingStarts(e.selection,t.selection)));for(const{selection:r,idx:g}of v){let C=Jt.adjustSelection(c,r,i,0),w=Jt.adjustSelection(c,r,0,n);f!==c.getValueInRange(C)&&(C=r),_!==c.getValueInRange(w)&&(w=r);const y=r.setStartPosition(C.startLineNumber,C.startColumn).setEndPosition(w.endLineNumber,w.endColumn),S=(new ct).parse(t,!0,o),x=y.getStartPosition(),L=Jt.adjustWhitespace(c,x,S,s||g>0&&b!==c.getLineFirstNonWhitespaceColumn(r.positionLineNumber),!0);S.resolveVariables(new Ht([u,new Kt(m,g,v.length,"spread"===e.getOption(67)),new zt(c,r,g,a),new $t(c,r),new qt,new Gt(d),new Yt]));const k=c.getOffsetAt(x)+p;p+=S.toString().length-c.getValueLengthInRange(y),l[g]=O.a.replace(y,S.toString()),l[g].identifier={major:g,minor:0},h[g]=new Qt(e,S,k,L)}return{edits:l,snippets:h}}dispose(){Object(re.f)(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=Jt.createEditsAndSnippets(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer);this._snippets=t,this._editor.executeEdits("snippet",e,(e=>this._snippets[0].hasPlaceholder?this._move(!0):e.filter((e=>!!e.identifier)).map((e=>m.a.fromPositions(e.range.getEndPosition()))))),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=Xt){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=Jt.createEditsAndSnippets(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer);this._editor.executeEdits("snippet",i,(e=>{for(const e of this._snippets)e.merge(n);return console.assert(0===n.length),this._snippets[0].hasPlaceholder?this._move(void 0):e.filter((e=>!!e.identifier)).map((e=>m.a.fromPositions(e.range.getEndPosition())))}))}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const n=i.move(e);t.push(...n)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get choice(){return this._snippets[0].choice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{e.push(...n.get(t))}))}e.sort(g.a.compareRangesUsingStarts);for(let[i,n]of t)if(n.length===e.length){n.sort(g.a.compareRangesUsingStarts);for(let o=0;o0}}var ei=function(e,t){return function(i,n){t(i,n,e)}};const ti={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let ii=class e{constructor(t,i,n){this._editor=t,this._logService=i,this._snippetListener=new re.b,this._modelVersionId=-1,this._inSnippet=e.InSnippetMode.bindTo(n),this._hasNextTabstop=e.HasNextTabstop.bindTo(n),this._hasPrevTabstop=e.HasPrevTabstop.bindTo(n)}static get(t){return t.getContribution(e.ID)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),null===(e=this._session)||void 0===e||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,void 0===t?ti:Object.assign(Object.assign({},ti),t))}catch(t){this.cancel(),this._logService.error(t),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){this._editor.hasModel()&&(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session?this._session.merge(e,t):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new Jt(this._editor,e,t),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent((e=>e.isFlush&&this.cancel()))),this._snippetListener.add(this._editor.onDidChangeModel((()=>this.cancel()))),this._snippetListener.add(this._editor.onDidChangeCursorSelection((()=>this._updateState()))))}_updateState(){if(this._session&&this._editor.hasModel()){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this.cancel();this._inSnippet.set(!0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel())return void(this._currentChoice=void 0);const{choice:e}=this._session;var t,i;if(e){if(this._currentChoice!==e){this._currentChoice=e,this._editor.setSelections(this._editor.getSelections().map((e=>m.a.fromPositions(e.getStartPosition()))));const[n]=e.options;t=this._editor,i=e.options.map(((e,t)=>({kind:13,label:e.value,insertText:e.value,sortText:"a".repeat(t+1),range:g.a.fromPositions(this._editor.getPosition(),this._editor.getPosition().delta(0,n.value.length))}))),setTimeout((()=>{kt.onlyOnceSuggestions.push(...i),t.getContribution("editor.contrib.suggestController").triggerSuggest((new Set).add(kt))}),0)}}else this._currentChoice=void 0}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),null===(t=this._session)||void 0===t||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session&&this._session.prev(),this._updateState()}next(){this._session&&this._session.next(),this._updateState()}isInSnippet(){return Boolean(this._inSnippet.get())}};ii.ID="snippetController2",ii.InSnippetMode=new _.c("inSnippetMode",!1,Object(r.a)("inSnippetMode","Whether the editor in current in snippet mode")),ii.HasNextTabstop=new _.c("hasNextTabstop",!1,Object(r.a)("hasNextTabstop","Whether there is a next tab stop when in snippet mode")),ii.HasPrevTabstop=new _.c("hasPrevTabstop",!1,Object(r.a)("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode")),ii=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([ei(1,Dt.b),ei(2,_.b)],ii),Object(a.j)(ii.ID,ii);const ni=a.c.bindToContribution(ii.get);Object(a.i)(new ni({id:"jumpToNextSnippetPlaceholder",precondition:_.a.and(ii.InSnippetMode,ii.HasNextTabstop),handler:e=>e.next(),kbOpts:{weight:130,kbExpr:p.a.editorTextFocus,primary:2}})),Object(a.i)(new ni({id:"jumpToPrevSnippetPlaceholder",precondition:_.a.and(ii.InSnippetMode,ii.HasPrevTabstop),handler:e=>e.prev(),kbOpts:{weight:130,kbExpr:p.a.editorTextFocus,primary:1026}})),Object(a.i)(new ni({id:"leaveSnippet",precondition:ii.InSnippetMode,handler:e=>e.cancel(!0),kbOpts:{weight:130,kbExpr:p.a.editorTextFocus,primary:9,secondary:[1033]}})),Object(a.i)(new ni({id:"acceptSnippet",precondition:ii.InSnippetMode,handler:e=>e.finish()}));var oi=i(61),si=i(128),ri=i(43),ai=i(104),li=i(75),hi=function(e,t){return function(i,n){t(i,n,e)}};class ci{constructor(e){this.name=e}select(e,t,i){if(0===i.length)return 0;let n=i[0].score[0];for(let e=0;ethis._saveState()),500),this._disposables.add(e.onWillSaveState((e=>{e.reason===si.c.SHUTDOWN&&this._saveState()})))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(t,i){var n,o;const s=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:null===(n=this._modeService.getLanguageIdentifier(t.getLanguageIdAtPosition(i.lineNumber,i.column)))||void 0===n?void 0:n.language,resource:t.uri});if((null===(o=this._strategy)||void 0===o?void 0:o.name)!==s){this._saveState();const t=e._strategyCtors.get(s)||di;this._strategy=new t;try{const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=this._storageService.get(`${e._storagePrefix}/${s}`,t);i&&this._strategy.fromJSON(JSON.parse(i))}catch(e){}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${e._storagePrefix}/${this._strategy.name}`,i,t,1)}}};ui._strategyCtors=new Map([["recentlyUsedByPrefix",class extends ci{constructor(){super("recentlyUsedByPrefix"),this._trie=oi.c.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageIdentifier().language}/${n}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){let{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);let o=`${e.getLanguageIdentifier().language}/${n}`,s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)),s)for(let e=0;ee.push([i,t]))),e.sort(((e,t)=>-(e[1].touch-t[1].touch))).forEach(((e,t)=>e[1].touch=t)),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type="number"==typeof i.type?i.type:Object(Oe.D)(i.type),this._trie.set(t,i)}}}],["recentlyUsed",class extends ci{constructor(){super("recentlyUsed"),this._cache=new oi.a(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageIdentifier().language}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(0===i.length)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);let o=i[0].score[0],s=-1,r=-1;for(let t=0;tr&&o.type===i[t].completion.kind&&o.insertText===i[t].completion.insertText&&(r=o.touch,s=t),i[t].completion.preselect)return t}return-1!==s?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();for(const[t,i]of e)i.touch=0,i.type="number"==typeof i.type?i.type:Object(Oe.D)(i.type),this._cache.set(t,i);this._seq=this._cache.size}}],["first",di]]),ui._storagePrefix="suggest/memories",ui=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([hi(0,si.a),hi(1,li.a),hi(2,ri.a)],ui);const gi=Object(Et.c)("ISuggestMemories");Object(ai.b)(gi,ui,!0);var mi=i(81);let pi=class e{constructor(t,i){this._editor=t,this._index=0,this._ckOtherSuggestions=e.OtherSuggestions.bindTo(i)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),null===(e=this._listener)||void 0===e||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:t,index:i},n){0!==t.items.length&&e._moveIndex(!0,t,i)!==i?(this._acceptNext=n,this._model=t,this._index=i,this._listener=this._editor.onDidChangeCursorPosition((()=>{this._ignore||this.reset()})),this._ckOtherSuggestions.set(!0)):this.reset()}static _moveIndex(e,t,i){let n=i;for(;n=(n+t.items.length+(e?1:-1))%t.items.length,n!==i&&t.items[n].completion.additionalTextEdits;);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(t){if(this._model)try{this._ignore=!0,this._index=e._moveIndex(t,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};pi.OtherSuggestions=new _.c("hasOtherSuggestions",!1),pi=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,_.b)],pi);class fi{constructor(e,t,i,n,o,s,r){this.clipboardText=r,this._snippetCompareFn=fi._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=o,this._refilterKind=1,this._lineContext=i,"top"===s?this._snippetCompareFn=fi._compareCompletionItemsSnippetsUp:"bottom"===s&&(this._snippetCompareFn=fi._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){this._lineContext.leadingLineContent===e.leadingLineContent&&this._lineContext.characterCountDelta===e.characterCountDelta||(this._refilterKind=this._lineContext.characterCountDelta2e3?Xe.d:Xe.e;for(let l=0;l=d)h.score=Xe.a.Default;else if("string"==typeof h.completion.filterText){let t=a(n,o,e,h.completion.filterText,h.filterTextLow,0,!1);if(!t)continue;0===Object(E.g)(h.completion.filterText,h.textLabel)?h.score=t:(h.score=Object(Xe.b)(n,o,e,h.textLabel,h.labelLow,0),h.score[0]=t[0])}else{let t=a(n,o,e,h.textLabel,h.labelLow,0,!1);if(!t)continue;h.score=t}}h.idx=l,h.distance=this._wordDistance.distance(h.position,h.completion),r.push(h),e.push(h.textLabel.length)}this._filteredItems=r.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?Object(Le.p)(e.length-.85,e,((e,t)=>e-t)):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return fi._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return fi._compareCompletionItems(e,t)}}var _i=i(93),bi=i(72);class vi{provideSelectionRanges(e,t){return i=this,n=void 0,s=function*(){const i=[];for(const n of t){const t=[];i.push(t);const o=new Map;yield new Promise((t=>vi._bracketsRightYield(t,0,e,n,o))),yield new Promise((i=>vi._bracketsLeftYield(i,0,e,n,o,t)))}return i},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(r,a)}l((s=s.apply(i,n||[])).next())}));var i,n,o,s}static _bracketsRightYield(e,t,i,n,o){const s=new Map,r=Date.now();for(;;){if(t>=vi._maxRounds){e();break}if(!n){e();break}let a=i.findNextBracket(n);if(!a){e();break}if(Date.now()-r>vi._maxDuration){setTimeout((()=>vi._bracketsRightYield(e,t+1,i,n,o)));break}const l=a.close[0];if(a.isOpen){let e=s.has(l)?s.get(l):0;s.set(l,e+1)}else{let e=s.has(l)?s.get(l):0;if(e-=1,s.set(l,Math.max(0,e)),e<0){let e=o.get(l);e||(e=new bi.a,o.set(l,e)),e.push(a.range)}}n=a.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,o,s){const r=new Map,a=Date.now();for(;;){if(t>=vi._maxRounds&&0===o.size){e();break}if(!n){e();break}let l=i.findPrevBracket(n);if(!l){e();break}if(Date.now()-a>vi._maxDuration){setTimeout((()=>vi._bracketsLeftYield(e,t+1,i,n,o,s)));break}const h=l.close[0];if(l.isOpen){let e=r.has(h)?r.get(h):0;if(e-=1,r.set(h,Math.max(0,e)),e<0){let e=o.get(h);if(e){let t=e.shift();0===e.size&&o.delete(h);const n=g.a.fromPositions(l.range.getEndPosition(),t.getStartPosition()),r=g.a.fromPositions(l.range.getStartPosition(),t.getEndPosition());s.push({range:n}),s.push({range:r}),vi._addBracketLeading(i,r,s)}}}else{let e=r.has(h)?r.get(h):0;r.set(h,e+1)}n=l.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(n);0!==o&&o!==t.startColumn&&(i.push({range:g.a.fromPositions(new u.a(n,o),t.getEndPosition())}),i.push({range:g.a.fromPositions(new u.a(n,1),t.getEndPosition())}));const s=n-1;if(s>0){const n=e.getLineFirstNonWhitespaceColumn(s);n===t.startColumn&&n!==e.getLineLastNonWhitespaceColumn(s)&&(i.push({range:g.a.fromPositions(new u.a(s,n),t.getEndPosition())}),i.push({range:g.a.fromPositions(new u.a(s,1),t.getEndPosition())}))}}}vi._maxDuration=30,vi._maxRounds=2;class Ci{static create(e,t){return i=this,n=void 0,s=function*(){if(!t.getOption(103).localityBonus)return Ci.None;if(!t.hasModel())return Ci.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Ci.None;const[o]=yield(new vi).provideSelectionRanges(i,[n]);if(0===o.length)return Ci.None;const s=yield e.computeWordRanges(i.uri,o[0].range);if(!s)return Ci.None;const r=i.getWordUntilPosition(n);return delete s[r.word],new class extends Ci{distance(e,i){if(!n.equals(t.getPosition()))return 0;if(17===i.kind)return 2<<20;let r="string"==typeof i.label?i.label:i.label.name,a=s[r];if(Object(Le.l)(a))return 2<<20;let l=Object(Le.c)(a,g.a.fromPositions(e),g.a.compareRangesUsingStarts),h=l>=0?a[l]:a[Math.max(0,~l-1)],c=o.length;for(const e of o){if(!g.a.containsRange(e.range,h))break;c-=1}return c}}},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(r,a)}l((s=s.apply(i,n||[])).next())}));var i,n,o,s}}Ci.None=new class extends Ci{distance(){return 0}};var wi=i(125),yi=i(119),Si=function(e,t){return function(i,n){t(i,n,e)}};class xi{constructor(e,t,i,n){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.auto=i,this.shy=n}static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!!n&&n.endColumn===i.column&&!!isNaN(Number(n.word))}}let Li=class e{constructor(e,t,i,n,o){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=o,this._toDispose=new re.b,this._quickSuggestDelay=10,this._triggerCharacterListener=new re.b,this._triggerQuickSuggest=new se.g,this._state=0,this._completionDisposables=new re.b,this._onDidCancel=new ae.a,this._onDidTrigger=new ae.a,this._onDidSuggest=new ae.a,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new m.a(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel((()=>{this._updateTriggerCharacters(),this.cancel()}))),this._toDispose.add(this._editor.onDidChangeModelLanguage((()=>{this._updateTriggerCharacters(),this.cancel()}))),this._toDispose.add(this._editor.onDidChangeConfiguration((()=>{this._updateTriggerCharacters(),this._updateQuickSuggest()}))),this._toDispose.add(Oe.d.onDidChange((()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}))),this._toDispose.add(this._editor.onDidChangeCursorSelection((e=>{this._onCursorChange(e)})));let s=!1;this._toDispose.add(this._editor.onDidCompositionStart((()=>{s=!0}))),this._toDispose.add(this._editor.onDidCompositionEnd((()=>{s=!1,this._refilterCompletionItems()}))),this._toDispose.add(this._editor.onDidChangeModelContent((()=>{s||this._refilterCompletionItems()}))),this._updateTriggerCharacters(),this._updateQuickSuggest()}dispose(){Object(re.f)(this._triggerCharacterListener),Object(re.f)([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateQuickSuggest(){this._quickSuggestDelay=this._editor.getOption(76),(isNaN(this._quickSuggestDelay)||!this._quickSuggestDelay&&0!==this._quickSuggestDelay||this._quickSuggestDelay<0)&&(this._quickSuggestDelay=10)}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(77)||!this._editor.hasModel()||!this._editor.getOption(106))return;const e=new Map;for(const t of Oe.d.all(this._editor.getModel()))for(const i of t.triggerCharacters||[]){let n=e.get(i);n||(n=new Set,n.add(Ct),e.set(i,n)),n.add(t)}const t=t=>{if(!t){const e=this._editor.getPosition();t=this._editor.getModel().getLineContent(e.lineNumber).substr(0,e.column-1)}let i="";Object(E.E)(t.charCodeAt(t.length-1))?Object(E.D)(t.charCodeAt(t.length-2))&&(i=t.substr(t.length-2)):i=t.charAt(t.length-1);const n=e.get(i);if(n){const e=this._completionModel?{items:this._completionModel.adopt(n),clipboardText:this._completionModel.clipboardText}:void 0;this.trigger({auto:!0,shy:!1,triggerCharacter:i},Boolean(this._completionModel),n,e)}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(t))}get state(){return this._state}cancel(e=!1){var t;0!==this._state&&(this._triggerQuickSuggest.cancel(),null===(t=this._requestToken)||void 0===t||t.cancel(),this._requestToken=void 0,this._state=0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){0!==this._state&&(this._editor.hasModel()&&Oe.d.has(this._editor.getModel())?this.trigger({auto:2===this._state,shy:!1},!0):this.cancel())}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||0!==e.reason&&3!==e.reason||"keyboard"!==e.source&&"deleteLeft"!==e.source)this.cancel();else if(Oe.d.has(t))if(0===this._state&&0===e.reason){if(!1===this._editor.getOption(75))return;if(!i.containsRange(this._currentSelection)&&!i.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))return;if(this._editor.getOption(103).snippetsPreventQuickSuggestions&&ii.get(this._editor).isInSnippet())return;this.cancel(),this._triggerQuickSuggest.cancelAndSet((()=>{if(0!==this._state)return;if(!xi.shouldAutoTrigger(this._editor))return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(75);if(!1!==i){if(!0===i);else{e.tokenizeIfCheap(t.lineNumber);const n=e.getLineTokens(t.lineNumber),o=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(!(i.other&&0===o||i.comments&&1===o||i.strings&&2===o))return}this.trigger({auto:!0,shy:!1})}}),this._quickSuggestDelay)}else 0!==this._state&&3===e.reason&&this._refilterCompletionItems()}_refilterCompletionItems(){Promise.resolve().then((()=>{if(0===this._state)return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=new xi(e,t,2===this._state,!1);this._onNewContext(i)}))}trigger(t,i=!1,n,o){var s;if(!this._editor.hasModel())return;const r=this._editor.getModel(),a=t.auto,l=new xi(r,this._editor.getPosition(),a,t.shy);this.cancel(i),this._state=a?2:1,this._onDidTrigger.fire({auto:a,shy:t.shy,position:this._editor.getPosition()}),this._context=l;let h={triggerKind:null!==(s=t.triggerKind)&&void 0!==s?s:0};t.triggerCharacter&&(h={triggerKind:1,triggerCharacter:t.triggerCharacter}),this._requestToken=new Qe.b;const c=this._editor.getOption(98);let d=1;switch(c){case"top":d=0;break;case"bottom":d=2}const u=e._createItemKindFilter(this._editor),g=Ci.create(this._editorWorkerService,this._editor),m=yt(r,this._editor.getPosition(),new vt(d,u,n),h,this._requestToken.token);Promise.all([m,g]).then((([e,i])=>{return n=this,s=void 0,l=function*(){var n;if(null===(n=this._requestToken)||void 0===n||n.dispose(),!this._editor.hasModel())return;let s=null==o?void 0:o.clipboardText;if(!s&&e.needsClipboard&&(s=yield this._clipboardService.readText()),0===this._state)return;const r=this._editor.getModel();let l=e.items;if(o){const e=Lt(d);l=l.concat(o.items).sort(e)}const h=new xi(r,this._editor.getPosition(),a,t.shy);this._completionModel=new fi(l,this._context.column,{leadingLineContent:h.leadingLineContent,characterCountDelta:h.column-this._context.column},i,this._editor.getOption(103),this._editor.getOption(98),s),this._completionDisposables.add(e.disposable),this._onNewContext(h),this._reportDurationsTelemetry(e.durations)},new((r=void 0)||(r=Promise))((function(e,t){function i(e){try{a(l.next(e))}catch(e){t(e)}}function o(e){try{a(l.throw(e))}catch(e){t(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,o)}a((l=l.apply(n,s||[])).next())}));var n,s,r,l})).catch(Ie.e)}_reportDurationsTelemetry(e){this._telemetryGate++%230==0&&setTimeout((()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)}))}static _createItemKindFilter(e){const t=new Set;"none"===e.getOption(98)&&t.add(27);const i=e.getOption(103);return i.showMethods||t.add(0),i.showFunctions||t.add(1),i.showConstructors||t.add(2),i.showFields||t.add(3),i.showVariables||t.add(4),i.showClasses||t.add(5),i.showStructs||t.add(6),i.showInterfaces||t.add(7),i.showModules||t.add(8),i.showProperties||t.add(9),i.showEvents||t.add(10),i.showOperators||t.add(11),i.showUnits||t.add(12),i.showValues||t.add(13),i.showConstants||t.add(14),i.showEnums||t.add(15),i.showEnumMembers||t.add(16),i.showKeywords||t.add(17),i.showWords||t.add(18),i.showColors||t.add(19),i.showFiles||t.add(20),i.showReferences||t.add(21),i.showColors||t.add(22),i.showFolders||t.add(23),i.showTypeParameters||t.add(24),i.showSnippets||t.add(27),i.showUsers||t.add(25),i.showIssues||t.add(26),t}_onNewContext(e){if(this._context)if(e.lineNumber===this._context.lineNumber)if(Object(E.x)(e.leadingLineContent)===Object(E.x)(this._context.leadingLineContent)){if(e.columnthis._context.leadingWord.startColumn){const e=new Set(Oe.d.all(this._editor.getModel()));for(let t of this._completionModel.allProvider)e.delete(t);const t=this._completionModel.adopt(new Set);this.trigger({auto:this._context.auto,shy:!1},!0,e,{items:t,clipboardText:this._completionModel.clipboardText})}else if(e.column>this._context.column&&this._completionModel.incomplete.size>0&&0!==e.leadingWord.word.length){const{incomplete:e}=this._completionModel,t=this._completionModel.adopt(e);this.trigger({auto:2===this._state,shy:!1,triggerKind:2},!0,e,{items:t,clipboardText:this._completionModel.clipboardText})}else{let t=this._completionModel.lineContext,i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},0===this._completionModel.items.length){if(xi.shouldAutoTrigger(this._editor)&&this._context.leadingWord.endColumn0,i&&0===e.leadingWord.word.length)return void this.cancel()}this._onDidSuggest.fire({completionModel:this._completionModel,auto:this._context.auto,shy:this._context.shy,isFrozen:i})}}else this.cancel();else this.cancel()}};Li=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Si(1,_i.a),Si(2,wi.a),Si(3,yi.a),Si(4,Dt.b)],Li),i(183);const ki=Object(Be.ac)("symbolIcon.arrayForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Di=Object(Be.ac)("symbolIcon.booleanForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ni=Object(Be.ac)("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},Object(r.a)("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ei=Object(Be.ac)("symbolIcon.colorForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Oi=Object(Be.ac)("symbolIcon.constantForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ii=Object(Be.ac)("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},Object(r.a)("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ti=Object(Be.ac)("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},Object(r.a)("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Mi=Object(Be.ac)("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},Object(r.a)("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ai=Object(Be.ac)("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hc:"#EE9D28"},Object(r.a)("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ri=Object(Be.ac)("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},Object(r.a)("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Pi=Object(Be.ac)("symbolIcon.fileForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Fi=Object(Be.ac)("symbolIcon.folderForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Wi=Object(Be.ac)("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},Object(r.a)("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Bi=Object(Be.ac)("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},Object(r.a)("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),ji=Object(Be.ac)("symbolIcon.keyForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Vi=Object(Be.ac)("symbolIcon.keywordForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Hi=Object(Be.ac)("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hc:"#B180D7"},Object(r.a)("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),zi=Object(Be.ac)("symbolIcon.moduleForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ui=Object(Be.ac)("symbolIcon.namespaceForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ki=Object(Be.ac)("symbolIcon.nullForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),$i=Object(Be.ac)("symbolIcon.numberForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),qi=Object(Be.ac)("symbolIcon.objectForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Gi=Object(Be.ac)("symbolIcon.operatorForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Yi=Object(Be.ac)("symbolIcon.packageForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Zi=Object(Be.ac)("symbolIcon.propertyForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Qi=Object(Be.ac)("symbolIcon.referenceForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Xi=Object(Be.ac)("symbolIcon.snippetForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Ji=Object(Be.ac)("symbolIcon.stringForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),en=Object(Be.ac)("symbolIcon.structForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),tn=Object(Be.ac)("symbolIcon.textForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),nn=Object(Be.ac)("symbolIcon.typeParameterForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),on=Object(Be.ac)("symbolIcon.unitForeground",{dark:Be.T,light:Be.T,hc:Be.T},Object(r.a)("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),sn=Object(Be.ac)("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},Object(r.a)("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));Object(we.f)(((e,t)=>{const i=e.getColor(ki);i&&t.addRule(`${ve.b.symbolArray.cssSelector} { color: ${i}; }`);const n=e.getColor(Di);n&&t.addRule(`${ve.b.symbolBoolean.cssSelector} { color: ${n}; }`);const o=e.getColor(Ni);o&&t.addRule(`${ve.b.symbolClass.cssSelector} { color: ${o}; }`);const s=e.getColor(Hi);s&&t.addRule(`${ve.b.symbolMethod.cssSelector} { color: ${s}; }`);const r=e.getColor(Ei);r&&t.addRule(`${ve.b.symbolColor.cssSelector} { color: ${r}; }`);const a=e.getColor(Oi);a&&t.addRule(`${ve.b.symbolConstant.cssSelector} { color: ${a}; }`);const l=e.getColor(Ii);l&&t.addRule(`${ve.b.symbolConstructor.cssSelector} { color: ${l}; }`);const h=e.getColor(Ti);h&&t.addRule(`\n\t\t\t${ve.b.symbolValue.cssSelector},${ve.b.symbolEnum.cssSelector} { color: ${h}; }`);const c=e.getColor(Mi);c&&t.addRule(`${ve.b.symbolEnumMember.cssSelector} { color: ${c}; }`);const d=e.getColor(Ai);d&&t.addRule(`${ve.b.symbolEvent.cssSelector} { color: ${d}; }`);const u=e.getColor(Ri);u&&t.addRule(`${ve.b.symbolField.cssSelector} { color: ${u}; }`);const g=e.getColor(Pi);g&&t.addRule(`${ve.b.symbolFile.cssSelector} { color: ${g}; }`);const m=e.getColor(Fi);m&&t.addRule(`${ve.b.symbolFolder.cssSelector} { color: ${m}; }`);const p=e.getColor(Wi);p&&t.addRule(`${ve.b.symbolFunction.cssSelector} { color: ${p}; }`);const f=e.getColor(Bi);f&&t.addRule(`${ve.b.symbolInterface.cssSelector} { color: ${f}; }`);const _=e.getColor(ji);_&&t.addRule(`${ve.b.symbolKey.cssSelector} { color: ${_}; }`);const b=e.getColor(Vi);b&&t.addRule(`${ve.b.symbolKeyword.cssSelector} { color: ${b}; }`);const v=e.getColor(zi);v&&t.addRule(`${ve.b.symbolModule.cssSelector} { color: ${v}; }`);const C=e.getColor(Ui);C&&t.addRule(`${ve.b.symbolNamespace.cssSelector} { color: ${C}; }`);const w=e.getColor(Ki);w&&t.addRule(`${ve.b.symbolNull.cssSelector} { color: ${w}; }`);const y=e.getColor($i);y&&t.addRule(`${ve.b.symbolNumber.cssSelector} { color: ${y}; }`);const S=e.getColor(qi);S&&t.addRule(`${ve.b.symbolObject.cssSelector} { color: ${S}; }`);const x=e.getColor(Gi);x&&t.addRule(`${ve.b.symbolOperator.cssSelector} { color: ${x}; }`);const L=e.getColor(Yi);L&&t.addRule(`${ve.b.symbolPackage.cssSelector} { color: ${L}; }`);const k=e.getColor(Zi);k&&t.addRule(`${ve.b.symbolProperty.cssSelector} { color: ${k}; }`);const D=e.getColor(Qi);D&&t.addRule(`${ve.b.symbolReference.cssSelector} { color: ${D}; }`);const N=e.getColor(Xi);N&&t.addRule(`${ve.b.symbolSnippet.cssSelector} { color: ${N}; }`);const E=e.getColor(Ji);E&&t.addRule(`${ve.b.symbolString.cssSelector} { color: ${E}; }`);const O=e.getColor(en);O&&t.addRule(`${ve.b.symbolStruct.cssSelector} { color: ${O}; }`);const I=e.getColor(tn);I&&t.addRule(`${ve.b.symbolText.cssSelector} { color: ${I}; }`);const T=e.getColor(nn);T&&t.addRule(`${ve.b.symbolTypeParameter.cssSelector} { color: ${T}; }`);const M=e.getColor(on);M&&t.addRule(`${ve.b.symbolUnit.cssSelector} { color: ${M}; }`);const A=e.getColor(sn);A&&t.addRule(`${ve.b.symbolVariable.cssSelector} { color: ${A}; }`)}));var rn=i(1),an=i(83),ln=i(64),hn=i(76),cn=i(172),dn=i(100);class un{constructor(e="",t=!1){var i,n;if(this.value=e,"string"!=typeof this.value)throw Object(Ie.b)("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1):(this.isTrusted=null!==(i=t.isTrusted)&&void 0!==i?i:void 0,this.supportThemeIcons=null!==(n=t.supportThemeIcons)&&void 0!==n&&n)}appendText(e,t=0){var i;return this.value+=(i=this.supportThemeIcons?Object(dn.a)(e):e,i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")).replace(/([ \t]+)/g,((e,t)=>" ".repeat(t.length))).replace(/^>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this}}function gn(e){return mn(e)?!e.value:!Array.isArray(e)||e.every(gn)}function mn(e){return e instanceof un||!(!e||"object"!=typeof e)&&!("string"!=typeof e.value||"boolean"!=typeof e.isTrusted&&void 0!==e.isTrusted||"boolean"!=typeof e.supportThemeIcons&&void 0!==e.supportThemeIcons)}function pn(e,t){return e===t||!(!e||!t)&&e.value===t.value&&e.isTrusted===t.isTrusted&&e.supportThemeIcons===t.supportThemeIcons}function fn(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!])/g,"$1"):e}var _n,bn=i(140),vn=i(185);let Cn;!function e(t,i,n){function o(r,a){if(!i[r]){if(!t[r]){if(!a&&"function"==typeof _n&&_n)return _n(r,!0);if(s)return s(r,!0);var l=new Error("Cannot find module '"+r+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[r]={exports:{}};t[r][0].call(h.exports,(function(e){return o(t[r][1][e]||e)}),h,h.exports,e,t,i,n)}return i[r].exports}for(var s="function"==typeof _n&&_n,r=0;r\s]+))?)*)\s*(\/?)\s*>/,a=/^<\s*\/\s*([\w:-]+)[^>]*>/,l=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,h=/^=0&&(t.comment&&t.comment(e.substring(4,n)),e=e.substring(n+3),i=!1):c.test(e)?m(a,f):h.test(e)&&m(r,p),function(){if(i){var n,o=e.indexOf("<");o>=0?(n=e.substring(0,o),e=e.substring(o)):(n=e,e=""),t.chars&&t.chars(n)}}();var o=e===u;u=e,o&&(e="")}function m(t,n){var o=e.match(t);o&&(e=e.substring(o[0].length),o[0].replace(t,n),i=!1)}function p(e,i,r,a){var h={},c=o(i),u=s.voids[c]||!!a;r.replace(l,(function(e,t,i,o,s){h[t]=void 0===i&&void 0===o&&void 0===s?void 0:n.decode(i||o||s||"")})),u||d.push(c),t.start&&t.start(c,h,u)}function f(e,i){var n,s=0,r=o(i);if(r)for(s=d.length-1;s>=0&&d[s]!==r;s--);if(s>=0){for(n=d.length-1;n>=s;n--)t.end&&t.end(d[n]);d.length=s}}f()}},{"./attributes":1,"./elements":3,"./lowercase":5,he:9}],8:[function(e,t,i){var n=e("he"),o=e("./lowercase"),s=e("./attributes"),r=e("./elements");t.exports=function(e,t){var i,a=t||{};return c(),{start:function(e,t,r){var c=o(e);i.ignoring?h(c):-1!==(a.allowedTags||[]).indexOf(c)&&(!a.filter||a.filter({tag:c,attrs:t}))?(l("<"),l(c),Object.keys(t).forEach((function(e){var i,r=t[e],h=(a.allowedClasses||{})[c]||[],d=(a.allowedAttributes||{})[c]||[];d=d.concat((a.allowedAttributes||{})["*"]||[]);var u=o(e);i="class"===u&&-1===d.indexOf(u)?(r=r.split(" ").filter((function(e){return h&&-1!==h.indexOf(e)})).join(" ").trim()).length:-1!==d.indexOf(u)&&(!0!==s.uris[u]||function(e){var t=e[0];if("#"===t||"/"===t)return!0;var i=e.indexOf(":");if(-1===i)return!0;var n=e.indexOf("?");if(-1!==n&&i>n)return!0;var o=e.indexOf("#");return-1!==o&&i>o||a.allowedSchemes.some((function(t){return 0===e.indexOf(t+":")}))}(r)),i&&(l(" "),l(e),"string"==typeof r&&(l('="'),l(n.encode(r)),l('"')))})),l(r?"/>":">")):h(c)},end:function(e){var t=o(e);-1!==(a.allowedTags||[]).indexOf(t)&&!1===i.ignoring?(l("")):function(e){i.ignoring===e&&--i.depth<=0&&c()}(t)},chars:function(e){!1===i.ignoring&&l(a.transformText?a.transformText(e):e)}};function l(t){e.push(t)}function h(e){r.voids[e]||(!1===i.ignoring?i={ignoring:e,depth:1}:i.ignoring===e&&i.depth++)}function c(){i={ignoring:!1,depth:0}}}},{"./attributes":1,"./elements":3,"./lowercase":5,he:9}],9:[function(e,t,i){var n={"&":"&","<":"<",">":">",'"':""","'":"'"},o={"&":"&","<":"<",">":">",""":'"',"'":"'"},s=/(&|<|>|"|')/g,r=/[&<>"']/g;function a(e){return n[e]}function l(e){return o[e]}function h(e){return null==e?"":String(e).replace(r,a)}function c(e){return null==e?"":String(e).replace(s,l)}h.options=c.options={},t.exports={encode:h,escape:h,decode:c,unescape:c,version:"1.0.0-browser"}},{}],10:[function(e,t,i){function n(e,t){return e[t]=!0,e}t.exports=function(e){return e.reduce(n,{})}},{}]},{},[4]);var wn,yn=Cn,Sn=i(167),xn=i(36),Ln=i(54),kn=i(127),Dn=i(26);const Nn=null===(wn=window.trustedTypes)||void 0===wn?void 0:wn.createPolicy("insane",{createHTML:(e,t)=>yn(e,t)});var En,On=i(67),In=i(171),Tn=function(e,t){return function(i,n){t(i,n,e)}};let Mn=class e{constructor(e,t,i){this._options=e,this._modeService=t,this._openerService=i,this._onDidRenderAsync=new ae.a,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){const n=new re.b;let o;return o=e?function(e,t={},i={}){var n;const o=Object(cn.a)(t),s=function(t){let i;try{i=Object(Sn.a)(decodeURIComponent(t))}catch(e){}return i?(i=Object(xn.a)(i,(t=>e.uris&&e.uris[t]?gt.a.revive(e.uris[t]):void 0)),encodeURIComponent(JSON.stringify(i))):t},r=function(t,i){const n=e.uris&&e.uris[t];if(!n)return t;let o=gt.a.revive(n);return gt.a.parse(t).toString()===o.toString()?t:i?At.a.asBrowserUri(o).toString(!0):(o.query&&(o=o.with({query:s(o.query)})),o.toString())};let a;const l=new Promise((e=>a=e)),h=new vn.Renderer;h.image=(e,i,n)=>{let o=[],s=[];if(e){({href:e,dimensions:o}=function(e){const t=[],i=e.split("|").map((e=>e.trim()));e=i[0];const n=i[1];if(n){const e=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),o=e?e[1]:"",s=i?i[1]:"",r=isFinite(parseInt(s)),a=isFinite(parseInt(o));r&&t.push(`width="${s}"`),a&&t.push(`height="${o}"`)}return{href:e,dimensions:t}}(e)),e=r(e,!0);try{const i=gt.a.parse(e);t.baseUrl&&i.scheme===At.c.file&&(e=Object(It.h)(t.baseUrl,e).toString())}catch(e){}s.push(`src="${e}"`)}return n&&s.push(`alt="${n}"`),i&&s.push(`title="${i}"`),o.length&&(s=s.concat(o)),""},h.link=(i,n,o)=>(i===o&&(o=fn(o)),i=r(i,!1),t.baseUrl&&(/^\w[\w\d+.-]*:/.test(i)||(i=Object(It.h)(t.baseUrl,i).toString())),n=fn(n),!(i=fn(i))||i.match(/^data:|javascript:/i)||i.match(/^command:/i)&&!e.isTrusted||i.match(/^command:(\/\/\/)?_workbench\.downloadResource/i)?o:`/g,">").replace(/"/g,""").replace(/'/g,"'")}" title="${n||i}">${o}`),h.paragraph=t=>(e.supportThemeIcons&&(t=Object(kn.a)(t).map((e=>"string"==typeof e?e:e.outerHTML)).join("")),`

    ${t}

    `),t.codeBlockRenderer&&(h.code=(e,i)=>{const n=t.codeBlockRenderer(i,e),s=bn.b.nextId(),r=Promise.all([n,l]).then((e=>{const t=o.querySelector(`div[data-code="${s}"]`);t&&rn.P(t,e[0])})).catch((e=>{}));return t.asyncRenderCallback&&r.then(t.asyncRenderCallback),`
    ${Object(E.s)(e)}
    `}),t.actionHandler&&t.actionHandler.disposeables.add(ae.b.any(Object(Dn.a)(o,"click"),Object(Dn.a)(o,"auxclick"))((e=>{const i=new Ln.a(e);if(!i.leftButton&&!i.middleButton)return;let n=i.target;if("A"===n.tagName||(n=n.parentElement,n&&"A"===n.tagName))try{const e=n.dataset.href;e&&t.actionHandler.callback(e,i)}catch(e){Object(Ie.e)(e)}finally{i.preventDefault()}}))),i.sanitizer=t=>(e.isTrusted?t.match(/^(]+>)|(<\/\s*span>)$/):void 0)?t:"",i.sanitize=!0,i.silent=!0,i.renderer=h;let c=null!==(n=e.value)&&void 0!==n?n:"";c.length>1e5&&(c=`${c.substr(0,1e5)}…`),e.supportThemeIcons&&(c=Object(dn.b)(c));const d=vn.parse(c,i);if(o.innerHTML=function(e,t){var i;const n=function(e){const t=[At.c.http,At.c.https,At.c.mailto,At.c.data,At.c.file,At.c.vscodeRemote,At.c.vscodeRemoteResource];return e.isTrusted&&t.push(At.c.command),{allowedSchemes:t,allowedTags:["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"],allowedAttributes:{a:["href","name","target","data-href"],img:["src","title","alt","width","height"],div:["class","data-code"],span:["class","style"],th:["align"],td:["align"]},filter:t=>!("span"===t.tag&&e.isTrusted&&(t.attrs.style&&1===Object.keys(t.attrs).length?!t.attrs.style.match(/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/):!t.attrs.class||!t.attrs.class.match(/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/)))}}(e);return null!==(i=null==Nn?void 0:Nn.createHTML(t,n))&&void 0!==i?i:yn(t,n)}(e,d),a(),t.asyncRenderCallback)for(const e of o.getElementsByTagName("img")){const i=rn.i(e,"load",(()=>{i.dispose(),t.asyncRenderCallback()}))}return o}(e,Object.assign(Object.assign({},this._getRenderOptions(e,n)),t),i):document.createElement("span"),{element:o,dispose:()=>n.dispose()}}_getRenderOptions(t,i){return{baseUrl:this._options.baseUrl,codeBlockRenderer:(t,i)=>{return n=this,o=void 0,r=function*(){var n,o,s,r;let a;t?a=this._modeService.getModeIdForLanguageName(t):this._options.editor&&(a=null===(n=this._options.editor.getModel())||void 0===n?void 0:n.getLanguageIdentifier().language),a||(a="plaintext"),this._modeService.triggerMode(a);const l=null!==(o=yield Oe.B.getPromise(a))&&void 0!==o?o:void 0,h=document.createElement("span");h.innerHTML=null!==(r=null===(s=e._ttpTokenizer)||void 0===s?void 0:s.createHTML(i,l))&&void 0!==r?r:Object(In.b)(i,l);let c=this._options.codeBlockFontFamily;return this._options.editor&&(c=this._options.editor.getOption(40).fontFamily),c&&(h.style.fontFamily=c),h},new((s=void 0)||(s=Promise))((function(e,t){function i(e){try{l(r.next(e))}catch(e){t(e)}}function a(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(i,a)}l((r=r.apply(n,o||[])).next())}));var n,o,s,r},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:e=>this._openerService.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:t.isTrusted}).catch(Ie.e),disposeables:i}}}};Mn._ttpTokenizer=null===(En=window.trustedTypes)||void 0===En?void 0:En.createPolicy("tokenizeToString",{createHTML:(e,t)=>Object(In.b)(e,t)}),Mn=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Tn(1,li.a),Tn(2,On.a)],Mn);var An=i(108);class Rn{constructor(){let e;this._onDidWillResize=new ae.a,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new ae.a,this.onDidResize=this._onDidResize.event,this._sashListener=new re.b,this._size=new rn.b(0,0),this._minSize=new rn.b(0,0),this._maxSize=new rn.b(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new An.b(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new An.b(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new An.b(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:An.a.North}),this._southSash=new An.b(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:An.a.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let t=0,i=0;this._sashListener.add(ae.b.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)((()=>{void 0===e&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)}))),this._sashListener.add(ae.b.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)((()=>{void 0!==e&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))}))),this._sashListener.add(this._eastSash.onDidChange((n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))}))),this._sashListener.add(this._westSash.onDidChange((n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))}))),this._sashListener.add(this._northSash.onDidChange((n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))}))),this._sashListener.add(this._southSash.onDidChange((n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))}))),this._sashListener.add(ae.b.any(this._eastSash.onDidReset,this._westSash.onDidReset)((e=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))),this._sashListener.add(ae.b.any(this._northSash.onDidReset,this._southSash.onDidReset)((e=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))})))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:o,width:s}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(n,Math.min(s,t));const r=new rn.b(t,e);rn.b.equals(r,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=r,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}function Pn(e){return!!e&&Boolean(e.completion.documentation||e.completion.detail&&e.completion.detail!==e.completion.label)}let Fn=class{constructor(e,t){this._editor=e,this._onDidClose=new ae.a,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new ae.a,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new re.b,this._renderDisposeable=new re.b,this._borderWidth=1,this._size=new rn.b(330,0),this.domNode=rn.a(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Mn,{editor:e}),this._body=rn.a(".body"),this._scrollbar=new hn.a(this._body,{}),rn.q(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=rn.q(this._body,rn.a(".header")),this._close=rn.q(this._header,rn.a("span"+ve.b.close.cssSelector)),this._close.title=r.a("details.close","Close"),this._type=rn.q(this._header,rn.a("p.type")),this._docs=rn.q(this._body,rn.a("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(40)&&this._configureFont()})))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(40),i=t.fontFamily,n=e.get(104)||t.fontSize,o=e.get(105)||t.lineHeight,s=t.fontWeight,r=`${n}px`,a=`${o}px`;this.domNode.style.fontSize=r,this.domNode.style.lineHeight=a,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=a,this._close.style.width=a}getLayoutInfo(){const e=this._editor.getOption(105)||this._editor.getOption(40).lineHeight,t=this._borderWidth;return{lineHeight:e,borderWidth:t,borderHeight:2*t,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=r.a("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,2*this.getLayoutInfo().lineHeight),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,n;this._renderDisposeable.clear();let{detail:o,documentation:s}=e.completion;if(t){let t="";t+=`score: ${e.score[0]}\n`,t+=`prefix: ${null!==(i=e.word)&&void 0!==i?i:"(no prefix)"}\n`,t+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}\n`,t+=`distance: ${e.distance} (localityBonus-setting)\n`,t+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}\n`,t+=`commit_chars: ${null===(n=e.completion.commitCharacters)||void 0===n?void 0:n.join("")}\n`,s=(new un).appendCodeblock("empty",t),o=`Provider: ${e.provider._debugDisplayName}`}if(t||Pn(e)){if(this.domNode.classList.remove("no-docs","no-type"),o){const e=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=e,this._type.title=e,rn.U(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gim.test(e))}else rn.t(this._type),this._type.title="",rn.J(this._type),this.domNode.classList.add("no-type");if(rn.t(this._docs),"string"==typeof s)this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),rn.t(this._docs);const e=this._markdownRenderer.render(s);this._docs.appendChild(e.element),this._renderDisposeable.add(e),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync((()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)})))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=e=>{e.preventDefault(),e.stopPropagation()},this._close.onclick=e=>{e.preventDefault(),e.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}else this.clearContents()}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new rn.b(e,t);rn.b.equals(i,this._size)||(this._size=i,rn.V(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};Fn=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,Et.a)],Fn);class Wn{constructor(e,t){let i,n;this.widget=e,this._editor=t,this._disposables=new re.b,this._added=!1,this._resizable=new Rn,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let o=0,s=0;this._disposables.add(this._resizable.onDidWillResize((()=>{i=this._topLeft,n=this._resizable.size}))),this._disposables.add(this._resizable.onDidResize((e=>{if(i&&n){this.widget.layout(e.dimension.width,e.dimension.height);let t=!1;e.west&&(s=n.width-e.dimension.width,t=!0),e.north&&(o=n.height-e.dimension.height,t=!0),t&&this._applyTopLeft({top:i.top+o,left:i.left+s})}e.done&&(i=void 0,n=void 0,o=0,s=0,this._userSize=e.dimension)}))),this._disposables.add(this.widget.onDidChangeContents((()=>{var e;this._anchorBox&&this._placeAtAnchor(this._anchorBox,null!==(e=this._userSize)&&void 0!==e?e:this.widget.size)})))}dispose(){this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e){var t;const i=rn.C(e);this._anchorBox=i,this._placeAtAnchor(this._anchorBox,null!==(t=this._userSize)&&void 0!==t?t:this.widget.size)}_placeAtAnchor(e,t){const i=rn.z(document.body),n=this.widget.getLayoutInfo();let o,s,r,a,l=new rn.b(220,2*n.lineHeight),h=0,c=e.top,d=e.top+e.height-n.borderHeight,u=i.width-(e.left+e.width+n.borderWidth+n.horizontalPadding);h=-n.borderWidth+e.left+e.width,a=!0,o=new rn.b(u,i.height-e.top-n.borderHeight-n.verticalPadding),s=o.with(void 0,e.top+e.height-n.borderHeight-n.verticalPadding),t.width>u&&(e.left>u&&(u=e.left-n.borderWidth-n.horizontalPadding,a=!1,h=Math.max(n.horizontalPadding,e.left-t.width-n.borderWidth),o=o.with(u),s=o.with(void 0,s.height)),e.width>1.3*u&&i.height-(e.top+e.height)>e.height&&(u=e.width,h=e.left,c=-n.borderWidth+e.top+e.height,o=new rn.b(e.width-n.borderHeight,i.height-e.top-e.height-n.verticalPadding),s=o.with(void 0,e.top-n.verticalPadding),l=l.with(o.width)));let g,m=t.height,p=Math.max(o.height,s.height);m>p&&(m=p),m<=o.height?(r=!0,g=o):(r=!1,g=s),this._applyTopLeft({left:h,top:r?c:d-m}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!r,a,r,!a),this._resizable.minSize=l,this._resizable.maxSize=g,this._resizable.layout(m,Math.min(g.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var Bn=i(92),jn=i(48),Vn=i(80),Hn=i(56),zn=i(151),Un=i(59),Kn=i(114),$n=i(47),qn=i(46);class Gn extends jn.b{constructor(e,t){super(),this._onDidChangeVisibility=new ae.a,this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Object(rn.q)(e,Object(rn.a)(".monaco-dropdown")),this._label=Object(rn.q)(this._element,Object(rn.a)(".dropdown-label"));let i=t.labelRenderer;i||(i=e=>(e.textContent=t.label||"",null));for(const e of[rn.d.CLICK,rn.d.MOUSE_DOWN,$n.a.Tap])this._register(Object(rn.i)(this.element,e,(e=>rn.c.stop(e,!0))));for(const e of[rn.d.MOUSE_DOWN,$n.a.Tap])this._register(Object(rn.i)(this._label,e,(e=>{e instanceof MouseEvent&&e.detail>1||(this.visible?this.hide():this.show())})));this._register(Object(rn.i)(this._label,rn.d.KEY_UP,(e=>{const t=new qn.a(e);(t.equals(3)||t.equals(10))&&(rn.c.stop(e,!0),this.visible?this.hide():this.show())})));const n=i(this._label);n&&this._register(n),this._register($n.b.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class Yn extends Gn{constructor(e,t){super(e,t),this._actions=[],this._contextMenuProvider=t.contextMenuProvider,this.actions=t.actions||[],this.actionProvider=t.actionProvider,this.menuClassName=t.menuClassName||"",this.menuAsChild=!!t.menuAsChild}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this.actionProvider?this.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:e=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this.menuClassName,onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this.menuAsChild?this.element:void 0})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class Zn extends Kn.b{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new ae.a),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>{this.element=Object(rn.q)(e,Object(rn.a)("a.action-label"));let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter((e=>!!e)):this.options.classNames&&(t=this.options.classNames),t.find((e=>"icon"===e))||t.push("codicon"),this.element.classList.add(...t),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",null},menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider};if(this.dropdownMenu=this._register(new Yn(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility((e=>{var t;null===(t=this.element)||void 0===t||t.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)}))),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return e.options.anchorAlignmentProvider()}})}this.updateEnabled()}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}updateEnabled(){var e,t;const i=!this.getAction().enabled;null===(e=this.actionItem)||void 0===e||e.classList.toggle("disabled",i),null===(t=this.element)||void 0===t||t.classList.toggle("disabled",i)}}var Qn=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Xn=function(e,t){return function(i,n){t(i,n,e)}};let Jn=class extends Kn.a{constructor(e,t,i){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon}),this._keybindingService=t,this._notificationService=i,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new re.d),this._altKey=rn.e.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){e.preventDefault(),e.stopPropagation(),this.actionRunner.run(this._commandAction,this._context).catch((e=>this._notificationService.error(e)))}render(e){super.render(e),e.classList.add("menu-entry"),this._updateItemClass(this._menuItemAction.item);let t=!1,i=this._altKey.keyStatus.altKey||(Rt.j||Rt.d)&&this._altKey.keyStatus.shiftKey;const n=()=>{const e=t&&i;e!==this._wantsAltCommand&&(this._wantsAltCommand=e,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._menuItemAction.alt&&this._register(this._altKey.event((e=>{i=e.altKey||(Rt.j||Rt.d)&&e.shiftKey,n()}))),this._register(Object(Dn.a)(e,"mouseleave")((e=>{t=!1,n()}))),this._register(Object(Dn.a)(e,"mouseenter")((e=>{t=!0,n()})))}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}updateTooltip(){if(this.label){const e=this._keybindingService.lookupKeybinding(this._commandAction.id),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let n=t?Object(r.a)("titleAndKb","{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt){const e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id),i=t&&t.getLabel(),o=i?Object(r.a)("titleAndKb","{0} ({1})",e,i):e;n+=`\n[${zn.b.modifierLabels[Rt.a].altKey}] ${o}`}this.label.title=n}}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){var t;this._itemClassDispose.value=void 0;const{element:i,label:n}=this;if(!i||!n)return;const o=this._commandAction.checked&&(null===(t=e.toggled)||void 0===t?void 0:t.icon)?e.toggled.icon:e.icon;if(o)if(we.d.isThemeIcon(o)){const e=we.d.asClassNameArray(o);n.classList.add(...e),this._itemClassDispose.value=Object(re.h)((()=>{n.classList.remove(...e)}))}else o.light&&n.style.setProperty("--menu-entry-icon-light",Object(rn.s)(o.light)),o.dark&&n.style.setProperty("--menu-entry-icon-dark",Object(rn.s)(o.dark)),n.classList.add("icon"),this._itemClassDispose.value=Object(re.h)((()=>{n.classList.remove("icon"),n.style.removeProperty("--menu-entry-icon-light"),n.style.removeProperty("--menu-entry-icon-dark")}))}};Jn=Qn([Xn(1,Hn.a),Xn(2,Un.a)],Jn);let eo=class extends Zn{constructor(e,t){super(e,{getActions:()=>e.actions},t,{menuAsChild:!0,classNames:we.d.isThemeIcon(e.item.icon)?we.d.asClassName(e.item.icon):void 0})}render(e){if(super.render(e),this.element){e.classList.add("menu-entry");const{icon:t}=this._action.item;t&&!we.d.isThemeIcon(t)&&(this.element.classList.add("icon"),t.light&&this.element.style.setProperty("--menu-entry-icon-light",Object(rn.s)(t.light)),t.dark&&this.element.style.setProperty("--menu-entry-icon-dark",Object(rn.s)(t.dark)))}}};function to(e,t){return t instanceof V.c?e.createInstance(Jn,t):t instanceof V.e?e.createInstance(eo,t):void 0}eo=Qn([Xn(1,Vn.a)],eo);var io=function(e,t){return function(i,n){t(i,n,e)}};class no extends Jn{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id);if(!e)return super.updateLabel();this.label&&(this.label.textContent=Object(r.a)("ddd","{0} ({1})",this._action.label,no.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return null===(t=e.getLabel())||void 0===t?void 0:t.replace(/\benter\b/gi,"⏎")}}let oo=class{constructor(e,t,i,n){this._menuService=i,this._contextKeyService=n,this._menuDisposables=new re.b,this.element=rn.q(e,rn.a(".suggest-status-bar"));const o=e=>e instanceof V.c?t.createInstance(no,e):void 0;this._leftActions=new Bn.a(this.element,{actionViewItemProvider:o}),this._rightActions=new Bn.a(this.element,{actionViewItemProvider:o}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(_t,this._contextKeyService),t=()=>{const t=[],i=[];for(let[n,o]of e.getActions())"left"===n?t.push(...o):i.push(...o);this._leftActions.clear(),this._leftActions.push(t),this._rightActions.clear(),this._rightActions.push(i)};this._menuDisposables.add(e.onDidChange((()=>t()))),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};oo=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([io(1,Et.a),io(2,V.a),io(3,_.b)],oo);var so,ro=i(160),ao=i(120);function lo(e,t,i,n){const o=n===so.ROOT_FOLDER?["rootfolder-icon"]:n===so.FOLDER?["folder-icon"]:["file-icon"];if(i){let s;if(s=i.scheme===At.c.data?It.a.parseMetaData(i).get(It.a.META_DATA_LABEL):ho(Object(It.c)(i).toLowerCase()),n===so.FOLDER)o.push(`${s}-name-folder-icon`);else{if(s){if(o.push(`${s}-name-file-icon`),s.length<=255){const e=s.split(".");for(let t=1;t{const e=this._editor.getOptions(),i=e.get(40),o=i.fontFamily,s=i.fontFeatureSettings,r=e.get(104)||i.fontSize,a=e.get(105)||i.lineHeight,l=i.fontWeight,h=`${r}px`,c=`${a}px`;t.root.style.fontSize=h,t.root.style.fontWeight=l,n.style.fontFamily=o,n.style.fontFeatureSettings=s,n.style.lineHeight=c,t.icon.style.height=c,t.icon.style.width=c,t.readMore.style.height=c,t.readMore.style.width=c};return o(),t.disposables.add(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(40)||e.hasChanged(104)||e.hasChanged(105))&&o()}))),t}renderElement(e,t,i){var n,o,s;const{completion:r}=e;i.root.id=mo(t),i.colorspan.style.backgroundColor="";const a={labelEscapeNewLines:!0,matches:Object(Xe.c)(e.score)};let l=[];if(19===r.kind&&fo.extract(e,l))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=l[0];else if(20===r.kind&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const t=lo(this._modelService,this._modeService,gt.a.from({scheme:"fake",path:e.textLabel}),so.FILE),n=lo(this._modelService,this._modeService,gt.a.from({scheme:"fake",path:r.detail}),so.FILE);a.extraClasses=t.length>n.length?t:n}else 23===r.kind&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",a.extraClasses=Object(Le.j)([lo(this._modelService,this._modeService,gt.a.from({scheme:"fake",path:e.textLabel}),so.FOLDER),lo(this._modelService,this._modeService,gt.a.from({scheme:"fake",path:r.detail}),so.FOLDER)])):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...Object(Oe.E)(r.kind).split(" ")));r.tags&&r.tags.indexOf(1)>=0&&(a.extraClasses=(a.extraClasses||[]).concat(["deprecated"]),a.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,a),"string"==typeof r.label?(i.parametersLabel.textContent="",i.qualifierLabel.textContent="",i.detailsLabel.textContent=(r.detail||"").replace(/\n.*$/m,""),i.root.classList.add("string-label"),i.root.title=""):(i.parametersLabel.textContent=(r.label.parameters||"").replace(/\n.*$/m,""),i.qualifierLabel.textContent=(r.label.qualifier||"").replace(/\n.*$/m,""),i.detailsLabel.textContent=(r.label.type||"").replace(/\n.*$/m,""),i.root.classList.remove("string-label"),i.root.title=`${e.textLabel}${null!==(n=r.label.parameters)&&void 0!==n?n:""} ${null!==(o=r.label.qualifier)&&void 0!==o?o:""} ${null!==(s=r.label.type)&&void 0!==s?s:""}`),this._editor.getOption(103).showInlineDetails?Object(rn.U)(i.detailsLabel):Object(rn.J)(i.detailsLabel),Pn(e)?(i.right.classList.add("can-expand-details"),Object(rn.U)(i.readMore),i.readMore.onmousedown=e=>{e.stopPropagation(),e.preventDefault()},i.readMore.onclick=e=>{e.stopPropagation(),e.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Object(rn.J)(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};_o=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([go(1,uo.a),go(2,li.a),go(3,we.b)],_o);var bo=i(38),vo=function(e,t){return function(i,n){t(i,n,e)}};let Co=class extends s.a{constructor(e,t,i,n,o,s,r,a,l,h){super(e,Object.assign(Object.assign({},i.getRawOptions()),{overflowWidgetsDomNode:i.getOverflowWidgetsDomNode()}),{},n,o,s,r,a,l,h),this._parentEditor=i,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(i.onDidChangeConfiguration((e=>this._onParentConfigurationChanged(e))))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){xn.f(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Co=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([vo(3,Et.a),vo(4,bo.a),vo(5,ut.b),vo(6,_.b),vo(7,we.b),vo(8,Un.a),vo(9,f.b)],Co);var wo=i(86),yo=function(e,t){return function(i,n){t(i,n,e)}};const So=Object(Be.ac)("editorSuggestWidget.background",{dark:Be.Q,light:Be.Q,hc:Be.Q},r.a("editorSuggestWidgetBackground","Background color of the suggest widget.")),xo=Object(Be.ac)("editorSuggestWidget.border",{dark:Be.R,light:Be.R,hc:Be.R},r.a("editorSuggestWidgetBorder","Border color of the suggest widget.")),Lo=Object(Be.ac)("editorSuggestWidget.foreground",{dark:Be.w,light:Be.w,hc:Be.w},r.a("editorSuggestWidgetForeground","Foreground color of the suggest widget.")),ko=Object(Be.ac)("editorSuggestWidget.selectedBackground",{dark:Be.Yb,light:Be.Yb,hc:Be.Yb},r.a("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget.")),Do=Object(Be.ac)("editorSuggestWidget.highlightForeground",{dark:Be.ub,light:Be.ub,hc:Be.ub},r.a("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));class No{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof Co}`}restore(){var e;const t=null!==(e=this._service.get(this._key,0))&&void 0!==e?e:"";try{const e=JSON.parse(t);if(rn.b.is(e))return rn.b.lift(e)}catch(e){}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let Eo=class e{constructor(e,t,i,n,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._ignoreFocusEvents=!1,this._explainMode=!1,this._showTimeout=new se.g,this._disposables=new re.b,this._onDidSelect=new ae.a,this._onDidFocus=new ae.a,this._onDidHide=new ae.a,this._onDidShow=new ae.a,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new ae.a,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new Rn,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Oo(this,e),this._persistedSize=new No(t,e);class s{constructor(e,t,i=!1,n=!1){this.persistedSize=e,this.currentSize=t,this.persistHeight=i,this.persistWidth=n}}let a;this._disposables.add(this.element.onDidWillResize((()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)}))),this._disposables.add(this.element.onDidResize((e=>{var t,i,n,o;if(this._resize(e.dimension.width,e.dimension.height),a&&(a.persistHeight=a.persistHeight||!!e.north||!!e.south,a.persistWidth=a.persistWidth||!!e.east||!!e.west),e.done){if(a){const{itemHeight:e,defaultSize:s}=this.getLayoutInfo(),r=Math.round(e/2);let{width:l,height:h}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-h)<=r)&&(h=null!==(i=null===(t=a.persistedSize)||void 0===t?void 0:t.height)&&void 0!==i?i:s.height),(!a.persistWidth||Math.abs(a.currentSize.width-l)<=r)&&(l=null!==(o=null===(n=a.persistedSize)||void 0===n?void 0:n.width)&&void 0!==o?o:s.width),this._persistedSize.store(new rn.b(l,h))}this._contentWidget.unlockPreference(),a=void 0}}))),this._messageElement=rn.q(this.element.domNode,rn.a(".message")),this._listElement=rn.q(this.element.domNode,rn.a(".tree"));const l=o.createInstance(Fn,this.editor);l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new Wn(l,this.editor);const h=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(103).showIcons);h();const c=o.createInstance(_o,this.editor);this._disposables.add(c),this._disposables.add(c.onDidToggleDetails((()=>this.toggleDetails()))),this._list=new an.c("SuggestWidget",this._listElement,{getHeight:e=>this.getLayoutInfo().itemHeight,getTemplateId:e=>"suggestion"},[c],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,accessibilityProvider:{getRole:()=>"option",getAriaLabel:e=>{if(e.isResolved&&this._isDetailsVisible()){const{documentation:t,detail:i}=e.completion,n=E.v("{0}{1}",i||"",t?"string"==typeof t?t:t.value:"");return r.a("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",e.textLabel,n)}return e.textLabel},getWidgetAriaLabel:()=>r.a("suggest","Suggest"),getWidgetRole:()=>"listbox"}}),this._status=o.createInstance(oo,this.element.domNode);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(103).showStatusBar);d(),this._disposables.add(Object(ln.b)(this._list,n,{listInactiveFocusBackground:ko,listInactiveFocusOutline:Be.b})),this._disposables.add(n.onDidColorThemeChange((e=>this._onThemeChange(e)))),this._onThemeChange(n.getColorTheme()),this._disposables.add(this._list.onMouseDown((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onTap((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onDidChangeSelection((e=>this._onListSelection(e)))),this._disposables.add(this._list.onDidChangeFocus((e=>this._onListFocus(e)))),this._disposables.add(this.editor.onDidChangeCursorSelection((()=>this._onCursorSelectionChanged()))),this._disposables.add(this.editor.onDidChangeConfiguration((e=>{e.hasChanged(103)&&(d(),h())}))),this._ctxSuggestWidgetVisible=ft.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=ft.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=ft.MultipleSuggestions.bindTo(i),this._disposables.add(rn.o(this._details.widget.domNode,"keydown",(e=>{this._onDetailsKeydown.fire(e)}))),this._disposables.add(this.editor.onMouseDown((e=>this._onEditorMouseDown(e))))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),null===(e=this._loadingTimeout)||void 0===e||e.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){0!==this._state&&this._contentWidget.layout()}_onListMouseDownOrTap(e){void 0!==e.element&&void 0!==e.index&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){const t=e.getColor(So);t&&(this.element.domNode.style.backgroundColor=t.toString(),this._messageElement.style.backgroundColor=t.toString(),this._details.widget.domNode.style.backgroundColor=t.toString());const i=e.getColor(xo);i&&(this.element.domNode.style.borderColor=i.toString(),this._messageElement.style.borderColor=i.toString(),this._status.element.style.borderTopColor=i.toString(),this._details.widget.domNode.style.borderColor=i.toString(),this._detailsBorderColor=i.toString());const n=e.getColor(Be.S);n&&(this._detailsFocusBorderColor=n.toString()),this._details.widget.borderWidth="hc"===e.type?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length)return this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),void this.editor.setAriaOptions({activeDescendant:void 0});if(!this._completionModel)return;const i=e.elements[0],n=e.indexes[0];i!==this._focusedItem&&(null===(t=this._currentSuggestionDetails)||void 0===t||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(n),this._currentSuggestionDetails=Object(se.h)((e=>{return t=this,n=void 0,s=function*(){const t=Object(se.i)((()=>{this._isDetailsVisible()&&this.showDetails(!0)}),250);e.onCancellationRequested((()=>t.dispose()));const n=yield i.resolve(e);return t.dispose(),n},new((o=void 0)||(o=Promise))((function(e,i){function r(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(r,a)}l((s=s.apply(t,n||[])).next())}));var t,n,o,s})),this._currentSuggestionDetails.then((()=>{n>=this._list.length||i!==this._list.element(n)||(this._ignoreFocusEvents=!0,this._list.splice(n,1,[i]),this._list.setFocus([n]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:mo(n)}))})).catch(Ie.e)),this._onDidFocus.fire({item:i,index:n,model:this._completionModel})}_setState(t){if(this._state!==t)switch(this._state=t,this.element.domNode.classList.toggle("frozen",4===t),this.element.domNode.classList.remove("message"),t){case 0:rn.J(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=e.LOADING_MESSAGE,rn.J(this._listElement,this._status.element),rn.U(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=e.NO_SUGGESTIONS_MESSAGE,rn.J(this._listElement,this._status.element),rn.U(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0;break;case 3:case 4:rn.J(this._messageElement),rn.U(this._listElement,this._status.element),this._show();break;case 5:rn.J(this._messageElement),rn.U(this._listElement,this._status.element),this._details.show(),this._show()}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet((()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)}),100)}showTriggered(e,t){0===this._state&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Object(se.i)((()=>this._setState(1)),t)))}showSuggestions(e,t,i,n){var o,s;if(this._contentWidget.setPosition(this.editor.getPosition()),null===(o=this._loadingTimeout)||void 0===o||o.dispose(),null===(s=this._currentSuggestionDetails)||void 0===s||s.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&2!==this._state&&0!==this._state)return void this._setState(4);const r=this._completionModel.items.length,a=0===r;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),a)return this._setState(n?0:2),void(this._completionModel=void 0);this._focusedItem=void 0,this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus([t]),this._layout(this.element.size),this._detailsBorderColor&&(this._details.widget.domNode.style.borderColor=this._detailsBorderColor)}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(0!==this._state&&2!==this._state&&1!==this._state&&this._completionModel)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){5===this._state?(this._setState(3),this._detailsBorderColor&&(this._details.widget.domNode.style.borderColor=this._detailsBorderColor)):3===this._state&&this._isDetailsVisible()&&(this._setState(5),this._detailsFocusBorderColor&&(this._details.widget.domNode.style.borderColor=this._detailsFocusBorderColor))}toggleDetails(){this._isDetailsVisible()?(this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):!Pn(this._list.getFocusedElements()[0])&&!this._explainMode||3!==this._state&&5!==this._state&&4!==this._state||(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;null===(e=this._loadingTimeout)||void 0===e||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(4.3*this.getLayoutInfo().itemHeight);t&&t.heightl&&(a=l);const h=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:a,c=s.statusBarHeight+this._list.contentHeight+s.borderHeight,d=s.itemHeight+s.statusBarHeight,u=rn.C(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),m=u.top+g.top+g.height,p=Math.min(o.height-m-s.verticalPadding,c),f=Math.min(u.top+g.top-s.verticalPadding,c);let _=Math.min(Math.max(f,p)+s.borderHeight,c);r===(null===(t=this._cappedHeight)||void 0===t?void 0:t.capped)&&(r=this._cappedHeight.wanted),r_&&(r=_),r>p?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),_=f):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),_=p),this.element.preferredSize=new rn.b(h,s.defaultSize.height),this.element.maxSize=new rn.b(l,_),this.element.minSize=new rn.b(220,d),this._cappedHeight=r===c?{wanted:null!==(n=null===(i=this._cappedHeight)||void 0===i?void 0:i.wanted)&&void 0!==n?n:e.height,capped:r}:void 0}this._resize(a,r)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=t-o+"px",this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode)}getLayoutInfo(){const e=this.editor.getOption(40),t=Object(wo.b)(this.editor.getOption(105)||e.lineHeight,8,1e3),i=this.editor.getOption(103).showStatusBar&&2!==this._state&&1!==this._state?t:0,n=this._details.widget.borderWidth,o=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new rn.b(430,i+12*t+o)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}};Eo.LOADING_MESSAGE=r.a("suggestWidget.loading","Loading..."),Eo.NO_SUGGESTIONS_MESSAGE=r.a("suggestWidget.noSuggestions","No suggestions."),Eo=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([yo(1,si.a),yo(2,_.b),yo(3,we.b),yo(4,Et.a)],Eo);class Oo{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return!this._hidden&&this._position&&this._preference?{position:this._position,preference:[this._preference]}:null}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new rn.b(t+2*i+n,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}Object(we.f)(((e,t)=>{const i=e.getColor(Do);i&&t.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight { color: ${i}; }`);const n=e.getColor(Lo);n&&t.addRule(`.monaco-editor .suggest-widget, .monaco-editor .suggest-details { color: ${n}; }`);const o=e.getColor(Be.mc);o&&t.addRule(`.monaco-editor .suggest-details a { color: ${o}; }`);const s=e.getColor(Be.lc);s&&t.addRule(`.monaco-editor .suggest-details code { background-color: ${s}; }`)}));let Io=class e{constructor(t,i){this._editor=t,this._enabled=!1,this._ckAtEnd=e.AtEnd.bindTo(i),this._configListener=this._editor.onDidChangeConfiguration((e=>e.hasChanged(108)&&this._update())),this._update()}dispose(){var e;this._configListener.dispose(),null===(e=this._selectionListener)||void 0===e||e.dispose(),this._ckAtEnd.reset()}_update(){const e="on"===this._editor.getOption(108);if(this._enabled!==e)if(this._enabled=e,this._enabled){const e=()=>{if(!this._editor.hasModel())return void this._ckAtEnd.set(!1);const e=this._editor.getModel(),t=this._editor.getSelection(),i=e.getWordAtPosition(t.getStartPosition());i?this._ckAtEnd.set(i.endColumn===t.getStartPosition().column):this._ckAtEnd.set(!1)};this._selectionListener=this._editor.onDidChangeCursorSelection(e),e()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};Io.AtEnd=new _.c("atEndOfWord",!1),Io=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,_.b)],Io);var To=i(110);class Mo{constructor(e,t,i){this._disposables=new re.b,this._disposables.add(t.onDidShow((()=>this._onItem(t.getFocusedItem())))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType((n=>{if(this._active&&!t.isFrozen()){const t=n.charCodeAt(n.length-1);this._active.acceptCharacters.has(t)&&e.getOption(0)&&i(this._active.item)}})))}_onItem(e){if(!e||!Object(Le.m)(e.item.completion.commitCharacters))return void this.reset();if(this._active&&this._active.item.item===e.item)return;const t=new To.b;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}class Ao{constructor(e,t){this._disposables=new re.b,this._lastOvertyped=[],this._empty=!0,this._disposables.add(e.onWillType((()=>{if(!this._empty)return;if(!e.hasModel())return;const t=e.getSelections(),i=t.length;let n=!1;for(let e=0;eAo._maxSelectionLength)return;this._lastOvertyped[e]={value:o.getValueInRange(i),multiline:i.startLineNumber!==i.endLineNumber}}this._empty=!1}))),this._disposables.add(t.onDidCancel((e=>{this._empty||e.retrigger||(this._empty=!0)})))}getLastOvertypedInfo(e){if(!this._empty&&e>=0&&er.set(e.getOption(103).insertMode))),this.widget=this._toDispose.add(new se.b((()=>{const e=this._instantiationService.createInstance(Eo,this.editor);this._toDispose.add(e),this._toDispose.add(e.onDidSelect((e=>this._insertSuggestion(e,0)),this));const t=new Mo(this.editor,e,(e=>this._insertSuggestion(e,2)));this._toDispose.add(t),this._toDispose.add(this.model.onDidSuggest((e=>{0===e.completionModel.items.length&&t.reset()})));const i=ft.MakesTextEdit.bindTo(this._contextKeyService),n=ft.HasInsertAndReplaceRange.bindTo(this._contextKeyService),o=ft.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Object(re.h)((()=>{i.reset(),n.reset(),o.reset()}))),this._toDispose.add(e.onDidFocus((({item:e})=>{const t=this.editor.getPosition(),s=e.editStart.column,r=t.column;let a=!0;"smart"!==this.editor.getOption(1)||2!==this.model.state||e.completion.command||e.completion.additionalTextEdits||4&e.completion.insertTextRules||r-s!==e.completion.insertText.length||(a=this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:s,endLineNumber:t.lineNumber,endColumn:r})!==e.completion.insertText),i.set(a),n.set(!u.a.equals(e.editInsertEnd,e.editReplaceEnd)),o.set(Boolean(e.provider.resolveCompletionItem)||Boolean(e.completion.documentation)||e.completion.detail!==e.completion.label)}))),this._toDispose.add(e.onDetailsKeyDown((e=>{e.toKeybinding().equals(new N.e(!0,!1,!1,!1,33))||Rt.f&&e.toKeybinding().equals(new N.e(!1,!1,!1,!0,33))?e.stopPropagation():e.toKeybinding().isModifierKey()||this.editor.focus()}))),e}))),this._overtypingCapturer=this._toDispose.add(new se.b((()=>this._toDispose.add(new Ao(this.editor,this.model))))),this._alternatives=this._toDispose.add(new se.b((()=>this._toDispose.add(new pi(this.editor,this._contextKeyService))))),this._toDispose.add(o.createInstance(Io,e)),this._toDispose.add(this.model.onDidTrigger((e=>{this.widget.value.showTriggered(e.auto,e.shy?250:50),this._lineSuffix.value=new Po(this.editor.getModel(),e.position)}))),this._toDispose.add(this.model.onDidSuggest((e=>{if(!e.shy){let t=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.completionModel.items);this.widget.value.showSuggestions(e.completionModel,t,e.isFrozen,e.auto)}}))),this._toDispose.add(this.model.onDidCancel((e=>{e.retrigger||this.widget.value.hideWidget()}))),this._toDispose.add(this.editor.onDidBlurEditorWidget((()=>{this.model.cancel(),this.model.clear()})));let a=ft.AcceptSuggestionsOnEnter.bindTo(n),l=()=>{const e=this.editor.getOption(1);a.set("on"===e||"smart"===e)};this._toDispose.add(this.editor.onDidChangeConfiguration((()=>l()))),l()}static get(t){return t.getContribution(e.ID)}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose()}_insertSuggestion(e,t){if(!e||!e.item)return this._alternatives.value.reset(),this.model.cancel(),void this.model.clear();if(!this.editor.hasModel())return;const i=this.editor.getModel(),n=i.getAlternativeVersionId(),{item:o}=e,s=[],r=new Qe.b;1&t||this.editor.pushUndoStop();const a=this.getOverwriteInfo(o,Boolean(8&t));if(this._memoryService.memorize(i,this.editor.getPosition(),o),Array.isArray(o.completion.additionalTextEdits)){const e=Ze.c.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map((e=>O.a.replace(g.a.lift(e.range),e.text)))),e.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!o.isResolved){const e=new dt.a(!0);let n;const a=i.onDidChangeContent((e=>{if(e.isFlush)return r.cancel(),void a.dispose();for(let t of e.changes){const e=g.a.getEndPosition(t.range);n&&!u.a.isBefore(e,n)||(n=e)}}));let l=t;t|=2;let h=!1,c=this.editor.onWillType((()=>{c.dispose(),h=!0,2&l||this.editor.pushUndoStop()}));s.push(o.resolve(r.token).then((()=>{if(!o.completion.additionalTextEdits||r.token.isCancellationRequested)return!1;if(n&&o.completion.additionalTextEdits.some((e=>u.a.isBefore(n,g.a.getStartPosition(e.range)))))return!1;h&&this.editor.pushUndoStop();const e=Ze.c.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map((e=>O.a.replace(g.a.lift(e.range),e.text)))),e.restoreRelativeVerticalPositionOfCursor(this.editor),!h&&2&l||this.editor.pushUndoStop(),!0})).then((t=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",e.elapsed(),t),a.dispose(),c.dispose()})))}let{insertText:l}=o.completion;4&o.completion.insertTextRules||(l=ct.escape(l)),ii.get(this.editor).insert(l,{overwriteBefore:a.overwriteBefore,overwriteAfter:a.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(1&o.completion.insertTextRules),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),2&t||this.editor.pushUndoStop(),o.completion.command?o.completion.command.id===Wo.id?this.model.trigger({auto:!0,shy:!1},!0):(s.push(this._commandService.executeCommand(o.completion.command.id,...o.completion.command.arguments?[...o.completion.command.arguments]:[]).catch(Ie.e)),this.model.cancel()):this.model.cancel(),4&t&&this._alternatives.value.set(e,(e=>{for(r.cancel();i.canUndo();){n!==i.getAlternativeVersionId()&&i.undo(),this._insertSuggestion(e,3|(8&t?8:0));break}})),this._alertCompletionItem(o),Promise.all(s).finally((()=>{this.model.clear(),r.dispose()}))}getOverwriteInfo(e,t){Object(oe.b)(this.editor.hasModel());let i="replace"===this.editor.getOption(103).insertMode;t&&(i=!i);const n=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column;return{overwriteBefore:n+(this.editor.getPosition().column-e.position.column),overwriteAfter:o+(this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0)}}_alertCompletionItem(e){if(Object(Le.m)(e.completion.additionalTextEdits)){let t=r.a("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Object(Ye.a)(t)}}triggerSuggest(e){this.editor.hasModel()&&(this.model.trigger({auto:!1,shy:!1},!1,e),this.editor.revealLine(this.editor.getPosition().lineNumber,0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=e=>{if(4&e.completion.insertTextRules||e.completion.additionalTextEdits)return!0;const t=this.editor.getPosition(),i=e.editStart.column,n=t.column;return n-i!==e.completion.insertText.length||this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:i,endLineNumber:t.lineNumber,endColumn:n})!==e.completion.insertText};ae.b.once(this.model.onDidTrigger)((e=>{let t=[];ae.b.any(this.model.onDidTrigger,this.model.onDidCancel)((()=>{Object(re.f)(t),i()}),void 0,t),this.model.onDidSuggest((({completionModel:e})=>{if(Object(re.f)(t),0===e.items.length)return void i();const o=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.items),s=e.items[o];n(s)?(this.editor.pushUndoStop(),this._insertSuggestion({index:o,item:s,model:e},7)):i()}),void 0,t)})),this.model.trigger({auto:!1,shy:!0}),this.editor.revealLine(t.lineNumber,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),this._insertSuggestion(i,n)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}};Fo.ID="editor.contrib.suggestController",Fo=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Ro(1,gi),Ro(2,ut.b),Ro(3,_.b),Ro(4,Et.a),Ro(5,Dt.b)],Fo);class Wo extends a.b{constructor(){super({id:Wo.id,label:r.a("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:_.a.and(p.a.writable,p.a.hasCompletionItemProvider),kbOpts:{kbExpr:p.a.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t){const i=Fo.get(t);i&&i.triggerSuggest()}}Wo.id="editor.action.triggerSuggest",Object(a.j)(Fo.ID,Fo),Object(a.h)(Wo);const Bo=190,jo=a.c.bindToContribution(Fo.get);Object(a.i)(new jo({id:"acceptSelectedSuggestion",precondition:ft.Visible,handler(e){e.acceptSelectedSuggestion(!0,!1)}})),mi.a.registerKeybindingRule({id:"acceptSelectedSuggestion",when:_.a.and(ft.Visible,p.a.textInputFocus),primary:2,weight:Bo}),mi.a.registerKeybindingRule({id:"acceptSelectedSuggestion",when:_.a.and(ft.Visible,p.a.textInputFocus,ft.AcceptSuggestionsOnEnter,ft.MakesTextEdit),primary:3,weight:Bo}),V.d.appendMenuItem(_t,{command:{id:"acceptSelectedSuggestion",title:r.a("accept.insert","Insert")},group:"left",order:1,when:ft.HasInsertAndReplaceRange.toNegated()}),V.d.appendMenuItem(_t,{command:{id:"acceptSelectedSuggestion",title:r.a("accept.insert","Insert")},group:"left",order:1,when:_.a.and(ft.HasInsertAndReplaceRange,ft.InsertMode.isEqualTo("insert"))}),V.d.appendMenuItem(_t,{command:{id:"acceptSelectedSuggestion",title:r.a("accept.replace","Replace")},group:"left",order:1,when:_.a.and(ft.HasInsertAndReplaceRange,ft.InsertMode.isEqualTo("replace"))}),Object(a.i)(new jo({id:"acceptAlternativeSelectedSuggestion",precondition:_.a.and(ft.Visible,p.a.textInputFocus),kbOpts:{weight:Bo,kbExpr:p.a.textInputFocus,primary:1027,secondary:[1026]},handler(e){e.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:_t,group:"left",order:2,when:_.a.and(ft.HasInsertAndReplaceRange,ft.InsertMode.isEqualTo("insert")),title:r.a("accept.replace","Replace")},{menuId:_t,group:"left",order:2,when:_.a.and(ft.HasInsertAndReplaceRange,ft.InsertMode.isEqualTo("replace")),title:r.a("accept.insert","Insert")}]})),ut.a.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion"),Object(a.i)(new jo({id:"hideSuggestWidget",precondition:ft.Visible,handler:e=>e.cancelSuggestWidget(),kbOpts:{weight:Bo,kbExpr:p.a.textInputFocus,primary:9,secondary:[1033]}})),Object(a.i)(new jo({id:"selectNextSuggestion",precondition:_.a.and(ft.Visible,ft.MultipleSuggestions),handler:e=>e.selectNextSuggestion(),kbOpts:{weight:Bo,kbExpr:p.a.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),Object(a.i)(new jo({id:"selectNextPageSuggestion",precondition:_.a.and(ft.Visible,ft.MultipleSuggestions),handler:e=>e.selectNextPageSuggestion(),kbOpts:{weight:Bo,kbExpr:p.a.textInputFocus,primary:12,secondary:[2060]}})),Object(a.i)(new jo({id:"selectLastSuggestion",precondition:_.a.and(ft.Visible,ft.MultipleSuggestions),handler:e=>e.selectLastSuggestion()})),Object(a.i)(new jo({id:"selectPrevSuggestion",precondition:_.a.and(ft.Visible,ft.MultipleSuggestions),handler:e=>e.selectPrevSuggestion(),kbOpts:{weight:Bo,kbExpr:p.a.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),Object(a.i)(new jo({id:"selectPrevPageSuggestion",precondition:_.a.and(ft.Visible,ft.MultipleSuggestions),handler:e=>e.selectPrevPageSuggestion(),kbOpts:{weight:Bo,kbExpr:p.a.textInputFocus,primary:11,secondary:[2059]}})),Object(a.i)(new jo({id:"selectFirstSuggestion",precondition:_.a.and(ft.Visible,ft.MultipleSuggestions),handler:e=>e.selectFirstSuggestion()})),Object(a.i)(new jo({id:"toggleSuggestionDetails",precondition:ft.Visible,handler:e=>e.toggleSuggestionDetails(),kbOpts:{weight:Bo,kbExpr:p.a.textInputFocus,primary:2058,mac:{primary:266}},menuOpts:[{menuId:_t,group:"right",order:1,when:_.a.and(ft.DetailsVisible,ft.CanResolve),title:r.a("detail.more","show less")},{menuId:_t,group:"right",order:1,when:_.a.and(ft.DetailsVisible.toNegated(),ft.CanResolve),title:r.a("detail.less","show more")}]})),Object(a.i)(new jo({id:"toggleExplainMode",precondition:ft.Visible,handler:e=>e.toggleExplainMode(),kbOpts:{weight:100,primary:2133}})),Object(a.i)(new jo({id:"toggleSuggestionFocus",precondition:ft.Visible,handler:e=>e.toggleSuggestionFocus(),kbOpts:{weight:Bo,kbExpr:p.a.textInputFocus,primary:2570,mac:{primary:778}}})),Object(a.i)(new jo({id:"insertBestCompletion",precondition:_.a.and(p.a.textInputFocus,_.a.equals("config.editor.tabCompletion","on"),Io.AtEnd,ft.Visible.toNegated(),pi.OtherSuggestions.toNegated(),ii.InSnippetMode.toNegated()),handler:(e,t)=>{e.triggerSuggestAndAcceptBest(Object(oe.i)(t)?Object.assign({fallback:"tab"},t):{fallback:"tab"})},kbOpts:{weight:Bo,primary:2}})),Object(a.i)(new jo({id:"insertNextSuggestion",precondition:_.a.and(p.a.textInputFocus,_.a.equals("config.editor.tabCompletion","on"),pi.OtherSuggestions,ft.Visible.toNegated(),ii.InSnippetMode.toNegated()),handler:e=>e.acceptNextSuggestion(),kbOpts:{weight:Bo,kbExpr:p.a.textInputFocus,primary:2}})),Object(a.i)(new jo({id:"insertPrevSuggestion",precondition:_.a.and(p.a.textInputFocus,_.a.equals("config.editor.tabCompletion","on"),pi.OtherSuggestions,ft.Visible.toNegated(),ii.InSnippetMode.toNegated()),handler:e=>e.acceptPrevSuggestion(),kbOpts:{weight:Bo,kbExpr:p.a.textInputFocus,primary:1026}})),Object(a.h)(class extends a.b{constructor(){super({id:"editor.action.resetSuggestSize",label:r.a("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(e,t){Fo.get(t).resetWidgetSize()}});var Vo=i(12);function Ho(e,t,i,n){return Promise.resolve(i.provideColorPresentations(e,t,n))}ut.a.registerCommand("_executeDocumentColorProvider",(function(e,...t){const[i]=t;if(!(i instanceof gt.a))throw Object(Ie.b)();const n=e.get(uo.a).getModel(i);if(!n)throw Object(Ie.b)();const o=[],s=Oe.c.ordered(n).reverse().map((e=>Promise.resolve(e.provideDocumentColors(n,Qe.a.None)).then((e=>{if(Array.isArray(e))for(let t of e)o.push({range:t.range,color:[t.color.red,t.color.green,t.color.blue,t.color.alpha]})}))));return Promise.all(s).then((()=>o))})),ut.a.registerCommand("_executeColorPresentationProvider",(function(e,...t){const[i,n]=t,{uri:o,range:s}=n;if(!(o instanceof gt.a&&Array.isArray(i)&&4===i.length&&g.a.isIRange(s)))throw Object(Ie.b)();const[r,a,l,h]=i,c=e.get(uo.a).getModel(o);if(!c)throw Object(Ie.b)();const d={range:s,color:{red:r,green:a,blue:l,alpha:h}},u=[],m=Oe.c.ordered(c).reverse().map((e=>Promise.resolve(e.provideColorPresentations(c,d,Qe.a.None)).then((e=>{Array.isArray(e)&&u.push(...e)}))));return Promise.all(m).then((()=>u))}));var zo=i(138),Uo=function(e,t){return function(i,n){t(i,n,e)}};let Ko=class e extends re.a{constructor(e,t,i){super(),this._editor=e,this._codeEditorService=t,this._configurationService=i,this._localToDispose=this._register(new re.b),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=[],this._decorationsTypes=new Set,this._register(e.onDidChangeModel((()=>{this._isEnabled=this.isEnabled(),this.onModelChanged()}))),this._register(e.onDidChangeModelLanguage((()=>this.onModelChanged()))),this._register(Oe.c.onDidChange((()=>this.onModelChanged()))),this._register(e.onDidChangeConfiguration((()=>{let e=this._isEnabled;this._isEnabled=this.isEnabled(),e!==this._isEnabled&&(this._isEnabled?this.onModelChanged():this.removeAllDecorations())}))),this._timeoutTimer=null,this._computePromise=null,this._isEnabled=this.isEnabled(),this.onModelChanged()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageIdentifier(),i=this._configurationService.getValue(t.language);if(i){const e=i.colorDecorators;if(e&&void 0!==e.enable&&!e.enable)return e.enable}return this._editor.getOption(15)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}onModelChanged(){if(this.stop(),!this._isEnabled)return;const t=this._editor.getModel();t&&Oe.c.has(t)&&(this._localToDispose.add(this._editor.onDidChangeModelContent((()=>{this._timeoutTimer||(this._timeoutTimer=new se.g,this._timeoutTimer.cancelAndSet((()=>{this._timeoutTimer=null,this.beginCompute()}),e.RECOMPUTE_TIME))}))),this.beginCompute())}beginCompute(){this._computePromise=Object(se.h)((e=>{const t=this._editor.getModel();return t?function(e,t){const i=[],n=Oe.c.ordered(e).reverse().map((n=>Promise.resolve(n.provideDocumentColors(e,t)).then((e=>{if(Array.isArray(e))for(let t of e)i.push({colorInfo:t,provider:n})}))));return Promise.all(n).then((()=>i))}(t,e):Promise.resolve([])})),this._computePromise.then((e=>{this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}),Ie.e)}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map((e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:be.a.EMPTY})));this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach(((t,i)=>this._colorDatas.set(t,e[i])))}updateColorDecorators(e){let t=[],i={};for(let n=0;n{i[e]||this._codeEditorService.removeDecorationType(e)})),this._colorDecoratorIds=this._editor.deltaDecorations(this._colorDecoratorIds,t)}removeAllDecorations(){this._decorationsIds=this._editor.deltaDecorations(this._decorationsIds,[]),this._colorDecoratorIds=this._editor.deltaDecorations(this._colorDecoratorIds,[]),this._decorationsTypes.forEach((e=>{this._codeEditorService.removeDecorationType(e)}))}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(g.a.fromPositions(e,e)).filter((e=>this._colorDatas.has(e.id)));return 0===i.length?null:this._colorDatas.get(i[0].id)}};Ko.ID="editor.contrib.colorDetector",Ko.RECOMPUTE_TIME=1e3,Ko=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Uo(1,bo.a),Uo(2,ri.a)],Ko),Object(a.j)(Ko.ID,Ko);class $o{constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new ae.a,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new ae.a,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new ae.a,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){for(let e=0;e{this.backgroundColor=e.getColor(Be.z)||Vo.a.white}))),this._register(rn.i(this.pickedColorNode,rn.d.CLICK,(()=>this.model.selectNextColorPresentation()))),this._register(rn.i(n,rn.d.CLICK,(()=>{this.model.color=this.model.originalColor,this.model.flushColor()}))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this.pickedColorNode.style.backgroundColor=Vo.a.Format.CSS.format(t.color)||"",this.pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter())}onDidChangeColor(e){this.pickedColorNode.style.backgroundColor=Vo.a.Format.CSS.format(e)||"",this.pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this.pickedColorNode.textContent=this.model.presentation?this.model.presentation.label:""}}class Xo extends re.a{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this.domNode=Zo(".colorpicker-body"),rn.q(e,this.domNode),this.saturationBox=new Jo(this.domNode,this.model,this.pixelRatio),this._register(this.saturationBox),this._register(this.saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this.saturationBox.onColorFlushed(this.flushColor,this)),this.opacityStrip=new ts(this.domNode,this.model),this._register(this.opacityStrip),this._register(this.opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this.opacityStrip.onColorFlushed(this.flushColor,this)),this.hueStrip=new is(this.domNode,this.model),this._register(this.hueStrip),this._register(this.hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this.hueStrip.onColorFlushed(this.flushColor,this))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new Vo.a(new Vo.b(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new Vo.a(new Vo.b(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=360*(1-e);this.model.color=new Vo.a(new Vo.b(360===i?0:i,t.s,t.v,t.a))}layout(){this.saturationBox.layout(),this.opacityStrip.layout(),this.hueStrip.layout()}}class Jo extends re.a{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new ae.a,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new ae.a,this.onColorFlushed=this._onColorFlushed.event,this.domNode=Zo(".saturation-wrap"),rn.q(e,this.domNode),this.canvas=document.createElement("canvas"),this.canvas.className="saturation-box",rn.q(this.domNode,this.canvas),this.selection=Zo(".saturation-selection"),rn.q(this.domNode,this.selection),this.layout(),this._register(rn.g(this.domNode,(e=>this.onMouseDown(e)))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}onMouseDown(e){this.monitor=this._register(new Go.a);const t=rn.C(this.domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.buttons,Go.b,(e=>this.onDidChangePosition(e.posx-t.left,e.posy-t.top)),(()=>null));const i=rn.h(document,(()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)}),!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this.domNode.offsetWidth,this.height=this.domNode.offsetHeight,this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new Vo.a(new Vo.b(e.h,1,1,1)),i=this.canvas.getContext("2d"),n=i.createLinearGradient(0,0,this.canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this.canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this.canvas.width,this.canvas.height),i.fillStyle=Vo.a.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=e*this.width+"px",this.selection.style.top=this.height-t*this.height+"px"}onDidChangeColor(){this.monitor&&this.monitor.isMonitoring()||this.paint()}}class es extends re.a{constructor(e,t){super(),this.model=t,this._onDidChange=new ae.a,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new ae.a,this.onColorFlushed=this._onColorFlushed.event,this.domNode=rn.q(e,Zo(".strip")),this.overlay=rn.q(this.domNode,Zo(".overlay")),this.slider=rn.q(this.domNode,Zo(".slider")),this.slider.style.top="0px",this._register(rn.g(this.domNode,(e=>this.onMouseDown(e)))),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onMouseDown(e){const t=this._register(new Go.a),i=rn.C(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.buttons,Go.b,(e=>this.onDidChangeTop(e.posy-i.top)),(()=>null));const n=rn.h(document,(()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")}),!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=(1-e)*this.height+"px"}}class ts extends es{constructor(e,t){super(e,t),this.domNode.classList.add("opacity-strip"),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){const{r:t,g:i,b:n}=e.rgba,o=new Vo.a(new Vo.c(t,i,n,1)),s=new Vo.a(new Vo.c(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class is extends es{constructor(e,t){super(e,t),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class ns extends Yo.a{constructor(e,t,i,n){super(),this.model=t,this.pixelRatio=i,this._register(Object(qo.l)((()=>this.layout())));const o=Zo(".colorpicker-widget");e.appendChild(o);const s=new Qo(o,this.model,n);this.body=new Xo(o,this.model,this.pixelRatio),this._register(s),this._register(this.body)}layout(){this.body.layout()}}class os{constructor(e,t,i,n,o){this._computer=e,this._state=0,this._hoverTime=o,this._firstWaitScheduler=new se.e((()=>this._triggerAsyncComputation()),0),this._secondWaitScheduler=new se.e((()=>this._triggerSyncComputation()),0),this._loadingMessageScheduler=new se.e((()=>this._showLoadingMessage()),0),this._asyncComputationPromise=null,this._asyncComputationPromiseDone=!1,this._completeCallback=t,this._errorCallback=i,this._progressCallback=n}setHoverTime(e){this._hoverTime=e}_firstWaitTime(){return this._hoverTime/2}_secondWaitTime(){return this._hoverTime/2}_loadingMessageTime(){return 3*this._hoverTime}_triggerAsyncComputation(){this._state=2,this._secondWaitScheduler.schedule(this._secondWaitTime()),this._computer.computeAsync?(this._asyncComputationPromiseDone=!1,this._asyncComputationPromise=Object(se.h)((e=>this._computer.computeAsync(e))),this._asyncComputationPromise.then((e=>{this._asyncComputationPromiseDone=!0,this._withAsyncResult(e)}),(e=>this._onError(e)))):this._asyncComputationPromiseDone=!0}_triggerSyncComputation(){this._computer.computeSync&&this._computer.onResult(this._computer.computeSync(),!0),this._asyncComputationPromiseDone?(this._state=0,this._onComplete(this._computer.getResult())):(this._state=3,this._onProgress(this._computer.getResult()))}_showLoadingMessage(){3===this._state&&this._onProgress(this._computer.getResultWithLoadingMessage())}_withAsyncResult(e){e&&this._computer.onResult(e,!1),3===this._state&&(this._state=0,this._onComplete(this._computer.getResult()))}_onComplete(e){this._completeCallback(e)}_onError(e){this._errorCallback?this._errorCallback(e):Object(Ie.e)(e)}_onProgress(e){this._progressCallback(e)}start(e){if(0===e)0===this._state&&(this._state=1,this._firstWaitScheduler.schedule(this._firstWaitTime()),this._loadingMessageScheduler.schedule(this._loadingMessageTime()));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation()}}cancel(){this._loadingMessageScheduler.cancel(),1===this._state&&this._firstWaitScheduler.cancel(),2===this._state&&(this._secondWaitScheduler.cancel(),this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null)),3===this._state&&this._asyncComputationPromise&&(this._asyncComputationPromise.cancel(),this._asyncComputationPromise=null),this._state=0}}const ss=rn.a;class rs extends re.a{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this._scrollbar=this._register(new hn.a(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this._scrollbar.getDomNode())}onContentsChanged(){this._scrollbar.scanDomNode()}}var as=i(45),ls=i(158);const hs=new Vo.a(new Vo.c(0,122,204)),cs={showArrow:!0,showFrame:!0,className:"",frameColor:hs,arrowColor:hs,keepEditorSelection:!1};class ds{constructor(e,t,i,n,o,s){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class us{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class gs{constructor(e){this._editor=e,this._ruleName=gs._IdGenerator.nextId(),this._decorations=[],this._color=null,this._height=-1}dispose(){this.hide(),rn.O(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){rn.O(this._ruleName),rn.v(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){this._decorations=this._editor.deltaDecorations(this._decorations,[{range:g.a.fromPositions(e),options:{className:this._ruleName,stickiness:1}}])}hide(){this._editor.deltaDecorations(this._decorations,[])}}gs._IdGenerator=new bn.a(".arrow-decoration-");class ms{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._positionMarkerId=[],this._viewZone=null,this._disposables=new re.b,this.container=null,this._isShowing=!1,this.editor=e,this.options=xn.b(t),xn.f(this.options,cs,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange((e=>{const t=this._getWidth(e);this.domNode.style.width=t+"px",this.domNode.style.left=this._getLeft(e)+"px",this._onWidth(t)})))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null})),this.editor.deltaDecorations(this._positionMarkerId,[]),this._positionMarkerId=[],this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new gs(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){let e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){let e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){let t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash&&this._resizeSash.layout()}get position(){const[e]=this._positionMarkerId;if(!e)return;const t=this.editor.getModel();if(!t)return;const i=t.getDecorationRange(e);return i?i.getStartPosition():void 0}show(e,t){const i=g.a.isIRange(e)?g.a.lift(e):g.a.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId=this.editor.deltaDecorations(this._positionMarkerId,[{range:i,options:be.a.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id)})),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow&&this._arrow.hide()}_decoratingElementsHeight(){let e=this.editor.getOption(55),t=0;return this.options.showArrow&&(t+=2*Math.round(e/3)),this.options.showFrame&&(t+=2*Math.round(e/9)),t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),o=this._getWidth(n);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(n)+"px";const s=document.createElement("div");s.style.overflow="hidden";const r=this.editor.getOption(55),a=Math.max(12,this.editor.getLayoutInfo().height/r*.8);t=Math.min(t,a);let l=0,h=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(r/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(h=Math.round(r/9)),this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new ds(s,i.lineNumber,i.column,t,(e=>this._onViewZoneTop(e)),(e=>this._onViewZoneHeight(e))),this._viewZone.id=e.addZone(this._viewZone),this._overlayWidget=new us("vs.editor.contrib.zoneWidget"+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)})),this.container&&this.options.showFrame){const e=this.options.frameWidth?this.options.frameWidth:h;this.container.style.borderTopWidth=e+"px",this.container.style.borderBottomWidth=e+"px"}let c=t*r-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,o),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const t=e.endLineNumber+1;t<=d.getLineCount()?this.revealLine(t,!1):this.revealLine(d.getLineCount(),!0)}}revealLine(e,t){t?this.editor.revealLineInCenter(e,0):this.editor.revealLine(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones((t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))}))}_initSash(){if(this._resizeSash)return;let e;this._resizeSash=this._disposables.add(new An.b(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.hide(),this._resizeSash.state=0),this._disposables.add(this._resizeSash.onDidStart((t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})}))),this._disposables.add(this._resizeSash.onDidEnd((()=>{e=void 0}))),this._disposables.add(this._resizeSash.onDidChange((t=>{if(e){let i=(t.currentY-e.startY)/this.editor.getOption(55),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;o>5&&o<35&&this._relayout(o)}})))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(null===this.domNode.style.height?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var ps=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},fs=function(e,t){return function(i,n){t(i,n,e)}};const _s=Object(Et.c)("IPeekViewService");var bs,vs;Object(ai.b)(_s,class{constructor(){this._widgets=new Map}addExclusiveWidget(e,t){const i=this._widgets.get(e);i&&(i.listener.dispose(),i.widget.dispose()),this._widgets.set(e,{widget:t,listener:t.onDidClose((()=>{const i=this._widgets.get(e);i&&i.widget===t&&(i.listener.dispose(),this._widgets.delete(e))}))})}}),(vs=bs||(bs={})).inPeekEditor=new _.c("inReferenceSearchEditor",!0,r.a("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),vs.notInPeekEditor=vs.inPeekEditor.toNegated();let Cs=class{constructor(e,t){e instanceof Co&&bs.inPeekEditor.bindTo(t)}dispose(){}};Cs.ID="editor.contrib.referenceController",Cs=ps([fs(1,_.b)],Cs),Object(a.j)(Cs.ID,Cs);const ws={headerBackgroundColor:Vo.a.white,primaryHeadingColor:Vo.a.fromHex("#333333"),secondaryHeadingColor:Vo.a.fromHex("#6c6c6cb3")};let ys=class extends ms{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new ae.a,this.onDidClose=this._onDidClose.event,xn.f(this.options,ws,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){let t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();let e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=rn.a(".head"),this._bodyElement=rn.a(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){const i=rn.a(".peekview-title");rn.q(this._headElement,i),rn.o(i,"click",(e=>this._onTitleClick(e))),this._fillTitleIcon(i),this._primaryHeading=rn.a("span.filename"),this._secondaryHeading=rn.a("span.dirname"),this._metaHeading=rn.a("span.meta"),rn.q(i,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=rn.a(".peekview-actions");rn.q(this._headElement,n);const o=this._getActionBarOptions();this._actionbarWidget=new Bn.a(n,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new jn.a("peekview.close",r.a("label.close","Close"),ve.b.close.classNames,!0,(()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:to.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("aria-label",e),t?this._secondaryHeading.innerText=t:rn.t(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,rn.U(this._metaHeading)):rn.J(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0)return void this.dispose();const i=Math.ceil(1.2*this.editor.getOption(55)),n=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(n,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};ys=ps([fs(2,Et.a)],ys);const Ss=Object(Be.ac)("peekViewTitle.background",{dark:"#1E1E1E",light:"#FFFFFF",hc:"#0C141F"},r.a("peekViewTitleBackground","Background color of the peek view title area.")),xs=Object(Be.ac)("peekViewTitleLabel.foreground",{dark:"#FFFFFF",light:"#333333",hc:"#FFFFFF"},r.a("peekViewTitleForeground","Color of the peek view title.")),Ls=Object(Be.ac)("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161e6",hc:"#FFFFFF99"},r.a("peekViewTitleInfoForeground","Color of the peek view title info.")),ks=Object(Be.ac)("peekView.border",{dark:"#007acc",light:"#007acc",hc:Be.h},r.a("peekViewBorder","Color of the peek view borders and arrow.")),Ds=Object(Be.ac)("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hc:Vo.a.black},r.a("peekViewResultsBackground","Background color of the peek view result list.")),Ns=Object(Be.ac)("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hc:Vo.a.white},r.a("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list.")),Es=Object(Be.ac)("peekViewResult.fileForeground",{dark:Vo.a.white,light:"#1E1E1E",hc:Vo.a.white},r.a("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list.")),Os=Object(Be.ac)("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hc:null},r.a("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list.")),Is=Object(Be.ac)("peekViewResult.selectionForeground",{dark:Vo.a.white,light:"#6C6C6C",hc:Vo.a.white},r.a("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list.")),Ts=Object(Be.ac)("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hc:Vo.a.black},r.a("peekViewEditorBackground","Background color of the peek view editor.")),Ms=Object(Be.ac)("peekViewEditorGutter.background",{dark:Ts,light:Ts,hc:Ts},r.a("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor.")),As=Object(Be.ac)("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hc:null},r.a("peekViewResultsMatchHighlight","Match highlight color in the peek view result list.")),Rs=Object(Be.ac)("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hc:null},r.a("peekViewEditorMatchHighlight","Match highlight color in the peek view editor.")),Ps=Object(Be.ac)("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hc:Be.b},r.a("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var Fs,Ws=i(52);(Fs||(Fs={})).className=function(e){switch(e){case Ws.a.Ignore:return"severity-ignore "+ve.b.info.classNames;case Ws.a.Info:return ve.b.info.classNames;case Ws.a.Warning:return ve.b.warning.classNames;case Ws.a.Error:return ve.b.error.classNames;default:return""}},Object(we.f)(((e,t)=>{const i=e.getColor(Be.Sb);if(i){const e=ve.b.error.cssSelector;t.addRule(`\n\t\t\t.monaco-editor .zone-widget ${e},\n\t\t\t.markers-panel .marker-icon${e},\n\t\t\t.extensions-viewlet > .extensions ${e} {\n\t\t\t\tcolor: ${i};\n\t\t\t}\n\t\t`)}const n=e.getColor(Be.Ub);if(n){const e=ve.b.warning.cssSelector;t.addRule(`\n\t\t\t.monaco-editor .zone-widget ${e},\n\t\t\t.markers-panel .marker-icon${e},\n\t\t\t.extensions-viewlet > .extensions ${e},\n\t\t\t.extension-editor ${e} {\n\t\t\t\tcolor: ${n};\n\t\t\t}\n\t\t`)}const o=e.getColor(Be.Tb);if(o){const e=ve.b.info.cssSelector;t.addRule(`\n\t\t\t.monaco-editor .zone-widget ${e},\n\t\t\t.markers-panel .marker-icon${e},\n\t\t\t.extensions-viewlet > .extensions ${e},\n\t\t\t.extension-editor ${e} {\n\t\t\t\tcolor: ${o};\n\t\t\t}\n\t\t`)}}));var Bs=function(e,t){return function(i,n){t(i,n,e)}};class js{constructor(e,t,i,n,o){this._openerService=n,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new re.b,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(rn.o(this._relatedBlock,"click",(e=>{e.preventDefault();const t=this._relatedDiagnostics.get(e.target);t&&i(t)}))),this._scrollable=new hn.b(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:3,verticalScrollbarSize:3}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll((e=>{s.style.left=`-${e.scrollLeft}px`,s.style.top=`-${e.scrollTop}px`}))),this._disposables.add(this._scrollable)}dispose(){Object(re.f)(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:o}=e;let s=((null==t?void 0:t.length)||0)+"()".length;o&&(s+="string"==typeof o?o.length:o.value.length);const r=Object(E.P)(i);this._lines=r.length,this._longestLineLength=0;for(const e of r)this._longestLineLength=Math.max(e.length+s,this._longestLineLength);rn.t(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let a=this._messageBlock;for(const e of r)a=document.createElement("div"),a.innerText=e,""===e&&(a.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(a);if(t||o){const e=document.createElement("span");if(e.classList.add("details"),a.appendChild(e),t){const i=document.createElement("span");i.innerText=t,i.classList.add("source"),e.appendChild(i)}if(o)if("string"==typeof o){const t=document.createElement("span");t.innerText=`(${o})`,t.classList.add("code"),e.appendChild(t)}else this._codeLink=rn.a("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=e=>{this._openerService.open(o.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()},rn.q(this._codeLink,rn.a("span")).innerText=o.value,e.appendChild(this._codeLink)}if(rn.t(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Object(Le.m)(n)){const e=this._relatedBlock.appendChild(document.createElement("div"));e.style.paddingTop=`${Math.floor(.66*this._editor.getOption(55))}px`,this._lines+=1;for(const t of n){let i=document.createElement("div"),n=document.createElement("a");n.classList.add("filename"),n.innerText=`${Ft(t.resource)}(${t.startLineNumber}, ${t.startColumn}): `,n.title=this._labelService.getUriLabel(t.resource),this._relatedDiagnostics.set(n,t);let o=document.createElement("span");o.innerText=t.message,i.appendChild(n),i.appendChild(o),this._lines+=1,e.appendChild(i)}}const l=this._editor.getOption(40),h=Math.ceil(l.typicalFullwidthCharacterWidth*this._longestLineLength*.75),c=l.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:h,scrollHeight:c})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case as.c.Error:t=r.a("Error","Error");break;case as.c.Warning:t=r.a("Warning","Warning");break;case as.c.Info:t=r.a("Info","Info");break;case as.c.Hint:t=r.a("Hint","Hint")}let i=r.a("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}}let Vs=class e extends ys{constructor(e,t,i,n,o,s,r){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0},o),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=s,this._labelService=r,this._callOnDispose=new re.b,this._onDidSelectRelatedInformation=new ae.a,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=as.c.Warning,this._backgroundColor=Vo.a.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Gs);let t=Ks;this._severity===as.c.Warning?t=$s:this._severity===as.c.Info&&(t=qs);const i=e.getColor(t);this.style({arrowColor:i,frameColor:i,headerBackgroundColor:this._backgroundColor,primaryHeadingColor:e.getColor(xs),secondaryHeadingColor:e.getColor(Ls)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(t){super._fillHead(t),this._disposables.add(this._actionbarWidget.actionRunner.onBeforeRun((e=>this.editor.focus())));const i=[],n=this._menuService.createMenu(e.TitleMenu,this._contextKeyService);(function(e,t,i,n,o,s){const r=e.getActions(t);(function(e,t,i,n="navigation",o=Number.MAX_SAFE_INTEGER,s=(()=>!1)){let r,a;Array.isArray(t)?(r=t,a=t):(r=t.primary,a=t.secondary);const l=new Set;for(const[t,o]of e){let e;t===n?e=r:(e=a,e.length>0&&e.push(new jn.d));for(let n of o){i&&(n=n instanceof V.c&&n.alt?n.alt:n);const o=e.push(n);n instanceof jn.e&&l.add({group:t,action:n,index:o-1})}}for(const{group:e,action:t,index:i}of l){const l=e===n?r:a,h=t.actions;(h.length<=1||l.length+h.length-2<=o)&&s(t,e,l.length)&&l.splice(i,1,...h)}if(r!==a&&r.length>o){const e=r.splice(o,r.length-o);a.unshift(...e,new jn.d)}})(r,i,!1,n,o,s),function(e){const t=new re.b;for(const[,i]of e)for(const e of i)t.add(e)}(r)})(n,void 0,i),this._actionbarWidget.push(i,{label:!1,icon:!0,index:0}),n.dispose()}_fillTitleIcon(e){this._icon=rn.q(e,rn.a(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new js(this._container,this.editor,(e=>this._onDidSelectRelatedInformation.fire(e)),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());let n=g.a.lift(e);const o=this.editor.getPosition();let s=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const e=i>1?r.a("problems","{0} of {1} problems",t,i):r.a("change","{0} of {1} problem",t,i);this.setTitle(Object(It.b)(a.uri),e)}this._icon.className=`codicon ${Fs.className(as.c.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};Vs.TitleMenu=new V.b("gotoErrorTitleMenu"),Vs=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Bs(1,we.b),Bs(2,On.a),Bs(3,V.a),Bs(4,Et.a),Bs(5,_.b),Bs(6,Zt.a)],Vs);let Hs=Object(Be.Pb)(Be.u,Be.t),zs=Object(Be.Pb)(Be.P,Be.O),Us=Object(Be.Pb)(Be.H,Be.G);const Ks=Object(Be.ac)("editorMarkerNavigationError.background",{dark:Hs,light:Hs,hc:Hs},r.a("editorMarkerNavigationError","Editor marker navigation widget error color.")),$s=Object(Be.ac)("editorMarkerNavigationWarning.background",{dark:zs,light:zs,hc:zs},r.a("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),qs=Object(Be.ac)("editorMarkerNavigationInfo.background",{dark:Us,light:Us,hc:Us},r.a("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Gs=Object(Be.ac)("editorMarkerNavigation.background",{dark:"#2D2D30",light:Vo.a.white,hc:"#0C141F"},r.a("editorMarkerNavigationBackground","Editor marker navigation widget background."));Object(we.f)(((e,t)=>{const i=e.getColor(Be.mc);i&&(t.addRule(`.monaco-editor .marker-widget a { color: ${i}; }`),t.addRule(`.monaco-editor .marker-widget a.code-link span:hover { color: ${i}; }`))}));var Ys=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Zs=function(e,t){return function(i,n){t(i,n,e)}};class Qs{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let Xs=class e{constructor(t,i){this._markerService=i,this._onDidChange=new ae.a,this.onDidChange=this._onDidChange.event,this._dispoables=new re.b,this._markers=[],this._nextIdx=-1,gt.a.isUri(t)?this._resourceFilter=e=>e.toString()===t.toString():t&&(this._resourceFilter=t);const n=()=>{this._markers=this._markerService.read({resource:gt.a.isUri(t)?t:void 0,severities:as.c.Error|as.c.Warning|as.c.Info}),"function"==typeof t&&(this._markers=this._markers.filter((e=>this._resourceFilter(e.resource)))),this._markers.sort(e._compareMarker)};n(),this._dispoables.add(i.onMarkerChanged((e=>{this._resourceFilter&&!e.some((e=>this._resourceFilter(e)))||(n(),this._nextIdx=-1,this._onDidChange.fire())})))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e||!(!this._resourceFilter||!e)&&this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new Qs(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,o=this._markers.findIndex((t=>t.resource.toString()===e.uri.toString()));o<0&&(o=Object(Le.c)(this._markers,{resource:e.uri},((e,t)=>Object(E.f)(e.resource.toString(),t.resource.toString()))),o<0&&(o=~o));for(let i=o;it.resource.toString()===e.toString()));if(!(i<0))for(;ithis.close()),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition((e=>{var t,i,n;(null===(t=this._model)||void 0===t?void 0:t.selected)&&g.a.containsPosition(null===(i=this._model)||void 0===i?void 0:i.selected.marker,e.position)||null===(n=this._model)||void 0===n||n.resetIndex()}))),this._sessionDispoables.add(this._model.onDidChange((()=>{if(!this._widget||!this._widget.position||!this._model)return;const e=this._model.find(this._editor.getModel().uri,this._widget.position);e?this._widget.updateMarker(e.marker):this._widget.showStale()}))),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation((e=>{this._editorService.openCodeEditor({resource:e.resource,options:{pinned:!0,revealIfOpened:!0,selection:g.a.lift(e).collapseToStart()}},this._editor),this.close(!1)}))),this._sessionDispoables.add(this._editor.onDidChangeModel((()=>this._cleanUp()))),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new u.a(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(t,i){return ir(this,void 0,void 0,(function*(){if(this._editor.hasModel()){const n=this._getOrCreateModel(i?void 0:this._editor.getModel().uri);if(n.move(t,this._editor.getModel(),this._editor.getPosition()),!n.selected)return;if(n.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const o=yield this._editorService.openCodeEditor({resource:n.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:n.selected.marker}},this._editor);o&&(e.get(o).close(),e.get(o).nagivate(t,i))}else this._widget.showAtMarker(n.selected.marker,n.selected.index,n.selected.total)}}))}};nr.ID="editor.contrib.markerController",nr=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([tr(1,Js),tr(2,_.b),tr(3,bo.a),tr(4,Et.a)],nr);class or extends a.b{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){return ir(this,void 0,void 0,(function*(){t.hasModel()&&nr.get(t).nagivate(this._next,this._multiFile)}))}}class sr extends or{constructor(){super(!0,!1,{id:sr.ID,label:sr.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:p.a.focus,primary:578,weight:100},menuOpts:{menuId:Vs.TitleMenu,title:sr.LABEL,icon:Object(Ce.b)("marker-navigation-next",ve.b.chevronDown,r.a("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}sr.ID="editor.action.marker.next",sr.LABEL=r.a("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class rr extends or{constructor(){super(!1,!1,{id:rr.ID,label:rr.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:p.a.focus,primary:1602,weight:100},menuOpts:{menuId:Vs.TitleMenu,title:sr.LABEL,icon:Object(Ce.b)("marker-navigation-previous",ve.b.chevronUp,r.a("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}rr.ID="editor.action.marker.prev",rr.LABEL=r.a("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)"),Object(a.j)(nr.ID,nr),Object(a.h)(sr),Object(a.h)(rr),Object(a.h)(class extends or{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:r.a("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:p.a.focus,primary:66,weight:100},menuOpts:{menuId:V.b.MenubarGoMenu,title:r.a({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}),Object(a.h)(class extends or{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:r.a("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:p.a.focus,primary:1090,weight:100},menuOpts:{menuId:V.b.MenubarGoMenu,title:r.a({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}});const ar=new _.c("markersNavigationVisible",!1),lr=a.c.bindToContribution(nr.get);Object(a.i)(new lr({id:"closeMarkersNavigation",precondition:ar,handler:e=>e.close(),kbOpts:{weight:150,kbExpr:p.a.focus,primary:9,secondary:[1033]}}));class hr{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||""===this.value||e.value.startsWith(this.value+hr.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new hr(this.value+hr.sep+e)}}function cr(e,t,i){return!(!t.contains(e)||i&&t.contains(i))}hr.sep=".",hr.None=new hr("@@none@@"),hr.Empty=new hr(""),hr.QuickFix=new hr("quickfix"),hr.Refactor=new hr("refactor"),hr.Source=new hr("source"),hr.SourceOrganizeImports=hr.Source.append("organizeImports"),hr.SourceFixAll=hr.Source.append("fixAll");class dr{constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}static fromUser(e,t){return e&&"object"==typeof e?new dr(dr.getKindFromUser(e,t.kind),dr.getApplyFromUser(e,t.apply),dr.getPreferredUser(e)):new dr(t.kind,t.apply,!1)}static getApplyFromUser(e,t){switch("string"==typeof e.apply?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return"string"==typeof e.kind?new hr(e.kind):t}static getPreferredUser(e){return"boolean"==typeof e.preferred&&e.preferred}}var ur=i(84),gr=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const mr="editor.action.codeAction",pr="editor.action.refactor",fr="editor.action.sourceAction",_r="editor.action.organizeImports",br="editor.action.fixAll";class vr{constructor(e,t){this.action=e,this.provider=t}resolve(e){var t;return gr(this,void 0,void 0,(function*(){if((null===(t=this.provider)||void 0===t?void 0:t.resolveCodeAction)&&!this.action.edit){let t;try{t=yield this.provider.resolveCodeAction(this.action,e)}catch(e){Object(Ie.f)(e)}t&&(this.action.edit=t.edit)}return this}))}}class Cr extends re.a{constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(Cr.codeActionsComparator),this.validActions=this.allActions.filter((({action:e})=>!e.disabled))}static codeActionsComparator({action:e},{action:t}){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:Object(Le.m)(e.diagnostics)?Object(Le.m)(t.diagnostics)?e.diagnostics[0].message.localeCompare(t.diagnostics[0].message):-1:Object(Le.m)(t.diagnostics)?1:0}get hasAutoFix(){return this.validActions.some((({action:e})=>!!e.kind&&hr.QuickFix.contains(new hr(e.kind))&&!!e.isPreferred))}}const wr={actions:[],documentation:void 0};function yr(e,t,i,n,o){var s;const r=i.filter||{},a={only:null===(s=r.include)||void 0===s?void 0:s.value,trigger:i.type},l=new Ze.d(e,o),h=function(e,t){return Oe.a.all(e).filter((e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some((e=>function(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some((i=>cr(t,i,e.include)))||!e.includeSourceActions&&hr.Source.contains(t))}(t,new hr(e))))))}(e,r),c=new re.b,d=h.map((i=>gr(this,void 0,void 0,(function*(){try{n.report(i);const o=yield i.provideCodeActions(e,t,a,l.token);if(o&&c.add(o),l.token.isCancellationRequested)return wr;const s=((null==o?void 0:o.actions)||[]).filter((e=>e&&function(e,t){const i=t.kind?new hr(t.kind):void 0;return!(!(!e.include||i&&e.include.contains(i))||e.excludes&&i&&e.excludes.some((t=>cr(i,t,e.include)))||!e.includeSourceActions&&i&&hr.Source.contains(i)||e.onlyIncludePreferredActions&&!t.isPreferred)}(r,e))),h=function(e,t,i){if(!e.documentation)return;const n=e.documentation.map((e=>({kind:new hr(e.kind),command:e.command})));if(i){let e;for(const t of n)t.kind.contains(i)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return null==e?void 0:e.command}for(const e of t)if(e.kind)for(const t of n)if(t.kind.contains(new hr(e.kind)))return t.command}(i,s,r.include);return{actions:s.map((e=>new vr(e,i))),documentation:h}}catch(e){if(Object(Ie.d)(e))throw e;return Object(Ie.f)(e),wr}})))),u=Oe.a.onDidChange((()=>{const t=Oe.a.all(e);Object(Le.g)(t,h)||l.cancel()}));return Promise.all(d).then((e=>{const t=Object(Le.j)(e.map((e=>e.actions))),i=Object(Le.d)(e.map((e=>e.documentation)));return new Cr(t,i,c)})).finally((()=>{u.dispose(),l.dispose()}))}ut.a.registerCommand("_executeCodeActionProvider",(function(e,t,i,n,o){return gr(this,void 0,void 0,(function*(){if(!(t instanceof gt.a))throw Object(Ie.b)();const s=e.get(uo.a).getModel(t);if(!s)throw Object(Ie.b)();const r=m.a.isISelection(i)?m.a.liftSelection(i):g.a.isIRange(i)?s.validateRange(i):void 0;if(!r)throw Object(Ie.b)();const a="string"==typeof n?new hr(n):void 0,l=yield yr(s,r,{type:1,filter:{includeSourceActions:!0,include:a}},ur.b.None,Qe.a.None),h=[],c=Math.min(l.validActions.length,"number"==typeof o?o:0);for(let e=0;ee.action))}finally{setTimeout((()=>l.dispose()),100)}}))}));class Sr{constructor(e){this.executor=e,this._didRun=!1}getValue(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var xr=i(150),Lr=i(97);let kr=class e{constructor(t,i){this._messageWidget=new re.d,this._messageListeners=new re.b,this._editor=t,this._visible=e.MESSAGE_VISIBLE.bindTo(i),this._editorListener=this._editor.onDidAttemptReadOnlyEdit((()=>this._onDidAttemptReadOnlyEdit()))}static get(t){return t.getContribution(e.ID)}dispose(){this._editorListener.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){let i;Object(Ye.a)(e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._messageWidget.value=new Nr(this._editor,t,e),this._messageListeners.add(this._editor.onDidBlurEditorText((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidChangeCursorPosition((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidDispose((()=>this.closeMessage()))),this._messageListeners.add(this._editor.onDidChangeModel((()=>this.closeMessage()))),this._messageListeners.add(new se.g((()=>this.closeMessage()),3e3)),this._messageListeners.add(this._editor.onMouseMove((e=>{e.target.position&&(i?i.containsPosition(e.target.position)||this.closeMessage():i=new g.a(t.lineNumber-3,1,e.target.position.lineNumber+3,1))})))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Nr.fadeOut(this._messageWidget.value))}_onDidAttemptReadOnlyEdit(){this._editor.hasModel()&&this.showMessage(r.a("editor.readonly","Cannot edit in read-only editor"),this._editor.getPosition())}};kr.ID="editor.contrib.messageController",kr.MESSAGE_VISIBLE=new _.c("messageVisible",!1,r.a("messageVisible","Whether the editor is currently showing an inline message")),kr=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,_.b)],kr);const Dr=a.c.bindToContribution(kr.get);Object(a.i)(new Dr({id:"leaveEditorMessage",precondition:kr.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));class Nr{constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i-1},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage");const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");s.classList.add("message"),s.textContent=n,this._domNode.appendChild(s);const r=document.createElement("div");r.classList.add("anchor","below"),this._domNode.appendChild(r),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}static fadeOut(e){let t;const i=()=>{e.dispose(),clearTimeout(t),e.getDomNode().removeEventListener("animationend",i)};return t=setTimeout(i,110),e.getDomNode().addEventListener("animationend",i),e.getDomNode().classList.add("fadeOut"),{dispose:i}}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2]}}afterRender(e){this._domNode.classList.toggle("below",2===e)}}Object(a.j)(kr.ID,kr),Object(we.f)(((e,t)=>{const i=e.getColor(Be.cb);if(i){let n=e.type===Lr.a.HIGH_CONTRAST?2:1;t.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor.below { border-top-color: ${i}; }`),t.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor.top { border-bottom-color: ${i}; }`),t.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { border: ${n}px solid ${i}; }`)}const n=e.getColor(Be.bb);n&&t.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${n}; }`);const o=e.getColor(Be.db);o&&t.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { color: ${o}; }`)}));var Er=function(e,t){return function(i,n){t(i,n,e)}};class Or extends jn.a{constructor(e,t){super(e.command?e.command.id:e.title,e.title.replace(/\r\n|\r|\n/g," "),void 0,!e.disabled,t),this.action=e}}let Ir=class extends re.a{constructor(e,t,i,n){super(),this._editor=e,this._delegate=t,this._contextMenuService=i,this._visible=!1,this._showingActions=this._register(new re.d),this._keybindingResolver=new Tr({getKeybindings:()=>n.getKeybindings()})}get isVisible(){return this._visible}show(e,t,i,n){return o=this,s=void 0,a=function*(){const o=n.includeDisabledActions?t.allActions:t.validActions;if(!o.length)return void(this._visible=!1);if(!this._editor.getDomNode())throw this._visible=!1,Object(Ie.a)();this._visible=!0,this._showingActions.value=t;const s=this.getMenuActions(e,o,t.documentation),r=u.a.isIPosition(i)?this._toCoords(i):i||{x:0,y:0},a=this._keybindingResolver.getResolver(),l=this._editor.getOption(111);this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>r,getActions:()=>s,onHide:()=>{this._visible=!1,this._editor.focus()},autoSelectFirstItem:!0,getKeyBinding:e=>e instanceof Or?a(e.action):void 0})},new((r=void 0)||(r=Promise))((function(e,t){function i(e){try{l(a.next(e))}catch(e){t(e)}}function n(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var o;t.done?e(t.value):(o=t.value,o instanceof r?o:new r((function(e){e(o)}))).then(i,n)}l((a=a.apply(o,s||[])).next())}));var o,s,r,a}getMenuActions(e,t,i){var n,o;const s=e=>new Or(e.action,(()=>this._delegate.onSelectCodeAction(e))),r=t.map(s),a=[...i],l=this._editor.getModel();if(l&&r.length)for(const i of Oe.a.all(l))i._getAdditionalMenuItems&&a.push(...i._getAdditionalMenuItems({trigger:e.type,only:null===(o=null===(n=e.filter)||void 0===n?void 0:n.include)||void 0===o?void 0:o.value},t.map((e=>e.action))));return a.length&&r.push(new jn.d,...a.map((e=>s(new vr({title:e.title,command:e},void 0))))),r}_toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Object(rn.C)(this._editor.getDomNode());return{x:i.left+t.left,y:i.top+t.top+t.height}}};Ir=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Er(2,Vn.a),Er(3,Hn.a)],Ir);class Tr{constructor(e){this._keybindingProvider=e}getResolver(){const e=new Sr((()=>this._keybindingProvider.getKeybindings().filter((e=>Tr.codeActionCommands.indexOf(e.command)>=0)).filter((e=>e.resolvedKeybinding)).map((e=>{let t=e.commandArgs;return e.command===_r?t={kind:hr.SourceOrganizeImports.value}:e.command===br&&(t={kind:hr.SourceFixAll.value}),Object.assign({resolvedKeybinding:e.resolvedKeybinding},dr.fromUser(t,{kind:hr.None,apply:"never"}))}))));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.getValue());return null==i?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new hr(e.kind);return t.filter((e=>e.kind.contains(i))).filter((t=>!t.preferred||e.isPreferred)).reduceRight(((e,t)=>e?e.kind.contains(t.kind)?t:e:t),void 0)}}Tr.codeActionCommands=[pr,mr,fr,_r,br];var Mr;!function(e){e.Hidden={type:0},e.Showing=class{constructor(e,t,i,n){this.actions=e,this.trigger=t,this.editorPosition=i,this.widgetPosition=n,this.type=1}}}(Mr||(Mr={}));let Ar=class e extends re.a{constructor(e,t,i,n){super(),this._editor=e,this._quickFixActionId=t,this._preferredFixActionId=i,this._keybindingService=n,this._onClick=this._register(new ae.a),this.onClick=this._onClick.event,this._state=Mr.Hidden,this._domNode=document.createElement("div"),this._domNode.className=ve.b.lightBulb.classNames,this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent((e=>{const t=this._editor.getModel();(1!==this.state.type||!t||this.state.editorPosition.lineNumber>=t.getLineCount())&&this.hide()}))),$n.b.ignoreTarget(this._domNode),this._register(rn.n(this._domNode,(e=>{if(1!==this.state.type)return;this._editor.focus(),e.preventDefault();const{top:t,height:i}=rn.C(this._domNode),n=this._editor.getOption(55);let o=Math.floor(n/3);null!==this.state.widgetPosition.position&&this.state.widgetPosition.position.lineNumber{if(1!=(1&e.buttons))return;this.hide();const t=new Go.a;t.startMonitoring(e.target,e.buttons,Go.b,(()=>{}),(()=>{t.dispose()}))}))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(53)&&!this._editor.getOption(53).enabled&&this.hide()}))),this._updateLightBulbTitleAndIcon(),this._register(this._keybindingService.onDidUpdateKeybindings(this._updateLightBulbTitleAndIcon,this))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return 1===this._state.type?this._state.widgetPosition:null}update(t,i,n){if(t.validActions.length<=0)return this.hide();const o=this._editor.getOptions();if(!o.get(53).enabled)return this.hide();const s=this._editor.getModel();if(!s)return this.hide();const{lineNumber:r,column:a}=s.validatePosition(n),l=s.getOptions().tabSize,h=o.get(40),c=s.getLineContent(r),d=be.b.computeIndentLevel(c,l),u=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1);let g=r;if(!(h.spaceWidth*d>22))if(r>1&&!u(r-1))g-=1;else if(u(r+1)){if(a*h.spaceWidth<22)return this.hide()}else g+=1;this.state=new Mr.Showing(t,i,n,{position:{lineNumber:g,column:1},preference:e._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state=Mr.Hidden,this._editor.layoutContentWidget(this)}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(1===this.state.type&&this.state.actions.hasAutoFix){this._domNode.classList.remove(...ve.b.lightBulb.classNamesArray),this._domNode.classList.add(...ve.b.lightbulbAutofix.classNamesArray);const e=this._keybindingService.lookupKeybinding(this._preferredFixActionId);if(e)return void(this.title=r.a("prefferedQuickFixWithKb","Show Fixes. Preferred Fix Available ({0})",e.getLabel()))}this._domNode.classList.remove(...ve.b.lightbulbAutofix.classNamesArray),this._domNode.classList.add(...ve.b.lightBulb.classNamesArray);const e=this._keybindingService.lookupKeybinding(this._quickFixActionId);this.title=e?r.a("quickFixWithKb","Show Fixes ({0})",e.getLabel()):r.a("quickFix","Show Fixes")}set title(e){this._domNode.title=e}};Ar._posPref=[0],Ar=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(3,Hn.a)],Ar),Object(we.f)(((e,t)=>{var i;const n=null===(i=e.getColor(Be.r))||void 0===i?void 0:i.transparent(.7),o=e.getColor(Be.J);o&&t.addRule(`\n\t\t.monaco-editor .contentWidgets ${ve.b.lightBulb.cssSelector} {\n\t\t\tcolor: ${o};\n\t\t\tbackground-color: ${n};\n\t\t}`);const s=e.getColor(Be.I);s&&t.addRule(`\n\t\t.monaco-editor .contentWidgets ${ve.b.lightbulbAutofix.cssSelector} {\n\t\t\tcolor: ${s};\n\t\t\tbackground-color: ${n};\n\t\t}`)}));var Rr,Pr=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Fr=class extends re.a{constructor(e,t,i,n,o){super(),this._editor=e,this.delegate=n,this._activeCodeActions=this._register(new re.d),Rr.set(this,!1),this._codeActionWidget=new Sr((()=>this._register(o.createInstance(Ir,this._editor,{onSelectCodeAction:e=>Pr(this,void 0,void 0,(function*(){this.delegate.applyCodeAction(e,!0)}))})))),this._lightBulbWidget=new Sr((()=>{const e=this._register(o.createInstance(Ar,this._editor,t,i));return this._register(e.onClick((e=>this.showCodeActionList(e.trigger,e.actions,e,{includeDisabledActions:!1})))),e}))}dispose(){(function(e,t,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,i):o?o.value=i:t.set(e,i)})(this,Rr,!0,"f"),super.dispose()}update(e){var t,i,n;return Pr(this,void 0,void 0,(function*(){if(1!==e.type)return void(null===(t=this._lightBulbWidget.rawValue)||void 0===t||t.hide());let o;try{o=yield e.actions}catch(e){return void Object(Ie.e)(e)}if(!function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}(this,Rr,"f"))if(this._lightBulbWidget.getValue().update(o,e.trigger,e.position),1===e.trigger.type){if(null===(i=e.trigger.filter)||void 0===i?void 0:i.include){const t=this.tryGetValidActionToApply(e.trigger,o);if(t){try{yield this.delegate.applyCodeAction(t,!1)}finally{o.dispose()}return}if(e.trigger.context){const t=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,o);if(t&&t.action.disabled)return kr.get(this._editor).showMessage(t.action.disabled,e.trigger.context.position),void o.dispose()}}const t=!!(null===(n=e.trigger.filter)||void 0===n?void 0:n.include);if(e.trigger.context&&(!o.allActions.length||!t&&!o.validActions.length))return kr.get(this._editor).showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=o,void o.dispose();this._activeCodeActions.value=o,this._codeActionWidget.getValue().show(e.trigger,o,e.position,{includeDisabledActions:t})}else this._codeActionWidget.getValue().isVisible?o.dispose():this._activeCodeActions.value=o}))}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length)return"first"===e.autoApply&&0===t.validActions.length||"ifSingle"===e.autoApply&&1===t.allActions.length?t.allActions.find((({action:e})=>e.disabled)):void 0}tryGetValidActionToApply(e,t){if(t.validActions.length)return"first"===e.autoApply&&t.validActions.length>0||"ifSingle"===e.autoApply&&1===t.validActions.length?t.validActions[0]:void 0}showCodeActionList(e,t,i,n){return Pr(this,void 0,void 0,(function*(){this._codeActionWidget.getValue().show(e,t,i,n)}))}};Rr=new WeakMap,Fr=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(4,Et.a)],Fr);var Wr,Br=function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)};const jr=new _.c("supportedCodeAction","");class Vr extends re.a{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new se.g),this._register(this._markerService.onMarkerChanged((e=>this._onMarkerChanges(e)))),this._register(this._editor.onDidChangeCursorPosition((()=>this._onCursorChange())))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);return this._createEventAndSignalChange(e,t)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some((e=>Object(It.f)(e,t.uri)))&&this._autoTriggerTimer.cancelAndSet((()=>{this.trigger({type:2})}),this._delay)}_onCursorChange(){this._autoTriggerTimer.cancelAndSet((()=>{this.trigger({type:2})}),this._delay)}_getRangeOfMarker(e){const t=this._editor.getModel();if(t)for(const i of this._markerService.read({resource:t.uri})){const n=t.validateRange(i);if(g.a.intersectRanges(n,e))return g.a.lift(n)}}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&2===e.type){const{lineNumber:e,column:n}=i.getPosition(),o=t.getLineContent(e);if(0===o.length)return;if(1===n){if(/\s/.test(o[0]))return}else if(n===t.getLineMaxColumn(e)){if(/\s/.test(o[o.length-1]))return}else if(/\s/.test(o[n-2])&&/\s/.test(o[n-1]))return}return i}_createEventAndSignalChange(e,t){const i=this._editor.getModel();if(!t||!i)return void this._signalChange(void 0);const n=this._getRangeOfMarker(t),o=n?n.getStartPosition():t.getStartPosition(),s={trigger:e,selection:t,position:o};return this._signalChange(s),s}}var Hr,zr;(zr=Hr||(Hr={})).Empty={type:0},zr.Triggered=class{constructor(e,t,i,n){this.trigger=e,this.rangeOrSelection=t,this.position=i,this._cancellablePromise=n,this.type=1,this.actions=n.catch((e=>{if(Object(Ie.d)(e))return Ur;throw e}))}cancel(){this._cancellablePromise.cancel()}};const Ur={allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1};class Kr extends re.a{constructor(e,t,i,n){super(),this._editor=e,this._markerService=t,this._progressService=n,this._codeActionOracle=this._register(new re.d),this._state=Hr.Empty,this._onDidChangeState=this._register(new ae.a),this.onDidChangeState=this._onDidChangeState.event,Wr.set(this,!1),this._supportedCodeActions=jr.bindTo(i),this._register(this._editor.onDidChangeModel((()=>this._update()))),this._register(this._editor.onDidChangeModelLanguage((()=>this._update()))),this._register(Oe.a.onDidChange((()=>this._update()))),this._update()}dispose(){Br(this,Wr,"f")||(function(e,t,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,i):o?o.value=i:t.set(e,i)}(this,Wr,!0,"f"),super.dispose(),this.setState(Hr.Empty,!0))}_update(){if(Br(this,Wr,"f"))return;this._codeActionOracle.value=void 0,this.setState(Hr.Empty);const e=this._editor.getModel();if(e&&Oe.a.has(e)&&!this._editor.getOption(77)){const t=[];for(const i of Oe.a.all(e))Array.isArray(i.providedCodeActionKinds)&&t.push(...i.providedCodeActionKinds);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Vr(this._editor,this._markerService,(t=>{var i;if(!t)return void this.setState(Hr.Empty);const n=Object(se.h)((i=>yr(e,t.selection,t.trigger,ur.b.None,i)));1===t.trigger.type&&(null===(i=this._progressService)||void 0===i||i.showWhile(n,250)),this.setState(new Hr.Triggered(t.trigger,t.selection,t.position,n))}),void 0),this._codeActionOracle.value.trigger({type:2})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value&&this._codeActionOracle.value.trigger(e)}setState(e,t){e!==this._state&&(1===this._state.type&&this._state.cancel(),this._state=e,t||Br(this,Wr,"f")||this._onDidChangeState.fire(e))}}Wr=new WeakMap;var $r=function(e,t){return function(i,n){t(i,n,e)}},qr=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Gr(e){return _.a.regex(jr.keys()[0],new RegExp("(\\s|^)"+Object(E.t)(e.value)+"\\b"))}r.a("args.schema.kind","Kind of the code action to run."),r.a("args.schema.apply","Controls when the returned actions are applied."),r.a("args.schema.apply.first","Always apply the first returned code action."),r.a("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),r.a("args.schema.apply.never","Do not apply the returned code actions."),r.a("args.schema.preferred","Controls if only preferred code actions should be returned.");let Yr=class e extends re.a{constructor(e,t,i,n,o){super(),this._instantiationService=o,this._editor=e,this._model=this._register(new Kr(this._editor,t,i,n)),this._register(this._model.onDidChangeState((e=>this.update(e)))),this._ui=new Sr((()=>this._register(new Fr(e,Xr.Id,oa.Id,{applyCodeAction:(e,t)=>qr(this,void 0,void 0,(function*(){try{yield this._applyCodeAction(e)}finally{t&&this._trigger({type:2,filter:{}})}}))},this._instantiationService))))}static get(t){return t.getContribution(e.ID)}update(e){this._ui.getValue().update(e)}showCodeActions(e,t,i){return this._ui.getValue().showCodeActionList(e,t,i,{includeDisabledActions:!1})}manualTriggerAtCurrentPosition(e,t,i){if(!this._editor.hasModel())return;kr.get(this._editor).closeMessage();const n=this._editor.getPosition();this._trigger({type:1,filter:t,autoApply:i,context:{notAvailableMessage:e,position:n}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e){return this._instantiationService.invokeFunction(Zr,e,this._editor)}};function Zr(e,t,i){return qr(this,void 0,void 0,(function*(){const n=e.get(xr.a),o=e.get(ut.b),s=e.get(yi.a),a=e.get(Un.a);if(s.publicLog2("codeAction.applyCodeAction",{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred}),yield t.resolve(Qe.a.None),t.action.edit&&(yield n.apply(xr.b.convert(t.action.edit),{editor:i,label:t.action.title})),t.action.command)try{yield o.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(e){const t=function(e){return"string"==typeof e?e:e instanceof Error&&"string"==typeof e.message?e.message:void 0}(e);a.error("string"==typeof t?t:r.a("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}))}function Qr(e,t,i,n){if(e.hasModel()){const o=Yr.get(e);o&&o.manualTriggerAtCurrentPosition(t,i,n)}}Yr.ID="editor.contrib.quickFixController",Yr=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([$r(1,as.b),$r(2,_.b),$r(3,ur.a),$r(4,Et.a)],Yr);class Xr extends a.b{constructor(){super({id:Xr.Id,label:r.a("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:_.a.and(p.a.writable,p.a.hasCodeActionsProvider),kbOpts:{kbExpr:p.a.editorTextFocus,primary:2132,weight:100}})}run(e,t){return Qr(t,r.a("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0)}}Xr.Id="editor.action.quickFix";class Jr extends a.c{constructor(){super({id:mr,precondition:_.a.and(p.a.writable,p.a.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:argsSchema}]}})}runEditorCommand(e,t,i){const n=dr.fromUser(i,{kind:hr.Empty,apply:"ifSingle"});return Qr(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?r.a("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):r.a("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):n.preferred?r.a("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):r.a("editor.action.codeAction.noneMessage","No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class ea extends a.b{constructor(){super({id:pr,label:r.a("refactor.label","Refactor..."),alias:"Refactor...",precondition:_.a.and(p.a.writable,p.a.hasCodeActionsProvider),kbOpts:{kbExpr:p.a.editorTextFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:_.a.and(p.a.writable,Gr(hr.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:argsSchema}]}})}run(e,t,i){const n=dr.fromUser(i,{kind:hr.Refactor,apply:"never"});return Qr(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?r.a("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):r.a("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):n.preferred?r.a("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):r.a("editor.action.refactor.noneMessage","No refactorings available"),{include:hr.Refactor.contains(n.kind)?n.kind:hr.None,onlyIncludePreferredActions:n.preferred},n.apply)}}class ta extends a.b{constructor(){super({id:fr,label:r.a("source.label","Source Action..."),alias:"Source Action...",precondition:_.a.and(p.a.writable,p.a.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:_.a.and(p.a.writable,Gr(hr.Source))},description:{description:"Source Action...",args:[{name:"args",schema:argsSchema}]}})}run(e,t,i){const n=dr.fromUser(i,{kind:hr.Source,apply:"never"});return Qr(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?r.a("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):r.a("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):n.preferred?r.a("editor.action.source.noneMessage.preferred","No preferred source actions available"):r.a("editor.action.source.noneMessage","No source actions available"),{include:hr.Source.contains(n.kind)?n.kind:hr.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}class ia extends a.b{constructor(){super({id:_r,label:r.a("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:_.a.and(p.a.writable,Gr(hr.SourceOrganizeImports)),kbOpts:{kbExpr:p.a.editorTextFocus,primary:1581,weight:100}})}run(e,t){return Qr(t,r.a("editor.action.organize.noneMessage","No organize imports action available"),{include:hr.SourceOrganizeImports,includeSourceActions:!0},"ifSingle")}}class na extends a.b{constructor(){super({id:br,label:r.a("fixAll.label","Fix All"),alias:"Fix All",precondition:_.a.and(p.a.writable,Gr(hr.SourceFixAll))})}run(e,t){return Qr(t,r.a("fixAll.noneMessage","No fix all action available"),{include:hr.SourceFixAll,includeSourceActions:!0},"ifSingle")}}class oa extends a.b{constructor(){super({id:oa.Id,label:r.a("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:_.a.and(p.a.writable,Gr(hr.QuickFix)),kbOpts:{kbExpr:p.a.editorTextFocus,primary:1620,mac:{primary:2644},weight:100}})}run(e,t){return Qr(t,r.a("editor.action.autoFix.noneMessage","No auto fixes available"),{include:hr.QuickFix,onlyIncludePreferredActions:!0},"ifSingle")}}oa.Id="editor.action.autoFix";var sa=function(e,t){return function(i,n){t(i,n,e)}};const ra=rn.a;class aa{constructor(e,t){this.range=e,this.marker=t}equals(e){return e instanceof aa&&as.a.makeKey(this.marker)===as.a.makeKey(e.marker)}}const la={type:1,filter:{include:hr.QuickFix}};let ha=class{constructor(e,t,i,n,o){this._editor=e,this._hover=t,this._markerDecorationsService=i,this._keybindingService=n,this._openerService=o,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel())return[];const i=this._editor.getModel(),n=e.startLineNumber,o=i.getLineMaxColumn(n),s=[];for(const r of t){const t=r.range.startLineNumber===n?r.range.startColumn:1,a=r.range.endLineNumber===n?r.range.endColumn:o,l=this._markerDecorationsService.getMarker(i.uri,r);if(!l)continue;const h=new g.a(e.startLineNumber,t,e.startLineNumber,a);s.push(new aa(h,l))}return s}renderHoverParts(e,t){if(!e.length)return re.a.None;const i=new re.b;e.forEach((e=>t.appendChild(this.renderMarkerHover(e,i))));const n=1===e.length?e[0]:e.sort(((e,t)=>as.c.compare(e.marker.severity,t.marker.severity)))[0];return t.appendChild(this.renderMarkerStatusbar(n,i)),i}renderMarkerHover(e,t){const i=ra("div.hover-row"),n=rn.q(i,ra("div.marker.hover-contents")),{source:o,message:s,code:r,relatedInformation:a}=e.marker;this._editor.applyFontInfo(n);const l=rn.q(n,ra("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=s,o||r)if(r&&"string"!=typeof r){const e=ra("span");o&&(rn.q(e,ra("span")).innerText=o);const i=rn.q(e,ra("a.code-link"));i.setAttribute("href",r.target.toString()),t.add(rn.i(i,"click",(e=>{this._openerService.open(r.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()}))),rn.q(i,ra("span")).innerText=r.value;const s=rn.q(n,e);s.style.opacity="0.6",s.style.paddingLeft="6px"}else{const e=rn.q(n,ra("span"));e.style.opacity="0.6",e.style.paddingLeft="6px",e.innerText=o&&r?`${o}(${r})`:o||`(${r})`}if(Object(Le.m)(a))for(const{message:e,resource:i,startLineNumber:o,startColumn:s}of a){const r=rn.q(n,ra("div"));r.style.marginTop="8px";const a=rn.q(r,ra("a"));a.innerText=`${Object(It.b)(i)}(${o}, ${s}): `,a.style.cursor="pointer",t.add(rn.i(a,"click",(e=>{e.stopPropagation(),e.preventDefault(),this._openerService&&this._openerService.open(i,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:o,startColumn:s}}}).catch(Ie.e)})));const l=rn.q(r,ra("span"));l.innerText=e,this._editor.applyFontInfo(l)}return i}renderMarkerStatusbar(e,t){const i=ra("div.hover-row.status-bar"),n=rn.q(i,ra("div.actions"));if(e.marker.severity!==as.c.Error&&e.marker.severity!==as.c.Warning&&e.marker.severity!==as.c.Info||t.add(this.renderAction(n,{label:r.a("view problem","View Problem"),commandId:sr.ID,run:()=>{this._hover.hide(),nr.get(this._editor).showAtMarker(e.marker),this._editor.focus()}})),!this._editor.getOption(77)){const i=rn.q(n,ra("div"));this.recentMarkerCodeActionsInfo&&(as.a.makeKey(this.recentMarkerCodeActionsInfo.marker)===as.a.makeKey(e.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(i.textContent=r.a("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?re.a.None:t.add(Object(se.i)((()=>i.textContent=r.a("checkingForQuickFixes","Checking for quick fixes...")),200));i.textContent||(i.textContent=String.fromCharCode(160));const s=this.getCodeActions(e.marker);t.add(Object(re.h)((()=>s.cancel()))),s.then((s=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:e.marker,hasCodeActions:s.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions)return s.dispose(),void(i.textContent=r.a("noQuickFixes","No quick fixes available"));i.style.display="none";let a=!1;t.add(Object(re.h)((()=>{a||s.dispose()}))),t.add(this.renderAction(n,{label:r.a("quick fixes","Quick Fix..."),commandId:Xr.Id,run:e=>{a=!0;const t=Yr.get(this._editor),i=rn.C(e);this._hover.hide(),t.showCodeActions(la,s,{x:i.left+6,y:i.top+i.height+6})}}))}))}return i}renderAction(e,t){const i=this._keybindingService.lookupKeybinding(t.commandId);return function(e,t,i){const n=rn.q(e,ss("div.action-container")),o=rn.q(n,ss("a.action"));return o.setAttribute("href","#"),o.setAttribute("role","button"),t.iconClass&&rn.q(o,ss(`span.icon.${t.iconClass}`)),rn.q(o,ss("span")).textContent=i?`${t.label} (${i})`:t.label,rn.i(n,rn.d.CLICK,(e=>{e.stopPropagation(),e.preventDefault(),t.run(n)}))}(e,t,i?i.getLabel():null)}getCodeActions(e){return Object(se.h)((t=>yr(this._editor.getModel(),new g.a(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),la,ur.b.None,t)))}};function ca(e,t,i){const n=Oe.o.ordered(e).map((n=>Promise.resolve(n.provideHover(e,t,i)).then((e=>e&&function(e){const t=void 0!==e.range,i=void 0!==e.contents&&e.contents&&e.contents.length>0;return t&&i}(e)?e:void 0),(e=>{Object(Ie.f)(e)}))));return Promise.all(n).then(Le.d)}ha=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([sa(2,ls.a),sa(3,Hn.a),sa(4,On.a)],ha),Object(a.l)("_executeHoverProvider",((e,t)=>ca(e,t,Qe.a.None)));var da=function(e,t){return function(i,n){t(i,n,e)}};const ua=rn.a;class ga{constructor(e,t){this.range=e,this.contents=t}equals(e){return e instanceof ga&&(t=this.contents,i=e.contents,!t&&!i||!(!t||!i)&&(Array.isArray(t)&&Array.isArray(i)?Object(Le.g)(t,i,pn):!(!mn(t)||!mn(i))&&pn(t,i)));var t,i}}let ma=class{constructor(e,t,i,n){this._editor=e,this._hover=t,this._modeService=i,this._openerService=n}createLoadingMessage(e){return new ga(e,[(new un).appendText(r.a("modesContentHover.loading","Loading..."))])}computeSync(e,t){if(!this._editor.hasModel())return[];const i=this._editor.getModel(),n=e.startLineNumber,o=i.getLineMaxColumn(n),s=[];for(const i of t){const t=i.range.startLineNumber===n?i.range.startColumn:1,r=i.range.endLineNumber===n?i.range.endColumn:o,a=i.options.hoverMessage;if(!a||gn(a))continue;const l=new g.a(e.startLineNumber,t,e.startLineNumber,r);s.push(new ga(l,Object(Le.b)(a)))}return s}computeAsync(e,t){return i=this,n=void 0,s=function*(){if(!this._editor.hasModel()||!e)return Promise.resolve([]);const i=this._editor.getModel();if(!Oe.o.has(i))return Promise.resolve([]);const n=yield ca(i,new u.a(e.startLineNumber,e.startColumn),t),o=[];for(const t of n){if(gn(t.contents))continue;const i=t.range?g.a.lift(t.range):e;o.push(new ga(i,t.contents))}return o},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o((function(e){e(i)}))).then(r,a)}l((s=s.apply(i,n||[])).next())}));var i,n,o,s}renderHoverParts(e,t){const i=new re.b;for(const n of e)for(const e of n.contents){if(gn(e))continue;const n=ua("div.hover-row.markdown-hover"),o=rn.q(n,ua("div.hover-contents")),s=i.add(new Mn({editor:this._editor},this._modeService,this._openerService));i.add(s.onDidRenderAsync((()=>{o.className="hover-contents code-hover-contents",this._hover.onContentsChanged()})));const r=i.add(s.render(e));o.appendChild(r.element),t.appendChild(n)}return i}};ma=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([da(2,li.a),da(3,On.a)],ma);class pa{constructor(e,t,i){this.range=e,this.color=t,this.provider=i}equals(e){return!1}}class fa{constructor(e,t){this.owner=e,this.data=t}}class _a{constructor(e,t,i){this._markerHoverParticipant=t,this._markdownHoverParticipant=i,this._editor=e,this._result=[],this._range=null}setRange(e){this._range=e,this._result=[]}clearResult(){this._result=[]}computeAsync(e){return t=this,i=void 0,o=function*(){return this._editor.hasModel()&&this._range?(yield this._markdownHoverParticipant.computeAsync(this._range,e)).map((e=>new fa(this._markdownHoverParticipant,e))):Promise.resolve([])},new((n=void 0)||(n=Promise))((function(e,s){function r(e){try{l(o.next(e))}catch(e){s(e)}}function a(e){try{l(o.throw(e))}catch(e){s(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(r,a)}l((o=o.apply(t,i||[])).next())}));var t,i,n,o}computeSync(){if(!this._editor.hasModel()||!this._range)return[];const e=this._editor.getModel(),t=this._range,i=t.startLineNumber;if(i>this._editor.getModel().getLineCount())return[];const n=e.getLineMaxColumn(i),o=this._editor.getLineDecorations(i).filter((e=>{if(e.options.isWholeLine)return!0;const o=e.range.startLineNumber===i?e.range.startColumn:1,s=e.range.endLineNumber===i?e.range.endColumn:n;return!(o>t.startColumn||t.endColumn>s)}));let s=[];const r=Ko.get(this._editor);for(const e of o){const t=r.getColorData(e.range.getStartPosition());if(t){const{color:e,range:i}=t.colorInfo;s.push(new fa(null,new pa(g.a.lift(i),e,t.provider)));break}}const a=this._markdownHoverParticipant.computeSync(this._range,o);s=s.concat(a.map((e=>new fa(this._markdownHoverParticipant,e))));const l=this._markerHoverParticipant.computeSync(this._range,o);return s=s.concat(l.map((e=>new fa(this._markerHoverParticipant,e)))),Object(Le.d)(s)}onResult(e,t){this._result=t?e.concat(this._result):this._result.concat(e)}getResult(){return this._result.slice(0)}getResultWithLoadingMessage(){if(this._range){const e=new fa(this._markdownHoverParticipant,this._markdownHoverParticipant.createLoadingMessage(this._range));return this._result.slice(0).concat([e])}return this._result.slice(0)}}class ba extends Yo.a{constructor(e,t,i,n){super(),this._hoverVisibleKey=t,this._themeService=n,this.allowEditorOverflow=!0,this._markerHoverParticipant=i.createInstance(ha,e,this),this._markdownHoverParticipant=i.createInstance(ma,e,this),this._hover=this._register(new rs),this._id=ba.ID,this._editor=e,this._isVisible=!1,this._stoleFocus=!1,this._renderDisposable=null,this.onkeydown(this._hover.containerDomNode,(e=>{e.equals(9)&&this.hide()})),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(40)&&this._updateFont()}))),this._editor.onDidLayoutChange((()=>this.layout())),this.layout(),this._editor.addContentWidget(this),this._showAtPosition=null,this._showAtRange=null,this._stoleFocus=!1,this._messages=[],this._lastRange=null,this._computer=new _a(this._editor,this._markerHoverParticipant,this._markdownHoverParticipant),this._highlightDecorations=[],this._isChangingDecorations=!1,this._shouldFocus=!1,this._colorPicker=null,this._hoverOperation=new os(this._computer,(e=>this._withResult(e,!0)),null,(e=>this._withResult(e,!1)),this._editor.getOption(50).delay),this._register(rn.o(this.getDomNode(),rn.d.FOCUS,(()=>{this._colorPicker&&this.getDomNode().classList.add("colorpicker-hover")}))),this._register(rn.o(this.getDomNode(),rn.d.BLUR,(()=>{this.getDomNode().classList.remove("colorpicker-hover")}))),this._register(e.onDidChangeConfiguration((()=>{this._hoverOperation.setHoverTime(this._editor.getOption(50).delay)}))),this._register(Oe.B.onDidChange((()=>{this._isVisible&&this._lastRange&&this._messages.length>0&&(this._messages=this._messages.map((e=>{var t,i;if(e.data instanceof pa&&(null===(t=this._lastRange)||void 0===t?void 0:t.intersectRanges(e.data.range))&&(null===(i=this._colorPicker)||void 0===i?void 0:i.model.color)){const t=this._colorPicker.model.color,i={red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a};return new fa(e.owner,new pa(e.data.range,i,e.data.provider))}return e})),this._hover.contentsDomNode.textContent="",this._renderMessages(this._lastRange,this._messages))})))}dispose(){this._hoverOperation.cancel(),this._editor.removeContentWidget(this),super.dispose()}getId(){return this._id}getDomNode(){return this._hover.containerDomNode}showAt(e,t,i){this._showAtPosition=e,this._showAtRange=t,this._hoverVisibleKey.set(!0),this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._editor.layoutContentWidget(this),this._editor.render(),this._stoleFocus=i,i&&this._hover.containerDomNode.focus()}getPosition(){return this._isVisible?{position:this._showAtPosition,range:this._showAtRange,preference:[1,2]}:null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont(),this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}layout(){const e=Math.max(this._editor.getLayoutInfo().height/4,250),{fontSize:t,lineHeight:i}=this._editor.getOption(40);this._hover.contentsDomNode.style.fontSize=`${t}px`,this._hover.contentsDomNode.style.lineHeight=`${i}px`,this._hover.contentsDomNode.style.maxHeight=`${e}px`,this._hover.contentsDomNode.style.maxWidth=`${Math.max(.66*this._editor.getLayoutInfo().width,500)}px`}onModelDecorationsChanged(){this._isChangingDecorations||this._isVisible&&(this._hoverOperation.cancel(),this._computer.clearResult(),this._colorPicker||this._hoverOperation.start(0))}startShowingAt(e,t,i){if(!this._lastRange||!this._lastRange.equalsRange(e)){if(this._hoverOperation.cancel(),this._isVisible)if(this._showAtPosition&&this._showAtPosition.lineNumber===e.startLineNumber){let t=[];for(let i=0,n=this._messages.length;i=e.endColumn&&t.push(n)}if(t.length>0){if(function(e,t){if(e.length!==t.length)return!1;for(let i=0;i{this._isVisible||this._hoverVisibleKey.set(!1)}),0),this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._editor.layoutContentWidget(this),this._stoleFocus&&this._editor.focus()),this._isChangingDecorations=!0,this._highlightDecorations=this._editor.deltaDecorations(this._highlightDecorations,[]),this._isChangingDecorations=!1,this._renderDisposable&&(this._renderDisposable.dispose(),this._renderDisposable=null),this._colorPicker=null}isColorPickerVisible(){return!!this._colorPicker}onContentsChanged(){this._hover.onContentsChanged()}_withResult(e,t){this._messages=e,this._lastRange&&this._messages.length>0?this._renderMessages(this._lastRange,this._messages):t&&this.hide()}_renderMessages(e,t){this._renderDisposable&&(this._renderDisposable.dispose(),this._renderDisposable=null),this._colorPicker=null;let i=1073741824,n=t[0].data.range?g.a.lift(t[0].data.range):null,o=document.createDocumentFragment(),s=!1;const r=new re.b,a=[],l=[];t.forEach((e=>{const t=e.data;if(t.range)if(i=Math.min(i,t.range.startColumn),n=n?g.a.plusRange(n,t.range):g.a.lift(t.range),t instanceof pa){s=!0;const{red:e,green:i,blue:n,alpha:a}=t.color,l=new Vo.c(Math.round(255*e),Math.round(255*i),Math.round(255*n),a),h=new Vo.a(l);if(!this._editor.hasModel())return;const c=this._editor.getModel();let d=new g.a(t.range.startLineNumber,t.range.startColumn,t.range.endLineNumber,t.range.endColumn),u={range:t.range,color:t.color};const m=new $o(h,[],0),p=new ns(o,m,this._editor.getOption(125),this._themeService);Ho(c,u,t.provider,Qe.a.None).then((e=>{if(m.colorPresentations=e||[],!this._editor.hasModel())return;const i=this._editor.getModel().getValueInRange(t.range);m.guessColorPresentation(h,i);const n=()=>{let e,t;if(m.presentation.textEdit){e=[m.presentation.textEdit],t=new g.a(m.presentation.textEdit.range.startLineNumber,m.presentation.textEdit.range.startColumn,m.presentation.textEdit.range.endLineNumber,m.presentation.textEdit.range.endColumn);const i=this._editor.getModel()._setTrackedRange(null,t,3);this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",e),t=this._editor.getModel()._getTrackedRange(i)||t}else e=[{identifier:null,range:d,text:m.presentation.label,forceMoveMarkers:!1}],t=d.setEndPosition(d.endLineNumber,d.startColumn+m.presentation.label.length),this._editor.pushUndoStop(),this._editor.executeEdits("colorpicker",e);m.presentation.additionalTextEdits&&(e=[...m.presentation.additionalTextEdits],this._editor.executeEdits("colorpicker",e),this.hide()),this._editor.pushUndoStop(),d=t},s=e=>Ho(c,{range:d,color:{red:e.rgba.r/255,green:e.rgba.g/255,blue:e.rgba.b/255,alpha:e.rgba.a}},t.provider,Qe.a.None).then((e=>{m.colorPresentations=e||[]})),a=m.onColorFlushed((e=>{s(e).then(n)})),l=m.onDidChangeColor(s);this._colorPicker=p,this.showAt(d.getStartPosition(),d,this._shouldFocus),this._updateContents(o),this._colorPicker.layout(),this._renderDisposable=Object(re.e)(a,l,p,r)}))}else t instanceof aa?a.push(t):t instanceof ga&&l.push(t)})),l.length>0&&r.add(this._markdownHoverParticipant.renderHoverParts(l,o)),a.length&&r.add(this._markerHoverParticipant.renderHoverParts(a,o)),this._renderDisposable=r,!s&&o.hasChildNodes()&&(this.showAt(new u.a(e.startLineNumber,i),n,this._shouldFocus),this._updateContents(o)),this._isChangingDecorations=!0,this._highlightDecorations=this._editor.deltaDecorations(this._highlightDecorations,n?[{range:n,options:ba._DECORATION_OPTIONS}]:[]),this._isChangingDecorations=!1}}ba.ID="editor.contrib.modesContentHoverWidget",ba._DECORATION_OPTIONS=be.a.register({className:"hoverHighlight"}),Object(we.f)(((e,t)=>{const i=e.getColor(Be.mc);i&&t.addRule(`.monaco-hover .hover-contents a.code-link span:hover { color: ${i}; }`)}));class va extends Yo.a{constructor(e,t){super(),this._id=e,this._editor=t,this._isVisible=!1,this._domNode=document.createElement("div"),this._domNode.className="monaco-hover hidden",this._domNode.setAttribute("aria-hidden","true"),this._domNode.setAttribute("role","tooltip"),this._showAtLineNumber=-1,this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(40)&&this.updateFont()}))),this._editor.addOverlayWidget(this)}get isVisible(){return this._isVisible}set isVisible(e){this._isVisible=e,this._domNode.classList.toggle("hidden",!this._isVisible)}getId(){return this._id}getDomNode(){return this._domNode}showAt(e){this._showAtLineNumber=e,this.isVisible||(this.isVisible=!0);const t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(this._showAtLineNumber),n=this._editor.getScrollTop(),o=this._editor.getOption(55),s=i-n-(this._domNode.clientHeight-o)/2;this._domNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._domNode.style.top=`${Math.max(Math.round(s),0)}px`}hide(){this.isVisible&&(this.isVisible=!1)}getPosition(){return null}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}updateFont(){[...Array.prototype.slice.call(this._domNode.getElementsByTagName("code")),...Array.prototype.slice.call(this._domNode.getElementsByClassName("code"))].forEach((e=>this._editor.applyFontInfo(e)))}updateContents(e){this._domNode.textContent="",this._domNode.appendChild(e),this.updateFont()}}class Ca{constructor(e){this._editor=e,this._lineNumber=-1,this._result=[]}setLineNumber(e){this._lineNumber=e,this._result=[]}clearResult(){this._result=[]}computeSync(){const e=e=>({value:e}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const n of t){if(!n.options.glyphMarginClassName)continue;const t=n.options.glyphMarginHoverMessage;t&&!gn(t)&&i.push(...Object(Le.b)(t).map(e))}return i}onResult(e,t){this._result=this._result.concat(e)}getResult(){return this._result}getResultWithLoadingMessage(){return this.getResult()}}class wa extends va{constructor(e,t,i=On.b){super(wa.ID,e),this._renderDisposeables=this._register(new re.b),this._messages=[],this._lastLineNumber=-1,this._markdownRenderer=this._register(new Mn({editor:this._editor},t,i)),this._computer=new Ca(this._editor),this._hoverOperation=new os(this._computer,(e=>this._withResult(e)),void 0,(e=>this._withResult(e)),300)}dispose(){this._hoverOperation.cancel(),super.dispose()}onModelDecorationsChanged(){this.isVisible&&(this._hoverOperation.cancel(),this._computer.clearResult(),this._hoverOperation.start(0))}startShowingAt(e){this._lastLineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._lastLineNumber=e,this._computer.setLineNumber(e),this._hoverOperation.start(0))}hide(){this._lastLineNumber=-1,this._hoverOperation.cancel(),super.hide()}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._lastLineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const i=document.createDocumentFragment();for(const e of t){const t=this._markdownRenderer.render(e.value);this._renderDisposeables.add(t),i.appendChild(Object(rn.a)("div.hover-row",void 0,t.element))}this.updateContents(i),this.showAt(e)}}wa.ID="editor.contrib.modesGlyphHoverWidget";class ya{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=bn.b.nextId()}get uri(){return this.link.uri}get range(){var e,t;return null!==(t=null!==(e=this._range)&&void 0!==e?e:this.link.targetSelectionRange)&&void 0!==t?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=null===(e=this.parent.getPreview(this))||void 0===e?void 0:e.preview(this.range);return t?Object(r.a)({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"symbol in {0} on line {1} at column {2}, {3}",Object(It.b)(this.uri),this.range.startLineNumber,this.range.startColumn,t.value):Object(r.a)("aria.oneReference","symbol in {0} on line {1} at column {2}",Object(It.b)(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Sa{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:s,endColumn:r}=e,a=i.getWordUntilPosition({lineNumber:n,column:o-t}),l=new g.a(n,a.startColumn,n,o),h=new g.a(s,r,s,1073741824),c=i.getValueInRange(l).replace(/^\s+/,""),d=i.getValueInRange(e);return{value:c+d+i.getValueInRange(h).replace(/\s+$/,""),highlight:{start:c.length,end:c.length+d.length}}}}class xa{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new oi.b}dispose(){Object(re.f)(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return 1===e?Object(r.a)("aria.fileReferences.1","1 symbol in {0}, full path {1}",Object(It.b)(this.uri),this.uri.fsPath):Object(r.a)("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Object(It.b)(this.uri),this.uri.fsPath)}resolve(e){return t=this,i=void 0,o=function*(){if(0!==this._previews.size)return this;for(let t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new Sa(i))}catch(e){Object(Ie.e)(e)}return this},new((n=void 0)||(n=Promise))((function(e,s){function r(e){try{l(o.next(e))}catch(e){s(e)}}function a(e){try{l(o.throw(e))}catch(e){s(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(r,a)}l((o=o.apply(t,i||[])).next())}));var t,i,n,o}}class La{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new ae.a,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;let n;e.sort(La._compareReferences);for(let t of e)if(n&&It.e.isEqual(n.uri,t.uri,!0)||(n=new xa(this,t.uri),this.groups.push(n)),0===n.children.length||0!==La._compareReferences(t,n.children[n.children.length-1])){const e=new ya(i===t,n,t,(e=>this._onDidChangeReferenceRange.fire(e)));this.references.push(e),n.children.push(e)}}dispose(){Object(re.f)(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new La(this._links,this._title)}get title(){return this._title}get isEmpty(){return 0===this.groups.length}get ariaMessage(){return this.isEmpty?Object(r.a)("aria.result.0","No results found"):1===this.references.length?Object(r.a)("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):1===this.groups.length?Object(r.a)("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):Object(r.a)("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){let{parent:i}=e,n=i.children.indexOf(e),o=i.children.length,s=i.parent.groups.length;return 1===s||t&&n+10?(n=t?(n+1)%o:(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%s,i.parent.groups[n].children[0]):(n=(n+s-1)%s,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map(((i,n)=>({idx:n,prefixLen:E.d(i.uri.toString(),e.toString()),offsetDist:100*Math.abs(i.range.startLineNumber-t.lineNumber)+Math.abs(i.range.startColumn-t.column)}))).sort(((e,t)=>e.prefixLen>t.prefixLen?-1:e.prefixLent.offsetDist?1:0))[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&g.a.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return It.e.compare(e.uri,t.uri)||g.a.compareRangesUsingStarts(e.range,t.range)}}var ka=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Da(e,t,i,n){const o=i.ordered(e).map((i=>Promise.resolve(n(i,e,t)).then(void 0,(e=>{Object(Ie.f)(e)}))));return Promise.all(o).then((e=>{const t=[];for(let i of e)Array.isArray(i)?t.push(...i):i&&t.push(i);return t}))}function Na(e,t,i){return Da(e,t,Oe.f,((e,t,n)=>e.provideDefinition(t,n,i)))}function Ea(e,t,i){return Da(e,t,Oe.e,((e,t,n)=>e.provideDeclaration(t,n,i)))}function Oa(e,t,i){return Da(e,t,Oe.p,((e,t,n)=>e.provideImplementation(t,n,i)))}function Ia(e,t,i){return Da(e,t,Oe.C,((e,t,n)=>e.provideTypeDefinition(t,n,i)))}function Ta(e,t,i,n){return Da(e,t,Oe.v,((e,t,o)=>ka(this,void 0,void 0,(function*(){const s=yield e.provideReferences(t,o,{includeDeclaration:!0},n);if(!i||!s||2!==s.length)return s;const r=yield e.provideReferences(t,o,{includeDeclaration:!1},n);return r&&1===r.length?r:s}))))}function Ma(e){return ka(this,void 0,void 0,(function*(){const t=yield e(),i=new La(t,""),n=i.references.map((e=>e.link));return i.dispose(),n}))}Object(a.l)("_executeDefinitionProvider",((e,t)=>Ma((()=>Na(e,t,Qe.a.None))))),Object(a.l)("_executeDeclarationProvider",((e,t)=>Ma((()=>Ea(e,t,Qe.a.None))))),Object(a.l)("_executeImplementationProvider",((e,t)=>Ma((()=>Oa(e,t,Qe.a.None))))),Object(a.l)("_executeTypeDefinitionProvider",((e,t)=>Ma((()=>Ia(e,t,Qe.a.None))))),Object(a.l)("_executeReferenceProvider",((e,t)=>Ma((()=>Ta(e,t,!1,Qe.a.None)))));var Aa=i(115),Ra=i(173),Pa=i(134),Fa=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Wa=function(e,t){return function(i,n){t(i,n,e)}};let Ba=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof La||e instanceof xa}getChildren(e){if(e instanceof La)return e.groups;if(e instanceof xa)return e.resolve(this._resolverService).then((e=>e.children));throw new Error("bad tree")}};Ba=Fa([Wa(0,mt.a)],Ba);class ja{getHeight(){return 23}getTemplateId(e){return e instanceof xa?Ua.id:$a.id}}let Va=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof ya){const i=null===(t=e.parent.getPreview(e))||void 0===t?void 0:t.preview(e.range);if(i)return i.value}return Object(It.b)(e.uri)}};Va=Fa([Wa(0,Hn.a)],Va);class Ha{getId(e){return e instanceof ya?e.id:e.uri}}let za=class extends re.a{constructor(e,t,i){super(),this._uriLabel=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new ro.a(n,{supportHighlights:!0})),this.badge=new Ra.a(rn.q(n,rn.a(".count"))),this._register(Object(ln.a)(this.badge,i)),e.appendChild(n)}set(e,t){let i=Object(It.d)(e.uri);this.file.setLabel(Ft(e.uri),this._uriLabel.getUriLabel(i,{relative:!0}),{title:this._uriLabel.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(Object(r.a)("referencesCount","{0} references",n)):this.badge.setTitleFormat(Object(r.a)("referenceCount","{0} reference",n))}};za=Fa([Wa(1,Zt.a),Wa(2,we.b)],za);let Ua=class e{constructor(t){this._instantiationService=t,this.templateId=e.id}renderTemplate(e){return this._instantiationService.createInstance(za,e)}renderElement(e,t,i){i.set(e.element,Object(Xe.c)(e.filterData))}disposeTemplate(e){e.dispose()}};Ua.id="FileReferencesRenderer",Ua=Fa([Wa(0,Et.a)],Ua);class Ka{constructor(e){this.label=new Pa.a(e,!1)}set(e,t){var i;const n=null===(i=e.parent.getPreview(e))||void 0===i?void 0:i.preview(e.range);if(n&&n.value){const{value:e,highlight:i}=n;t&&!Xe.a.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(e,Object(Xe.c)(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(e,[i]))}else this.label.set(`${Object(It.b)(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`)}}class $a{constructor(){this.templateId=$a.id}renderTemplate(e){return new Ka(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}$a.id="OneReferenceRenderer";class qa{getWidgetAriaLabel(){return Object(r.a)("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var Ga=i(111),Ya=i(163),Za=i(95),Qa=function(e,t){return function(i,n){t(i,n,e)}},Xa=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Ja{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new re.b,this._callOnModelChange=new re.b,this._callOnDispose.add(this._editor.onDidChangeModel((()=>this._onModelChanged()))),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e)for(let t of this._model.references)if(t.uri.toString()===e.uri.toString())return void this._addDecorations(t.parent)}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations((()=>this._onDecorationChanged())));const t=[],i=[];for(let n=0,o=e.children.length;n{e.equals(9)&&(this._keybindingService.dispatchEvent(e,e.target),e.stopPropagation())}),!0)),this._tree=this._instantiationService.createInstance(tl,"ReferencesWidget",this._treeContainer,new ja,[this._instantiationService.createInstance(Ua),this._instantiationService.createInstance($a)],this._instantiationService.createInstance(Ba),t),this._splitView.addView({onDidChange:ae.b.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:e=>{this._preview.layout({height:this._dim.height,width:e})}},Ya.a.Distribute),this._splitView.addView({onDidChange:ae.b.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:e=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${e}px`,this._tree.layout(this._dim.height,e)}},Ya.a.Distribute),this._disposables.add(this._splitView.onDidSashChange((()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)}),void 0));let i=(e,t)=>{e instanceof ya&&("show"===t&&this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:t,source:"tree"}))};this._tree.onDidOpen((e=>{e.sideBySide?i(e.element,"side"):e.editorOptions.pinned?i(e.element,"goto"):i(e.element,"show")})),rn.J(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new rn.b(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then((()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))}))}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=r.a("noResults","No results"),rn.U(this._messageContainer),Promise.resolve(void 0)):(rn.J(this._messageContainer),this._decorationsManager=new Ja(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange((e=>this._tree.rerender(e)))),this._disposeOnNewModel.add(this._preview.onMouseDown((e=>{const{event:t,target:i}=e;if(2!==t.detail)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})}))),this.container.classList.add("results-loaded"),rn.U(this._treeContainer),rn.U(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(1===this._model.groups.length?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();return e instanceof ya?e:e instanceof xa&&e.children.length>0?e.children[0]:void 0}revealReference(e){return Xa(this,void 0,void 0,(function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}))}_revealReference(e,t){return Xa(this,void 0,void 0,(function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==At.c.inMemory?this.setTitle(Object(It.c)(e.uri),this._uriLabel.getUriLabel(Object(It.d)(e.uri))):this.setTitle(r.a("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent||(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent)),this._tree.reveal(e);const n=yield i;if(!this._model)return void n.dispose();Object(re.f)(this._previewModelReference);const o=n.object;if(o){const t=this._preview.getModel()===o.textEditorModel?0:1,i=g.a.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(i),this._preview.revealRangeInCenter(i,t)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}))}};il=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Qa(3,we.b),Qa(4,mt.a),Qa(5,Et.a),Qa(6,_s),Qa(7,Zt.a),Qa(8,Za.a),Qa(9,Hn.a)],il),Object(we.f)(((e,t)=>{const i=e.getColor(As);i&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { background-color: ${i}; }`);const n=e.getColor(Rs);n&&t.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { background-color: ${n}; }`);const o=e.getColor(Ps);o&&t.addRule(`.monaco-editor .reference-zone-widget .preview .reference-decoration { border: 2px solid ${o}; box-sizing: border-box; }`);const s=e.getColor(Be.b);s&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight { border: 1px dotted ${s}; box-sizing: border-box; }`);const r=e.getColor(Ds);r&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree { background-color: ${r}; }`);const a=e.getColor(Ns);a&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree { color: ${a}; }`);const l=e.getColor(Es);l&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree .reference-file { color: ${l}; }`);const h=e.getColor(Os);h&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { background-color: ${h}; }`);const c=e.getColor(Is);c&&t.addRule(`.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { color: ${c} !important; }`);const d=e.getColor(Ts);d&&t.addRule(`.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input {\tbackground-color: ${d};}`);const u=e.getColor(Ms);u&&t.addRule(`.monaco-editor .reference-zone-widget .preview .monaco-editor .margin {\tbackground-color: ${u};}`)}));var nl=function(e,t){return function(i,n){t(i,n,e)}},ol=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const sl=new _.c("referenceSearchVisible",!1,r.a("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let rl=class e{constructor(e,t,i,n,o,s,r,a){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=o,this._instantiationService=s,this._storageService=r,this._configurationService=a,this._disposables=new re.b,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=sl.bindTo(i)}static get(t){return t.getContribution(e.ID)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),null===(e=this._widget)||void 0===e||e.dispose(),null===(t=this._model)||void 0===t||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage((()=>{this.closeWidget()}))),this._disposables.add(this._editor.onDidChangeModel((()=>{this._ignoreModelChangeEvent||this.closeWidget()})));const o="peekViewLayout",s=el.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(il,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(r.a("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose((()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()}))),this._disposables.add(this._widget.onDidSelectReference((e=>{let{element:t,kind:n}=e;if(t)switch(n){case"open":"editor"===e.source&&this._configurationService.getValue("editor.stablePeek")||this.openReference(t,!1,!1);break;case"side":this.openReference(t,!0,!1);break;case"goto":i?this._gotoReference(t):this.openReference(t,!1,!0)}})));const a=++this._requestIdPool;t.then((t=>{var i;if(a===this._requestIdPool&&this._widget)return null===(i=this._model)||void 0===i||i.dispose(),this._model=t,this._widget.setModel(this._model).then((()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(r.a("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));let t=this._editor.getModel().uri,i=new u.a(e.startLineNumber,e.startColumn),n=this._model.nearestReference(t,i);if(n)return this._widget.setSelection(n).then((()=>{this._widget&&"editor"===this._editor.getOption(73)&&this._widget.focusOnPreviewEditor()}))}}));t.dispose()}),(e=>{this._notificationService.error(e)}))}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return ol(this,void 0,void 0,(function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(n),yield this._gotoReference(n),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}))}revealReference(e){return ol(this,void 0,void 0,(function*(){this._editor.hasModel()&&this._model&&this._widget&&(yield this._widget.revealReference(e))}))}closeWidget(e=!0){var t,i;null===(t=this._widget)||void 0===t||t.dispose(),null===(i=this._model)||void 0===i||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(t){this._widget&&this._widget.hide(),this._ignoreModelChangeEvent=!0;const i=g.a.lift(t.range).collapseToStart();return this._editorService.openCodeEditor({resource:t.uri,options:{selection:i}},this._editor).then((t=>{var n;if(this._ignoreModelChangeEvent=!1,t&&this._widget)if(this._editor===t)this._widget.show(i),this._widget.focusOnReferenceTree();else{const o=e.get(t),s=this._model.clone();this.closeWidget(),t.focus(),o.toggleWidget(i,Object(se.h)((e=>Promise.resolve(s))),null!==(n=this._peekMode)&&void 0!==n&&n)}else this.closeWidget()}),(e=>{this._ignoreModelChangeEvent=!1,Object(Ie.e)(e)}))}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:o}=e;this._editorService.openCodeEditor({resource:n,options:{selection:o,pinned:i}},this._editor,t)}};function al(e,t){const i=function(e){let t=e.get(bo.a).getFocusedCodeEditor();return t instanceof Co?t.getParentEditor():t}(e);if(!i)return;let n=rl.get(i);n&&t(n)}rl.ID="editor.contrib.referencesController",rl=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([nl(2,_.b),nl(3,bo.a),nl(4,Un.a),nl(5,Et.a),nl(6,si.a),nl(7,ri.a)],rl),mi.a.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Object(N.a)(2089,60),when:_.a.or(sl,bs.inPeekEditor),handler(e){al(e,(e=>{e.changeFocusBetweenPreviewAndReferences()}))}}),mi.a.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:_.a.or(sl,bs.inPeekEditor),handler(e){al(e,(e=>{e.goToNextOrPreviousReference(!0)}))}}),mi.a.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:_.a.or(sl,bs.inPeekEditor),handler(e){al(e,(e=>{e.goToNextOrPreviousReference(!1)}))}}),ut.a.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference"),ut.a.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference"),ut.a.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch"),ut.a.registerCommand("closeReferenceSearch",(e=>al(e,(e=>e.closeWidget())))),mi.a.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:_.a.and(bs.inPeekEditor,_.a.not("config.editor.stablePeek"))}),mi.a.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:_.a.and(sl,_.a.not("config.editor.stablePeek"))}),mi.a.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:_.a.and(sl,Ga.e),handler(e){var t;const i=null===(t=e.get(Ga.a).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof ya&&al(e,(e=>e.revealReference(i[0])))}}),mi.a.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:_.a.and(sl,Ga.e),handler(e){var t;const i=null===(t=e.get(Ga.a).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof ya&&al(e,(e=>e.openReference(i[0],!0,!0)))}}),ut.a.registerCommand("openReference",(e=>{var t;const i=null===(t=e.get(Ga.a).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof ya&&al(e,(e=>e.openReference(i[0],!1,!0)))}));var ll=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},hl=function(e,t){return function(i,n){t(i,n,e)}};const cl=new _.c("hasSymbols",!1,Object(r.a)("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),dl=Object(Et.c)("ISymbolNavigationService");let ul=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=cl.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),null===(e=this._currentState)||void 0===e||e.dispose(),null===(t=this._currentMessage)||void 0===t||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1)return void this.reset();this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new gl(this._editorService),n=i.onDidChange((e=>{if(this._ignoreEditorChange)return;const i=this._editorService.getActiveCodeEditor();if(!i)return;const n=i.getModel(),o=i.getPosition();if(!n||!o)return;let s=!1,r=!1;for(const e of t.references)if(Object(It.f)(e.uri,n.uri))s=!0,r=r||g.a.containsPosition(e.range,o);else if(s)break;s&&r||this.reset()}));this._currentState=Object(re.e)(i,n)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:g.a.collapseToStart(t.range),selectionRevealType:3}},e).finally((()=>{this._ignoreEditorChange=!1}))}_showMessage(){var e;null===(e=this._currentMessage)||void 0===e||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?Object(r.a)("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):Object(r.a)("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};ul=ll([hl(0,_.b),hl(1,bo.a),hl(2,Un.a),hl(3,Hn.a)],ul),Object(ai.b)(dl,ul,!0),Object(a.i)(new class extends a.c{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:cl,kbOpts:{weight:100,primary:70}})}runEditorCommand(e,t){return e.get(dl).revealNext(t)}}),mi.a.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:cl,primary:9,handler(e){e.get(dl).reset()}});let gl=class{constructor(e){this._listener=new Map,this._disposables=new re.b,this._onDidChange=new ae.a,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),Object(re.f)(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Object(re.e)(e.onDidChangeCursorPosition((t=>this._onDidChange.fire({editor:e}))),e.onDidChangeModelContent((t=>this._onDidChange.fire({editor:e})))))}_onDidRemoveEditor(e){var t;null===(t=this._listener.get(e))||void 0===t||t.dispose(),this._listener.delete(e)}};gl=ll([hl(0,bo.a)],gl);var ml,pl,fl,_l,bl,vl,Cl,wl,yl=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};V.d.appendMenuItem(V.b.EditorContext,{submenu:V.b.EditorContextPeek,title:r.a("peek.submenu","Peek"),group:"navigation",order:100});const Sl=new Set;function xl(e){const t=new e;return Object(a.k)(t),Sl.add(t.id),t}class Ll extends a.b{constructor(e,t){super(t),this._configuration=e}run(e,t){if(!t.hasModel())return Promise.resolve(void 0);const i=e.get(Un.a),n=e.get(bo.a),o=e.get(ur.a),s=e.get(dl),r=t.getModel(),a=t.getPosition(),l=new Ze.b(t,5),h=Object(se.k)(this._getLocationModel(r,a,l.token),l.token).then((e=>yl(this,void 0,void 0,(function*(){if(!e||l.token.isCancellationRequested)return;let i;if(Object(Ye.a)(e.ariaMessage),e.referenceAt(r.uri,a)){const e=this._getAlternativeCommand(t);e!==this.id&&Sl.has(e)&&(i=t.getAction(e))}const o=e.references.length;if(0===o){if(!this._configuration.muteMessage){const e=r.getWordAtPosition(a);kr.get(t).showMessage(this._getNoResultFoundMessage(e),a)}}else{if(1!==o||!i)return this._onResult(n,s,t,e);i.run()}}))),(e=>{i.error(e)})).finally((()=>{l.dispose()}));return o.showWhile(h,250),h}_onResult(e,t,i,n){return yl(this,void 0,void 0,(function*(){const o=this._getGoToPreference(i);if(i instanceof Co||!(this._configuration.openInPeek||"peek"===o&&n.references.length>1)){const s=n.firstReference(),r=n.references.length>1&&"gotoAndPeek"===o,a=yield this._openReference(i,e,s,this._configuration.openToSide,!r);r&&a?this._openInPeek(a,n):n.dispose(),"goto"===o&&t.put(s)}else this._openInPeek(i,n)}))}_openReference(e,t,i,n,o){return yl(this,void 0,void 0,(function*(){let s;if(Object(Oe.F)(i)&&(s=i.targetSelectionRange),s||(s=i.range),!s)return;const r=yield t.openCodeEditor({resource:i.uri,options:{selection:g.a.collapseToStart(s),selectionRevealType:3}},e,n);if(r){if(o){const e=r.getModel(),t=r.deltaDecorations([],[{range:s,options:{className:"symbolHighlight"}}]);setTimeout((()=>{r.getModel()===e&&r.deltaDecorations(t,[])}),350)}return r}}))}_openInPeek(e,t){let i=rl.get(e);i&&e.hasModel()?i.toggleWidget(e.getSelection(),Object(se.h)((e=>Promise.resolve(t))),this._configuration.openInPeek):t.dispose()}}class kl extends Ll{_getLocationModel(e,t,i){return yl(this,void 0,void 0,(function*(){return new La(yield Na(e,t,i),r.a("def.title","Definitions"))}))}_getNoResultFoundMessage(e){return e&&e.word?r.a("noResultWord","No definition found for '{0}'",e.word):r.a("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(47).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(47).multipleDefinitions}}const Dl=Rt.i&&!qo.i?2118:70;xl(((ml=class e extends kl{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.id,label:r.a("actions.goToDecl.label","Go to Definition"),alias:"Go to Definition",precondition:_.a.and(p.a.hasDefinitionProvider,p.a.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:p.a.editorTextFocus,primary:Dl,weight:100},contextMenuOpts:{group:"navigation",order:1.1},menuOpts:{menuId:V.b.MenubarGoMenu,group:"4_symbol_nav",order:2,title:r.a({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")}}),ut.a.registerCommandAlias("editor.action.goToDeclaration",e.id)}}).id="editor.action.revealDefinition",ml)),xl(((pl=class e extends kl{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:e.id,label:r.a("actions.goToDeclToSide.label","Open Definition to the Side"),alias:"Open Definition to the Side",precondition:_.a.and(p.a.hasDefinitionProvider,p.a.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,Dl),weight:100}}),ut.a.registerCommandAlias("editor.action.openDeclarationToTheSide",e.id)}}).id="editor.action.revealDefinitionAside",pl)),xl(((fl=class e extends kl{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.id,label:r.a("actions.previewDecl.label","Peek Definition"),alias:"Peek Definition",precondition:_.a.and(p.a.hasDefinitionProvider,bs.notInPeekEditor,p.a.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:p.a.editorTextFocus,primary:582,linux:{primary:3140},weight:100},contextMenuOpts:{menuId:V.b.EditorContextPeek,group:"peek",order:2}}),ut.a.registerCommandAlias("editor.action.previewDeclaration",e.id)}}).id="editor.action.peekDefinition",fl));class Nl extends Ll{_getLocationModel(e,t,i){return yl(this,void 0,void 0,(function*(){return new La(yield Ea(e,t,i),r.a("decl.title","Declarations"))}))}_getNoResultFoundMessage(e){return e&&e.word?r.a("decl.noResultWord","No declaration found for '{0}'",e.word):r.a("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(47).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(47).multipleDeclarations}}xl(((_l=class e extends Nl{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.id,label:r.a("actions.goToDeclaration.label","Go to Declaration"),alias:"Go to Declaration",precondition:_.a.and(p.a.hasDeclarationProvider,p.a.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{group:"navigation",order:1.3},menuOpts:{menuId:V.b.MenubarGoMenu,group:"4_symbol_nav",order:3,title:r.a({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")}})}_getNoResultFoundMessage(e){return e&&e.word?r.a("decl.noResultWord","No declaration found for '{0}'",e.word):r.a("decl.generic.noResults","No declaration found")}}).id="editor.action.revealDeclaration",_l)),xl(class extends Nl{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",label:r.a("actions.peekDecl.label","Peek Declaration"),alias:"Peek Declaration",precondition:_.a.and(p.a.hasDeclarationProvider,bs.notInPeekEditor,p.a.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:V.b.EditorContextPeek,group:"peek",order:3}})}});class El extends Ll{_getLocationModel(e,t,i){return yl(this,void 0,void 0,(function*(){return new La(yield Ia(e,t,i),r.a("typedef.title","Type Definitions"))}))}_getNoResultFoundMessage(e){return e&&e.word?r.a("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):r.a("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(47).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(47).multipleTypeDefinitions}}xl(((bl=class e extends El{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,label:r.a("actions.goToTypeDefinition.label","Go to Type Definition"),alias:"Go to Type Definition",precondition:_.a.and(p.a.hasTypeDefinitionProvider,p.a.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:p.a.editorTextFocus,primary:0,weight:100},contextMenuOpts:{group:"navigation",order:1.4},menuOpts:{menuId:V.b.MenubarGoMenu,group:"4_symbol_nav",order:3,title:r.a({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")}})}}).ID="editor.action.goToTypeDefinition",bl)),xl(((vl=class e extends El{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,label:r.a("actions.peekTypeDefinition.label","Peek Type Definition"),alias:"Peek Type Definition",precondition:_.a.and(p.a.hasTypeDefinitionProvider,bs.notInPeekEditor,p.a.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:V.b.EditorContextPeek,group:"peek",order:4}})}}).ID="editor.action.peekTypeDefinition",vl));class Ol extends Ll{_getLocationModel(e,t,i){return yl(this,void 0,void 0,(function*(){return new La(yield Oa(e,t,i),r.a("impl.title","Implementations"))}))}_getNoResultFoundMessage(e){return e&&e.word?r.a("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):r.a("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(47).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(47).multipleImplementations}}xl(((Cl=class e extends Ol{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,label:r.a("actions.goToImplementation.label","Go to Implementations"),alias:"Go to Implementations",precondition:_.a.and(p.a.hasImplementationProvider,p.a.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:p.a.editorTextFocus,primary:2118,weight:100},menuOpts:{menuId:V.b.MenubarGoMenu,group:"4_symbol_nav",order:4,title:r.a({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},contextMenuOpts:{group:"navigation",order:1.45}})}}).ID="editor.action.goToImplementation",Cl)),xl(((wl=class e extends Ol{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,label:r.a("actions.peekImplementation.label","Peek Implementations"),alias:"Peek Implementations",precondition:_.a.and(p.a.hasImplementationProvider,bs.notInPeekEditor,p.a.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:p.a.editorTextFocus,primary:3142,weight:100},contextMenuOpts:{menuId:V.b.EditorContextPeek,group:"peek",order:5}})}}).ID="editor.action.peekImplementation",wl));class Il extends Ll{_getNoResultFoundMessage(e){return e?r.a("references.no","No references found for '{0}'",e.word):r.a("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(47).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(47).multipleReferences}}xl(class extends Il{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",label:r.a("goToReferences.label","Go to References"),alias:"Go to References",precondition:_.a.and(p.a.hasReferenceProvider,bs.notInPeekEditor,p.a.isInWalkThroughSnippet.toNegated()),kbOpts:{kbExpr:p.a.editorTextFocus,primary:1094,weight:100},contextMenuOpts:{group:"navigation",order:1.45},menuOpts:{menuId:V.b.MenubarGoMenu,group:"4_symbol_nav",order:5,title:r.a({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")}})}_getLocationModel(e,t,i){return yl(this,void 0,void 0,(function*(){return new La(yield Ta(e,t,!0,i),r.a("ref.title","References"))}))}}),xl(class extends Il{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",label:r.a("references.action.label","Peek References"),alias:"Peek References",precondition:_.a.and(p.a.hasReferenceProvider,bs.notInPeekEditor,p.a.isInWalkThroughSnippet.toNegated()),contextMenuOpts:{menuId:V.b.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i){return yl(this,void 0,void 0,(function*(){return new La(yield Ta(e,t,!1,i),r.a("ref.title","References"))}))}});class Tl extends Ll{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",label:r.a("label.generic","Go To Any Symbol"),alias:"Go To Any Symbol",precondition:_.a.and(bs.notInPeekEditor,p.a.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i){return yl(this,void 0,void 0,(function*(){return new La(this._references,r.a("generic.title","Locations"))}))}_getNoResultFoundMessage(e){return e&&r.a("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return null!==(t=this._gotoMultipleBehaviour)&&void 0!==t?t:e.getOption(47).multipleReferences}_getAlternativeCommand(){return""}}function Ml(e,t){return!!e[t]}ut.a.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:gt.a},{name:"position",description:"The position at which to start",constraint:u.a.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(e,t,i,n,o,s,r)=>yl(void 0,void 0,void 0,(function*(){Object(oe.b)(gt.a.isUri(t)),Object(oe.b)(u.a.isIPosition(i)),Object(oe.b)(Array.isArray(n)),Object(oe.b)(void 0===o||"string"==typeof o),Object(oe.b)(void 0===r||"boolean"==typeof r);const a=e.get(bo.a),l=yield a.openCodeEditor({resource:t},a.getFocusedCodeEditor());if(Object(Aa.a)(l))return l.setPosition(i),l.revealPositionInCenterIfOutsideViewport(i,0),l.invokeWithinContext((e=>{const t=new class extends Tl{_getNoResultFoundMessage(e){return s||super._getNoResultFoundMessage(e)}}({muteMessage:!Boolean(s),openInPeek:Boolean(r),openToSide:!1},n,o);e.get(Et.a).invokeFunction(t.run.bind(t),l)}))}))}),ut.a.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:gt.a},{name:"position",description:"The position at which to start",constraint:u.a.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(e,t,i,n,o)=>yl(void 0,void 0,void 0,(function*(){e.get(ut.b).executeCommand("editor.action.goToLocations",t,i,n,o,void 0,!0)}))}),ut.a.registerCommand({id:"editor.action.findReferences",handler:(e,t,i)=>{Object(oe.b)(gt.a.isUri(t)),Object(oe.b)(u.a.isIPosition(i));const n=e.get(bo.a);return n.openCodeEditor({resource:t},n.getFocusedCodeEditor()).then((e=>{if(!Object(Aa.a)(e)||!e.hasModel())return;const t=rl.get(e);if(!t)return;const n=Object(se.h)((t=>Ta(e.getModel(),u.a.lift(i),!1,t).then((e=>new La(e,r.a("ref.title","References")))))),o=new g.a(i.lineNumber,i.column,i.lineNumber,i.column);return Promise.resolve(t.toggleWidget(o,n,!1))}))}}),ut.a.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");class Al{constructor(e,t){this.target=e.target,this.hasTriggerModifier=Ml(e.event,t.triggerModifier),this.hasSideBySideModifier=Ml(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Rl{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Ml(e,t.triggerModifier)}}class Pl{constructor(e,t,i,n){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function Fl(e){return"altKey"===e?Rt.f?new Pl(57,"metaKey",6,"altKey"):new Pl(5,"ctrlKey",6,"altKey"):Rt.f?new Pl(6,"altKey",57,"metaKey"):new Pl(6,"altKey",5,"ctrlKey")}class Wl extends re.a{constructor(e){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new ae.a),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new ae.a),this.onExecute=this._onExecute.event,this._onCancel=this._register(new ae.a),this.onCancel=this._onCancel.event,this._editor=e,this._opts=Fl(this._editor.getOption(66)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration((e=>{if(e.hasChanged(66)){const e=Fl(this._editor.getOption(66));if(this._opts.equals(e))return;this._opts=e,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}}))),this._register(this._editor.onMouseMove((e=>this._onEditorMouseMove(new Al(e,this._opts))))),this._register(this._editor.onMouseDown((e=>this._onEditorMouseDown(new Al(e,this._opts))))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(new Al(e,this._opts))))),this._register(this._editor.onKeyDown((e=>this._onEditorKeyDown(new Rl(e,this._opts))))),this._register(this._editor.onKeyUp((e=>this._onEditorKeyUp(new Rl(e,this._opts))))),this._register(this._editor.onMouseDrag((()=>this._resetHandler()))),this._register(this._editor.onDidChangeCursorSelection((e=>this._onDidChangeCursorSelection(e)))),this._register(this._editor.onDidChangeModel((e=>this._resetHandler()))),this._register(this._editor.onDidChangeModelContent((()=>this._resetHandler()))),this._register(this._editor.onDidScrollChange((e=>{(e.scrollTopChanged||e.scrollLeftChanged)&&this._resetHandler()})))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=e.target.position?e.target.position.lineNumber:0}_onEditorMouseUp(e){const t=e.target.position?e.target.position.lineNumber:0;this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var Bl=function(e,t){return function(i,n){t(i,n,e)}};let jl=class e{constructor(e,t,i){this.textModelResolverService=t,this.modeService=i,this.toUnhook=new re.b,this.toUnhookForKeyboard=new re.b,this.linkDecorations=[],this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e;let n=new Wl(e);this.toUnhook.add(n),this.toUnhook.add(n.onMouseMoveOrRelevantKeyDown((([e,t])=>{this.startFindDefinitionFromMouse(e,Object(oe.n)(t))}))),this.toUnhook.add(n.onExecute((e=>{this.isEnabled(e)&&this.gotoDefinition(e.target.position,e.hasSideBySideModifier).then((()=>{this.removeLinkDecorations()}),(e=>{this.removeLinkDecorations(),Object(Ie.e)(e)}))}))),this.toUnhook.add(n.onCancel((()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null})))}static get(t){return t.getContribution(e.ID)}startFindDefinitionFromCursor(e){return this.startFindDefinition(e).then((()=>{this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition((()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()}))),this.toUnhookForKeyboard.add(this.editor.onKeyDown((e=>{e&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())})))}))}startFindDefinitionFromMouse(e,t){if(9===e.target.type&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t))return this.currentWordAtPosition=null,void this.removeLinkDecorations();const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const i=e?null===(t=this.editor.getModel())||void 0===t?void 0:t.getWordAtPosition(e):null;if(!i)return this.currentWordAtPosition=null,this.removeLinkDecorations(),Promise.resolve(0);if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return Promise.resolve(0);this.currentWordAtPosition=i;let n=new Ze.a(this.editor,15);return this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Object(se.h)((t=>this.findDefinition(e,t))),this.previousPromise.then((t=>{if(t&&t.length&&n.validate(this.editor))if(t.length>1)this.addDecoration(new g.a(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn),(new un).appendText(r.a("multipleResults","Click to show {0} definitions.",t.length)));else{let n=t[0];if(!n.uri)return;this.textModelResolverService.createModelReference(n.uri).then((t=>{if(!t.object||!t.object.textEditorModel)return void t.dispose();const{object:{textEditorModel:o}}=t,{startLineNumber:s}=n.range;if(s<1||s>o.getLineCount())return void t.dispose();const r=this.getPreviewValue(o,s,n);let a;a=n.originSelectionRange?g.a.lift(n.originSelectionRange):new g.a(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);const l=this.modeService.getModeIdByFilepathOrFirstLine(o.uri);this.addDecoration(a,(new un).appendCodeblock(l||"",r)),t.dispose()}))}else this.removeLinkDecorations()})).then(void 0,Ie.e)}getPreviewValue(t,i,n){let o=n.targetSelectionRange?n.range:this.getPreviewRangeBasedOnBrackets(t,i);return o.endLineNumber-o.startLineNumber>=e.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(t,i)),this.stripIndentationFromPreviewRange(t,i,o)}stripIndentationFromPreviewRange(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t);for(let o=t+1;on)return new g.a(i,1,n+1,1);r=t.findNextBracket(new u.a(a,l))}return new g.a(i,1,n+1,1)}addDecoration(e,t){const i={range:e,options:{inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[i])}removeLinkDecorations(){this.linkDecorations.length>0&&(this.linkDecorations=this.editor.deltaDecorations(this.linkDecorations,[]))}isEnabled(e,t){return this.editor.hasModel()&&e.isNoneOrSingleMouseDown&&6===e.target.type&&(e.hasTriggerModifier||!!t&&t.keyCodeIsTriggerKey)&&Oe.f.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?Na(i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext((e=>{const i=!t&&this.editor.getOption(74)&&!this.isInPeekEditor(e);return new kl({openToSide:t,openInPeek:i,muteMessage:!0},{alias:"",label:"",id:"",precondition:void 0}).run(e,this.editor)}))}isInPeekEditor(e){const t=e.get(_.b);return bs.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose()}};jl.ID="editor.contrib.gotodefinitionatposition",jl.MAX_SOURCE_PREVIEW_LINES=8,jl=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Bl(1,mt.a),Bl(2,li.a)],jl),Object(a.j)(jl.ID,jl),Object(we.f)(((e,t)=>{const i=e.getColor(Be.q);i&&t.addRule(`.monaco-editor .goto-definition-link { color: ${i} !important; }`)}));var Vl=function(e,t){return function(i,n){t(i,n,e)}};let Hl=class e{constructor(e,t,i,n,o,s){this._editor=e,this._instantiationService=t,this._openerService=i,this._modeService=n,this._themeService=o,this._toUnhook=new re.b,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._hookEvents(),this._didChangeConfigurationHandler=this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&(this._unhookEvents(),this._hookEvents())})),this._hoverVisibleKey=p.a.hoverVisible.bindTo(s)}static get(t){return t.getContribution(e.ID)}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(50);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown((e=>this._onEditorMouseDown(e)))),this._toUnhook.add(this._editor.onMouseUp((e=>this._onEditorMouseUp(e)))),this._toUnhook.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._toUnhook.add(this._editor.onKeyDown((e=>this._onKeyDown(e)))),this._toUnhook.add(this._editor.onDidChangeModelDecorations((()=>this._onModelDecorationsChanged())))):(this._toUnhook.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._toUnhook.add(this._editor.onKeyDown((e=>this._onKeyDown(e))))),this._toUnhook.add(this._editor.onMouseLeave(e)),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange((e=>this._onEditorScrollChanged(e))))}_unhookEvents(){this._toUnhook.clear()}_onModelDecorationsChanged(){var e,t;null===(e=this._contentWidget)||void 0===e||e.onModelDecorationsChanged(),null===(t=this._glyphWidget)||void 0===t||t.onModelDecorationsChanged()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){this._isMouseDown=!0;const t=e.target.type;9!==t||e.target.detail!==ba.ID?12===t&&e.target.detail===wa.ID||(12!==t&&e.target.detail!==wa.ID&&(this._hoverClicked=!1),this._hideWidgets()):this._hoverClicked=!0}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseMove(e){var t,i,n,o,s,r;let a=e.target.type;if((!this._isMouseDown||!this._hoverClicked)&&(!this._isHoverSticky||9!==a||e.target.detail!==ba.ID)&&(!this._isHoverSticky||(null===(i=null===(t=e.event.browserEvent.view)||void 0===t?void 0:t.getSelection())||void 0===i?void 0:i.isCollapsed))&&(this._isHoverSticky||9!==a||e.target.detail!==ba.ID||!(null===(n=this._contentWidget)||void 0===n?void 0:n.isColorPickerVisible()))&&(!this._isHoverSticky||12!==a||e.target.detail!==wa.ID)){if(7===a){const t=this._editor.getOption(40).typicalHalfwidthCharacterWidth/2,i=e.target.detail;i&&!i.isAfterLines&&"number"==typeof i.horizontalDistanceToText&&i.horizontalDistanceToTexte.startsWith("ced-colorBox")))&&e.target.range.endColumn-e.target.range.startColumn==1?new g.a(e.target.range.startLineNumber,e.target.range.startColumn+1,e.target.range.endLineNumber,e.target.range.endColumn+1):e.target.range;this._contentWidget||(this._contentWidget=new ba(this._editor,this._hoverVisibleKey,this._instantiationService,this._themeService)),this._contentWidget.startShowingAt(t,0,!1)}}else 2===a?(null===(r=this._contentWidget)||void 0===r||r.hide(),this._isHoverEnabled&&e.target.position&&(this._glyphWidget||(this._glyphWidget=new wa(this._editor,this._modeService,this._openerService)),this._glyphWidget.startShowingAt(e.target.position.lineNumber))):this._hideWidgets()}}_onKeyDown(e){5!==e.keyCode&&6!==e.keyCode&&57!==e.keyCode&&4!==e.keyCode&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(null===(e=this._contentWidget)||void 0===e?void 0:e.isColorPickerVisible())||(this._hoverClicked=!1,null===(t=this._glyphWidget)||void 0===t||t.hide(),null===(i=this._contentWidget)||void 0===i||i.hide())}isColorPickerVisible(){var e;return(null===(e=this._contentWidget)||void 0===e?void 0:e.isColorPickerVisible())||!1}showContentHover(e,t,i){this._contentWidget||(this._contentWidget=new ba(this._editor,this._hoverVisibleKey,this._instantiationService,this._themeService)),this._contentWidget.startShowingAt(e,t,i)}dispose(){var e,t;this._unhookEvents(),this._toUnhook.dispose(),this._didChangeConfigurationHandler.dispose(),null===(e=this._glyphWidget)||void 0===e||e.dispose(),null===(t=this._contentWidget)||void 0===t||t.dispose()}};Hl.ID="editor.contrib.hover",Hl=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Vl(1,Et.a),Vl(2,On.a),Vl(3,li.a),Vl(4,we.b),Vl(5,_.b)],Hl);class zl extends a.b{constructor(){super({id:"editor.action.showHover",label:r.a({key:"showHover",comment:["Label for action that will trigger the showing of a hover in the editor.","This allows for users to show the hover without using the mouse."]},"Show Hover"),alias:"Show Hover",precondition:void 0,kbOpts:{kbExpr:p.a.editorTextFocus,primary:Object(N.a)(2089,2087),weight:100}})}run(e,t){if(!t.hasModel())return;let i=Hl.get(t);if(!i)return;const n=t.getPosition(),o=new g.a(n.lineNumber,n.column,n.lineNumber,n.column),s=2===t.getOption(2);i.showContentHover(o,1,s)}}class Ul extends a.b{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:r.a({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){let i=Hl.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const o=new g.a(n.lineNumber,n.column,n.lineNumber,n.column);jl.get(t).startFindDefinitionFromCursor(n).then((()=>{i.showContentHover(o,1,!0)}))}}Object(a.j)(Hl.ID,Hl),Object(a.h)(zl),Object(a.h)(Ul),Object(we.f)(((e,t)=>{const i=e.getColor(Be.C);i&&t.addRule(`.monaco-editor .hoverHighlight { background-color: ${i}; }`);const n=e.getColor(Be.z);n&&t.addRule(`.monaco-editor .monaco-hover { background-color: ${n}; }`);const o=e.getColor(Be.A);o&&(t.addRule(`.monaco-editor .monaco-hover { border: 1px solid ${o}; }`),t.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${o.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${o.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${o.transparent(.5)}; }`));const s=e.getColor(Be.mc);s&&t.addRule(`.monaco-editor .monaco-hover a { color: ${s}; }`);const r=e.getColor(Be.B);r&&t.addRule(`.monaco-editor .monaco-hover { color: ${r}; }`);const a=e.getColor(Be.D);a&&t.addRule(`.monaco-editor .monaco-hover .hover-row .actions { background-color: ${a}; }`);const l=e.getColor(Be.lc);l&&t.addRule(`.monaco-editor .monaco-hover code { background-color: ${l}; }`)}));var Kl=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const $l={Visible:new _.c("parameterHintsVisible",!1),MultipleSignatures:new _.c("parameterHintsMultipleSignatures",!1)};function ql(e,t,i,n){return Kl(this,void 0,void 0,(function*(){const o=Oe.y.ordered(e);for(const s of o)try{const o=yield s.provideSignatureHelp(e,t,n,i);if(o)return o}catch(e){Object(Ie.f)(e)}}))}ut.a.registerCommand("_executeSignatureHelpProvider",((e,...t)=>Kl(void 0,void 0,void 0,(function*(){const[i,n,o]=t;Object(oe.b)(gt.a.isUri(i)),Object(oe.b)(u.a.isIPosition(n)),Object(oe.b)("string"==typeof o||!o);const s=yield e.get(mt.a).createModelReference(i);try{const e=yield ql(s.object.textEditorModel,u.a.lift(n),{triggerKind:Oe.z.Invoke,isRetrigger:!1,triggerCharacter:o},Qe.a.None);if(!e)return;return setTimeout((()=>e.dispose()),0),e.value}finally{s.dispose()}}))));var Gl;!function(e){e.Default={type:0},e.Pending=class{constructor(e,t){this.request=e,this.previouslyActiveHints=t,this.type=2}},e.Active=class{constructor(e){this.hints=e,this.type=1}}}(Gl||(Gl={}));class Yl extends re.a{constructor(e,t=Yl.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new ae.a),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Gl.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new re.d),this.triggerChars=new To.b,this.retriggerChars=new To.b,this.triggerId=0,this.editor=e,this.throttledDelayer=new se.a(t),this._register(this.editor.onDidBlurEditorWidget((()=>this.cancel()))),this._register(this.editor.onDidChangeConfiguration((()=>this.onEditorConfigurationChange()))),this._register(this.editor.onDidChangeModel((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeModelLanguage((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeCursorSelection((e=>this.onCursorChange(e)))),this._register(this.editor.onDidChangeModelContent((e=>this.onModelContentChange()))),this._register(Oe.y.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType((e=>this.onDidType(e)))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){2===this._state.type&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Gl.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!Oe.y.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger((()=>this.doTrigger(n)),t).catch(Ie.e)}next(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e==e-1,n=this.editor.getOption(72).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?0:t+1):this.cancel()}previous(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=0===t,n=this.editor.getOption(72).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?e-1:t-1):this.cancel()}updateActiveSignature(e){1===this.state.type&&(this.state=new Gl.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return t=this,i=void 0,o=function*(){const t=1===this.state.type||2===this.state.type,i=this.getLastActiveHints();if(this.cancel(!0),0===this._pendingTriggers.length)return!1;const n=this._pendingTriggers.reduce(Zl);this._pendingTriggers=[];const o={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),r=this.editor.getPosition();this.state=new Gl.Pending(Object(se.h)((e=>ql(s,r,o,e))),i);try{const t=yield this.state.request;return e!==this.triggerId?(null==t||t.dispose(),!1):t&&t.value.signatures&&0!==t.value.signatures.length?(this.state=new Gl.Active(t.value),this._lastSignatureHelpResult.value=t,this._onChangedHints.fire(this.state.hints),!0):(null==t||t.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1)}catch(t){return e===this.triggerId&&(this.state=Gl.Default),Object(Ie.e)(t),!1}},new((n=void 0)||(n=Promise))((function(e,s){function r(e){try{l(o.next(e))}catch(e){s(e)}}function a(e){try{l(o.throw(e))}catch(e){s(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof n?i:new n((function(e){e(i)}))).then(r,a)}l((o=o.apply(t,i||[])).next())}));var t,i,n,o}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return 1===this.state.type||2===this.state.type||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars=new To.b,this.retriggerChars=new To.b;const e=this.editor.getModel();if(e)for(const t of Oe.y.ordered(e)){for(const e of t.signatureHelpTriggerCharacters||[])this.triggerChars.add(e.charCodeAt(0)),this.retriggerChars.add(e.charCodeAt(0));for(const e of t.signatureHelpRetriggerCharacters||[])this.retriggerChars.add(e.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:Oe.z.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){"mouse"===e.source?this.cancel():this.isTriggered&&this.trigger({triggerKind:Oe.z.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Oe.z.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(72).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}function Zl(e,t){switch(t.triggerKind){case Oe.z.Invoke:return t;case Oe.z.ContentChange:return e;case Oe.z.TriggerCharacter:default:return t}}Yl.DEFAULT_DELAY=120;var Ql=function(e,t){return function(i,n){t(i,n,e)}};const Xl=rn.a,Jl=Object(Ce.b)("parameter-hints-next",ve.b.chevronDown,r.a("parameterHintsNextIcon","Icon for show next parameter hint.")),eh=Object(Ce.b)("parameter-hints-previous",ve.b.chevronUp,r.a("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let th=class e extends re.a{constructor(e,t,i,n){super(),this.editor=e,this.renderDisposeables=this._register(new re.b),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Mn({editor:e},n,i)),this.model=this._register(new Yl(e)),this.keyVisible=$l.Visible.bindTo(t),this.keyMultipleSignatures=$l.MultipleSignatures.bindTo(t),this._register(this.model.onChangedHints((e=>{e?(this.show(),this.render(e)):this.hide()})))}createParamaterHintDOMNodes(){const e=Xl(".editor-widget.parameter-hints-widget"),t=rn.q(e,Xl(".phwrapper"));t.tabIndex=-1;const i=rn.q(t,Xl(".controls")),n=rn.q(i,Xl(".button"+we.d.asCSSSelector(eh))),o=rn.q(i,Xl(".overloads")),s=rn.q(i,Xl(".button"+we.d.asCSSSelector(Jl))),r=Object(Dn.b)(Object(Dn.a)(n,"click"));this._register(r(this.previous,this));const a=Object(Dn.b)(Object(Dn.a)(s,"click"));this._register(a(this.next,this));const l=Xl(".body"),h=new hn.a(l,{});this._register(h),t.appendChild(h.getDomNode());const c=rn.q(l,Xl(".signature")),d=rn.q(l,Xl(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:d,scrollbar:h},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection((e=>{this.visible&&this.editor.layoutContentWidget(this)})));const u=()=>{if(!this.domNodes)return;const e=this.editor.getOption(40);this.domNodes.element.style.fontSize=`${e.fontSize}px`};u(),this._register(ae.b.chain(this.editor.onDidChangeConfiguration.bind(this.editor)).filter((e=>e.hasChanged(40))).on(u,null)),this._register(this.editor.onDidLayoutChange((e=>this.updateMaxHeight()))),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParamaterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout((()=>{this.domNodes&&this.domNodes.element.classList.add("visible")}),100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes&&this.domNodes.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const n=e.signatures[e.activeSignature];if(!n)return;const o=rn.q(this.domNodes.signature,Xl(".code")),s=this.editor.getOption(40);o.style.fontSize=`${s.fontSize}px`,o.style.fontFamily=s.fontFamily;const a=n.parameters.length>0,l=null!==(t=n.activeParameter)&&void 0!==t?t:e.activeParameter;a?this.renderParameters(o,n,l):rn.q(o,Xl("span")).textContent=n.label;const h=n.parameters[l];if(null==h?void 0:h.documentation){const e=Xl("span.documentation");if("string"==typeof h.documentation)e.textContent=h.documentation;else{const t=this.renderMarkdownDocs(h.documentation);e.appendChild(t.element)}rn.q(this.domNodes.docs,Xl("p",{},e))}if(void 0===n.documentation);else if("string"==typeof n.documentation)rn.q(this.domNodes.docs,Xl("p",{},n.documentation));else{const e=this.renderMarkdownDocs(n.documentation);rn.q(this.domNodes.docs,e.element)}const c=this.hasDocs(n,h);if(this.domNodes.signature.classList.toggle("has-docs",c),this.domNodes.docs.classList.toggle("empty",!c),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,h){const e=this.getParameterLabel(n,l);this.announcedLabel!==e&&(Ye.a(r.a("hint","{0}, hint",e)),this.announcedLabel=e)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var e;null===(e=this.domNodes)||void 0===e||e.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&"string"==typeof t.documentation&&Object(oe.a)(t.documentation).length>0||t&&"object"==typeof t.documentation&&Object(oe.a)(t.documentation).value.length>0||e.documentation&&"string"==typeof e.documentation&&Object(oe.a)(e.documentation).length>0||e.documentation&&"object"==typeof e.documentation&&Object(oe.a)(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,o]=this.getParameterLabelOffsets(t,i),s=document.createElement("span");s.textContent=t.label.substring(0,n);const r=document.createElement("span");r.textContent=t.label.substring(n,o),r.className="parameter active";const a=document.createElement("span");a.textContent=t.label.substring(o),rn.q(e,s,r,a)}getParameterLabel(e,t){const i=e.parameters[t];return Array.isArray(i.label)?e.label.substring(i.label[0],i.label[1]):i.label}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const t=new RegExp(`(\\W|^)${Object(E.t)(i.label)}(?=\\W|$)`,"g");t.test(e.label);const n=t.lastIndex-i.label.length;return n>=0?[n,t.lastIndex]:[0,0]}return[0,0]}return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}cancel(){this.model.cancel()}getDomNode(){return this.domNodes||this.createParamaterHintDOMNodes(),this.domNodes.element}getId(){return e.ID}trigger(e){this.model.trigger(e,0)}updateMaxHeight(){if(!this.domNodes)return;const e=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=e;const t=this.domNodes.element.getElementsByClassName("phwrapper");t.length&&(t[0].style.maxHeight=e)}};th.ID="editor.widget.parameterHintsWidget",th=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([Ql(1,_.b),Ql(2,On.a),Ql(3,li.a)],th),Object(we.f)(((e,t)=>{const i=e.getColor(Be.A);if(i){const n=e.type===Lr.a.HIGH_CONTRAST?2:1;t.addRule(`.monaco-editor .parameter-hints-widget { border: ${n}px solid ${i}; }`),t.addRule(`.monaco-editor .parameter-hints-widget.multiple .body { border-left: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .parameter-hints-widget .signature.has-docs { border-bottom: 1px solid ${i.transparent(.5)}; }`)}const n=e.getColor(Be.z);n&&t.addRule(`.monaco-editor .parameter-hints-widget { background-color: ${n}; }`);const o=e.getColor(Be.mc);o&&t.addRule(`.monaco-editor .parameter-hints-widget a { color: ${o}; }`);const s=e.getColor(Be.B);s&&t.addRule(`.monaco-editor .parameter-hints-widget { color: ${s}; }`);const r=e.getColor(Be.lc);r&&t.addRule(`.monaco-editor .parameter-hints-widget code { background-color: ${r}; }`)}));let ih=class e extends re.a{constructor(e,t){super(),this.editor=e,this.widget=this._register(t.createInstance(th,this.editor))}static get(t){return t.getContribution(e.ID)}cancel(){this.widget.cancel()}previous(){this.widget.previous()}next(){this.widget.next()}trigger(e){this.widget.trigger(e)}};ih.ID="editor.controller.parameterHints",ih=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}([function(e,t){return function(i,n){t(i,n,e)}}(1,Et.a)],ih);class nh extends a.b{constructor(){super({id:"editor.action.triggerParameterHints",label:r.a("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:p.a.hasSignatureHelpProvider,kbOpts:{kbExpr:p.a.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=ih.get(t);i&&i.trigger({triggerKind:Oe.z.Invoke})}}Object(a.j)(ih.ID,ih),Object(a.h)(nh);const oh=a.c.bindToContribution(ih.get);Object(a.i)(new oh({id:"closeParameterHints",precondition:$l.Visible,handler:e=>e.cancel(),kbOpts:{weight:175,kbExpr:p.a.focus,primary:9,secondary:[1033]}})),Object(a.i)(new oh({id:"showPrevParameterHint",precondition:_.a.and($l.Visible,$l.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:175,kbExpr:p.a.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),Object(a.i)(new oh({id:"showNextParameterHint",precondition:_.a.and($l.Visible,$l.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:175,kbExpr:p.a.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var sh=i(60),rh=i(49);const ah=Object(Be.ac)("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hc:"#A0A0A0"},r.a("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class lh extends a.b{constructor(){super({id:"editor.action.jumpToBracket",label:r.a("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:p.a.editorTextFocus,primary:3160,weight:100}})}run(e,t){let i=dh.get(t);i&&i.jumpToBracket()}}class hh extends a.b{constructor(){super({id:"editor.action.selectToBracket",label:r.a("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,description:{description:"Select to Bracket",args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){const n=dh.get(t);if(!n)return;let o=!0;i&&!1===i.selectBrackets&&(o=!1),n.selectToBracket(o)}}class ch{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class dh extends re.a{constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=[],this._updateBracketsSoon=this._register(new se.e((()=>this._updateBrackets()),50)),this._matchBrackets=this._editor.getOption(60),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition((e=>{"never"!==this._matchBrackets&&this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelContent((e=>{this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModel((e=>{this._lastBracketsData=[],this._decorations=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelLanguageConfiguration((e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(60)&&(this._matchBrackets=this._editor.getOption(60),this._decorations=this._editor.deltaDecorations(this._decorations,[]),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})))}static get(e){return e.getContribution(dh.ID)}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map((t=>{const i=t.getStartPosition(),n=e.matchBracket(i);let o=null;if(n)n[0].containsPosition(i)?o=n[1].getStartPosition():n[1].containsPosition(i)&&(o=n[0].getStartPosition());else{const t=e.findEnclosingBrackets(i);if(t)o=t[0].getStartPosition();else{const t=e.findNextBracket(i);t&&t.range&&(o=t.range.getStartPosition())}}return o?new m.a(o.lineNumber,o.column,o.lineNumber,o.column):new m.a(i.lineNumber,i.column,i.lineNumber,i.column)}));this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach((n=>{const o=n.getStartPosition();let s=t.matchBracket(o);if(!s&&(s=t.findEnclosingBrackets(o),!s)){const e=t.findNextBracket(o);e&&e.range&&(s=t.matchBracket(e.range.getStartPosition()))}let r=null,a=null;if(s){s.sort(g.a.compareRangesUsingStarts);const[t,i]=s;r=e?t.getStartPosition():t.getEndPosition(),a=e?i.getEndPosition():i.getStartPosition()}r&&a&&i.push(new m.a(r.lineNumber,r.column,a.lineNumber,a.column))})),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}_updateBrackets(){if("never"===this._matchBrackets)return;this._recomputeBrackets();let e=[],t=0;for(const i of this._lastBracketsData){let n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations=this._editor.deltaDecorations(this._decorations,e)}_recomputeBrackets(){if(!this._editor.hasModel())return this._lastBracketsData=[],void(this._lastVersionId=0);const e=this._editor.getSelections();if(e.length>100)return this._lastBracketsData=[],void(this._lastVersionId=0);const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);let o=[],s=0;for(let t=0,i=e.length;t1&&o.sort(u.a.compare);let r=[],a=0,l=0,h=n.length;for(let e=0,i=o.length;e{const i=e.getColor(rh.c);i&&t.addRule(`.monaco-editor .bracket-match { background-color: ${i}; }`);const n=e.getColor(rh.d);n&&t.addRule(`.monaco-editor .bracket-match { border: 1px solid ${n}; }`)})),V.d.appendMenuItem(V.b.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:r.a({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});var uh=i(164),gh=new(function(){function e(e,t,i){this._onDidChange=new uh.a,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!1,configurable:!0}),e.prototype.setDiagnosticsOptions=function(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)},e.prototype.setModeConfiguration=function(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)},e}())("json",{validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},{documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0});uh.f.json={jsonDefaults:gh},uh.f.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]}),uh.f.onLanguage("json",(function(){i.e(2).then(i.bind(null,435)).then((function(e){return e.setupMode(gh)}))}));var mh=i(165),ph={},fh={},_h=function(){function e(e){var t=this;this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((function(e,i){t._lazyLoadPromiseResolve=e,t._lazyLoadPromiseReject=i}))}return e.getOrCreate=function(t){return fh[t]||(fh[t]=new e(t)),fh[t]},e.prototype.whenLoaded=function(){return this._lazyLoadPromise},e.prototype.load=function(){var e=this;return this._loadingTriggered||(this._loadingTriggered=!0,ph[this._languageId].loader().then((function(t){return e._lazyLoadPromiseResolve(t)}),(function(t){return e._lazyLoadPromiseReject(t)}))),this._lazyLoadPromise},e}();function bh(e){var t=e.id;ph[t]=e,mh.a.register(e);var i=_h.getOrCreate(t);mh.a.setMonarchTokensProvider(t,i.whenLoaded().then((function(e){return e.language}))),mh.a.onLanguage(t,(function(){i.load().then((function(e){mh.a.setLanguageConfiguration(t,e.conf)}))}))}bh({id:"javascript",extensions:[".js",".es6",".jsx",".mjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:function(){return i.e(4).then(i.bind(null,437))}}),bh({id:"xml",extensions:[".xml",".dtd",".ascx",".csproj",".config",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xsl"],firstLine:"(\\<\\?xml.*)|(\\{const e=new yh;e.setup();const t=async t=>{if(t.isDisposed())return;const i=await e.getAnnos(t.uri);if(!i)return;const{annotations:o}=i;n.editor.setModelMarkers(t,"XJSON_GRAMMAR_CHECKER",o.map((({at:e,text:i,type:o})=>{const{column:s,lineNumber:r}=t.getPositionAt(e);return{startLineNumber:r,startColumn:s,endLineNumber:r,endColumn:s,message:i,severity:"error"===o?n.MarkerSeverity.Error:n.MarkerSeverity.Warning}})))};n.editor.onDidCreateModel((e=>{if(e.getModeId()!==wh)return;const{dispose:i}=e.onDidChangeContent((async()=>{t(e)}));e.onWillDispose((()=>{i()})),t(e)}))}));const Sh={ID:wh,lexerRules:{escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,defaultToken:"invalid",tokenPostfix:"",tokenizer:{root:[[/("(?:[^"]*_)?script"|"inline"|"source")(\s*?)(:)(\s*?)(""")/,["variable","whitespace","ace.punctuation.colon","whitespace",{token:"punctuation.start_triple_quote",nextEmbedded:"painless",next:"my_painless"}]],[/(:)(\s*?)(""")(sql)/,["ace.punctuation.colon","whitespace","punctuation.start_triple_quote",{token:"punctuation.start_triple_quote.lang_marker",nextEmbedded:"esql",next:"my_sql"}]],[/{/,{token:"paren.lparen",next:"@push"}],[/}/,{token:"paren.rparen",next:"@pop"}],[/[[(]/,{token:"paren.lparen"}],[/[\])]/,{token:"paren.rparen"}],[/,/,{token:"punctuation.comma"}],[/:/,{token:"punctuation.colon"}],[/\s+/,{token:"whitespace"}],[/["](?:(?:\\.)|(?:[^"\\]))*?["]\s*(?=:)/,{token:"variable"}],[/"""/,{token:"string_literal",next:"string_literal"}],[/0[xX][0-9a-fA-F]+\b/,{token:"constant.numeric"}],[/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/,{token:"constant.numeric"}],[/(?:true|false)\b/,{token:"constant.language.boolean"}],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/['](?:(?:\\.)|(?:[^'\\]))*?[']/,{token:"invalid"}],[/.+?/,{token:"text"}],[/\/\/.*$/,{token:"invalid"}]],my_painless:[[/"""/,{token:"punctuation.end_triple_quote",nextEmbedded:"@pop",next:"@pop"}]],my_sql:[[/"""/,{token:"punctuation.end_triple_quote",nextEmbedded:"@pop",next:"@pop"}]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],string_literal:[[/"""/,{token:"punctuation.end_triple_quote",next:"@pop"}],[/\\""""/,{token:"punctuation.end_triple_quote",next:"@pop"}],[/./,{token:"multi_string"}]]}},languageConfiguration:{brackets:[["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:'"',close:'"'}]}},xh="painless";var Lh=i(85);const kh=e=>{const t=n.languages.CompletionItemKind;switch(e){case"type":return t.Interface;case"class":return t.Class;case"method":return t.Method;case"constructor":return t.Constructor;case"property":return t.Property;case"keyword":return t.Keyword;case"field":return t.Field;default:return t.Text}};class Dh{constructor(e,t){this.worker=e,this.editorStateService=t}get triggerCharacters(){return[".","'"]}async provideCompletionItems(e,t){const i=e.getValueInRange({startLineNumber:t.lineNumber,startColumn:0,endLineNumber:t.lineNumber,endColumn:t.column}),o=await this.worker(e.uri),{context:s,fields:r}=this.editorStateService.getState(),a=await o.provideAutocompleteSuggestions(i,s,r),l=e.getWordUntilPosition(t),h={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:l.startColumn,endColumn:l.endColumn},c=a.suggestions.map((({label:e,insertText:t,documentation:i,kind:o,insertTextAsSnippet:s})=>({label:e,insertText:t,documentation:i,range:h,kind:kh(o),insertTextRules:s?n.languages.CompletionItemInsertTextRule.InsertAsSnippet:void 0})));return{incomplete:a.isIncomplete,suggestions:c}}}const Nh=e=>({...e,severity:n.MarkerSeverity.Error});class Eh{constructor(e,t){Ch()(this,"errors",{}),Ch()(this,"validation",new Lh.BehaviorSubject({isValid:!0,isValidating:!1,errors:[]})),Ch()(this,"validateIdx",0),Ch()(this,"validation$",this.validation.asObservable()),this.langId=e,this.worker=t;const i=e=>{let t;e.getModeId()===this.langId&&(e.onDidChangeContent((()=>{if(e.getModeId()!==this.langId)return;const i=++this.validateIdx;if(clearTimeout(t),""===e.getValue().trim())return this.validation.next({isValid:!0,isValidating:!1,errors:[]}),n.editor.setModelMarkers(e,this.langId,[]);this.validation.next({...this.validation.value,isValidating:!0}),t=setTimeout((()=>{this.validate(e.uri,i)}),500)})),e.onDidChangeLanguage((({newLanguage:t})=>{if(t!==this.langId)return n.editor.setModelMarkers(e,this.langId,[]);this.validate(e.uri,++this.validateIdx)})),this.validation.next({...this.validation.value,isValidating:!0}),this.validate(e.uri,++this.validateIdx))};n.editor.onDidCreateModel(i),n.editor.getModels().forEach(i)}async validate(e,t){if(t!==this.validateIdx)return;const i=await this.worker(e),o=await i.getSyntaxErrors(e.toString());if(t!==this.validateIdx)return;if(o){const t=n.editor.getModel(e);this.errors={...this.errors,[t.id]:o},n.editor.setModelMarkers(t,this.langId,o.map(Nh))}const s=void 0===o||0===o.length;this.validation.next({isValidating:!1,isValid:s,errors:null!=o?o:[]})}getSyntaxErrors(){return this.errors}}class Oh{constructor(){Ch()(this,"worker",void 0)}async getWorker(e){if(!this.worker)throw new Error("Worker Proxy Service has not been setup!");return await this.worker.withSyncedResources(e),await this.worker.getProxy()}setup(e){this.worker=n.editor.createWebWorker({label:e,moduleId:""})}stop(){this.worker&&this.worker.dispose()}}const Ih=new Oh,Th=new class{constructor(){Ch()(this,"context","painless_test"),Ch()(this,"fields",[])}getState(){return{context:this.context,fields:this.fields}}setup(e,t){this.context=e,t&&(this.fields=t)}},Mh=(...e)=>Ih.getWorker(e);let Ah;n.languages.onLanguage(xh,(async()=>{Ih.setup(xh),Ah=new Eh(xh,Mh)}));const Rh={ID:xh,getSuggestionProvider:(e,t)=>(Th.setup(e,t),new Dh(Mh,Th)),lexerRules:{default:"",brackets:[["{","}","delimiter.curly"],["[","]","delimiter.square"],["(",")","delimiter.parenthesis"]],keywords:["if","in","else","while","do","for","continue","break","return","new","try","catch","throw","this","instanceof"],primitives:["void","boolean","byte","short","char","int","long","float","double","def"],constants:["true","false"],operators:["=",">","<","!","~","?","?:","?.",":","==","===","<=",">=","!=","!==","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>=","->","::","=~","==~"],symbols:/[=>{var e,t;return null!==(e=null===(t=Ah)||void 0===t?void 0:t.getSyntaxErrors())&&void 0!==e?e:{}},validation$:()=>{var e;return(null===(e=Ah)||void 0===e?void 0:e.validation$)||Object(Lh.of)({isValid:!0,isValidating:!1,errors:[]})}},Ph={ID:"sql",lexerRules:{defaultToken:"invalid",ignoreCase:!0,tokenPostfix:"",keywords:["describe","between","in","like","not","and","or","desc","select","from","where","having","group","by","order","asc","desc","pivot","for","in","as","show","columns","include","frozen","tables","escape","limit","rlike","all","distinct","is"],builtinFunctions:["avg","count","first","first_value","last","last_value","max","min","sum","kurtosis","mad","percentile","percentile_rank","skewness","stddev_pop","sum_of_squares","var_pop","histogram","case","coalesce","greatest","ifnull","iif","isnull","least","nullif","nvl","curdate","current_date","current_time","current_timestamp","curtime","dateadd","datediff","datepart","datetrunc","date_add","date_diff","date_part","date_trunc","day","dayname","dayofmonth","dayofweek","dayofyear","day_name","day_of_month","day_of_week","day_of_year","dom","dow","doy","hour","hour_of_day","idow","isodayofweek","isodow","isoweek","isoweekofyear","iso_day_of_week","iso_week_of_year","iw","iwoy","minute","minute_of_day","minute_of_hour","month","monthname","month_name","month_of_year","now","quarter","second","second_of_minute","timestampadd","timestampdiff","timestamp_add","timestamp_diff","today","week","week_of_year","year","abs","acos","asin","atan","atan2","cbrt","ceil","ceiling","cos","cosh","cot","degrees","e","exp","expm1","floor","log","log10","mod","pi","power","radians","rand","random","round","sign","signum|sin","sinh","sqrt","tan","truncate","ascii","bit_length","char","character_length","char_length","concat","insert","lcase","left","length","locate","ltrim","octet_length","position","repeat","replace","right","rtrim","space","substring","ucase","cast","convert","database","user","st_astext","st_aswkt","st_distance","st_geometrytype","st_geomfromtext","st_wkttosql","st_x","st_y","st_z","score"],brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],tokenizer:{root:[[/[a-zA-Z_$][a-zA-Z0-9_$]*\b/,{cases:{"@keywords":"keyword","@builtinFunctions":"identifier","@default":"identifier"}}],[/[()]/,"@brackets"],[/--.*$/,"comment"],[/\/\*/,"comment","@comment"],[/\/.*$/,"comment"],[/".*?"/,"string"],[/'.*?'/,"constant"],[/`.*?`/,"string"],[/[ \t\r\n]+/,{token:"@whitespace"}],[/[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b/,"entity.name.function"],[/⇐|<⇒|\*|\.|\:\:|\+|\-|\/|\/\/|%|&|\^|~|<|>|<=|=>|==|!=|<>|=/,"keyword.operator"],[/[\(]/,"paren.lparen"],[/[\)]/,"paren.rparen"],[/\s+/,"text"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]]}}};var Fh=i(124);let Wh;!function(e){e.SourceIdentifier="SourceIdentifier",e.FieldIdentifier="FieldIdentifier"}(Wh||(Wh={}));var Bh=i(40);const jh={incomplete:!1,suggestions:[]};class Vh{constructor(e,t){Ch()(this,"triggerCharacters",["("," ",""]),this.worker=e,this.callbacks=t}async injectDynamicAutocompleteItems(e,t){let i=[];for(const u of e)if((d=u)===Wh.SourceIdentifier||d===Wh.FieldIdentifier){let e=[];var n,o,s,r,a,l,h,c;u===Wh.SourceIdentifier&&(e=(null!==(n=await(null===(o=this.callbacks)||void 0===o||null===(s=(r=o).getSourceIdentifiers)||void 0===s?void 0:s.call(r,t)))&&void 0!==n?n:[]).map((e=>({label:e,insertText:e,kind:21,detail:Bh.i18n.translate("monaco.esql.autocomplete.sourceDefinition",{defaultMessage:"Input table"}),sortText:"A"})))),u===Wh.FieldIdentifier&&(e=(null!==(a=await(null===(l=this.callbacks)||void 0===l||null===(h=(c=l).getFieldsIdentifiers)||void 0===h?void 0:h.call(c,t)))&&void 0!==a?a:[]).map((e=>({label:e,insertText:e,kind:4,detail:Bh.i18n.translate("monaco.esql.autocomplete.fieldDefinition",{defaultMessage:"Field specified by the input table"}),sortText:"D"})))),i=[...i,...e]}else i=[...i,u];var d;return i}async provideCompletionItems(e,t){if(e.getLineCount()!==t.lineNumber||e.getLineContent(t.lineNumber).trimEnd().length>=t.column)return jh;const i=await this.worker(e.uri),n=e.getWordUntilPosition(t),o=await i.provideAutocompleteSuggestions(e.uri.toString(),{word:n.word,line:t.lineNumber,index:t.column});return{incomplete:!0,suggestions:(o?await this.injectDynamicAutocompleteItems(o.suggestions,{word:n.word,userDefinedVariables:o.userDefinedVariables}):[]).map((e=>({...e,range:{startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:n.startColumn,endColumn:n.endColumn}})))}}}const Hh=new Oh,zh={ID:Fh.a,async onLanguage(){const{ESQLTokensProvider:e}=await Promise.all([i.e(1),i.e(3)]).then(i.bind(null,436));Hh.setup(Fh.a),n.languages.setTokensProvider(Fh.a,new e),new Eh(Fh.a,((...e)=>Hh.getWorker(e)))},getSuggestionProvider:e=>new Vh(((...e)=>Hh.getWorker(e)),e)};var Uh=i(144);const Kh=(e,t,i=!1)=>e.map((e=>({token:e+Fh.c,foreground:t,fontStyle:i?"bold":""})));function $h(e){const{ID:t,lexerRules:i,languageConfiguration:o}=e;n.languages.register({id:t}),n.languages.onLanguage(t,(async()=>{i&&n.languages.setMonarchTokensProvider(t,i),o&&n.languages.setLanguageConfiguration(t,o),"onLanguage"in e&&await e.onLanguage()}))}var qh;const Gh=[Sh.ID,Rh.ID,zh.ID,n.languages.json.jsonDefaults.languageId,"yaml"];$h(Sh),$h(Rh),$h(Ph),$h(zh),function(e,t){try{n.editor.defineTheme(e,t)}catch(e){}}(Fh.b,{base:Uh.darkMode?"vs-dark":"vs",inherit:!0,rules:[...Kh(["explain","row","limit","project","ws","assign","comma","dot","first","last","opening_bracket","closing_bracket","quoted_identifier","src_ws","unquoted_identifier","pipe","not","percent","integer_literal","decimal_literal","src_unquoted_identifier","src_quoted_identifier","string"],Uh.euiThemeVars.euiTextColor),...Kh(["from","stats","eval","sort","by","where","expr_ws","row","limit","nulls_ordering_direction","nulls_ordering","null","boolean_value","comparison_operator"],Uh.euiThemeVars.euiColorPrimaryText),...Kh(["unary_function"],Uh.euiThemeVars.euiColorPrimaryText),...Kh(["or","and","rp","lp","plus","minus","asterisk","slash"],Uh.euiThemeVars.euiTextSubduedColor),...Kh(["line_comment","multiline_comment","expr_line_comment","expr_multiline_comment","src_line_comment","src_multiline_comment"],Uh.euiThemeVars.euiColorMediumShade)],colors:{}});const Yh=null===(qh=window.__kbnPublicPath__)||void 0===qh?void 0:qh["kbn-monaco"];window.MonacoEnvironment={monaco:n,getWorkerUrl:Yh?(e,t)=>{const i=Gh.includes(t)?t:"default";return`${Yh}${i}.editor.worker.js`}:()=>{}}},function(e,t,i){e.exports=i(33)(3809)},function(e,t,i){e.exports=i(33)(3810)},function(e,t){},function(e,t,i){e.exports=i(33)(226)},function(e,t,i){e.exports=i(33)(190)},function(e,t,i){"use strict";i.r(t),i.d(t,"Jquery",(function(){return n})),i.d(t,"KbnUiTheme",(function(){return o})),i.d(t,"KbnI18n",(function(){return s})),i.d(t,"KbnI18nReact",(function(){return r})),i.d(t,"EmotionCache",(function(){return a})),i.d(t,"EmotionReact",(function(){return l})),i.d(t,"Moment",(function(){return h})),i.d(t,"MomentTimezone",(function(){return c})),i.d(t,"IoTs",(function(){return d})),i.d(t,"KbnMonaco",(function(){return u})),i.d(t,"MonacoBarePluginApi",(function(){return g})),i.d(t,"React",(function(){return m})),i.d(t,"ReactDom",(function(){return p})),i.d(t,"ReactDomServer",(function(){return f})),i.d(t,"ReactRouter",(function(){return _})),i.d(t,"ReactRouterDom",(function(){return b})),i.d(t,"ReactRouterDomV5Compat",(function(){return v})),i.d(t,"StyledComponents",(function(){return C})),i.d(t,"Rxjs",(function(){return w})),i.d(t,"RxjsOperators",(function(){return y})),i.d(t,"ElasticNumeral",(function(){return S})),i.d(t,"ElasticCharts",(function(){return x})),i.d(t,"ElasticEui",(function(){return L})),i.d(t,"ElasticEuiLibServices",(function(){return k})),i.d(t,"ElasticEuiLibServicesFormat",(function(){return D})),i.d(t,"ElasticEuiChartsTheme",(function(){return N})),i.d(t,"KbnDatemath",(function(){return E})),i.d(t,"HelloPangeaDnd",(function(){return O})),i.d(t,"Lodash",(function(){return I})),i.d(t,"LodashFp",(function(){return T})),i.d(t,"Fflate",(function(){return R})),i.d(t,"TsLib",(function(){return P})),i.d(t,"Uuid",(function(){return F})),i.d(t,"KbnAnalytics",(function(){return W})),i.d(t,"KbnEsQuery",(function(){return B})),i.d(t,"KbnStd",(function(){return j})),i.d(t,"SaferLodashSet",(function(){return V})),i.d(t,"KbnRison",(function(){return H})),i.d(t,"History",(function(){return z})),i.d(t,"Classnames",(function(){return U})),i.d(t,"ReactQuery",(function(){return K})),i.d(t,"ReactQueryDevtools",(function(){return $})),i(198),i(199);const n=i(208);window.$=window.jQuery=n,i(281);const o=i(144),s=i(40),r=i(280),a=i(235),l=i(177),h=i(155),c=i(236),d=i(237),u=i(191),g=i(191).BarePluginApi,m=i(66),p=i(240),f=i(241),_=i(242),b=i(243),v=i(244),C=i(245);h.tz.load(i(246));const w=i(85),y=i(141),S=i(247),x=i(248),L=i(249),k=i(250),D=i(251),N=i(252),E=i(253),O=i(254),I=i(24),T=i(255),{unzlibSync:M,strFromU8:A}=i(256),R={unzlibSync:M,strFromU8:A},P=i(257),F=i(258),W=i(279),B=i(277),j=i(278),V=i(264),H=i(282),z=i(273),U=i(274),K=i(275),$=i(276)},function(e,t,i){i.p=window.__kbnPublicPath__["kbn-ui-shared-deps-src"]},function(e,t,i){"use strict";i.r(t),i(200),i(201),i(202),i(203),i(204),i(205),"object"==typeof window.Event&&(window.Event=CustomEvent),i(206),i(207)},function(e,t,i){e.exports=i(33)(2687)},function(e,t,i){e.exports=i(33)(2820)},function(e,t,i){e.exports=i(33)(2916)},function(e,t,i){e.exports=i(33)(2918)},function(e,t,i){e.exports=i(33)(2924)},function(e,t,i){e.exports=i(33)(2980)},function(e,t,i){e.exports=i(33)(2940)},function(e,t,i){e.exports=i(33)(2941)},function(e,t,i){e.exports=i(33)(3817)},function(e,t){!function(e){e.color={},e.color.make=function(t,i,n,o){var s={};return s.r=t||0,s.g=i||0,s.b=n||0,s.a=null!=o?o:1,s.add=function(e,t){for(var i=0;i=1?"rgb("+[s.r,s.g,s.b].join(",")+")":"rgba("+[s.r,s.g,s.b,s.a].join(",")+")"},s.normalize=function(){function e(e,t,i){return ti?i:t}return s.r=e(0,parseInt(s.r),255),s.g=e(0,parseInt(s.g),255),s.b=e(0,parseInt(s.b),255),s.a=e(0,s.a,1),s},s.clone=function(){return e.color.make(s.r,s.b,s.g,s.a)},s.normalize()},e.color.extract=function(t,i){var n;do{if(""!=(n=t.css(i).toLowerCase())&&"transparent"!=n)break;t=t.parent()}while(t.length&&!e.nodeName(t.get(0),"body"));return"rgba(0, 0, 0, 0)"==n&&(n="transparent"),e.color.parse(n)},e.color.parse=function(i){var n,o=e.color.make;if(n=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(i))return o(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10));if(n=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(i))return o(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4]));if(n=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(i))return o(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]));if(n=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(i))return o(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]),parseFloat(n[4]));if(n=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(i))return o(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16));if(n=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(i))return o(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16));var s=e.trim(i).toLowerCase();return"transparent"==s?o(255,255,255,0):o((n=t[s]||[0,0,0])[0],n[1],n[2])};var t={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function(e){var t=Object.prototype.hasOwnProperty;function i(t,i){var n=i.children("."+t)[0];if(null==n&&((n=document.createElement("canvas")).className=t,e(n).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(i),!n.getContext)){if(!window.G_vmlCanvasManager)throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");n=window.G_vmlCanvasManager.initElement(n)}this.element=n;var o=this.context=n.getContext("2d"),s=window.devicePixelRatio||1,r=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1;this.pixelRatio=s/r,this.resize(i.width(),i.height()),this.textContainer=null,this.text={},this._textCache={}}function n(t,n,o,s){var r=[],a={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1,zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},l=null,h=null,c=null,d=null,u=null,g=[],m=[],p={left:0,right:0,top:0,bottom:0},f=0,_=0,b={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},v=this;function C(e,t){t=[v].concat(t);for(var i=0;in&&(n=o))}i<=n&&(i=n+1);var s,l=[],h=a.colors,c=h.length,d=0;for(t=0;t=0?d<.5?-d-.2:0:-d),l[t]=s.scale("rgb",1+d);var u,p=0;for(t=0;te.datamax&&i!=f&&(e.datamax=i)}for(e.each(S(),(function(e,t){t.datamin=m,t.datamax=p,t.used=!1})),t=0;t0&&null!=a[n-l]&&a[n-l]!=a[n]&&a[n-l+1]!=a[n+1]){for(o=0;ok&&(k=h)),c.y&&(hD&&(D=h)));if(s.bars.show){var N;switch(s.bars.align){case"left":N=0;break;case"right":N=-s.bars.barWidth;break;default:N=-s.bars.barWidth/2}s.bars.horizontal?(L+=N,D+=N+s.bars.barWidth):(x+=N,k+=N+s.bars.barWidth)}_(s.xaxis,x,k),_(s.yaxis,L,D)}e.each(S(),(function(e,t){t.datamin==m&&(t.datamin=null),t.datamax==p&&(t.datamax=null)}))}()}function y(e,t){var i=e[t+"axis"];return"object"==typeof i&&(i=i.n),"number"!=typeof i&&(i=1),i}function S(){return e.grep(g.concat(m),(function(e){return e}))}function x(e){var t,i,n={};for(t=0;t=0&&(i=0),null==t.max&&(n+=o*r)>0&&null!=e.datamax&&e.datamax<=0&&(n=0))}e.min=i,e.max=n}(t)})),o){var c=e.grep(n,(function(e){return e.show||e.reserveSpace}));for(e.each(c,(function(t,i){!function(t){var i,n=t.options;i="number"==typeof n.ticks&&n.ticks>0?n.ticks:.3*Math.sqrt("x"==t.direction?l.width:l.height);var o=(t.max-t.min)/i,s=-Math.floor(Math.log(o)/Math.LN10),r=n.tickDecimals;null!=r&&s>r&&(s=r);var a,h=Math.pow(10,-s),c=o/h;if(c<1.5?a=1:c<3?(a=2,c>2.25&&(null==r||s+1<=r)&&(a=2.5,++s)):a=c<7.5?5:10,a*=h,null!=n.minTickSize&&a0&&(null==n.min&&(t.min=Math.min(t.min,u[0])),null==n.max&&u.length>1&&(t.max=Math.max(t.max,u[u.length-1]))),t.tickGenerator=function(e){var t,i,n=[];for(i=0;i1&&/\..*0$/.test((f[1]-f[0]).toFixed(p))||(t.tickDecimals=p)}}}}(i),function(t){var i,n,o=t.options.ticks,s=[];for(null==o||"number"==typeof o&&o>0?s=t.tickGenerator(t):o&&(s=e.isFunction(o)?o(t):o),t.ticks=[],i=0;i1&&(r=a[1])):n=+a,null==r&&(r=t.tickFormatter(n,t)),isNaN(n)||t.ticks.push({v:n,label:r})}}(i),function(e,t){e.options.autoscaleMargin&&t.length>0&&(null==e.options.min&&(e.min=Math.min(e.min,t[0].v)),null==e.options.max&&t.length>1&&(e.max=Math.max(e.max,t[t.length-1].v)))}(i,i.ticks),function(e){for(var t=e.options,i=e.ticks||[],n=t.labelWidth||0,o=t.labelHeight||0,s=n||("x"==e.direction?Math.floor(l.width/(i.length||1)):null),r=e.direction+"Axis "+e.direction+e.n+"Axis",a="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+r,h=t.font||"flot-tick-label tickLabel",c=0;c=0;--i)D(c[i]);!function(){var t,i=a.grid.minBorderMargin;if(null==i)for(i=0,t=0;tt.max||("x"==t.direction?(s="center",n=p.left+t.p2c(i.v),"bottom"==t.position?o=a.top+a.padding:(o=a.top+a.height-a.padding,r="bottom")):(r="middle",o=p.top+t.p2c(i.v),"left"==t.position?(n=a.left+a.width-a.padding,s="right"):n=a.left+a.padding),l.addText(c,n,o,i.label,d,null,null,s,r))})),function(){if(null!=a.legend.container?e(a.legend.container).html(""):t.find(".legend").remove(),a.legend.show){for(var i,n,o=[],s=[],l=!1,h=a.legend.labelFormatter,c=0;c"),o.push(""),l=!0),o.push('
    '+u.label+"")}if(l&&o.push(""),0!=o.length){var g=''+o.join("")+"
    ";if(null!=a.legend.container)e(a.legend.container).html(g);else{var m="",f=a.legend.position,_=a.legend.margin;null==_[0]&&(_=[_,_]),"n"==f.charAt(0)?m+="top:"+(_[1]+p.top)+"px;":"s"==f.charAt(0)&&(m+="bottom:"+(_[1]+p.bottom)+"px;"),"e"==f.charAt(1)?m+="right:"+(_[0]+p.right)+"px;":"w"==f.charAt(1)&&(m+="left:"+(_[0]+p.left)+"px;");var b=e('
    '+g.replace('style="','style="position:absolute;'+m+";")+"
    ").appendTo(t);if(0!=a.legend.backgroundOpacity){var v=a.legend.backgroundColor;null==v&&((v=(v=a.grid.backgroundColor)&&"string"==typeof v?e.color.parse(v):e.color.extract(b,"background-color")).a=1,v=v.toString());var C=b.children();e('
    ').prependTo(b).css("opacity",a.legend.backgroundOpacity)}}}}}()}function E(){l.clear(),C(b.drawBackground,[d]);var e=a.grid;e.show&&e.backgroundColor&&(d.save(),d.translate(p.left,p.top),d.fillStyle=G(a.grid.backgroundColor,_,0,"rgba(255, 255, 255, 0)"),d.fillRect(0,0,f,_),d.restore()),e.show&&!e.aboveData&&I();for(var t=0;to){var l=n;n=o,o=l}return{from:n,to:o,axis:i}}function I(){var t,i,n,o;d.save(),d.translate(p.left,p.top);var s=a.grid.markings;if(s)for(e.isFunction(s)&&((i=v.getAxes()).xmin=i.xaxis.min,i.xmax=i.xaxis.max,i.ymin=i.yaxis.min,i.ymax=i.yaxis.max,s=s(i)),t=0;tl.axis.max||h.toh.axis.max)){l.from=Math.max(l.from,l.axis.min),l.to=Math.min(l.to,l.axis.max),h.from=Math.max(h.from,h.axis.min),h.to=Math.min(h.to,h.axis.max);var c=l.from===l.to,u=h.from===h.to;if(!c||!u)if(l.from=Math.floor(l.axis.p2c(l.from)),l.to=Math.floor(l.axis.p2c(l.to)),h.from=Math.floor(h.axis.p2c(h.from)),h.to=Math.floor(h.axis.p2c(h.to)),c||u){var g=r.lineWidth||a.grid.markingsLineWidth,m=g%2?.5:0;d.beginPath(),d.strokeStyle=r.color||a.grid.markingsColor,d.lineWidth=g,c?(d.moveTo(l.to+m,h.from),d.lineTo(l.to+m,h.to)):(d.moveTo(l.from,h.to+m),d.lineTo(l.to,h.to+m)),d.stroke()}else d.fillStyle=r.color||a.grid.markingsColor,d.fillRect(l.from,h.to,l.to-l.from,h.from-h.to)}}i=S(),n=a.grid.borderWidth;for(var b=0;bL.max||"full"==D&&("object"==typeof n&&n[L.position]>0||n>0)&&(N==L.min||N==L.max)||("x"==L.direction?(C=L.p2c(N),x="full"==D?-_:D,"top"==L.position&&(x=-x)):(w=L.p2c(N),y="full"==D?-f:D,"left"==L.position&&(y=-y)),1==d.lineWidth&&("x"==L.direction?C=Math.floor(C)+.5:w=Math.floor(w)+.5),d.moveTo(C,w),d.lineTo(C+y,w+x))}d.stroke()}}n&&(o=a.grid.borderColor,"object"==typeof n||"object"==typeof o?("object"!=typeof n&&(n={top:n,right:n,bottom:n,left:n}),"object"!=typeof o&&(o={top:o,right:o,bottom:o,left:o}),n.top>0&&(d.strokeStyle=o.top,d.lineWidth=n.top,d.beginPath(),d.moveTo(0-n.left,0-n.top/2),d.lineTo(f,0-n.top/2),d.stroke()),n.right>0&&(d.strokeStyle=o.right,d.lineWidth=n.right,d.beginPath(),d.moveTo(f+n.right/2,0-n.top),d.lineTo(f+n.right/2,_),d.stroke()),n.bottom>0&&(d.strokeStyle=o.bottom,d.lineWidth=n.bottom,d.beginPath(),d.moveTo(f+n.right,_+n.bottom/2),d.lineTo(0,_+n.bottom/2),d.stroke()),n.left>0&&(d.strokeStyle=o.left,d.lineWidth=n.left,d.beginPath(),d.moveTo(0-n.left/2,_+n.bottom),d.lineTo(0-n.left/2,0),d.stroke())):(d.lineWidth=n,d.strokeStyle=a.grid.borderColor,d.strokeRect(-n/2,-n/2,f+n,_+n))),d.restore()}function T(e){e.lines.show&&function(e){function t(e,t,i,n,o){var s=e.points,r=e.pointsize,a=null,l=null;d.beginPath();for(var h=r;h=m&&u>o.max){if(m>o.max)continue;c=(o.max-u)/(m-u)*(g-c)+c,u=o.max}else if(m>=u&&m>o.max){if(u>o.max)continue;g=(o.max-u)/(m-u)*(g-c)+c,m=o.max}if(c<=g&&c=g&&c>n.max){if(g>n.max)continue;u=(n.max-c)/(g-c)*(m-u)+u,c=n.max}else if(g>=c&&g>n.max){if(c>n.max)continue;m=(n.max-c)/(g-c)*(m-u)+u,g=n.max}c==a&&u==l||d.moveTo(n.p2c(c)+t,o.p2c(u)+i),a=g,l=m,d.lineTo(n.p2c(g)+t,o.p2c(m)+i)}}d.stroke()}d.save(),d.translate(p.left,p.top),d.lineJoin="round";var i=e.lines.lineWidth,n=e.shadowSize;if(i>0&&n>0){d.lineWidth=n,d.strokeStyle="rgba(0,0,0,0.1)";var o=Math.PI/18;t(e.datapoints,Math.sin(o)*(i/2+n/2),Math.cos(o)*(i/2+n/2),e.xaxis,e.yaxis),d.lineWidth=n/2,t(e.datapoints,Math.sin(o)*(i/2+n/4),Math.cos(o)*(i/2+n/4),e.xaxis,e.yaxis)}d.lineWidth=i,d.strokeStyle=e.color;var s=A(e.lines,e.color,0,_);s&&(d.fillStyle=s,function(e,t,i){for(var n=e.points,o=e.pointsize,s=Math.min(Math.max(0,i.min),i.max),r=0,a=!1,l=1,h=0,c=0;!(o>0&&r>n.length+o);){var u=n[(r+=o)-o],g=n[r-o+l],m=n[r],p=n[r+l];if(a){if(o>0&&null!=u&&null==m){c=r,o=-o,l=2;continue}if(o<0&&r==h+o){d.fill(),a=!1,l=1,r=h=c+(o=-o);continue}}if(null!=u&&null!=m){if(u<=m&&u=m&&u>t.max){if(m>t.max)continue;g=(t.max-u)/(m-u)*(p-g)+g,u=t.max}else if(m>=u&&m>t.max){if(u>t.max)continue;p=(t.max-u)/(m-u)*(p-g)+g,m=t.max}if(a||(d.beginPath(),d.moveTo(t.p2c(u),i.p2c(s)),a=!0),g>=i.max&&p>=i.max)d.lineTo(t.p2c(u),i.p2c(i.max)),d.lineTo(t.p2c(m),i.p2c(i.max));else if(g<=i.min&&p<=i.min)d.lineTo(t.p2c(u),i.p2c(i.min)),d.lineTo(t.p2c(m),i.p2c(i.min));else{var f=u,_=m;g<=p&&g=i.min?(u=(i.min-g)/(p-g)*(m-u)+u,g=i.min):p<=g&&p=i.min&&(m=(i.min-g)/(p-g)*(m-u)+u,p=i.min),g>=p&&g>i.max&&p<=i.max?(u=(i.max-g)/(p-g)*(m-u)+u,g=i.max):p>=g&&p>i.max&&g<=i.max&&(m=(i.max-g)/(p-g)*(m-u)+u,p=i.max),u!=f&&d.lineTo(t.p2c(f),i.p2c(g)),d.lineTo(t.p2c(u),i.p2c(g)),d.lineTo(t.p2c(m),i.p2c(p)),m!=_&&(d.lineTo(t.p2c(m),i.p2c(p)),d.lineTo(t.p2c(_),i.p2c(p)))}}}}(e.datapoints,e.xaxis,e.yaxis)),i>0&&t(e.datapoints,0,0,e.xaxis,e.yaxis),d.restore()}(e),e.bars.show&&function(e){var t;switch(d.save(),d.translate(p.left,p.top),d.lineWidth=e.bars.lineWidth,d.strokeStyle=e.color,e.bars.align){case"left":t=0;break;case"right":t=-e.bars.barWidth;break;default:t=-e.bars.barWidth/2}var i=e.bars.fill?function(t,i){return A(e.bars,e.color,t,i)}:null;(function(t,i,n,o,s,r){for(var a=t.points,l=t.pointsize,h=0;hs.max||gr.max||(d.beginPath(),u=s.p2c(u),g=r.p2c(g)+n,"circle"==a?d.arc(u,g,t,0,o?Math.PI:2*Math.PI,!1):a(d,u,g,t,o),d.closePath(),i&&(d.fillStyle=i,d.fill()),d.stroke())}}d.save(),d.translate(p.left,p.top);var i=e.points.lineWidth,n=e.shadowSize,o=e.points.radius,s=e.points.symbol;if(0==i&&(i=1e-4),i>0&&n>0){var r=n/2;d.lineWidth=r,d.strokeStyle="rgba(0,0,0,0.1)",t(e.datapoints,o,null,r+r/2,!0,e.xaxis,e.yaxis,s),d.strokeStyle="rgba(0,0,0,0.2)",t(e.datapoints,o,null,r/2,!0,e.xaxis,e.yaxis,s)}d.lineWidth=i,d.strokeStyle=e.color,t(e.datapoints,o,A(e.points,e.color),0,!1,e.xaxis,e.yaxis,s),d.restore()}(e)}function M(e,t,i,n,o,s,r,a,l,h,c){var d,u,g,m,p,f,_,b,v;h?(b=f=_=!0,p=!1,m=t+n,g=t+o,(u=e)<(d=i)&&(v=u,u=d,d=v,p=!0,f=!1)):(p=f=_=!0,b=!1,d=e+n,u=e+o,(m=t)<(g=i)&&(v=m,m=g,g=v,b=!0,_=!1)),ur.max||ma.max||(dr.max&&(u=r.max,f=!1),ga.max&&(m=a.max,_=!1),d=r.p2c(d),g=a.p2c(g),u=r.p2c(u),m=a.p2c(m),s&&(l.fillStyle=s(g,m),l.fillRect(d,m,u-d,g-m)),c>0&&(p||f||_||b)&&(l.beginPath(),l.moveTo(d,g),p?l.lineTo(d,m):l.moveTo(d,m),_?l.lineTo(u,m):l.moveTo(u,m),f?l.lineTo(u,g):l.moveTo(u,g),b?l.lineTo(d,g):l.moveTo(d,g),l.stroke()))}function A(t,i,n,o){var s=t.fill;if(!s)return null;if(t.fillColor)return G(t.fillColor,n,o,i);var r=e.color.parse(i);return r.a="number"==typeof s?s:.4,r.normalize(),r.toString()}v.setData=w,v.setupGrid=N,v.draw=E,v.getPlaceholder=function(){return t},v.getCanvas=function(){return l.element},v.getPlotOffset=function(){return p},v.width=function(){return f},v.height=function(){return _},v.offset=function(){var e=c.offset();return e.left+=p.left,e.top+=p.top,e},v.getData=function(){return r},v.getAxes=function(){var t={};return e.each(g.concat(m),(function(e,i){i&&(t[i.direction+(1!=i.n?i.n:"")+"axis"]=i)})),t},v.getXAxes=function(){return g},v.getYAxes=function(){return m},v.c2p=x,v.p2c=function(e){var t,i,n,o={};for(t=0;t=0;--n)if(i(r[n])){var d=r[n],u=d.xaxis,g=d.yaxis,m=d.datapoints.points,p=u.c2p(e),f=g.c2p(t),_=l/u.scale,b=l/g.scale;if(s=d.datapoints.pointsize,u.options.inverseTransform&&(_=Number.MAX_VALUE),g.options.inverseTransform&&(b=Number.MAX_VALUE),d.lines.show||d.points.show)for(o=0;o_||v-p<-_||C-f>b||C-f<-b)){var w=Math.abs(u.p2c(v)-e),y=Math.abs(g.p2c(C)-t),S=w*w+y*y;S=Math.min(k,v)&&f>=C+x&&f<=C+L:p>=v+x&&p<=v+L&&f>=Math.min(k,C)&&f<=Math.max(k,C))&&(c=[n,o/s])}}}return c?(n=c[0],o=c[1],s=r[n].datapoints.pointsize,{datapoint:r[n].datapoints.points.slice(o*s,(o+1)*s),dataIndex:o,series:r[n],seriesIndex:n}):null}(s,l,n);if(d&&(d.pageX=parseInt(d.series.xaxis.p2c(d.datapoint[0])+o.left+p.left,10),d.pageY=parseInt(d.series.yaxis.p2c(d.datapoint[1])+o.top+p.top,10)),a.grid.autoHighlight){for(var u=0;us.max||or.max)){var l=t.points.radius+t.points.lineWidth/2;u.lineWidth=l,u.strokeStyle=a;var h=1.5*l;n=s.p2c(n),o=r.p2c(o),u.beginPath(),"circle"==t.points.symbol?u.arc(n,o,h,0,2*Math.PI,!1):t.points.symbol(u,n,o,h,!1),u.closePath(),u.stroke()}}function q(t,i){var n,o="string"==typeof t.highlightColor?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString(),s=o;switch(t.bars.align){case"left":n=0;break;case"right":n=-t.bars.barWidth;break;default:n=-t.bars.barWidth/2}u.lineWidth=t.bars.lineWidth,u.strokeStyle=o,M(i[0],i[1],i[2]||0,n,n+t.bars.barWidth,(function(){return s}),t.xaxis,t.yaxis,u,t.bars.horizontal,t.bars.lineWidth)}function G(t,i,n,o){if("string"==typeof t)return t;for(var s=d.createLinearGradient(0,n,0,i),r=0,a=t.colors.length;r").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),i=this.text[t]=e("
    ").addClass(t).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),i},i.prototype.getTextInfo=function(t,i,n,o,s){var r,a,l,h;if(i=""+i,r="object"==typeof n?n.style+" "+n.variant+" "+n.weight+" "+n.size+"px/"+n.lineHeight+"px "+n.family:n,null==(a=this._textCache[t])&&(a=this._textCache[t]={}),null==(l=a[r])&&(l=a[r]={}),null==(h=l[i])){var c=e("
    ").text(i).css({position:"absolute","max-width":s,top:-9999}).appendTo(this.getTextLayer(t));"object"==typeof n?c.css({font:r,color:n.color}):"string"==typeof n&&c.addClass(n),h=l[i]={width:c.outerWidth(!0),height:c.outerHeight(!0),element:c,positions:[]},c.detach()}return h},i.prototype.addText=function(e,t,i,n,o,s,r,a,l){var h=this.getTextInfo(e,n,o,s,r),c=h.positions;"center"==a?t-=h.width/2:"right"==a&&(t-=h.width),"middle"==l?i-=h.height/2:"bottom"==l&&(i-=h.height);for(var d,u=0;d=c[u];u++)if(d.x==t&&d.y==i)return void(d.active=!0);d={active:!0,rendered:!1,element:c.length?h.element.clone():h.element,x:t,y:i},c.push(d),d.element.css({top:Math.round(i),left:Math.round(t),"text-align":a})},i.prototype.removeText=function(e,i,n,o,s,r){if(null==o){var a=this._textCache[e];if(null!=a)for(var l in a)if(t.call(a,l)){var h=a[l];for(var c in h)if(t.call(h,c))for(var d=h[c].positions,u=0;g=d[u];u++)g.active=!1}}else{var g;for(d=this.getTextInfo(e,o,s,r).positions,u=0;g=d[u];u++)g.x==i&&g.y==n&&(g.active=!1)}},e.plot=function(t,i,o){return new n(e(t),i,o,e.plot.plugins)},e.plot.version="0.8.3",e.plot.plugins=[],e.fn.plot=function(t,i){return this.each((function(){e.plot(this,t,i)}))}}(jQuery)},function(e,t){!function(e){var t,i,n,o=Object.prototype.hasOwnProperty;e.plot.plugins.push({init:function(s,r){var a=r.Canvas;null==t&&(i=a.prototype.getTextInfo,n=a.prototype.addText,t=a.prototype.render),a.prototype.render=function(){if(!s.getOptions().canvas)return t.call(this);var e=this.context,i=this._textCache;for(var n in e.save(),e.textBaseline="middle",i)if(o.call(i,n)){var r=i[n];for(var a in r)if(o.call(r,a)){var l=r[a],h=!0;for(var c in l)if(o.call(l,c)){var d=l[c],u=d.positions,g=d.lines;h&&(e.fillStyle=d.font.color,e.font=d.font.definition,h=!1);for(var m,p=0;m=u[p];p++)if(m.active)for(var f,_=0;f=m.lines[_];_++)e.fillText(g[_].text,f[0],f[1]);else u.splice(p--,1);0==u.length&&delete l[c]}}}e.restore()},a.prototype.getTextInfo=function(t,n,o,r,a){if(!s.getOptions().canvas)return i.call(this,t,n,o,r,a);var l,h,c,d;if(n=""+n,l="object"==typeof o?o.style+" "+o.variant+" "+o.weight+" "+o.size+"px "+o.family:o,null==(h=this._textCache[t])&&(h=this._textCache[t]={}),null==(c=h[l])&&(c=h[l]={}),null==(d=c[n])){var u=this.context;if("object"!=typeof o){var g=e("
     
    ").css("position","absolute").addClass("string"==typeof o?o:null).appendTo(this.getTextLayer(t));(o={lineHeight:g.height(),style:g.css("font-style"),variant:g.css("font-variant"),weight:g.css("font-weight"),family:g.css("font-family"),color:g.css("color")}).size=g.css("line-height",1).height(),g.remove()}l=o.style+" "+o.variant+" "+o.weight+" "+o.size+"px "+o.family,d=c[n]={width:0,height:0,positions:[],lines:[],font:{definition:l,color:o.color}},u.save(),u.font=l;for(var m=(n+"").replace(/
    |\r\n|\r/g,"\n").split("\n"),p=0;p1?arguments[1]:{},o={},s={start:Ee},r=Ee,a=function(e){return{type:"messageFormatPattern",elements:e,location:Le()}},l=function(e){var t,i,n,o,s,r="";for(t=0,n=e.length;tye&&(ye=ve,Se=[]),Se.push(e))}function Ee(){return Oe()}function Oe(){var e,t,i;for(e=ve,t=[],i=Ie();i!==o;)t.push(i),i=Ie();return t!==o&&(Ce=e,t=a(t)),t}function Ie(){var e;return(e=function(){var e,i;return e=ve,i=function(){var e,i,n,s,r,a;if(e=ve,i=[],n=ve,(s=Re())!==o&&(r=je())!==o&&(a=Re())!==o?n=s=[s,r,a]:(ve=n,n=o),n!==o)for(;n!==o;)i.push(n),n=ve,(s=Re())!==o&&(r=je())!==o&&(a=Re())!==o?n=s=[s,r,a]:(ve=n,n=o);else i=o;return i!==o&&(Ce=e,i=l(i)),(e=i)===o&&(e=ve,e=(i=Ae())!==o?t.substring(e,ve):i),e}(),i!==o&&(Ce=e,i=h(i)),e=i}())===o&&(e=function(){var e,i,n,s,r,a,l;return e=ve,123===t.charCodeAt(ve)?(i=u,ve++):(i=o,0===xe&&Ne(g)),i!==o&&Re()!==o?(n=function(){var e,i,n;if((e=We())===o){if(e=ve,i=[],c.test(t.charAt(ve))?(n=t.charAt(ve),ve++):(n=o,0===xe&&Ne(d)),n!==o)for(;n!==o;)i.push(n),c.test(t.charAt(ve))?(n=t.charAt(ve),ve++):(n=o,0===xe&&Ne(d));else i=o;e=i!==o?t.substring(e,ve):i}return e}(),n!==o&&Re()!==o?(s=ve,44===t.charCodeAt(ve)?(r=m,ve++):(r=o,0===xe&&Ne(p)),r!==o&&(a=Re())!==o?(l=function(){var e;return e=function(){var e,i,n,s,r,a;return e=ve,t.substr(ve,6)===v?(i=v,ve+=6):(i=o,0===xe&&Ne(C)),i===o&&(t.substr(ve,4)===w?(i=w,ve+=4):(i=o,0===xe&&Ne(y)),i===o&&(t.substr(ve,4)===S?(i=S,ve+=4):(i=o,0===xe&&Ne(x)))),i!==o&&Re()!==o?(n=ve,44===t.charCodeAt(ve)?(s=m,ve++):(s=o,0===xe&&Ne(p)),s!==o&&(r=Re())!==o&&(a=je())!==o?n=s=[s,r,a]:(ve=n,n=o),n===o&&(n=null),n!==o?(Ce=e,e=i=L(i,n)):(ve=e,e=o)):(ve=e,e=o),e}(),e===o&&(e=function(){var e,i,n,s;return e=ve,t.substr(ve,6)===k?(i=k,ve+=6):(i=o,0===xe&&Ne(D)),i!==o&&Re()!==o?(44===t.charCodeAt(ve)?(n=m,ve++):(n=o,0===xe&&Ne(p)),n!==o&&Re()!==o&&(s=Me())!==o?(Ce=e,e=i=N(s)):(ve=e,e=o)):(ve=e,e=o),e}(),e===o&&(e=function(){var e,i,n,s;return e=ve,t.substr(ve,13)===E?(i=E,ve+=13):(i=o,0===xe&&Ne(O)),i!==o&&Re()!==o?(44===t.charCodeAt(ve)?(n=m,ve++):(n=o,0===xe&&Ne(p)),n!==o&&Re()!==o&&(s=Me())!==o?(Ce=e,e=i=I(s)):(ve=e,e=o)):(ve=e,e=o),e}(),e===o&&(e=function(){var e,i,n,s,r;if(e=ve,t.substr(ve,6)===T?(i=T,ve+=6):(i=o,0===xe&&Ne(M)),i!==o)if(Re()!==o)if(44===t.charCodeAt(ve)?(n=m,ve++):(n=o,0===xe&&Ne(p)),n!==o)if(Re()!==o){if(s=[],(r=Te())!==o)for(;r!==o;)s.push(r),r=Te();else s=o;s!==o?(Ce=e,e=i=A(s)):(ve=e,e=o)}else ve=e,e=o;else ve=e,e=o;else ve=e,e=o;else ve=e,e=o;return e}()))),e}(),l!==o?s=r=[r,a,l]:(ve=s,s=o)):(ve=s,s=o),s===o&&(s=null),s!==o&&(r=Re())!==o?(125===t.charCodeAt(ve)?(a=f,ve++):(a=o,0===xe&&Ne(_)),a!==o?(Ce=e,e=i=b(n,s)):(ve=e,e=o)):(ve=e,e=o)):(ve=e,e=o)):(ve=e,e=o),e}()),e}function Te(){var e,i,n,s,r;return e=ve,Re()!==o?(i=function(){var e,i,n,s;return e=ve,i=ve,61===t.charCodeAt(ve)?(n=R,ve++):(n=o,0===xe&&Ne(P)),n!==o&&(s=We())!==o?i=n=[n,s]:(ve=i,i=o),(e=i!==o?t.substring(e,ve):i)===o&&(e=je()),e}(),i!==o&&Re()!==o?(123===t.charCodeAt(ve)?(n=u,ve++):(n=o,0===xe&&Ne(g)),n!==o&&Re()!==o&&(s=Oe())!==o&&Re()!==o?(125===t.charCodeAt(ve)?(r=f,ve++):(r=o,0===xe&&Ne(_)),r!==o?(Ce=e,e=F(i,s)):(ve=e,e=o)):(ve=e,e=o)):(ve=e,e=o)):(ve=e,e=o),e}function Me(){var e,i,n,s;if(e=ve,i=function(){var e,i,n;return e=ve,t.substr(ve,7)===W?(i=W,ve+=7):(i=o,0===xe&&Ne(B)),i!==o&&Re()!==o&&(n=We())!==o?(Ce=e,e=i=j(n)):(ve=e,e=o),e}(),i===o&&(i=null),i!==o)if(Re()!==o){if(n=[],(s=Te())!==o)for(;s!==o;)n.push(s),s=Te();else n=o;n!==o?(Ce=e,e=i=V(i,n)):(ve=e,e=o)}else ve=e,e=o;else ve=e,e=o;return e}function Ae(){var e,i;if(xe++,e=[],z.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=o,0===xe&&Ne(U)),i!==o)for(;i!==o;)e.push(i),z.test(t.charAt(ve))?(i=t.charAt(ve),ve++):(i=o,0===xe&&Ne(U));else e=o;return xe--,e===o&&(i=o,0===xe&&Ne(H)),e}function Re(){var e,i,n;for(xe++,e=ve,i=[],n=Ae();n!==o;)i.push(n),n=Ae();return e=i!==o?t.substring(e,ve):i,xe--,e===o&&(i=o,0===xe&&Ne(K)),e}function Pe(){var e;return $.test(t.charAt(ve))?(e=t.charAt(ve),ve++):(e=o,0===xe&&Ne(q)),e}function Fe(){var e;return G.test(t.charAt(ve))?(e=t.charAt(ve),ve++):(e=o,0===xe&&Ne(Y)),e}function We(){var e,i,n,s,r,a;if(e=ve,48===t.charCodeAt(ve)?(i=Z,ve++):(i=o,0===xe&&Ne(Q)),i===o){if(i=ve,n=ve,X.test(t.charAt(ve))?(s=t.charAt(ve),ve++):(s=o,0===xe&&Ne(J)),s!==o){for(r=[],a=Pe();a!==o;)r.push(a),a=Pe();r!==o?n=s=[s,r]:(ve=n,n=o)}else ve=n,n=o;i=n!==o?t.substring(i,ve):n}return i!==o&&(Ce=e,i=ee(i)),i}function Be(){var e,i,n,s,r,a,l,h;return te.test(t.charAt(ve))?(e=t.charAt(ve),ve++):(e=o,0===xe&&Ne(ie)),e===o&&(e=ve,t.substr(ve,2)===ne?(i=ne,ve+=2):(i=o,0===xe&&Ne(oe)),i!==o&&(Ce=e,i=se()),(e=i)===o&&(e=ve,t.substr(ve,2)===re?(i=re,ve+=2):(i=o,0===xe&&Ne(ae)),i!==o&&(Ce=e,i=le()),(e=i)===o&&(e=ve,t.substr(ve,2)===he?(i=he,ve+=2):(i=o,0===xe&&Ne(ce)),i!==o&&(Ce=e,i=de()),(e=i)===o&&(e=ve,t.substr(ve,2)===ue?(i=ue,ve+=2):(i=o,0===xe&&Ne(ge)),i!==o&&(Ce=e,i=me()),(e=i)===o&&(e=ve,t.substr(ve,2)===pe?(i=pe,ve+=2):(i=o,0===xe&&Ne(fe)),i!==o?(n=ve,s=ve,(r=Fe())!==o&&(a=Fe())!==o&&(l=Fe())!==o&&(h=Fe())!==o?s=r=[r,a,l,h]:(ve=s,s=o),(n=s!==o?t.substring(n,ve):s)!==o?(Ce=e,e=i=_e(n)):(ve=e,e=o)):(ve=e,e=o)))))),e}function je(){var e,t,i;if(e=ve,t=[],(i=Be())!==o)for(;i!==o;)t.push(i),i=Be();else t=o;return t!==o&&(Ce=e,t=be(t)),t}if((i=r())!==o&&ve===t.length)return i;throw i!==o&&vet.description?1:0}));t1?n.slice(0,-1).join(", ")+" or "+n[e.length-1]:n[0])+" but "+(t?'"'+function(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,(function(e){return"\\x0"+t(e)})).replace(/[\x10-\x1F\x80-\xFF]/g,(function(e){return"\\x"+t(e)})).replace(/[\u0100-\u0FFF]/g,(function(e){return"\\u0"+t(e)})).replace(/[\u1000-\uFFFF]/g,(function(e){return"\\u"+t(e)}))}(t)+'"':"end of input")+" found."}(i,n),i,n,o)}(null,Se,ye=0)return!0;if("string"==typeof e){var t=/s$/.test(e)&&e.substr(0,e.length-1);if(t&&s.arrIndexOf.call(r,t)>=0)throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+t)}throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+r.join('", "')+'"')},l.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(l.defaultLocale);var t,i,n,o,s=l.__localeData__;for(t=0,i=e.length;t=0)return e;throw new Error('"'+e+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+a.join('", "')+'"')},l.prototype._selectUnits=function(e){var t,i,n,o=r.filter((function(e){return e.indexOf("-short")<1}));for(t=0,i=o.length;ti?i:t}function c(i,n){var o=e.getOptions(),s=e.getPlaceholder().offset(),r=e.getPlotOffset();i.x=h(0,n.pageX-s.left-r.left,e.width()),i.y=h(0,n.pageY-s.top-r.top,e.height()),"y"==o.selection.mode&&(i.x=i==t.first?0:e.width()),"x"==o.selection.mode&&(i.y=i==t.first?0:e.height())}function d(i){null!=i.pageX&&(c(t.second,i),m()?(t.show=!0,e.triggerRedrawOverlay()):u(!0))}function u(i){t.show&&(t.show=!1,e.triggerRedrawOverlay(),i||e.getPlaceholder().trigger("plotunselected",[]))}function g(t,i){var n,o,s,r,a=e.getAxes();for(var l in a)if((n=a[l]).direction==i&&(t[r=i+n.n+"axis"]||1!=n.n||(r=i+"axis"),t[r])){o=t[r].from,s=t[r].to;break}if(t[r]||(n="x"==i?e.getXAxes()[0]:e.getYAxes()[0],o=t[i+"1"],s=t[i+"2"]),null!=o&&null!=s&&o>s){var h=o;o=s,s=h}return{from:o,to:s,axis:n}}function m(){var i=e.getOptions().selection.minSize;return Math.abs(t.second.x-t.first.x)>=i&&Math.abs(t.second.y-t.first.y)>=i}e.clearSelection=u,e.setSelection=function(i,n){var o,s=e.getOptions();"y"==s.selection.mode?(t.first.x=0,t.second.x=e.width()):(o=g(i,"x"),t.first.x=o.axis.p2c(o.from),t.second.x=o.axis.p2c(o.to)),"x"==s.selection.mode?(t.first.y=0,t.second.y=e.height()):(o=g(i,"y"),t.first.y=o.axis.p2c(o.from),t.second.y=o.axis.p2c(o.to)),t.show=!0,e.triggerRedrawOverlay(),!n&&m()&&l()},e.getSelection=a,e.hooks.bindEvents.push((function(e,t){null!=e.getOptions().selection.mode&&(t.mousemove(s),t.mousedown(r))})),e.hooks.drawOverlay.push((function(e,n){if(t.show&&m()){var o=e.getPlotOffset(),s=e.getOptions();n.save(),n.translate(o.left,o.top);var r=i.color.parse(s.selection.color);n.strokeStyle=r.scale("a",.8).toString(),n.lineWidth=1,n.lineJoin=s.selection.shape,n.fillStyle=r.scale("a",.4).toString();var a=Math.min(t.first.x,t.second.x)+.5,l=Math.min(t.first.y,t.second.y)+.5,h=Math.abs(t.second.x-t.first.x)-1,c=Math.abs(t.second.y-t.first.y)-1;n.fillRect(a,l,h,c),n.strokeRect(a,l,h,c),n.restore()}})),e.hooks.shutdown.push((function(e,t){t.unbind("mousemove",s),t.unbind("mousedown",r),o&&i(document).unbind("mouseup",o)}))},options:{selection:{mode:null,color:"#e8cfac",shape:"round",minSize:5}},name:"selection",version:"1.1"})},function(e,t){jQuery.plot.plugins.push({init:function(e){e.hooks.processDatapoints.push((function(e,t,i){if(null!=t.stack&&!1!==t.stack){var n=function(e,t){for(var i=null,n=0;n2&&(b?i.format[2].x:i.format[2].y),C=_&&t.lines.steps,w=!0,y=b?1:0,S=b?0:1,x=0,L=0;!(x>=g.length);){if(c=f.length,null==g[x]){for(d=0;d=p.length){if(!_)for(d=0;da){if(_&&x>0&&null!=g[x-u]){for(r=s+(g[x-u+S]-s)*(a-o)/(g[x-u+y]-o),f.push(a),f.push(r+l),d=2;d0&&null!=p[L-m]&&(h=l+(p[L-m+S]-l)*(o-a)/(p[L-m+y]-a)),f[c+S]+=h,x+=u}w=!1,c!=f.length&&v&&(f[c+2]+=h)}if(C&&c!=f.length&&c>0&&null!=f[c]&&f[c]!=f[c-u]&&f[c+1]!=f[c-u+1]){for(d=0;d0&&null!=m[r-d]){var b=a+(o-l)*(a-m[r-d])/(l-m[r-d+1]);for(c.push(b),c.push(o),g=2;g0){var v=i.inArray(t,e.getData());e.getData().splice(v+1,0,u)}}e.hooks.processDatapoints.push((function(e,n,o){n.threshold&&(n.threshold instanceof Array?(n.threshold.sort((function(e,t){return e.below-t.below})),i(n.threshold).each((function(i,s){t(e,n,o,s.below,s.color)}))):t(e,n,o,n.threshold.below,n.threshold.color))}))},options:{series:{threshold:null}},name:"threshold",version:"1.2"})},function(e,t){jQuery.plot.plugins.push({init:function(e){e.hooks.processDatapoints.push((function(e,t,i){if(null!=t.fillBetween){var n=function(e,t){var i;for(i=0;i=t.length?null:t[e.fillBetween]:null}(t,e.getData());if(n){for(var o,s,r,a,l,h,c,d,u=i.pointsize,g=i.points,m=n.datapoints.pointsize,p=n.datapoints.points,f=[],_=t.lines.show,b=u>2&&i.format[2].y,v=_&&t.lines.steps,C=!0,w=0,y=0;!(w>=g.length);){if(c=f.length,null==g[w]){for(d=0;d=p.length){if(!_)for(d=0;da){if(_&&w>0&&null!=g[w-u]){for(r=s+(g[w-u+1]-s)*(a-o)/(g[w-u]-o),f.push(a),f.push(r),d=2;d0&&null!=p[y-m]&&(h=l+(p[y-m+1]-l)*(o-a)/(p[y-m]-a)),w+=u}C=!1,c!==f.length&&b&&(f[c+2]=h)}if(v&&c!==f.length&&c>0&&null!==f[c]&&f[c]!==f[c-u]&&f[c+1]!==f[c-u+1]){for(d=0;d'+this.opts.axisLabel+"");this.plot.getPlaceholder().append(t),this.labelWidth=t.outerWidth(!0),this.labelHeight=t.outerHeight(!0),t.remove(),this.width=this.height=0,"left"==this.position||"right"==this.position?this.width=this.labelWidth+this.padding:this.height=this.labelHeight+this.padding},o.prototype.cleanup=function(){this.elem&&this.elem.remove()},o.prototype.draw=function(t){this.plot.getPlaceholder().find("#"+this.axisName+"Label").remove(),this.elem=e('
    '+this.opts.axisLabel+"
    "),this.plot.getPlaceholder().append(this.elem),"top"==this.position?(this.elem.css("left",t.left+t.width/2-this.labelWidth/2+"px"),this.elem.css("top",t.top+"px")):"bottom"==this.position?(this.elem.css("left",t.left+t.width/2-this.labelWidth/2+"px"),this.elem.css("top",t.top+t.height-this.labelHeight+"px")):"left"==this.position?(this.elem.css("top",t.top+t.height/2-this.labelHeight/2+"px"),this.elem.css("left",t.left+"px")):"right"==this.position&&(this.elem.css("top",t.top+t.height/2-this.labelHeight/2+"px"),this.elem.css("left",t.left+t.width-this.labelWidth+"px"))},s.prototype=new o,s.prototype.constructor=s,s.prototype.calculateSize=function(){o.prototype.calculateSize.call(this),this.width=this.height=0,"left"==this.position||"right"==this.position?this.width=this.labelHeight+this.padding:this.height=this.labelHeight+this.padding},s.prototype.transforms=function(e,t,i){var n={"-moz-transform":"","-webkit-transform":"","-o-transform":"","-ms-transform":""};if(0!=t||0!=i){var o=" translate("+t+"px, "+i+"px)";n["-moz-transform"]+=o,n["-webkit-transform"]+=o,n["-o-transform"]+=o,n["-ms-transform"]+=o}if(0!=e){var s=" rotate("+e+"deg)";n["-moz-transform"]+=s,n["-webkit-transform"]+=s,n["-o-transform"]+=s,n["-ms-transform"]+=s}var r="top: 0; left: 0; ";for(var a in n)n[a]&&(r+=a+":"+n[a]+";");return r+";"},s.prototype.calculateOffsets=function(e){var t={x:0,y:0,degrees:0};return"bottom"==this.position?(t.x=e.left+e.width/2-this.labelWidth/2,t.y=e.top+e.height-this.labelHeight):"top"==this.position?(t.x=e.left+e.width/2-this.labelWidth/2,t.y=e.top):"left"==this.position?(t.degrees=-90,t.x=e.left-this.labelWidth/2+this.labelHeight/2,t.y=e.height/2+e.top):"right"==this.position&&(t.degrees=90,t.x=e.left+e.width-this.labelWidth/2-this.labelHeight/2,t.y=e.height/2+e.top),t.x=Math.round(t.x),t.y=Math.round(t.y),t},s.prototype.draw=function(t){this.plot.getPlaceholder().find("."+this.axisName+"Label").remove();var i=this.calculateOffsets(t);this.elem=e('
    '+this.opts.axisLabel+"
    "),this.plot.getPlaceholder().append(this.elem)},r.prototype=new s,r.prototype.constructor=r,r.prototype.transforms=function(e,t,i){var n="";if(0!=e){for(var o=e/90;o<0;)o+=4;n+=" filter: progid:DXImageTransform.Microsoft.BasicImage(rotation="+o+"); ",this.requiresResize="right"==this.position}return 0!=t&&(n+="left: "+t+"px; "),0!=i&&(n+="top: "+i+"px; "),n},r.prototype.calculateOffsets=function(e){var t=s.prototype.calculateOffsets.call(this,e);return"top"==this.position?t.y=e.top+1:"left"==this.position?(t.x=e.left,t.y=e.height/2+e.top-this.labelWidth/2):"right"==this.position&&(t.x=e.left+e.width-this.labelHeight,t.y=e.height/2+e.top-this.labelWidth/2),t},r.prototype.draw=function(e){s.prototype.draw.call(this,e),this.requiresResize&&(this.elem=this.plot.getPlaceholder().find("."+this.axisName+"Label"),this.elem.css("width",this.labelWidth),this.elem.css("height",this.labelHeight))},e.plot.plugins.push({init:function(i){i.hooks.processOptions.push((function(i,a){if(a.axisLabels.show){var l=!1,h={};i.hooks.draw.push((function(i,a){var c=!1;l?(l=!1,e.each(i.getAxes(),(function(e,t){var n=t.options||i.getOptions()[e];n&&n.axisLabel&&t.show&&h[e].draw(t.box)}))):(e.each(i.getAxes(),(function(e,a){var l=a.options||i.getOptions()[e];if(e in h&&(a.labelHeight=a.labelHeight-h[e].height,a.labelWidth=a.labelWidth-h[e].width,l.labelHeight=a.labelHeight,l.labelWidth=a.labelWidth,h[e].cleanup(),delete h[e]),l&&l.axisLabel&&a.show){c=!0;var d=null;if(l.axisLabelUseHtml||"Microsoft Internet Explorer"!=navigator.appName)d=!l.axisLabelUseHtml&&(t()||document.createElement("canvas").getContext&&"function"==typeof document.createElement("canvas").getContext("2d").fillText||l.axisLabelUseCanvas)?l.axisLabelUseCanvas||!t()?n:s:o;else{var u=navigator.userAgent;null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(u)&&(rv=parseFloat(RegExp.$1)),d=rv>=9&&!l.axisLabelUseCanvas&&!l.axisLabelUseHtml?s:l.axisLabelUseCanvas||l.axisLabelUseHtml?l.axisLabelUseCanvas?n:o:r}var g=void 0===l.axisLabelPadding?2:l.axisLabelPadding;h[e]=new d(e,a.position,g,i,l),h[e].calculateSize(),l.labelHeight=a.labelHeight+h[e].height,l.labelWidth=a.labelWidth+h[e].width}})),c&&(l=!0,i.setupGrid(),i.draw()))}))}}))},options:{axisLabels:{show:!0}},name:"axisLabels",version:"2.0"})}(jQuery)},function(e,t,i){e.exports=i(33)(409)},function(e,t,i){e.exports=i(33)(1507)},function(e,t,i){e.exports=i(33)(3816)},function(e,t,i){e.exports=i(33)(2943)},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,i){e.exports=i(33)(143)},function(e,t,i){e.exports=i(33)(3831)},function(e,t,i){e.exports=i(33)(122)},function(e,t,i){e.exports=i(33)(1804)},function(e,t,i){e.exports=i(33)(3836)},function(e,t,i){e.exports=i(33)(3839)},function(e,t,i){e.exports=i(33)(1508)},function(e,t,i){e.exports=i(33)(3811)},function(e,t,i){e.exports=i(33)(2982)},function(e,t,i){e.exports=i(33)(3288)},function(e,t,i){e.exports=i(33)(10)},function(e,t,i){e.exports=i(33)(1261)},function(e,t,i){e.exports=i(33)(3808)},function(e,t,i){"use strict";i.r(t),i.d(t,"unitsMap",(function(){return s})),i.d(t,"units",(function(){return r})),i.d(t,"unitsDesc",(function(){return a})),i.d(t,"unitsAsc",(function(){return l})),i.d(t,"parse",(function(){return d}));var n=i(155),o=i.n(n);const s={ms:{weight:1,type:"fixed",base:1},s:{weight:2,type:"fixed",base:1e3},m:{weight:3,type:"mixed",base:6e4},h:{weight:4,type:"mixed",base:36e5},d:{weight:5,type:"mixed",base:864e5},w:{weight:6,type:"calendar",base:NaN},M:{weight:7,type:"calendar",base:NaN},y:{weight:9,type:"calendar",base:NaN}},r=Object.keys(s).sort(((e,t)=>s[t].weight-s[e].weight)),a=[...r],l=[...r].reverse(),h=e=>"[object Date]"===Object.prototype.toString.call(e),c=e=>h(e)&&!isNaN(e.valueOf());function d(e,t={}){const i=e,{roundUp:n=!1,momentInstance:s=o.a,forceNow:a}=t;if(!i)return;if(s.isMoment(i))return i;if(h(i))return s(i);if(void 0!==a&&!c(a))throw new Error("forceNow must be a valid Date");let l,d,u,g="";return"now"===i.substring(0,3)?(l=s(a),g=i.substring("now".length)):(d=i.indexOf("||"),-1===d?(u=i,g=""):(u=i.substring(0,d),g=i.substring(d+2)),l=s(u)),g.length?function(e,t,i){const n=t,o=e.length;let s=0;for(;s=o)return;l=parseInt(e.substring(t,s),10)}if(0===a&&1!==l)return;h=e.charAt(s++);for(let t=s;t0&&h>l&&(h=l);for(var c=0;c=0?(d=p.substr(0,f),u=p.substr(f+1)):(d=p,u=""),g=decodeURIComponent(d),m=decodeURIComponent(u),n(r,g)?o(r[g])?r[g].push(m):r[g]=[r[g],m]:r[g]=m}return r};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,i){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,i,a){return t=t||"&",i=i||"=",null===e&&(e=void 0),"object"==typeof e?s(r(e),(function(r){var a=encodeURIComponent(n(r))+i;return o(e[r])?s(e[r],(function(e){return a+encodeURIComponent(n(e))})).join(t):a+encodeURIComponent(n(e[r]))})).join(t):a?encodeURIComponent(n(a))+i+encodeURIComponent(n(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function s(e,t){if(e.map)return e.map(t);for(var i=[],n=0;n{if("boolean"!=typeof t&&"boolean"===e.type){if([1,"true"].includes(t))return!0;if([0,"false"].includes(t))return!1;throw new Error(`${t} is not a valid boolean value for boolean field ${e.name}`)}return"number"!=typeof t&&"number"===e.type?Number(t):t};let f,_;!function(e){e.CUSTOM="custom",e.PHRASES="phrases",e.PHRASE="phrase",e.EXISTS="exists",e.MATCH_ALL="match_all",e.QUERY_STRING="query_string",e.RANGE="range",e.RANGE_FROM_VALUE="range_from_value",e.SPATIAL_FILTER="spatial_filter",e.COMBINED="combined"}(f||(f={})),function(e){e.APP_STATE="appState",e.GLOBAL_STATE="globalState"}(_||(_={}));const b={gt:">",gte:">=",lte:"<=",lt:"<"},v={gt:"boolean gt(Supplier s, def v) {return s.get() > v}",gte:"boolean gte(Supplier s, def v) {return s.get() >= v}",lte:"boolean lte(Supplier s, def v) {return s.get() <= v}",lt:"boolean lt(Supplier s, def v) {return s.get() < v}"},C={gt:"boolean gt(Supplier s, def v) {return s.get().toInstant().isAfter(Instant.parse(v))}",gte:"boolean gte(Supplier s, def v) {return !s.get().toInstant().isBefore(Instant.parse(v))}",lte:"boolean lte(Supplier s, def v) {return !s.get().toInstant().isAfter(Instant.parse(v))}",lt:"boolean lt(Supplier s, def v) {return s.get().toInstant().isBefore(Instant.parse(v))}"},w=e=>Boolean(Object(g.keys)(e).find((e=>["gte","gt","lte","lt","from","to"].includes(e))));function y(e){var t;return null!=e&&null!==(t=e.meta)&&void 0!==t&&t.type?e.meta.type===f.RANGE:Object(g.has)(e,"query.range")}const S=e=>{const t=Object(g.get)(e,"query.script.script.params",{});return w(t)},x=(e,t,i,n)=>{if("gte"in(t=Object(g.mapValues)(t,(t=>"number"===e.type?parseFloat(t):t)))&&"gt"in t)throw new Error("gte and gt are mutually exclusive");if("lte"in t&&"lt"in t)throw new Error("lte and lt are mutually exclusive");const o=["gt","lt"].reduce(((e,i)=>{const n=i in t?i:`${i}e`,o=Object(g.get)(t,n),s="number"==typeof o?o:0;return Math.abs(s)===1/0&&(e++,delete t[n]),e}),0),s={index:null==i?void 0:i.id,params:{},field:e.name,...n?{formattedValue:n}:{}};if(2===o)return{meta:s,query:{match_all:{}}};if(e.scripted){const i=L(e,t);return i.script.params.value=(e=>Object(g.map)(e,((e,t)=>Object(g.get)(b,t)+e)).join(" "))(i.script.params),{meta:s,query:{script:i}}}return{meta:s,query:{range:{[e.name]:t}}}},L=(e,t)=>{const i=Object(g.mapValues)(Object(g.pickBy)(t,((e,t)=>t in b)),(t=>"number"===e.type&&"string"==typeof t?parseFloat(t):t));let n=Object(g.map)(i,((t,i)=>"("+e.script+")"+Object(g.get)(b,i)+i)).join(" && ");if("painless"===e.lang){const t="date"===e.type?C:v;n=`${Object(g.reduce)(i,((e,i,n)=>e.concat(Object(g.get)(t,n))),[]).join(" ")}${Object(g.map)(i,((t,i)=>`${i}(() -> { ${e.script} }, params.${i})`)).join(" && ")}`}return{script:{source:n,params:i,lang:e.lang}}},k=e=>{const t=Object(g.has)(e,"query.match_phrase"),i=Object(g.get)(e,"query.match",[]),n=void 0!==Object.values(i).find((e=>"phrase"===e.type));return t||n},D=e=>{var t,i,n;return Object(g.has)(e,"query.script.script.params.value")&&!w(null===(t=e.query)||void 0===t||null===(i=t.script)||void 0===i||null===(n=i.script)||void 0===n?void 0:n.params)},N=e=>{var t,i,n;if(null!==(t=e.meta)&&void 0!==t&&t.field)return e.meta.field;const o=null!==(i=null!==(n=e.query.match_phrase)&&void 0!==n?n:e.query.match)&&void 0!==i?i:{};return Object.keys(o)[0]},E=e=>{if(k(e)){const t=e.query.match_phrase||e.query.match||{},i=Object.values(t)[0];return Object(g.isPlainObject)(i)?i.query:i}var t,i,n,o;return null===(t=e.query)||void 0===t||null===(i=t.script)||void 0===i||null===(n=i.script)||void 0===n||null===(o=n.params)||void 0===o?void 0:o.value},O=(e,t,i)=>{const n=p(e,t);return e.scripted?{meta:{index:i.id,field:e.name},query:{script:I(e,t)}}:{meta:{index:i.id},query:{match_phrase:{[e.name]:n}}}},I=(e,t)=>{const i=p(e,t);return{script:{source:T(e),lang:e.lang,params:{value:i}}}},T=e=>"painless"===e.lang?`boolean compare(Supplier s, def v) {if(s.get() instanceof List){List list = s.get(); for(def k : list){if(k==v){return true;}}return false;}else{return s.get() == v;}}compare(() -> { ${e.script} }, params.value);`:`(${e.script}) == value`,M=e=>{var t;return(null==e||null===(t=e.meta)||void 0===t?void 0:t.type)===f.PHRASES},A=(e,t,i)=>{const n=i.id,o=f.PHRASES,s=e.name;let r;return r=e.scripted?t.map((t=>({script:I(e,t)}))):t.map((t=>({match_phrase:{[e.name]:t}}))),{meta:{index:n,type:o,key:s,params:t},query:{bool:{should:r,minimum_should_match:1}}}},R=e=>Object(g.has)(e,"query.exists"),P=(e,t)=>({meta:{index:t.id},query:{exists:{field:e.name}}});function F(e,t,i,n,o,s,r,a){const l=function(e,t,i,n){switch(i){case"phrase":return O(t,n,e);case"phrases":return A(t,n,e);case"range":const{from:o,to:s}=n;return x(t,{lt:s,gte:o},e);case"range_from_value":return x(t,n,e);case"exists":return P(t,e);default:throw new Error(`Unknown filter type: ${i}`)}}(e,t,i,s);return l.meta.alias=r,l.meta.negate=n,l.meta.disabled=o,a&&(l.$state={store:a}),l}const W=(e,t)=>({meta:{disabled:!1,negate:!1,alias:null,index:t},$state:{store:e?_.GLOBAL_STATE:_.APP_STATE}});function B(e,t,i,n,o,s){const r={...t,meta:{index:e,type:f.CUSTOM,disabled:i,negate:n,alias:o}};return r.$state={store:s},r}const j=e=>R(e)?(e=>e.query.exists&&e.query.exists.field)(e):k(e)||D(e)?N(e):M(e)?(e=>e.meta.key)(e):y(e)||S(e)?(e=>{var t,i;return null!==(t=null===(i=e.meta)||void 0===i?void 0:i.field)&&void 0!==t?t:e.query.range&&Object.keys(e.query.range)[0]})(e):void 0;function V(e){var t;if(k(e))return null===(t=e.meta.params)||void 0===t?void 0:t.query;if(M(e))return e.meta.params;if(y(e)&&e.meta.params){const{gte:t,gt:i,lte:n,lt:o}=e.meta.params;return{from:null!=t?t:i,to:null!=o?o:n}}return e.meta.params}const H=e=>Object(g.has)(e,"query.match_all");let z;function U(e){var t;return(null==e||null===(t=e.meta)||void 0===t?void 0:t.type)===f.COMBINED}!function(e){e.AND="AND",e.OR="OR"}(z||(z={}));const K=e=>{const{$state:t,meta:i,...n}=e,{alias:o,disabled:s,...r}=i;return{...n,meta:r}};function $(e,t,i,n=!1,o=!1,s,r=_.APP_STATE){return{$state:{store:r},meta:{type:f.COMBINED,relation:e,params:t.map(K),index:i.id,disabled:n,negate:o,alias:s}}}const q=e=>Object(g.has)(e,"query.query_string"),G=(e,t,i,n={})=>({query:e,meta:{index:t,alias:i,...n}}),Y={index:!0,disabled:!0,negate:!0,state:!0,alias:!0},Z=(e,t,i)=>{var n,o;const s=U(e)?(e=>e.filter((e=>!["meta","relation"].includes(e))))(i):i,r=Object(g.omit)(e,s);return t.index&&(r.index=null===(n=e.meta)||void 0===n?void 0:n.index),t.negate&&(r.negate=e.meta&&Boolean(e.meta.negate)),t.disabled&&(r.disabled=e.meta&&Boolean(e.meta.disabled)),t.alias&&(r.alias=null===(o=e.meta)||void 0===o?void 0:o.alias),r},Q=(e,t,i)=>Object(g.map)(e,(e=>Z(e,t,i))),X=(e,t,i={})=>{if(!e||!t)return!1;let n={};const o=["$$hashKey","meta"];return n=Object(g.defaults)(i||{},{index:!1,state:!1,negate:!1,disabled:!1,alias:!1}),n.state||o.push("$state"),Array.isArray(e)&&Array.isArray(t)?Object(g.isEqual)(Q(e,n,o),Q(t,n,o)):!Array.isArray(e)&&!Array.isArray(t)&&Object(g.isEqual)(Z(e,n,o),Z(t,n,o))},J=(e,t,i={})=>(Array.isArray(t)||(t=[t]),Object(g.filter)(t,(t=>!Object(g.find)(e,(e=>X(e,t,i)))))),ee=(e,t={})=>{let i=[];return Object(g.each)(e,(e=>{i=Object(g.union)(i,J(i,[e],t))})),i},te=(e,t,i,n,o)=>t&&i?"exists"===i.type?function(e,t){return{...e,meta:{...e.meta,negate:null==t?void 0:t.negate,type:null==t?void 0:t.type,params:void 0,value:"exists"},query:{exists:{field:e.meta.key}}}}(e,i):"range"===i.type?function(e,t,i,n){if(function(e){return"object"==typeof e&&"range"===Object(g.get)(e,"type","")}(i)){const{from:o,to:s}=i,r={gte:o,lt:s};return{...e,meta:{...e.meta,negate:null==t?void 0:t.negate,type:null==t?void 0:t.type,params:r},query:{range:{[n]:r}}}}{const o={gte:Object(g.get)(i,"from",void 0),lt:Object(g.get)(i,"to",void 0)};return{...e,meta:{...e.meta,negate:null==t?void 0:t.negate,type:null==t?void 0:t.type,params:o},query:{range:{[n]:o}}}}}(e,i,n,t):Array.isArray(n)?function(e,t,i){var n;return Array.isArray(i)?{...e,meta:{...e.meta,negate:null==t?void 0:t.negate,type:null==t?void 0:t.type,params:i},query:{bool:{minimum_should_match:1,...null===(n=e.query)||void 0===n?void 0:n.should,should:null==i?void 0:i.map((t=>({match_phrase:{[e.meta.key]:t}})))}}}:e}(e,i,n):function(e,t,i,n){const o="number"!==n||i?i:0;return"object"==typeof e.meta.params?{...e,meta:{...e.meta,negate:null==t?void 0:t.negate,type:null==t?void 0:t.type,params:{...e.meta.params,query:i},value:void 0},query:{match_phrase:{[e.meta.key]:null!=o?o:""}}}:{...e,meta:{...e.meta,negate:null==t?void 0:t.negate,type:null==t?void 0:t.type,params:{query:i},value:void 0},query:{match_phrase:{[e.meta.key]:null!=o?o:""}}}}(e,i,n,o):function(e,t){return{...e,meta:{...e.meta,key:t,field:t,params:{query:void 0},value:void 0,type:void 0},query:void 0}}(e,t),ie=e=>e.$state&&e.$state.store===_.GLOBAL_STATE,ne=e=>Object(g.get)(e,"meta.disabled",!1),oe=e=>{const t=!e.meta.disabled,i={...e.meta,disabled:t};return{...e,meta:i}},se=e=>{const t=!e.meta.negate,i={...e.meta,negate:t};return{...e,meta:i}},re=e=>{const t=ie(e)?_.APP_STATE:_.GLOBAL_STATE,i={...e.$state,store:t};return{...e,$state:i}},ae=e=>e.meta.disabled?oe(e):e,le=e=>e.meta.disabled?e:oe(e),he=e=>ie(e)?e:re(e),ce=e=>ie(e)?re(e):e,de=e=>!!e&&"object"==typeof e&&!!e.meta&&"object"==typeof e.meta,ue=e=>Array.isArray(e)&&!e.find((e=>!de(e))),ge=e=>Object(g.omit)(e,["meta","$state"]),me=e=>e&&e.meta&&!e.meta.disabled,pe=(e,t,i)=>{const n=Object(g.filter)(e||[],me),o=Object(g.filter)(t||[],me);return X(o,n,null!=i?i:Y)};var fe=i(155),_e=i.n(fe);function be(e){const t=Object(g.keys)(e.query.range)[0],i=e.query.range[t];return{from:_e()(i.gt||i.gte),to:_e()(i.lt||i.lte)}}function ve(e){const{from:t,to:i}=be(e);return{from:null==t?void 0:t.toISOString(),to:null==i?void 0:i.toISOString()}}function Ce(e,t){const[i,n]=Object(g.partition)(t,(t=>{let i;return y(t)&&(i=Object(g.keys)(t.query.range)[0]),Boolean(i&&i===e)}));return{restOfFilters:n,timeRangeFilter:i[0]}}function we(e,t){if(!t)return{restOfFilters:e,timeRange:void 0};const{timeRangeFilter:i,restOfFilters:n}=Ce(t,e);return{restOfFilters:n,timeRange:i?ve(i):void 0}}function ye(e,t){if(function(e){var t,i;const n=Object.keys(null!==(t=e.match||(null===(i=e.query)||void 0===i?void 0:i.match))&&void 0!==t?t:{})[0];return Boolean(n&&("phrase"===Object(g.get)(e,["query","match",n,"type"])||"phrase"===Object(g.get)(e,["match",n,"type"])))}(e)){const i=e.match||e.query.match,n=Object.keys(i)[0],o=Object(g.get)(i,[n]);let s=o.query;if(t){const e=t.fields.find((e=>e.name===n));e&&(s=p(e,o.query))}return{meta:e.meta,$state:e.$state,query:{match_phrase:{[n]:Object(g.omit)({...o,query:s},"type")}}}}return(e=e.query?Object(g.pick)(e,["meta","query","$state"]):{...e,query:{}}).exists&&(e.query.exists=e.exists,delete e.exists),e.range&&(e.query.range=e.range,delete e.range),e.match_all&&(e.query.match_all=e.match_all,delete e.match_all),Object.keys(e).forEach((t=>{"meta"!==t&&"query"!==t&&"$state"!==t&&(e.query[t]=e[t],delete e[t])})),e}const Se="literal";function xe(e){return e.type===Se}function Le(e,t=!1){return{type:Se,value:e,isQuoted:t}}function ke(e){return e.value}function De(e){return e.isQuoted?`"${ti(`${e.value}`)}"`:ii(`${e.value}`)}const Ne="@kuery-wildcard@",Ee="wildcard";function Oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ie(e){return e.replace(/[+\-=&|>e.name===i));return n?[n]:[]}return Te(e)?t.fields.filter((t=>Re(e,t.name))):void 0}var He=i(159),ze=i.n(He);function Ue(e){const t=ze.a.tz.guess();return"Browser"===e?t:e}function Ke(e){var t;const i=null==e?void 0:e.subType;return!(null==i||null===(t=i.nested)||void 0===t||!t.path)}function $e(e){return Ke(e)?e.subType:void 0}function qe(e){var t;const i=null==e?void 0:e.subType;return!(null==i||null===(t=i.multi)||void 0===t||!t.parent)}function Ge(e){return qe(e)?e.subType:void 0}function Ye(e,t,i){const n={...e,value:i?`${i}.${e.value}`:e.value};if(!t||Te(n)&&!i)return n;const o=Ve(n,t).reduce(((e,t)=>{const n=$e(t),o=null==n?void 0:n.nested.path;return i&&!o?[...e,`${t.name} is not a nested field but is in nested group "${i}" in the KQL expression.`]:o&&!i?[...e,`${t.name} is a nested field, but is not in a nested group in the KQL expression.`]:o!==i?[...e,`Nested field ${t.name} is being queried with the incorrect nested path. The correct path is ${null==n?void 0:n.nested.path}.`]:e}),[]);if(o.length>0)throw new Error(o.join("\n"));return n}const Ze="is";function Qe(e){return e.function===Ze}function Xe(e,t){if(Object(g.isUndefined)(e))throw new Error("fieldName is a required argument");if(Object(g.isUndefined)(t))throw new Error("value is a required argument");return{arguments:["string"==typeof e?Qt(e):Le(e),"string"==typeof t?Qt(t):Le(t)]}}function Je(e,t,i={},n={}){const{arguments:[o,s]}=e,r=Te(s)&&We(s),a=Te(o)&&We(o);if(r&&a)return{match_all:{}};const l=Ye(o,t,null!=n&&n.nested?n.nested.path:void 0),h=Object(g.isUndefined)(s)?s:ei(s),c=s.isQuoted?"phrase":"best_fields";if(null===l.value)return Te(s)?{query_string:{query:Fe(s)}}:{multi_match:{type:c,query:h,lenient:!0}};const d=t?Ve(l,t):[];return d&&0===d.length&&d.push({name:ei(l),scripted:!1,type:""}),!r||null!=d&&d.length&&(null==d?void 0:d.length)!==(null==t?void 0:t.fields.length)?{bool:{should:d.reduce(((e,t)=>{var o;const a=1===(null===(o=t.esTypes)||void 0===o?void 0:o.length)&&t.esTypes.includes("keyword"),d=e=>{const o=$e(t);return!Te(l)||null==o||!o.nested||null!=n&&n.nested?e:{nested:{path:o.nested.path,query:e,score_mode:"none",..."boolean"==typeof i.nestedIgnoreUnmapped&&{ignore_unmapped:i.nestedIgnoreUnmapped}}}};if(!t.scripted){if(r)return[...e,d({exists:{field:t.name}})];if(Te(s)){const n=a?{wildcard:{[t.name]:{value:h,..."boolean"==typeof i.caseInsensitive&&{case_insensitive:i.caseInsensitive}}}}:{query_string:{fields:[t.name],query:Fe(s)}};return[...e,d(n)]}if("date"===t.type){const n=i.dateFormatTZ?{time_zone:Ue(i.dateFormatTZ)}:{};return[...e,d({range:{[t.name]:{gte:h,lte:h,...n}}})]}if(a)return[...e,d({term:{[t.name]:{value:h,..."boolean"==typeof i.caseInsensitive&&{case_insensitive:i.caseInsensitive}}}})];{const i="phrase"===c?"match_phrase":"match";return[...e,d({[i]:{[t.name]:h}})]}}if(!r)return[...e,{script:{...I(t,h)}}]}),[])||[],minimum_should_match:1}}:{match_all:{}}}function et(e){const[t,i]=e.arguments;return null===t.value?`${Jt(i)}`:`${Jt(t)}: ${Jt(i)}`}const tt="and";function it(e){return e.function===tt}function nt(e){return{arguments:e}}function ot(e,t,i={},n={}){const{filtersInMustClause:o}=i;return{bool:{[o?"must":"filter"]:(e.arguments||[]).map((e=>ei(e,t,i,n)))}}}function st(e){return`(${e.arguments.map(Jt).join(" AND ")})`}const rt="or";function at(e){return e.function===rt}function lt(e){return{arguments:e}}function ht(e,t,i={},n={}){return{bool:{should:(e.arguments||[]).map((e=>ei(e,t,i,n))),minimum_should_match:1}}}function ct(e){return`(${e.arguments.map(Jt).join(" OR ")})`}const dt="not";function ut(e){return e.function===dt}function gt(e){return{arguments:[e]}}function mt(e,t,i={},n={}){const[o]=e.arguments;return{bool:{must_not:ei(o,t,i,n)}}}function pt(e){const[t]=e.arguments;return`NOT ${Jt(t)}`}const ft="range",_t={gt:">",gte:">=",lt:"<",lte:"<="};function bt(e){return e.function===ft}function vt(e,t,i){return{arguments:[Qt(e),t,Le(i)]}}function Ct(e,t,i={},n={}){const[o,s,r]=e.arguments,a=Ye(o,t,null!=n&&n.nested?n.nested.path:void 0),l=t?Ve(a,t):[];return l&&0===l.length&&l.push({name:ei(a),scripted:!1,type:""}),{bool:{should:l.map((e=>{const t=t=>{const o=$e(e);return jt.wildcard.isNode(a)&&null!=o&&o.nested&&!n.nested?{nested:{path:o.nested.path,query:t,score_mode:"none",..."boolean"==typeof i.nestedIgnoreUnmapped&&{ignore_unmapped:i.nestedIgnoreUnmapped}}}:t},o={[s]:ei(r)};if(e.scripted)return{script:L(e,o)};if("date"===e.type){const n=i.dateFormatTZ?{time_zone:Ue(i.dateFormatTZ)}:{};return t({range:{[e.name]:{...o,...n}}})}return t({range:{[e.name]:o}})})),minimum_should_match:1}}}function wt(e){const[t,i,n]=e.arguments;return`${Jt(t)} ${_t[i]} ${Jt(n)}`}const yt="exists";function St(e){return e.function===yt}function xt(e){return{arguments:[Le(e)]}}function Lt(e,t,i={},n={}){var o;const{arguments:[s]}=e,r=ke({...s,value:null!=n&&n.nested?`${n.nested.path}.${s.value}`:s.value}),a=null==t||null===(o=t.fields)||void 0===o?void 0:o.find((e=>e.name===r));if(null!=a&&a.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:r}}}function kt(e){const[t]=e.arguments;return`${De(t)}: *`}const Dt="nested";function Nt(e){return e.function===Dt}function Et(e,t){return{arguments:["string"==typeof e?Qt(e):Le(e),t]}}function Ot(e,t,i={},n={}){var o;const[s,r]=e.arguments,a=ei(s),l=null!=n&&null!==(o=n.nested)&&void 0!==o&&o.path?`${n.nested.path}.${a}`:a;return{nested:{path:l,query:ei(r,t,i,{...n,nested:{path:l}}),score_mode:"none",..."boolean"==typeof i.nestedIgnoreUnmapped&&{ignore_unmapped:i.nestedIgnoreUnmapped}}}}function It(e){const[t,i]=e.arguments;return`${De(t)}: { ${Jt(i)} }`}const Tt={is:s,and:r,or:a,not:l,range:h,exists:c,nested:d},Mt="function";function At(e){return e.type===Mt}function Rt(e,...t){const i=Tt[e];if(m.a.isUndefined(i))throw new Error(`Unknown function "${e}"`);return{type:Mt,function:e,...i.buildNodeParams(...t)}}function Pt(e,t){if(m.a.isUndefined(Tt[e]))throw new Error(`Unknown function "${e}"`);return{type:Mt,function:e,arguments:t}}function Ft(e,t,i,n){if(Tt.and.isNode(e))return Tt.and.toElasticsearchQuery(e,t,i,n);if(Tt.exists.isNode(e))return Tt.exists.toElasticsearchQuery(e),n;if(Tt.is.isNode(e))return Tt.is.toElasticsearchQuery(e,t,i,n);if(Tt.nested.isNode(e))return Tt.nested.toElasticsearchQuery(e,t,i,n);if(Tt.not.isNode(e))return Tt.not.toElasticsearchQuery(e,t,i,n);if(Tt.or.isNode(e))return Tt.or.toElasticsearchQuery(e,t,i,n);if(Tt.range.isNode(e))return Tt.range.toElasticsearchQuery(e,t,i,n);throw new Error(`Unknown KQL function: "${e.function}"`)}function Wt(e){if(Tt.and.isNode(e))return Tt.and.toKqlExpression(e);if(Tt.exists.isNode(e))return Tt.exists.toKqlExpression(e);if(Tt.is.isNode(e))return Tt.is.toKqlExpression(e);if(Tt.nested.isNode(e))return Tt.nested.toKqlExpression(e);if(Tt.not.isNode(e))return Tt.not.toKqlExpression(e);if(Tt.or.isNode(e))return Tt.or.toKqlExpression(e);if(Tt.range.isNode(e))return Tt.range.toKqlExpression(e);throw new Error(`Unknown KQL function: "${e.function}"`)}const Bt={is:(e,t)=>jt.function.buildNodeWithArgumentNodes("is",[jt.literal.buildNode(e),"string"==typeof t?jt.literal.buildNode(t):t]),or:e=>1===e.length?e[0]:jt.function.buildNode("or",e),and:e=>1===e.length?e[0]:jt.function.buildNode("and",e),range:(e,t,i)=>jt.function.buildNodeWithArgumentNodes("range",[jt.literal.buildNode(e),t,"string"==typeof i?jt.literal.buildNode(i):i])},jt={function:u,literal:n,wildcard:o};var Vt=i(37),Ht=i.n(Vt),zt=i(40);const Ut=zt.i18n.translate("esQuery.kql.errors.endOfInputText",{defaultMessage:"end of input"}),Kt={fieldName:zt.i18n.translate("esQuery.kql.errors.fieldNameText",{defaultMessage:"field name"}),value:zt.i18n.translate("esQuery.kql.errors.valueText",{defaultMessage:"value"}),literal:zt.i18n.translate("esQuery.kql.errors.literalText",{defaultMessage:"literal"}),whitespace:zt.i18n.translate("esQuery.kql.errors.whitespaceText",{defaultMessage:"whitespace"})};class $t extends Error{constructor(e,t){let i=e.message;if(e.expected){const t=e.expected.map((e=>{const t="other"===(i=e).type?i.description:"literal"===i.type?`"${i.text}"`:"end"===i.type?"end of input":i.text||i.description||"";var i;return Kt[t]||t})),n=Object(g.uniq)(t).filter((e=>void 0!==e)).sort().join(", ");i=zt.i18n.translate("esQuery.kql.errors.syntaxError",{defaultMessage:"Expected {expectedList} but {foundInput} found.",values:{expectedList:n,foundInput:e.found?`"${e.found}"`:Ut}})}super([i,t,Object(g.repeat)("-",e.location.start.offset)+"^"].join("\n")),Ht()(this,"shortMessage",void 0),this.name="KQLSyntaxError",this.shortMessage=i}}function qt(e,t,i,n){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,qt.prototype),o.expected=t,o.found=i,o.location=n,o.name="SyntaxError",o}function Gt(e,t,i){return i=i||" ",e.length>t?e:(t-=e.length,e+(i+=i.repeat(t)).slice(0,t))}function Yt(e,t){var i,n={},o=(t=void 0!==t?t:{}).grammarSource,s={start:nt,Literal:ft},r=nt,a="(",l=")",h=":",c="{",d="}",u="or",g="and",m="not",p='"',f="\\",_="*",b="\\t",v="\\r",C="\\n",w="u",y="<=",S=">=",x="<",L=">",k="@kuery-cursor@",D=/^[\\"]/,N=/^[^"]/,E=/^[\\():<>"*{}]/,O=/^[0-9a-f]/i,I=/^[ \t\r\n\xA0]/,T=Qe("(",!1),M=Qe(")",!1),A=Qe(":",!1),R=Qe("{",!1),P=Qe("}",!1),F=Je("fieldName"),W=Je("value"),B=Je("OR"),j=Qe("or",!0),V=Je("AND"),H=Qe("and",!0),z=Je("NOT"),U=Qe("not",!0),K=Je("literal"),$=Qe('"',!1),q=Qe("\\",!1),G=Xe(["\\",'"'],!1,!1),Y=Xe(['"'],!0,!1),Z={type:"any"},Q=Qe("*",!1),X=Qe("\\t",!1),J=Qe("\\r",!1),ee=Qe("\\n",!1),te=Xe(["\\","(",")",":","<",">",'"',"*","{","}"],!1,!1),ie=Qe("u",!1),ne=Xe([["0","9"],["a","f"]],!1,!0),oe=Qe("<=",!1),se=Qe(">=",!1),re=Qe("<",!1),ae=Qe(">",!1),le=Je("whitespace"),he=Xe([" ","\t","\r","\n"," "],!1,!1),ce=Qe("@kuery-cursor@",!1),de=function(e,t){return"cursor"===t.type?{...t,suggestionTypes:["conjunction"]}:null!==e?e:It.function.buildNode("is","*","*")},ue=function(e,t){return t},ge=function(e,t){const i=[e,...t];return Nt&&i.find((e=>"cursor"===e.type))||Tt("or",i)},me=function(e,t){const i=[e,...t];return Nt&&i.find((e=>"cursor"===e.type))||Tt("and",i)},pe=function(e){return"cursor"===e.type?e:Tt("not",[e])},fe=function(e,t){return"cursor"===t.type?{...t,suggestionTypes:["conjunction"]}:e},_e=function(e,t,i){return"cursor"===t.type?{...t,nestedPath:t.nestedPath?`${e.value}.${t.nestedPath}`:e.value}:"cursor"===i.type?{...i,suggestionTypes:["conjunction"]}:Tt("nested",[e,t])},be=function(e,t,i){return"cursor"===i.type?{...i,suggestionTypes:["conjunction"]}:Tt("range",[e,t,i])},ve=function(e,t){return"cursor"===t.type?{...t,fieldName:e.value,suggestionTypes:["value","conjunction"]}:t(e)},Ce=function(e){if("cursor"===e.type){const t=`${e.prefix}${e.suffix}`.trim();return{...e,fieldName:t,suggestionTypes:["field","operator","conjunction"]}}return e(Mt(null))},we=function(e,t){return"cursor"===t.type?{...t,suggestionTypes:["conjunction"]}:e},ye=function(e,t){return t},Se=function(e,t){const i=[e,...t],n=Nt&&i.find((e=>"cursor"===e.type));return n?{...n,suggestionTypes:["value"]}:e=>Tt("or",i.map((t=>t(e))))},xe=function(e,t){const i=[e,...t],n=Nt&&i.find((e=>"cursor"===e.type));return n?{...n,suggestionTypes:["value"]}:e=>Tt("and",i.map((t=>t(e))))},Le=function(e){return"cursor"===e.type?{...list,suggestionTypes:["value"]}:t=>Tt("not",[e(t)])},ke=function(e){return"cursor"===e.type?e:t=>Tt("is",[t,e])},De=function(e){return"cursor"===e.type?e:(!Ot&&It.wildcard.isNode(e)&&It.wildcard.hasLeadingWildcard(e)&&function(e,t){throw function(e,t){return new qt(e,null,null,t)}("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.",t=void 0!==t?t:tt($e,Ke))}(),t=>Tt("is",[t,e]))},Ne=function(){return Nt},Ee=function(t,i,n){const{start:o,end:s}=tt($e,Ke);return{type:"cursor",start:o.offset,end:s.offset-i.length,prefix:t.join(""),suffix:n.join(""),text:e.substring($e,Ke).replace(i,"")}},Oe=function(e){return Mt(e.join(""),!0)},Ie=function(e){return e},Te=function(e){const t=e.join("").trim();return"null"===t?Mt(null):"true"===t?Mt(!0):"false"===t?Mt(!1):e.includes(Rt)?At(t):Mt(t)},Me=function(){return Rt},Ae=function(){return"\t"},Re=function(){return"\r"},Pe=function(){return"\n"},Fe=function(e){return e},We=function(e){return e},Be=function(e){return String.fromCharCode(parseInt(e,16))},je=function(){return"lte"},Ve=function(){return"gte"},He=function(){return"lt"},ze=function(){return"gt"},Ue=function(){return Et},Ke=0,$e=0,qe=[{line:1,column:1}],Ge=0,Ye=[],Ze=0;if("startRule"in t){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');r=s[t.startRule]}function Qe(e,t){return{type:"literal",text:e,ignoreCase:t}}function Xe(e,t,i){return{type:"class",parts:e,inverted:t,ignoreCase:i}}function Je(e){return{type:"other",description:e}}function et(t){var i,n=qe[t];if(n)return n;for(i=t-1;!qe[i];)i--;for(n={line:(n=qe[i]).line,column:n.column};iGe&&(Ge=Ke,Ye=[]),Ye.push(e))}function nt(){var e,t,i,o;for(e=Ke,t=[],i=kt();i!==n;)t.push(i),i=kt();return(i=ot())===n&&(i=null),(o=wt())!==n?($e=e,e=de(i,o)):(Ke=e,e=n),e}function ot(){var e,t,i,o,s;if(e=Ke,(t=st())!==n){if(i=[],o=Ke,gt()!==n&&(s=st())!==n?($e=o,o=ue(t,s)):(Ke=o,o=n),o!==n)for(;o!==n;)i.push(o),o=Ke,gt()!==n&&(s=st())!==n?($e=o,o=ue(t,s)):(Ke=o,o=n);else i=n;i!==n?($e=e,e=ge(t,i)):(Ke=e,e=n)}else Ke=e,e=n;return e===n&&(e=st()),e}function st(){var e,t,i,o,s;if(e=Ke,(t=rt())!==n){if(i=[],o=Ke,mt()!==n&&(s=rt())!==n?($e=o,o=ue(t,s)):(Ke=o,o=n),o!==n)for(;o!==n;)i.push(o),o=Ke,mt()!==n&&(s=rt())!==n?($e=o,o=ue(t,s)):(Ke=o,o=n);else i=n;i!==n?($e=e,e=me(t,i)):(Ke=e,e=n)}else Ke=e,e=n;return e===n&&(e=rt()),e}function rt(){var e,t;return e=Ke,pt()!==n&&(t=at())!==n?($e=e,e=pe(t)):(Ke=e,e=n),e===n&&(e=at()),e}function at(){var t,i,o,s,r,u;if(t=Ke,40===e.charCodeAt(Ke)?(i=a,Ke++):(i=n,0===Ze&&it(T)),i!==n){for(o=[],s=kt();s!==n;)o.push(s),s=kt();(s=ot())!==n&&(r=wt())!==n?(41===e.charCodeAt(Ke)?(u=l,Ke++):(u=n,0===Ze&&it(M)),u!==n?($e=t,t=fe(s,r)):(Ke=t,t=n)):(Ke=t,t=n)}else Ke=t,t=n;return t===n&&(t=function(){var t,i,o,s,r,a,l,u,g,m;if(t=Ke,(i=lt())!==n){for(o=[],s=kt();s!==n;)o.push(s),s=kt();if(58===e.charCodeAt(Ke)?(s=h,Ke++):(s=n,0===Ze&&it(A)),s!==n){for(r=[],a=kt();a!==n;)r.push(a),a=kt();if(123===e.charCodeAt(Ke)?(a=c,Ke++):(a=n,0===Ze&&it(R)),a!==n){for(l=[],u=kt();u!==n;)l.push(u),u=kt();(u=ot())!==n&&(g=wt())!==n?(125===e.charCodeAt(Ke)?(m=d,Ke++):(m=n,0===Ze&&it(P)),m!==n?($e=t,t=_e(i,u,g)):(Ke=t,t=n)):(Ke=t,t=n)}else Ke=t,t=n}else Ke=t,t=n}else Ke=t,t=n;return t===n&&(t=function(){var t;return t=function(){var t,i,o,s,r,a;if(t=Ke,(i=lt())!==n){for(o=[],s=kt();s!==n;)o.push(s),s=kt();if(s=function(){var t,i;return t=Ke,e.substr(Ke,2)===y?(i=y,Ke+=2):(i=n,0===Ze&&it(oe)),i!==n&&($e=t,i=je()),(t=i)===n&&(t=Ke,e.substr(Ke,2)===S?(i=S,Ke+=2):(i=n,0===Ze&&it(se)),i!==n&&($e=t,i=Ve()),(t=i)===n&&(t=Ke,60===e.charCodeAt(Ke)?(i=x,Ke++):(i=n,0===Ze&&it(re)),i!==n&&($e=t,i=He()),(t=i)===n&&(t=Ke,62===e.charCodeAt(Ke)?(i=L,Ke++):(i=n,0===Ze&&it(ae)),i!==n&&($e=t,i=ze()),t=i))),t}(),s!==n){for(r=[],a=kt();a!==n;)r.push(a),a=kt();(a=ft())!==n?($e=t,t=be(i,s,a)):(Ke=t,t=n)}else Ke=t,t=n}else Ke=t,t=n;return t}(),t===n&&(t=function(){var t,i,o,s,r,a;if(t=Ke,(i=lt())!==n){for(o=[],s=kt();s!==n;)o.push(s),s=kt();if(58===e.charCodeAt(Ke)?(s=h,Ke++):(s=n,0===Ze&&it(A)),s!==n){for(r=[],a=kt();a!==n;)r.push(a),a=kt();(a=ht())!==n?($e=t,t=ve(i,a)):(Ke=t,t=n)}else Ke=t,t=n}else Ke=t,t=n;return t}(),t===n&&(t=function(){var e,t;return e=Ke,(t=ut())!==n&&($e=e,t=Ce(t)),e=t}())),t}()),t}()),t}function lt(){var e;return Ze++,e=ft(),Ze--,e===n&&0===Ze&&it(F),e}function ht(){var t,i,o,s,r,h;if(t=Ke,40===e.charCodeAt(Ke)?(i=a,Ke++):(i=n,0===Ze&&it(T)),i!==n){for(o=[],s=kt();s!==n;)o.push(s),s=kt();s=function(){var e,t,i,o,s;if(e=Ke,(t=ct())!==n){if(i=[],o=Ke,gt()!==n&&(s=ct())!==n?($e=o,o=ye(t,s)):(Ke=o,o=n),o!==n)for(;o!==n;)i.push(o),o=Ke,gt()!==n&&(s=ct())!==n?($e=o,o=ye(t,s)):(Ke=o,o=n);else i=n;i!==n?($e=e,e=Se(t,i)):(Ke=e,e=n)}else Ke=e,e=n;return e===n&&(e=ct()),e}(),s!==n&&(r=wt())!==n?(41===e.charCodeAt(Ke)?(h=l,Ke++):(h=n,0===Ze&&it(M)),h!==n?($e=t,t=we(s,r)):(Ke=t,t=n)):(Ke=t,t=n)}else Ke=t,t=n;return t===n&&(t=ut()),t}function ct(){var e,t,i,o,s;if(e=Ke,(t=dt())!==n){if(i=[],o=Ke,mt()!==n&&(s=dt())!==n?($e=o,o=ye(t,s)):(Ke=o,o=n),o!==n)for(;o!==n;)i.push(o),o=Ke,mt()!==n&&(s=dt())!==n?($e=o,o=ye(t,s)):(Ke=o,o=n);else i=n;i!==n?($e=e,e=xe(t,i)):(Ke=e,e=n)}else Ke=e,e=n;return e===n&&(e=dt()),e}function dt(){var e,t;return e=Ke,pt()!==n&&(t=ht())!==n?($e=e,e=Le(t)):(Ke=e,e=n),e===n&&(e=ht()),e}function ut(){var e,t;return Ze++,e=Ke,(t=_t())!==n&&($e=e,t=ke(t)),(e=t)===n&&(e=Ke,(t=vt())!==n&&($e=e,t=De(t)),e=t),Ze--,e===n&&(t=n,0===Ze&&it(W)),e}function gt(){var t,i,o,s,r;if(Ze++,t=Ke,i=[],(o=kt())!==n)for(;o!==n;)i.push(o),o=kt();else i=n;if(i!==n)if(e.substr(Ke,2).toLowerCase()===u?(o=e.substr(Ke,2),Ke+=2):(o=n,0===Ze&&it(j)),o!==n){if(s=[],(r=kt())!==n)for(;r!==n;)s.push(r),r=kt();else s=n;s!==n?t=i=[i,o,s]:(Ke=t,t=n)}else Ke=t,t=n;else Ke=t,t=n;return Ze--,t===n&&(i=n,0===Ze&&it(B)),t}function mt(){var t,i,o,s,r;if(Ze++,t=Ke,i=[],(o=kt())!==n)for(;o!==n;)i.push(o),o=kt();else i=n;if(i!==n)if(e.substr(Ke,3).toLowerCase()===g?(o=e.substr(Ke,3),Ke+=3):(o=n,0===Ze&&it(H)),o!==n){if(s=[],(r=kt())!==n)for(;r!==n;)s.push(r),r=kt();else s=n;s!==n?t=i=[i,o,s]:(Ke=t,t=n)}else Ke=t,t=n;else Ke=t,t=n;return Ze--,t===n&&(i=n,0===Ze&&it(V)),t}function pt(){var t,i,o,s;if(Ze++,t=Ke,e.substr(Ke,3).toLowerCase()===m?(i=e.substr(Ke,3),Ke+=3):(i=n,0===Ze&&it(U)),i!==n){if(o=[],(s=kt())!==n)for(;s!==n;)o.push(s),s=kt();else o=n;o!==n?t=i=[i,o]:(Ke=t,t=n)}else Ke=t,t=n;return Ze--,t===n&&(i=n,0===Ze&&it(z)),t}function ft(){var e;return Ze++,(e=_t())===n&&(e=vt()),Ze--,e===n&&0===Ze&&it(K),e}function _t(){var t,i,o,s,r,a,l;if(t=Ke,$e=Ke,(i=(i=Ne())?void 0:n)!==n)if(34===e.charCodeAt(Ke)?(o=p,Ke++):(o=n,0===Ze&&it($)),o!==n){for(s=[],r=bt();r!==n;)s.push(r),r=bt();if((r=Dt())!==n){for(a=[],l=bt();l!==n;)a.push(l),l=bt();34===e.charCodeAt(Ke)?(l=p,Ke++):(l=n,0===Ze&&it($)),l!==n?($e=t,t=Ee(s,r,a)):(Ke=t,t=n)}else Ke=t,t=n}else Ke=t,t=n;else Ke=t,t=n;if(t===n)if(t=Ke,34===e.charCodeAt(Ke)?(i=p,Ke++):(i=n,0===Ze&&it($)),i!==n){for(o=[],s=bt();s!==n;)o.push(s),s=bt();34===e.charCodeAt(Ke)?(s=p,Ke++):(s=n,0===Ze&&it($)),s!==n?($e=t,t=Oe(o)):(Ke=t,t=n)}else Ke=t,t=n;return t}function bt(){var t,i,o;return(t=yt())===n&&(t=xt())===n&&(t=Ke,92===e.charCodeAt(Ke)?(i=f,Ke++):(i=n,0===Ze&&it(q)),i!==n?(D.test(e.charAt(Ke))?(o=e.charAt(Ke),Ke++):(o=n,0===Ze&&it(G)),o!==n?($e=t,t=Ie(o)):(Ke=t,t=n)):(Ke=t,t=n),t===n&&(t=Ke,i=Ke,Ze++,o=Dt(),Ze--,o===n?i=void 0:(Ke=i,i=n),i!==n?(N.test(e.charAt(Ke))?(o=e.charAt(Ke),Ke++):(o=n,0===Ze&&it(Y)),o!==n?($e=t,t=Ie(o)):(Ke=t,t=n)):(Ke=t,t=n))),t}function vt(){var e,t,i,o,s,r;if(e=Ke,$e=Ke,(t=(t=Ne())?void 0:n)!==n){for(i=[],o=Ct();o!==n;)i.push(o),o=Ct();if((o=Dt())!==n){for(s=[],r=Ct();r!==n;)s.push(r),r=Ct();$e=e,e=Ee(i,o,s)}else Ke=e,e=n}else Ke=e,e=n;if(e===n){if(e=Ke,t=[],(i=Ct())!==n)for(;i!==n;)t.push(i),i=Ct();else t=n;t!==n&&($e=e,t=Te(t)),e=t}return e}function Ct(){var t,i,o,s,r;return(t=yt())===n&&(t=function(){var t,i,o;return t=Ke,92===e.charCodeAt(Ke)?(i=f,Ke++):(i=n,0===Ze&&it(q)),i!==n&&(o=St())!==n?($e=t,t=Ie(o)):(Ke=t,t=n),t}(),t===n&&(t=xt())===n&&(t=function(){var t,i,o;return t=Ke,92===e.charCodeAt(Ke)?(i=f,Ke++):(i=n,0===Ze&&it(q)),i!==n?(e.substr(Ke,2).toLowerCase()===u?(o=e.substr(Ke,2),Ke+=2):(o=n,0===Ze&&it(j)),o===n&&(e.substr(Ke,3).toLowerCase()===g?(o=e.substr(Ke,3),Ke+=3):(o=n,0===Ze&&it(H)),o===n&&(e.substr(Ke,3).toLowerCase()===m?(o=e.substr(Ke,3),Ke+=3):(o=n,0===Ze&&it(U)))),o!==n?($e=t,t=Fe(o)):(Ke=t,t=n)):(Ke=t,t=n),t}(),t===n&&(t=function(){var t,i;return t=Ke,42===e.charCodeAt(Ke)?(i=_,Ke++):(i=n,0===Ze&&it(Q)),i!==n&&($e=t,i=Me()),t=i}(),t===n&&(t=Ke,i=Ke,Ze++,o=St(),Ze--,o===n?i=void 0:(Ke=i,i=n),i!==n?(o=Ke,Ze++,s=function(){var e;return(e=gt())===n&&(e=mt())===n&&(e=pt()),e}(),Ze--,s===n?o=void 0:(Ke=o,o=n),o!==n?(s=Ke,Ze++,r=Dt(),Ze--,r===n?s=void 0:(Ke=s,s=n),s!==n?(e.length>Ke?(r=e.charAt(Ke),Ke++):(r=n,0===Ze&&it(Z)),r!==n?($e=t,t=Ie(r)):(Ke=t,t=n)):(Ke=t,t=n)):(Ke=t,t=n)):(Ke=t,t=n))))),t}function wt(){var e,t,i,o,s,r;if(e=Ke,$e=Ke,(t=(t=Ne())?void 0:n)!==n){for(i=[],o=kt();o!==n;)i.push(o),o=kt();if((o=Dt())!==n){for(s=[],r=kt();r!==n;)s.push(r),r=kt();$e=e,e=Ee(i,o,s)}else Ke=e,e=n}else Ke=e,e=n;if(e===n)for(e=[],t=kt();t!==n;)e.push(t),t=kt();return e}function yt(){var t,i;return t=Ke,e.substr(Ke,2)===b?(i=b,Ke+=2):(i=n,0===Ze&&it(X)),i!==n&&($e=t,i=Ae()),(t=i)===n&&(t=Ke,e.substr(Ke,2)===v?(i=v,Ke+=2):(i=n,0===Ze&&it(J)),i!==n&&($e=t,i=Re()),(t=i)===n&&(t=Ke,e.substr(Ke,2)===C?(i=C,Ke+=2):(i=n,0===Ze&&it(ee)),i!==n&&($e=t,i=Pe()),t=i)),t}function St(){var t;return E.test(e.charAt(Ke))?(t=e.charAt(Ke),Ke++):(t=n,0===Ze&&it(te)),t}function xt(){var t,i,o;return t=Ke,92===e.charCodeAt(Ke)?(i=f,Ke++):(i=n,0===Ze&&it(q)),i!==n?(o=function(){var t,i,o,s,r,a,l,h;return t=Ke,117===e.charCodeAt(Ke)?(i=w,Ke++):(i=n,0===Ze&&it(ie)),i!==n?(o=Ke,s=Ke,(r=Lt())!==n&&(a=Lt())!==n&&(l=Lt())!==n&&(h=Lt())!==n?s=r=[r,a,l,h]:(Ke=s,s=n),(o=s!==n?e.substring(o,Ke):s)!==n?($e=t,t=Be(o)):(Ke=t,t=n)):(Ke=t,t=n),t}(),o!==n?($e=t,t=We(o)):(Ke=t,t=n)):(Ke=t,t=n),t}function Lt(){var t;return O.test(e.charAt(Ke))?(t=e.charAt(Ke),Ke++):(t=n,0===Ze&&it(ne)),t}function kt(){var t;return Ze++,I.test(e.charAt(Ke))?(t=e.charAt(Ke),Ke++):(t=n,0===Ze&&it(he)),Ze--,t===n&&0===Ze&&it(le),t}function Dt(){var t,i;return t=Ke,$e=Ke,(Ne()?void 0:n)!==n?(e.substr(Ke,14)===k?(i=k,Ke+=14):(i=n,0===Ze&&it(ce)),i!==n?($e=t,t=Ue()):(Ke=t,t=n)):(Ke=t,t=n),t}const{parseCursor:Nt,cursorSymbol:Et,allowLeadingWildcards:Ot=!0,helpers:{nodeTypes:It}}=t,Tt=It.function.buildNodeWithArgumentNodes,Mt=It.literal.buildNode,At=It.wildcard.buildNode,{KQL_WILDCARD_SYMBOL:Rt}=It.wildcard;if((i=r())!==n&&Ke===e.length)return i;throw i!==n&&Ke0){for(t=1,i=1;t{if(void 0===e)throw new Error("expression must be a string, got undefined instead");return i(e,{...t,helpers:{nodeTypes:jt}})},Qt=(e,t={})=>Zt(e,{...t,startRule:"Literal"},Yt),Xt=(e,t={})=>{try{return Zt(e,t,Yt)}catch(t){throw"SyntaxError"===t.name?new $t(t,e):t}};function Jt(e){if(jt.function.isNode(e))return jt.function.toKqlExpression(e);if(jt.literal.isNode(e))return jt.literal.toKqlExpression(e);if(jt.wildcard.isNode(e))return jt.wildcard.toKqlExpression(e);throw new Error(`Unknown KQL node type: "${e.type}"`)}const ei=(e,t,i={},n)=>e&&e.type&&jt[e.type]?jt[e.type].toElasticsearchQuery(e,t,i,n):ei(jt.function.buildNode("and",[]),t);function ti(e){return e.replace(/[\\"]/g,"\\$&")}const ii=Object(g.flow)((function(e){return e.replace(/[\\():<>"*]/g,"\\$&")}),(function(e){return e.replace(/(\s+)(and|or)(\s+)/gi,"$1\\$2$3")}),(function(e){return e.replace(/not(\s+)/gi,"\\$&")}),(function(e){return e.replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n")})),ni=(...e)=>ei(...e);const oi=(e,t,i={})=>{if(!t)return e;const n=j(e);if(!n)return e;const o=t.fields.find((e=>e.name===n)),s=o&&$e(o);if(!s)return e;const r=ge(e);return{meta:e.meta,query:{nested:{path:s.nested.path,query:r.query||r,..."boolean"==typeof i.nestedIgnoreUnmapped&&{ignore_unmapped:i.nestedIgnoreUnmapped}}}}},si=(e,t,i={})=>U(e)?e.meta.relation===z.AND?((e,t,i={})=>{const n=ai(e.meta.params,t,i);return{...e,query:{bool:n}}})(e,t,i):((e,t,i={})=>{const n={should:e.meta.params.map((e=>({bool:ai([e],t,i)}))),minimum_should_match:1};return{...e,query:{bool:n}}})(e,t,i):e,ri=e=>e.query||e,ai=(e=[],t,i={ignoreFilterIfFieldNotInIndex:!1})=>{const{ignoreFilterIfFieldNotInIndex:n=!1}=i,o=e.filter((e=>e&&!ne(e))),s=e=>{return o.filter((e=>!!e)).filter((s=e,e=>Object(g.isUndefined)(e.meta)||Object(g.isUndefined)(e.meta.negate)?!s:e.meta&&e.meta.negate===s)).filter((e=>{var i;const o=li(t,null===(i=e.meta)||void 0===i?void 0:i.index);return!n||function(e,t){var i,n;return null===(i=e.meta)||void 0===i||!i.key||!t||("custom"===(null===(n=e.meta)||void 0===n?void 0:n.type)?e.meta.index===t.id:t.fields.some((t=>t.name===e.meta.key)))}(e,o)})).map((e=>hi(e,t,i)));var s};return{must:[],filter:s(!1),should:[],must_not:s(!0)}};function li(e,t){var i;const n=Array.isArray(e)?e:[e];return null!==(i=n.find((e=>(null==e?void 0:e.id)===t)))&&void 0!==i?i:n[0]}function hi(e,t,i={}){var n;const o=li(t,null===(n=e.meta)||void 0===n?void 0:n.index),s=ye(e,o),r=oi(s,o,i),a=si(r,t,i),l=ge(a);return ri(l)}const ci=e=>Object(g.has)(e,"query_string.query");function di(e,t,i){return ci(e)&&("string"==typeof t&&(t=JSON.parse(t)),Object(g.extend)(e.query_string,t),i&&Object(g.defaults)(e.query_string,{time_zone:Ue(i)})),e}function ui(e){return Object(g.isString)(e)?""===e.trim()?{match_all:{}}:{query_string:{query:e}}:e}function gi(e){return Boolean(e&&"query"in e)}function mi(e){return Boolean(e&&("sql"in e||"esql"in e))}function pi(e){return Object.keys(e)[0]}function fi(e){var t,i,n;let o=null==e?void 0:e.replaceAll('"',"").replaceAll("'","");const s=null===(t=o)||void 0===t?void 0:t.split(new RegExp(/FROM\s/,"ig")),r=null!==(i=null==s?void 0:s.length)&&void 0!==i?i:0;s&&(null==s?void 0:s.length)>2&&(o=`${s[r-2]} FROM ${s[r-1]}`);const a=new RegExp(/FROM\s+([\w*-.!@$^()~;]+)/,"i"),l=null===(n=o)||void 0===n?void 0:n.match(a);return l?l[1]:""}function _i(e){return e.filter((e=>!e||"object"!=typeof e||!Object(g.isEqual)(e,{match_all:{}})))}function bi(e,t,i,n={allowLeadingWildcards:!1,queryStringOptions:{},ignoreFilterIfFieldNotInIndex:!1}){t=Array.isArray(t)?t:[t],i=Array.isArray(i)?i:[i];const o=t.filter(gi).filter((e=>Object(g.has)(e,"query"))),s=Object(g.groupBy)(o,"language"),r=function(e,t=[],{allowLeadingWildcards:i=!1}={allowLeadingWildcards:!1},{filtersInMustClause:n=!1,dateFormatTZ:o,nestedIgnoreUnmapped:s,caseInsensitive:r}={filtersInMustClause:!1}){return function(e,t,i={}){const n=jt.function.buildNode("and",t),o=ni(n,e,i);return Object.assign({must:[],filter:[],should:[],must_not:[]},o.bool)}(e,t.map((e=>Xt(e.query,{allowLeadingWildcards:i}))),{filtersInMustClause:n,dateFormatTZ:o,nestedIgnoreUnmapped:s,caseInsensitive:r})}(Array.isArray(e)?e[0]:e,s.kuery,{allowLeadingWildcards:n.allowLeadingWildcards},{dateFormatTZ:n.dateFormatTZ,filtersInMustClause:n.filtersInMustClause,nestedIgnoreUnmapped:n.nestedIgnoreUnmapped,caseInsensitive:n.caseInsensitive}),a=function(e,t={},i){return{must:(e||[]).map((e=>di(ui(e.query),t,i))),filter:[],should:[],must_not:[]}}(s.lucene,n.queryStringOptions,n.dateFormatTZ),l=ai(i,e,{ignoreFilterIfFieldNotInIndex:n.ignoreFilterIfFieldNotInIndex,nestedIgnoreUnmapped:n.nestedIgnoreUnmapped});return{bool:{must:_i([...r.must,...a.must,...l.must]),filter:_i([...r.filter,...a.filter,...l.filter]),should:_i([...r.should,...a.should,...l.should]),must_not:[...r.must_not,...a.must_not,...l.must_not]}}}},function(e,t,i){"use strict";function n(e){throw new Error(`Unexpected object: ${e}`)}function o(e){for(const t of Object.values(e))null!==t&&"object"==typeof t&&o(t);return Object.freeze(e)}function s(e,t){if("string"==typeof t){if(t.includes("."))throw new Error("Using dots in `get` with a string is not allowed, use array instead");return e[t]}for(const i of t)e=e[i];return e}function r(e){const t=Object.create(null);for(const[i,n]of e)t[i]=n;return t}i.r(t),i.d(t,"assertNever",(function(){return n})),i.d(t,"deepFreeze",(function(){return o})),i.d(t,"get",(function(){return s})),i.d(t,"mapToObject",(function(){return r})),i.d(t,"merge",(function(){return l})),i.d(t,"pick",(function(){return d})),i.d(t,"withTimeout",(function(){return u})),i.d(t,"isPromise",(function(){return g})),i.d(t,"isRelativeUrl",(function(){return f})),i.d(t,"modifyUrl",(function(){return p})),i.d(t,"getUrlOrigin",(function(){return _})),i.d(t,"unset",(function(){return b})),i.d(t,"getFlattenedObject",(function(){return C})),i.d(t,"ensureNoUnsafeProperties",(function(){return S})),i.d(t,"map$",(function(){return k})),i.d(t,"mapWithLimit$",(function(){return D})),i.d(t,"asyncMap",(function(){return I})),i.d(t,"asyncMapWithLimit",(function(){return T})),i.d(t,"asyncForEach",(function(){return N})),i.d(t,"asyncForEachWithLimit",(function(){return E})),i.d(t,"ensureDeepObject",(function(){return R})),i.d(t,"Semaphore",(function(){return j})),i.d(t,"stripVersionQualifier",(function(){return V}));var a=i(24);function l(e,...t){const i=t[0];return void 0===i?e:t.slice(1).reduce(((e,t)=>c(e,t)),c(e,i))}const h=e=>Object(a.isPlainObject)(e),c=(e,t)=>[...new Set([...Object.keys(e),...Object.keys(t)])].reduce(((i,n)=>{const o=e[n],s=t[n];return h(o)&&h(s)?i[n]=c(o,s):void 0!==s?i[n]=s:void 0!==o&&(i[n]=o),i}),{});function d(e,t){return t.reduce(((t,i)=>(e.hasOwnProperty(i)&&(t[i]=e[i]),t)),{})}async function u({promise:e,timeoutMs:t}){let i;try{return await Promise.race([e.then((e=>({value:e,timedout:!1}))),new Promise((e=>{i=setTimeout((()=>e({timedout:!0})),t)}))])}finally{void 0!==i&&clearTimeout(i)}}function g(e){return!!e&&"function"==typeof e.then}var m=i(175);function p(e,t){const i=Object(m.parse)(e,!0),n={auth:i.auth,hash:i.hash,hostname:i.hostname,pathname:i.pathname,port:i.port,protocol:i.protocol,query:i.query||{},slashes:i.slashes},o=t(n)||n;return Object(m.format)({auth:o.auth,hash:o.hash,hostname:o.hostname,pathname:o.pathname,port:o.port,protocol:o.protocol,query:o.query,slashes:o.slashes})}function f(e){const t=Object(m.parse)(e,!1,!0),{protocol:i,hostname:n,port:o}=t;return null===i&&null===n&&null===o}function _(e){const t=Object(m.parse)(e);return t.protocol||t.hostname?`${t.protocol}//${t.hostname}${t.port?`:${t.port}`:""}`:null}function b(e,t){const i=t.split(".").map((e=>e.trim())).filter((e=>""!==e));if(0===i.length)return;if(1===i.length)return void delete e[i[0]];const n=i.pop(),o=s(e,i);void 0!==o&&delete o[n]}function v(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function C(e){if(!v(e))throw new TypeError(`Root value is not flatten-able, received ${e}`);const t={};return function e(i,n){for(const[o,s]of Object.entries(n)){const n=i?`${i}.${o}`:o;v(s)?e(n,s):t[n]=s}}("",e),t}const w=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),y=e=>"object"==typeof e&&null!==e;function S(e){if(!y(e))return;const t=[{value:e,previousKey:null}],i=new WeakSet([e]);for(;t.length>0;){const{value:e,previousKey:n}=t.pop();if(!y(e))continue;if(w(e,"__proto__"))throw new Error("'__proto__' is an invalid key");if(w(e,"prototype")&&"constructor"===n)throw new Error("'constructor.prototype' is an invalid key");const o=Object.entries(e);for(let e=o.length-1;e>=0;--e){const[n,s]=o[e];if(y(s)){if(i.has(s))throw new Error("circular reference detected");i.add(s)}t.push({value:s,previousKey:n})}}}var x=i(85),L=i(141);function k(e,t){return Object(x.from)(e).pipe(Object(L.mergeMap)(t))}function D(e,t,i){return Object(x.from)(e).pipe(Object(L.mergeMap)(i,t))}async function N(e,t){await Object(x.lastValueFrom)(D(e,1/0,t).pipe(Object(x.defaultIfEmpty)(void 0)))}async function E(e,t,i){await Object(x.lastValueFrom)(D(e,t,i).pipe(Object(x.defaultIfEmpty)(void 0)))}const O=e=>Object(x.lastValueFrom)(Object(x.from)(e).pipe(Object(L.toArray)()));async function I(e,t){return await T(e,1/0,t)}async function T(e,t,i){const n=D(e,t,(async(e,t)=>[t,await O(i(e,t))]));return(await O(n)).sort((([e],[t])=>e-t)).reduce(((e,[,t])=>e.concat(t)),[])}const M=["__proto__","constructor.prototype"],A=".";function R(e,t=[]){return F(t),null==e||"object"!=typeof e?e:Array.isArray(e)?e.map(((e,i)=>R(e,[...t,`${i}`]))):Object.keys(e).reduce(((i,n)=>{const o=e[n],s=n.split(A);return 1===s.length?i[n]=R(o,[...t,n]):P(i,s,o,t),i}),{})}function P(e,t,i,n){F([...n,...t]);const o=t.shift();0!==t.length?(e.hasOwnProperty(o)||(e[o]={}),P(e[o],t,R(i,[...n,o,...t]),[...n,o])):e[o]=i}const F=e=>{const t=e.join(".");M.forEach((e=>{if(t.includes(e))throw new Error(`Forbidden path detected: ${t}`)}))};var W=i(37),B=i.n(W);class j{constructor(e){B()(this,"queue",[]),this.capacity=e,this.release=this.release.bind(this)}acquire(){return e=>new x.Observable((t=>{const i=()=>{t.add(e.pipe(Object(L.finalize)(this.release)).subscribe(t))},n=this.cancel.bind(this,i);t.add(n),this.schedule(i)}))}release(){this.capacity++,this.next()}next(){if(this.capacity<=0||!this.queue.length)return;const e=this.queue.shift();this.capacity--,e()}schedule(e){this.queue.push(e),this.next()}cancel(e){const t=this.queue.indexOf(e);t<0||this.queue.splice(t,1)}}function V(e){return e.split("-")[0]}},function(e,t,i){"use strict";i.r(t),i.d(t,"Reporter",(function(){return m})),i.d(t,"METRIC_TYPE",(function(){return c})),i.d(t,"ReportManager",(function(){return g})),i.d(t,"ApplicationUsageTracker",(function(){return u}));var n=i(37),o=i.n(n);function s(e){return Array.isArray(e)?e:[e]}class r extends Error{constructor(e){super(`Unreachable case: ${e}`)}}var a=i(159),l=i.n(a);function h(e,t){return{type:c.APPLICATION_USAGE,appId:e,viewId:t,startTime:l()(),numberOfClicks:0}}let c;!function(e){e.COUNT="count",e.LOADED="loaded",e.CLICK="click",e.USER_AGENT="user_agent",e.APPLICATION_USAGE="application_usage"}(c||(c={}));class d{constructor(e,t){o()(this,"storageKey",void 0),o()(this,"storage",void 0),this.storageKey=e,this.storage=t}get(){if(this.storage)return this.storage.get(this.storageKey)}store(e){this.storage&&this.storage.set(this.storageKey,e)}}class u{constructor(e){o()(this,"trackedApplicationViews",{}),o()(this,"reporter",void 0),o()(this,"currentAppId",void 0),o()(this,"currentApplicationKeys",[]),o()(this,"beforeUnloadListener",void 0),o()(this,"onVisiblityChangeListener",void 0),this.reporter=e}createKey(e,t){return{appId:e,viewId:t}}static serializeKey({appId:e,viewId:t}){return`${e}-${t}`}trackApplications(e){for(const{appId:t,viewId:i}of e.filter(Boolean)){const e=u.serializeKey({appId:t,viewId:i});if(void 0!==this.trackedApplicationViews[e])continue;const n=h(t,i);this.trackedApplicationViews[e]=n}}attachListeners(){"undefined"!=typeof window&&"undefined"!=typeof document&&(this.beforeUnloadListener=()=>{this.flushTrackedViews()},this.onVisiblityChangeListener=()=>{"visible"===document.visibilityState?this.resumeTrackingAll():"hidden"===document.visibilityState&&this.pauseTrackingAll()},window.addEventListener("beforeunload",this.beforeUnloadListener),document.addEventListener("visibilitychange",this.onVisiblityChangeListener))}detachListeners(){"undefined"!=typeof window&&"undefined"!=typeof document&&(this.beforeUnloadListener&&window.removeEventListener("beforeunload",this.beforeUnloadListener),this.onVisiblityChangeListener&&document.removeEventListener("visibilitychange",this.onVisiblityChangeListener))}sendMetricsToReporter(e){e.forEach((e=>{this.reporter.reportApplicationUsage(e)}))}updateViewClickCounter(e){if(!this.currentAppId)return;const t=u.serializeKey({appId:this.currentAppId,viewId:e});this.trackedApplicationViews[t]&&this.trackedApplicationViews[t].numberOfClicks++}flushTrackedViews(){const e=Object.values(this.trackedApplicationViews);this.sendMetricsToReporter(e),this.trackedApplicationViews={}}start(){this.attachListeners()}stop(){this.flushTrackedViews(),this.detachListeners()}setCurrentAppId(e){this.flushTrackedViews(),this.currentAppId=e}trackApplicationViewUsage(e){if(!this.currentAppId)return;const t=this.createKey(this.currentAppId,e);this.trackApplications([t])}pauseTrackingAll(){this.currentApplicationKeys=Object.values(this.trackedApplicationViews).map((({appId:e,viewId:t})=>this.createKey(e,t))),this.flushTrackedViews()}resumeTrackingAll(){this.trackApplications(this.currentApplicationKeys),this.currentApplicationKeys=[],this.reporter.sendReports()}flushTrackedView(e){if(!this.currentAppId)return;const t=this.createKey(this.currentAppId,e),i=u.serializeKey(t),n=this.trackedApplicationViews[i];n&&(this.sendMetricsToReporter([n]),delete this.trackedApplicationViews[i])}}class g{constructor(e){o()(this,"report",void 0),this.report=e||g.createReport()}static createReport(){return{reportVersion:3}}clearReport(){this.report=g.createReport()}isReportEmpty(){const{uiCounter:e,userAgent:t,application_usage:i}=this.report,n=!e||0===Object.keys(e).length,o=!t||0===Object.keys(t).length,s=!i||0===Object.keys(i).length;return n&&o&&s}incrementTotal(e,t){return e+("number"==typeof t?t:0)}assignReports(e){return s(e).forEach((e=>this.assignReport(this.report,e))),{report:this.report}}static createMetricKey(e){switch(e.type){case c.USER_AGENT:{const{appName:t,type:i}=e;return`${t}-${i}`}case c.APPLICATION_USAGE:{const{appId:t,viewId:i}=e;return u.serializeKey({appId:t,viewId:i})}default:const{appName:t,eventName:i,type:n}=e;return`${t}-${n}-${i}`}}assignReport(e,t){var i;const n=g.createMetricKey(t);switch(t.type){case c.USER_AGENT:{const{appName:i,type:o,userAgent:s}=t;return void(s&&(e.userAgent={[n]:{key:n,appName:i,type:o,userAgent:s}}))}case c.APPLICATION_USAGE:{const{numberOfClicks:i,startTime:o,appId:s,viewId:r}=t,a=l()().diff(o,"minutes",!0);e.application_usage=e.application_usage||{};const h=e.application_usage[n]||{minutesOnScreen:0,numberOfClicks:0,appId:s,viewId:r};return void(e.application_usage[n]={...h,minutesOnScreen:h.minutesOnScreen+a,numberOfClicks:h.numberOfClicks+i})}default:const{appName:o,type:s,eventName:r,count:a}=t;e.uiCounter=e.uiCounter||{};const h=null===(i=e.uiCounter[n])||void 0===i?void 0:i.total;return void(e.uiCounter[n]={key:n,appName:o,eventName:r,type:s,total:this.incrementTotal(a,h)})}}}o()(g,"REPORT_VERSION",3);class m{constructor(e){o()(this,"checkInterval",void 0),o()(this,"interval",void 0),o()(this,"http",void 0),o()(this,"reportManager",void 0),o()(this,"storageManager",void 0),o()(this,"debug",void 0),o()(this,"retryCount",0),o()(this,"maxRetries",3),o()(this,"start",(()=>{this.interval||(this.interval=setTimeout((()=>{this.interval=void 0,this.sendReports()}),this.checkInterval))})),o()(this,"reportUiCounter",((e,t,i,n)=>{const o=s(i).map((i=>{this.log(`${t} Metric -> (${e}:${i}):`);const o=function({type:e,appName:t,eventName:i,count:n=1}){return{type:e,appName:t,eventName:i,count:n}}({type:t,appName:e,eventName:i,count:n});return this.log(o),o}));this.saveToReport(o)})),o()(this,"reportUserAgent",(e=>{this.log("Reporting user-agent.");const t=function(e){const t=window&&window.navigator&&window.navigator.userAgent||"";return{type:c.USER_AGENT,appName:e,userAgent:t}}(e);this.saveToReport([t])})),o()(this,"sendReports",(async()=>{if(!this.reportManager.isReportEmpty())try{await this.http(this.reportManager.report),this.flushReport()}catch(e){this.log(`Error Sending Metrics Report ${e}`),this.retryCount=this.retryCount+1,(this.reportManager.report.reportVersion!==g.REPORT_VERSION||this.retryCount>this.maxRetries)&&this.flushReport()}this.start()}));const{http:t,storage:i,debug:n,checkInterval:r=9e4,storageKey:a="analytics"}=e;this.http=t,this.checkInterval=r,this.storageManager=new d(a,i);const l=this.storageManager.get();this.reportManager=new g(l),this.debug=!!n}saveToReport(e){this.reportManager.assignReports(e),this.storageManager.store(this.reportManager.report)}flushReport(){this.retryCount=0,this.reportManager.clearReport(),this.storageManager.store(this.reportManager.report)}log(e){this.debug&&console.debug(e)}reportApplicationUsage(e){this.log(`Reporting application usage for ${e.appId}, ${e.viewId}`),this.saveToReport([e])}}},function(e,t,i){"use strict";i.r(t),i.d(t,"intlShape",(function(){return K})),i.d(t,"FormattedDate",(function(){return Ce})),i.d(t,"FormattedTime",(function(){return we})),i.d(t,"FormattedRelative",(function(){return xe})),i.d(t,"FormattedNumber",(function(){return Le})),i.d(t,"FormattedPlural",(function(){return ke})),i.d(t,"FormattedMessage",(function(){return Ne})),i.d(t,"FormattedHTMLMessage",(function(){return Ee})),i.d(t,"__IntlProvider",(function(){return ve})),i.d(t,"I18nProvider",(function(){return Re})),i.d(t,"injectI18n",(function(){return se}));var n=i(194),o=i.n(n),s=i(106),r=i.n(s),a=i(122),l=i.n(a),h=i(116),c=i.n(h),d=i(66),u=i.n(d),g=i(195),m=i.n(g),p=i(174),f=i.n(p),_=i(135),b=i.n(_),v={locale:"en",pluralRuleFunction:function(e,t){var i=String(e).split("."),n=!i[1],o=Number(i[0])==e,s=o&&i[0].slice(-1),r=o&&i[0].slice(-2);return t?1==s&&11!=r?"one":2==s&&12!=r?"two":3==s&&13!=r?"few":"other":1==e&&n?"one":"other"},fields:{year:{displayName:"year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},"year-short":{displayName:"yr.",relative:{0:"this yr.",1:"next yr.","-1":"last yr."},relativeTime:{future:{one:"in {0} yr.",other:"in {0} yr."},past:{one:"{0} yr. ago",other:"{0} yr. ago"}}},month:{displayName:"month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},"month-short":{displayName:"mo.",relative:{0:"this mo.",1:"next mo.","-1":"last mo."},relativeTime:{future:{one:"in {0} mo.",other:"in {0} mo."},past:{one:"{0} mo. ago",other:"{0} mo. ago"}}},day:{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},"day-short":{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"hour",relative:{0:"this hour"},relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},"hour-short":{displayName:"hr.",relative:{0:"this hour"},relativeTime:{future:{one:"in {0} hr.",other:"in {0} hr."},past:{one:"{0} hr. ago",other:"{0} hr. ago"}}},minute:{displayName:"minute",relative:{0:"this minute"},relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},"minute-short":{displayName:"min.",relative:{0:"this minute"},relativeTime:{future:{one:"in {0} min.",other:"in {0} min."},past:{one:"{0} min. ago",other:"{0} min. ago"}}},second:{displayName:"second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}},"second-short":{displayName:"sec.",relative:{0:"now"},relativeTime:{future:{one:"in {0} sec.",other:"in {0} sec."},past:{one:"{0} sec. ago",other:"{0} sec. ago"}}}}};function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(Array.isArray(e)?e:[e]).forEach((function(e){e&&e.locale&&(r.a.__addLocaleData(e),l.a.__addLocaleData(e))}))}function w(e){var t=e&&e.toLowerCase();return!(!r.a.__localeData__[t]||!l.a.__localeData__[t])}var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S=(function(){function e(e){this.value=e}function t(t){var i,n;function o(i,n){try{var r=t[i](n),a=r.value;a instanceof e?Promise.resolve(a.value).then((function(e){o("next",e)}),(function(e){o("throw",e)})):s(r.done?"return":"normal",r.value)}catch(e){s("throw",e)}}function s(e,t){switch(e){case"return":i.resolve({value:t,done:!0});break;case"throw":i.reject(t);break;default:i.resolve({value:t,done:!1})}(i=i.next)?o(i.key,i.arg):n=null}this._invoke=function(e,t){return new Promise((function(s,r){var a={key:e,arg:t,resolve:s,reject:r,next:null};n?n=n.next=a:(i=n=a,o(e,t))}))},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),x=function(){function e(e,t){for(var i=0;i":">","<":"<",'"':""","'":"'"},X=/[&><"']/g;function J(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.reduce((function(t,n){return e.hasOwnProperty(n)?t[n]=e[n]:i.hasOwnProperty(n)&&(t[n]=i[n]),t}),{})}function ee(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).intl;f()(e,"[React Intl] Could not find required `intl` object. needs to exist in the component ancestry.")}function te(e,t){if(e===t)return!0;if("object"!==(void 0===e?"undefined":y(e))||null===e||"object"!==(void 0===t?"undefined":y(t))||null===t)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),s=0;s3&&void 0!==arguments[3]?arguments[3]:{},a=(void 0===s?{}:s).intl,l=void 0===a?{}:a,h=r.intl,c=void 0===h?{}:h;return!te(t,n)||!te(i,o)||!(c===l||te(J(c,Z),J(l,Z)))}function ne(e,t){return"[React Intl] "+e+(t?"\n"+t:"")}function oe(e){}function se(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.intlPropName,o=void 0===n?"intl":n,s=i.withRef,r=void 0!==s&&s,a=function(t){function i(e,t){S(this,i);var n=N(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e,t));return ee(t),n}return D(i,t),x(i,[{key:"getWrappedInstance",value:function(){return f()(r,"[React Intl] To access the wrapped instance, the `{withRef: true}` option must be set when calling: `injectIntl()`"),this._wrappedInstance}},{key:"render",value:function(){var t=this;return u.a.createElement(e,k({},this.props,L({},o,this.context.intl),{ref:r?function(e){return t._wrappedInstance=e}:null}))}}]),i}(d.Component);return a.displayName="InjectIntl("+((t=e).displayName||t.name||"Component")+")",a.contextTypes={intl:K},a.WrappedComponent=e,m()(a,e)}var re=function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S(this,e);var n,o="ordinal"===i.style,s=(n=function(e){return r.a.prototype._resolveLocale(e)}(t),r.a.prototype._findPluralRuleFunction(n));this.format=function(e){return s(e,o)}},ae=Object.keys($),le=Object.keys(q),he=Object.keys(G),ce=Object.keys(Y),de={second:60,minute:60,hour:24,day:30,month:12};function ue(e){var t=l.a.thresholds;t.second=e.second,t.minute=e.minute,t.hour=e.hour,t.day=e.day,t.month=e.month,t["second-short"]=e["second-short"],t["minute-short"]=e["minute-short"],t["hour-short"]=e["hour-short"],t["day-short"]=e["day-short"],t["month-short"]=e["month-short"]}function ge(e,t,i,n){var o=e&&e[t]&&e[t][i];if(o)return o;n(ne("No "+t+" format named: "+i))}function me(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,s=e.formats,r=e.messages,a=e.defaultLocale,l=e.defaultFormats,h=i.id,c=i.defaultMessage;f()(h,"[React Intl] An `id` must be provided to format a message.");var d=r&&r[h];if(!(Object.keys(n).length>0))return d||c||h;var u=void 0,g=e.onError||oe;if(d)try{u=t.getMessageFormat(d,o,s).format(n)}catch(e){g(ne('Error formatting message: "'+h+'" for locale: "'+o+'"'+(c?", using default message as fallback.":""),e))}else(!c||o&&o.toLowerCase()!==a.toLowerCase())&&g(ne('Missing message: "'+h+'" for locale: "'+o+'"'+(c?", using default message as fallback.":"")));if(!u&&c)try{u=t.getMessageFormat(c,a,l).format(n)}catch(e){g(ne('Error formatting the default message for: "'+h+'"',e))}return u||g(ne('Cannot format message: "'+h+'", using message '+(d||c?"source":"id")+" as fallback.")),u||d||c||h}var pe=Object.freeze({formatDate:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,s=e.formats,r=e.timeZone,a=n.format,l=e.onError||oe,h=new Date(i),c=k({},r&&{timeZone:r},a&&ge(s,"date",a,l)),d=J(n,ae,c);try{return t.getDateTimeFormat(o,d).format(h)}catch(e){l(ne("Error formatting date.",e))}return String(h)},formatTime:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,s=e.formats,r=e.timeZone,a=n.format,l=e.onError||oe,h=new Date(i),c=k({},r&&{timeZone:r},a&&ge(s,"time",a,l)),d=J(n,ae,c);d.hour||d.minute||d.second||(d=k({},d,{hour:"numeric",minute:"numeric"}));try{return t.getDateTimeFormat(o,d).format(h)}catch(e){l(ne("Error formatting time.",e))}return String(h)},formatRelative:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,s=e.formats,r=n.format,a=e.onError||oe,h=new Date(i),c=new Date(n.now),d=r&&ge(s,"relative",r,a),u=J(n,he,d),g=k({},l.a.thresholds);ue(de);try{return t.getRelativeFormat(o,u).format(h,{now:isFinite(c)?c:t.now()})}catch(e){a(ne("Error formatting relative time.",e))}finally{ue(g)}return String(h)},formatNumber:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,s=e.formats,r=n.format,a=e.onError||oe,l=r&&ge(s,"number",r,a),h=J(n,le,l);try{return t.getNumberFormat(o,h).format(i)}catch(e){a(ne("Error formatting number.",e))}return String(i)},formatPlural:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.locale,s=J(n,ce),r=e.onError||oe;try{return t.getPluralFormat(o,s).format(i)}catch(e){r(ne("Error formatting plural.",e))}return"other"},formatMessage:me,formatHTMLMessage:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return me(e,t,i,Object.keys(n).reduce((function(e,t){var i=n[t];return e[t]="string"==typeof i?(""+i).replace(X,(function(e){return Q[e]})):i,e}),{}))}}),fe=Object.keys(z),_e=Object.keys(U),be={formats:{},messages:{},timeZone:null,textComponent:"span",defaultLocale:"en",defaultFormats:{},onError:oe},ve=function(e){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};S(this,t);var n=N(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));f()("undefined"!=typeof Intl,"[React Intl] The `Intl` APIs must be available in the runtime, and do not appear to be built-in. An `Intl` polyfill should be loaded.\nSee: http://formatjs.io/guides/runtime-environments/");var o,s=i.intl;o=isFinite(e.initialNow)?Number(e.initialNow):s?s.now():Date.now();var a=(s||{}).formatters,h=void 0===a?{getDateTimeFormat:b()(Intl.DateTimeFormat),getNumberFormat:b()(Intl.NumberFormat),getMessageFormat:b()(r.a),getRelativeFormat:b()(l.a),getPluralFormat:b()(re)}:a;return n.state=k({},h,{now:function(){return n._didDisplay?Date.now():o}}),n}return D(t,e),x(t,[{key:"getConfig",value:function(){var e=this.context.intl,t=J(this.props,fe,e);for(var i in be)void 0===t[i]&&(t[i]=be[i]);if(!function(e){for(var t=(e||"").split("-");t.length>0;){if(w(t.join("-")))return!0;t.pop()}return!1}(t.locale)){var n=t,o=n.locale,s=n.defaultLocale,r=n.defaultFormats;(0,n.onError)(ne('Missing locale data for locale: "'+o+'". Using default locale: "'+s+'" as fallback.')),t=k({},t,{locale:s,formats:r,messages:be.messages})}return t}},{key:"getBoundFormatFns",value:function(e,t){return _e.reduce((function(i,n){return i[n]=pe[n].bind(null,e,t),i}),{})}},{key:"getChildContext",value:function(){var e=this.getConfig(),t=this.getBoundFormatFns(e,this.state),i=this.state,n=i.now,o=function(e,t){var i={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);return i}(i,["now"]);return{intl:k({},e,t,{formatters:o,now:n})}}},{key:"shouldComponentUpdate",value:function(){for(var e=arguments.length,t=Array(e),i=0;i1?n-1:0),s=1;s0){var b=Math.floor(1099511627776*Math.random()).toString(16),v=(e=0,function(){return"ELEMENT-"+b+"-"+(e+=1)});p="@__"+b+"__@",f={},_={},Object.keys(c).forEach((function(e){var t=c[e];if(Object(d.isValidElement)(t)){var i=v();f[e]=p+i+p,_[i]=t}else f[e]=t}))}var C,w=n({id:a,description:l,defaultMessage:h},f||c);return C=_&&Object.keys(_).length>0?w.split(p).filter((function(e){return!!e})).map((function(e){return _[e]||e})):[w],"function"==typeof m?m.apply(void 0,E(C)):d.createElement.apply(void 0,[g,null].concat(E(C)))}}]),t}(d.Component);Ne.displayName="FormattedMessage",Ne.contextTypes={intl:K},Ne.defaultProps={values:{}};var Ee=function(e){function t(e,i){S(this,t);var n=N(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,i));return ee(i),n}return D(t,e),x(t,[{key:"shouldComponentUpdate",value:function(e){var t=this.props.values;if(!te(e.values,t))return!0;for(var i=k({},e,{values:t}),n=arguments.length,o=Array(n>1?n-1:0),s=1;sfunction(e){const t=e.match(/@__.{10}__@/);return null!==t?e.split(t[0]).map((e=>e.startsWith("ELEMENT-")?e:Oe.i18n.translateUsingPseudoLocale(e))).join(t[0]):Oe.i18n.translateUsingPseudoLocale(e)}(e(...t))}}render(){return this.props.children}}Te()(Me,"contextTypes",{intl:h.object.isRequired});var Ae=i(177);const Re=({children:e})=>Object(Ae.jsx)(ve,{locale:Oe.i18n.getLocale(),messages:Oe.i18n.getTranslation().messages,defaultLocale:Oe.i18n.getDefaultLocale(),formats:Oe.i18n.getFormats(),textComponent:u.a.Fragment},Object(Ae.jsx)(Me,null,e))},function(e,t,i){"use strict";i.r(t),i(209),i(210);var n=i(40);!function(e){function t(e,t){return t*Math.floor(e/t)}function i(e,t,i,o){if("function"==typeof e.strftime)return e.strftime(t);var s,r=function(e,t){return t=""+(null==t?"0":t),1==(e=""+e).length?t+e:e},a=[],l=!1,h=e.getHours(),c=h<12;null==i&&(i=[n.i18n.translate("flot.time.janLabel",{defaultMessage:"Jan"}),n.i18n.translate("flot.time.febLabel",{defaultMessage:"Feb"}),n.i18n.translate("flot.time.marLabel",{defaultMessage:"Mar"}),n.i18n.translate("flot.time.aprLabel",{defaultMessage:"Apr"}),n.i18n.translate("flot.time.mayLabel",{defaultMessage:"May"}),n.i18n.translate("flot.time.junLabel",{defaultMessage:"Jun"}),n.i18n.translate("flot.time.julLabel",{defaultMessage:"Jul"}),n.i18n.translate("flot.time.augLabel",{defaultMessage:"Aug"}),n.i18n.translate("flot.time.sepLabel",{defaultMessage:"Sep"}),n.i18n.translate("flot.time.octLabel",{defaultMessage:"Oct"}),n.i18n.translate("flot.time.novLabel",{defaultMessage:"Nov"}),n.i18n.translate("flot.time.decLabel",{defaultMessage:"Dec"})]),null==o&&(o=[n.i18n.translate("flot.time.sunLabel",{defaultMessage:"Sun"}),n.i18n.translate("flot.time.monLabel",{defaultMessage:"Mon"}),n.i18n.translate("flot.time.tueLabel",{defaultMessage:"Tue"}),n.i18n.translate("flot.time.wedLabel",{defaultMessage:"Wed"}),n.i18n.translate("flot.time.thuLabel",{defaultMessage:"Thu"}),n.i18n.translate("flot.time.friLabel",{defaultMessage:"Fri"}),n.i18n.translate("flot.time.satLabel",{defaultMessage:"Sat"})]),s=h>12?h-12:0==h?12:h;for(var d=0;d=a);++d);var u=c[d][0],g=c[d][1];if("year"==g){if(null!=o.minTickSize&&"year"==o.minTickSize[1])u=Math.floor(o.minTickSize[0]);else{var m=Math.pow(10,Math.floor(Math.log(e.delta/r.year)/Math.LN10)),p=e.delta/r.year/m;u=p<1.5?1:p<3?2:p<7.5?5:10,u*=m}u<1&&(u=1)}e.tickSize=o.tickSize||[u,g];var f=e.tickSize[0];g=e.tickSize[1];var _=f*r[g];"second"==g?n.setSeconds(t(n.getSeconds(),f)):"minute"==g?n.setMinutes(t(n.getMinutes(),f)):"hour"==g?n.setHours(t(n.getHours(),f)):"month"==g?n.setMonth(t(n.getMonth(),f)):"quarter"==g?n.setMonth(3*t(n.getMonth()/3,f)):"year"==g&&n.setFullYear(t(n.getFullYear(),f)),n.setMilliseconds(0),_>=r.minute&&n.setSeconds(0),_>=r.hour&&n.setMinutes(0),_>=r.day&&n.setHours(0),_>=4*r.day&&n.setDate(1),_>=2*r.month&&n.setMonth(t(n.getMonth(),3)),_>=2*r.quarter&&n.setMonth(t(n.getMonth(),6)),_>=r.year&&n.setMonth(0);var b,v=0,C=Number.NaN;do{if(b=C,C=n.getTime(),i.push(C),"month"==g||"quarter"==g)if(f<1){n.setDate(1);var w=n.getTime();n.setMonth(n.getMonth()+("quarter"==g?3:1));var y=n.getTime();n.setTime(C+v*r.hour+(y-w)*f),v=n.getHours(),n.setHours(0)}else n.setMonth(n.getMonth()+f*("quarter"==g?3:1));else"year"==g?n.setFullYear(n.getFullYear()+f):n.setTime(C+_)}while(C"+e+"
    "+Math.round(t.percent)+"%"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};e.plot.plugins.push({init:function(o){let s=null,r=null,a=null,l=null,h=null,c=null,d=!1,u=null,g=[];function m(e){if(a.series.pie.innerRadius>0){e.save();const t=a.series.pie.innerRadius>1?a.series.pie.innerRadius:l*a.series.pie.innerRadius;e.globalCompositeOperation="destination-out",e.beginPath(),e.fillStyle=a.series.pie.stroke.color,e.arc(0,0,t,0,2*Math.PI,!1),e.fill(),e.closePath(),e.restore(),a.series.pie.stroke.width>0&&(e.save(),e.beginPath(),e.strokeStyle=a.series.pie.stroke.color,e.arc(0,0,t,0,2*Math.PI,!1),e.stroke(),e.closePath(),e.restore())}}function p(e,t){let i=!1;const n=e.length;let o=n-1;for(let s=-1;++s1?n.series.pie.radius:l*n.series.pie.radius;let r,a;for(let n=0;n1?t.series.pie.tilt=1:t.series.pie.tilt<0&&(t.series.pie.tilt=0))})),o.hooks.bindEvents.push((function(e,t){const i=e.getOptions();i.series.pie.show&&(i.grid.hoverable&&t.unbind("mousemove").mousemove(f),i.grid.clickable&&t.unbind("click").click(_))})),o.hooks.processDatapoints.push((function(t,i,n,o){t.getOptions().series.pie.show&&function(t){d||(d=!0,s=t.getCanvas(),r=e(s).parent(),a=t.getOptions(),t.setData(function(t){let i=0,n=0,o=0,s=a.series.pie.combine.color;const r=[];for(let e=0;ea.series.pie.combine.threshold)&&r.push(e.extend(t[n],{data:[[1,s]],color:t[n].color,label:t[n].label,angle:s*Math.PI*2/i,percent:s/(i/100)}))}return o>1&&r.push({data:[[1,n]],color:s,label:a.series.pie.combine.label,angle:n*Math.PI*2/i,percent:n/(i/100)}),r}(t.getData())))}(t)})),o.hooks.drawOverlay.push((function(e,t){e.getOptions().series.pie.show&&function(e,t){const i=e.getOptions(),n=i.series.pie.radius>1?i.series.pie.radius:l*i.series.pie.radius;t.save(),t.translate(h,c),t.scale(1,i.series.pie.tilt);for(let e=0;e1e-9&&t.moveTo(0,0),t.arc(0,0,n,o.startAngle,o.startAngle+o.angle/2,!1),t.arc(0,0,n,o.startAngle+o.angle/2,o.startAngle+o.angle,!1),t.closePath(),t.fill());var o;m(t),t.restore()}(e,t)})),o.hooks.draw.push((function(o,s){o.getOptions().series.pie.show&&function(o,s){if(!r)return;const g=o.getPlaceholder().width(),p=o.getPlaceholder().height(),f=r.children().filter(".legend").children().width()||0;u=s,d=!1,l=Math.min(g,p/a.series.pie.tilt)/2,c=p/2+a.series.pie.offset.top,h=g/2,"auto"===a.series.pie.offset.left?(a.legend.position.match("w")?h+=f/2:h-=f/2,hg-l&&(h=g-l)):h+=a.series.pie.offset.left;const _=o.getData();let b=0;do{b>0&&(l*=i),b+=1,v(),a.series.pie.tilt<=.8&&C()}while(!w()&&b=t){v();const e=n.i18n.translate("flot.pie.unableToDrawLabelsInsideCanvasErrorMessage",{defaultMessage:"Could not draw pie with labels contained inside canvas"});r.prepend(`
    ${e}
    `)}function v(){u.clearRect(0,0,g,p),r.children().filter(".pieLabel, .pieLabelBackground").remove()}function C(){const e=a.series.pie.shadow.left,t=a.series.pie.shadow.top,i=a.series.pie.shadow.alpha;let n=a.series.pie.radius>1?a.series.pie.radius:l*a.series.pie.radius;if(!(n>=g/2-e||n*a.series.pie.tilt>=p/2-t||n<=10)){u.save(),u.translate(e,t),u.globalAlpha=i,u.fillStyle="#000",u.translate(h,c),u.scale(1,a.series.pie.tilt);for(let e=1;e<=10;e++)u.beginPath(),u.arc(0,0,n,0,2*Math.PI,!1),u.fill(),n-=e;u.restore()}}function w(){const t=Math.PI*a.series.pie.startAngle,i=a.series.pie.radius>1?a.series.pie.radius:l*a.series.pie.radius;u.save(),u.translate(h,c),u.scale(1,a.series.pie.tilt),u.save();let n=t;for(let e=0;e<_.length;++e)_[e].startAngle=n,o(_[e].angle,_[e].color,!0);if(u.restore(),a.series.pie.stroke.width>0){u.save(),u.lineWidth=a.series.pie.stroke.width,n=t;for(let e=0;e<_.length;++e)o(_[e].angle,a.series.pie.stroke.color,!1);u.restore()}return m(u),u.restore(),!a.series.pie.label.show||function(){let i=t;const n=a.series.pie.label.radius>1?a.series.pie.label.radius:l*a.series.pie.label.radius;for(let e=0;e<_.length;++e){if(_[e].percent>=100*a.series.pie.label.threshold&&!o(_[e],i,e))return!1;i+=_[e].angle}return!0;function o(t,i,o){if(0===t.data[0][1])return!0;const s=a.legend.labelFormatter;let l;const d=a.series.pie.label.formatter;l=s?s(t.label,t):t.label,d&&(l=d(l,t));const u=(i+t.angle+i)/2,m=h+Math.round(Math.cos(u)*n),f=c+Math.round(Math.sin(u)*n)*a.series.pie.tilt,_=""+l+"";r.append(_);const b=r.children("#pieLabel"+o),v=f-b.height()/2,C=m-b.width()/2;if(b.css("top",v),b.css("left",C),0-v>0||0-C>0||p-(v+b.height())<0||g-(C+b.width())<0)return!1;if(0!==a.series.pie.label.background.opacity){let i=a.series.pie.label.background.color;null==i&&(i=t.color);const n="top:"+v+"px;left:"+C+"px;";e("
    ").css("opacity",a.series.pie.label.background.opacity).insertBefore(b)}return!0}}();function o(e,t,o){e<=0||isNaN(e)||(o?u.fillStyle=t:(u.strokeStyle=t,u.lineJoin="round"),u.beginPath(),Math.abs(e-2*Math.PI)>1e-9&&u.moveTo(0,0),u.arc(0,0,i,n,n+e/2,!1),u.arc(0,0,i,n+e/2,n+e,!1),u.closePath(),n+=e,o?u.fill():u.stroke())}}o.setSeries&&o.insertLegend&&(o.setSeries(_),o.insertLegend())}(o,s)}))},options:o,name:"pie",version:"1.1"})}(jQuery),i(230),i(231),i(232),i(233),i(234)},function(e,t,i){"use strict";i.r(t),i.d(t,"encodeUnknown",(function(){return s})),i.d(t,"encode",(function(){return r})),i.d(t,"decode",(function(){return a})),i.d(t,"safeDecode",(function(){return l})),i.d(t,"encodeArray",(function(){return h})),i.d(t,"decodeArray",(function(){return c}));var n=i(176),o=i.n(n);function s(e){return o.a.encode(e)}function r(e){const t=s(e);if(void 0===t)throw new Error("unable to encode value into rison, expected a primitive value array or object");return t}function a(e){return o.a.decode(e)}function l(e){try{return a(e)}catch{return null}}function h(e){return o.a.encode_array(e)}function c(e){return o.a.decode_array(e)}t.default={encode:r,encodeUnknown:s,decode:a,encodeArray:h,decodeArray:c}}]);